-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snes: refactor to remove useless DeviceDriver.Use method; mapping.Det…
…ect accepts a UseMemory interface to dynamically require the ReadMemory capability when actual reading memory; moved all capability checks closer to when they are actually used
- Loading branch information
1 parent
ac03e53
commit a1acdbc
Showing
16 changed files
with
163 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,9 @@ | ||
package snes | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
// Device acts as an exclusive-access gateway to the subsystems of the SNES device | ||
type Device interface { | ||
IsClosed() bool | ||
|
||
// Use provides non-exclusive access to the device's subsystems to the user func | ||
Use(ctx context.Context, user DeviceUser) error | ||
UseControl | ||
UseMemory | ||
|
||
// UseMemory provides exclusive access to only the memory subsystem of the device to the user func | ||
UseMemory(ctx context.Context, user DeviceMemoryUser) error | ||
|
||
// UseControl provides exclusive access to only the control subsystem of the device to the user func | ||
UseControl(ctx context.Context, user DeviceControlUser) error | ||
IsClosed() bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.