Skip to content

Commit 450f6ae

Browse files
committed
default preferences values for disassembly and debugger
supercharger tries to load BIOS before anything else meaning a quicker failure if one is necessary failed cartridge attachment will result in log entry rather than a terminal error loading cartridge without a coprocessor (ARM) when the Last Execution window was open would cause a crash added video link in readme
1 parent b9891dc commit 450f6ae

File tree

6 files changed

+23
-12
lines changed

6 files changed

+23
-12
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ Below the menu-bar are the debugging windows. In this screenshot we can see:
220220

221221
Note that much of the information presented in the windows is editable in-place. For example, the contents of the CPU's PC register can be edited via the window. As in all areas of this project, the user is encouraged to experiment.
222222

223+
A video of the debugger in action can be found [here](https://www.youtube.com/watch?v=3vLyRw8iVCA).
224+
223225
#### Debugger Terminal
224226

225227
As an alternative to GUI interaction the debugger can also be controlled through a terminal. This is available through the `terminal` window. The rest of this section describes the operation of the terminal in detail.

debugger/debugger.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,9 @@ func (dbg *Debugger) attachCartridge(cartload cartridgeloader.Loader) error {
403403
// reset of vcs is implied with attach cartridge
404404
err = setup.AttachCartridge(dbg.VCS, cartload)
405405
if err != nil && !curated.Has(err, cartridge.Ejected) {
406-
dbg.printLine(terminal.StyleError, "%v", err)
406+
logger.Log("attach", err.Error())
407407

408-
// an error has occured so attach the ejected cartridge
408+
// an error has occurred so attach the ejected cartridge
409409
err = setup.AttachCartridge(dbg.VCS, cartridgeloader.Loader{})
410410
if err != nil {
411411
return err

disassembly/preferences.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ func (p *Preferences) String() string {
4242

4343
// newPreferences is the preferred method of initialisation for the Preferences type.
4444
func newPreferences(dsm *Disassembly) (*Preferences, error) {
45-
p := &Preferences{
46-
dsm: dsm,
47-
mirrorOrigin: memorymap.OriginCart,
48-
}
45+
p := &Preferences{dsm: dsm}
46+
47+
// set defaults
48+
p.FxxxMirror.Set(true)
49+
p.Symbols.Set(true)
50+
p.mirrorOrigin = memorymap.OriginCartFxxxMirror
4951

5052
// save server using the prefs package
5153
pth, err := paths.ResourcePath("", prefs.DefaultPrefsFile)

gui/sdlimgui/preferences.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ type preferences struct {
4444
func newDebugPreferences(img *SdlImgui) (*preferences, error) {
4545
p := &preferences{img: img}
4646

47+
// defaults
48+
p.openOnError.Set(true)
49+
4750
// setup preferences
4851
pth, err := paths.ResourcePath("", prefs.DefaultPrefsFile)
4952
if err != nil {

gui/sdlimgui/win_coproc_lastexecution.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ func (win *winCoProcLastExecution) draw() {
5555
return
5656
}
5757

58+
if !win.img.lz.CoProc.HasCoProcBus || win.img.lz.Dbg.Disasm.Coprocessor == nil {
59+
return
60+
}
61+
5862
imgui.SetNextWindowPosV(imgui.Vec2{465, 285}, imgui.ConditionFirstUseEver, imgui.Vec2{0, 0})
5963
imgui.SetNextWindowSizeV(imgui.Vec2{353, 466}, imgui.ConditionFirstUseEver)
6064

hardware/memory/cartridge/supercharger/supercharger.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ func NewSupercharger(cartload cartridgeloader.Loader) (mapper.CartMapper, error)
6868

6969
var err error
7070

71+
// load bios and activate
72+
cart.bios, err = loadBIOS(path.Dir(cartload.Filename))
73+
if err != nil {
74+
return nil, curated.Errorf("supercharger: %v", err)
75+
}
76+
7177
// set up tape
7278
if cartload.IsSoundData {
7379
cart.state.tape, err = newSoundLoad(cart, cartload)
@@ -78,12 +84,6 @@ func NewSupercharger(cartload cartridgeloader.Loader) (mapper.CartMapper, error)
7884
return nil, curated.Errorf("supercharger: %v", err)
7985
}
8086

81-
// load bios and activate
82-
cart.bios, err = loadBIOS(path.Dir(cartload.Filename))
83-
if err != nil {
84-
return nil, curated.Errorf("supercharger: %v", err)
85-
}
86-
8787
// prepare onLoaded function
8888
if cartload.OnLoaded == nil {
8989
cart.onLoaded = func(cart mapper.CartMapper) error { return nil }

0 commit comments

Comments
 (0)