Sega Master System / Mark III / Game Gear|
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats
Music - Videos - Development - Translations - Homebrew
Meka Debugger ThreadPosted: Fri Jan 20, 2012 12:56 pm
|Please use this thread to ask question about the debugger, provide feedback, bug reports or new features requests.|
||Posted: Fri Jan 20, 2012 12:59 pm|
( continuing from discussion on http://www.smspower.org/forums/viewtopic.php?t=13542 )
There might be a parsing problem with the fact that the symbol include a '.' (dot) character. I will look into that.
What couldn't you find inside the help and could you describe where you have looked? There is a specific help pane for the debugger (corresponding to the DEBUGGER.TXT file) and an HELP command within the label that should give enough examples. If you can help me understand what part you may have overlooked I'm happy to take action to increase accessibility or visibility of the features.
||Posted: Fri Jan 20, 2012 1:40 pm|
I only looked at the debug pane using "H" and "H B".
With "H B" i'd expected it to also state labels.
address : breakpoint address, can be range or symbol (label)
That would have helped.
||Posted: Fri Jan 20, 2012 2:32 pm|
For reference current full help for breakpoints is:
Debugger command - B
B/BREAK: Manage breakpoints
B address [..address2] ; Add CPU breakpoint
B [access] [bus] address [=xx] ; Add breakpoint
B LIST ; List breakpoints
B REMOVE id ; Remove breakpoint <id>
B ENABLE id ; Enable breakpoint <id>
B DISABLE id ; Disable breakpoint <id>
B CLEAR ; Clear breakpoints
address : breakpoint address, can be a range
access : access to trap, any from r/w/x (rwx)
bus : bus/event, one from cpu/io/vram/pal/line (cpu)
xx ; byte to compare to, for conditionnal break
id : breakpoint identifier
B 0038 ; break when CPU access $0038
B w io 7f ; break on IO write to $7F
B rx e000..ffff ; break on CPU read/exec from $E000+
B x =0,0,C9 ; break on CPU execution of NOP NOP RET
B w vram 3f00.. ; break on VRAM write to SAT
B w pram 0 =03 ; break on PRAM write of color 0 as $03
B line #13 ; break on display line 13
You can add a description to breakpoints, by ending the
command line with a string:
B 0038 "interrupt"
As a shortcut:
Is equivalent to:
B x=0,0 "NOP NOP"
You are right that it doesn't explicitely mention symbols, because they are a more generic feature that apply to anywhere where an address can be passed.
I will add the modification you suggested however because it seems to be such a common case.
Also for reference:
Mathematical expression can be evaluated by the debugger.
Supported features are:
- Immediate hexadecimal integer
(eg: 1234, or $1234 or 0x1234)
- Immediate binary integer
- Immediate decimal integer
- Symbols gets replaced by their address.
- Z80 registers names gets replaced by their current value.
(eg: PC, SP, AF, A, BC, B, C, DE, D, E, HL, H, L, IX, IY)
Pay attention that some registers names are ambiguous with hexadecimal
constants ('A' is a 10 in hexadecimal). Z80 registers name are always
given priority over hexadecimal constants.
Uses the 'Ox' or '$' prefixes to resolve ambiguity.
- Integer operators: + - / *
(eg: 1+2*3 returns 7)
- Binary operators: & | ^
(eg: 0xF0 | 0x0F returns 0xFF)
- Parenthesis: (), forcing priority
(eg: (1+2)*3 returns 9)
I'll think about how to make it clearer that those features exists, thank you.
||Posted: Sat Jan 21, 2012 11:42 am|
I have a related feature request: the ability to set breakpoints on ROM addresses.
For example, there is some data in the Alex Kidd In Miracle World ROM (e.g. at $0f96a - $0fc68) whose purpose is unknown. To find out what the data is for, I'd like to set a breakpoint on the area and play the game until it is triggered. Unfortunately, the best I can do at the moment is set a Z80 breakpoint, using the fact that the game maps banks 2 to 7 of the ROM into slot 2:
b r cpu b96a..bc68
This will be triggered for accesses to $0f96a, but also for $0b96a, $1396a etc. So, each time execution stops, I have to manually check the value at $ffff. It would really help me if it was possible to do:
b r rom f96a..fc68
||Posted: Sat Jan 21, 2012 11:55 am|
Another way to get the same effect would be to support extended conditions on Z80 breakpoints.
For example, a version of b r cpu b96a..bc68 which only breaks when $ffff (or another chosen Z80 address) contains a certain value.
||Posted: Sun Jan 22, 2012 2:33 pm|
I have now added this feature.
Please download from following thread:
||Posted: Mon Jan 30, 2012 5:51 am|
I suggested for a Visual Sprite RAM viewer earlier in the Meka 8 Dev Timeline, so I think soon that we should add one...
It is to be used in some game development situations.
||Posted: Wed Feb 22, 2012 11:27 pm|
Is it possible to dump the FM registers in Meka?
I am having problems with the custom voices that do not sound as expected and I am clueless why it sounds different.
Tracing the port writes takes ages.
SMS version (initial sfx on start is from the PSG not the FM)
||Posted: Thu Feb 23, 2012 12:21 am|
Zipper, are you able to compile MEKA by yourself?
If so it should be trivial for you to add a few logging lines to print all FM registers, I could guide you through this.
In the meanwhile, are you aware you can use watchpoints to print out all the IO port writes without stopping emulation?
||Posted: Fri Feb 24, 2012 10:33 am|
I tried the watchpoints (I don't have time to tinker with the Meka code atm). I didn't find any errors in the register values so probably a bug in my code.
||Posted: Fri Mar 30, 2012 9:03 am|
The sound issue was a nasty bug (sneaky 1 byte offset error I didn't notice) on my side.
I'll update the MBplay sources for SMS asap.