|
|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats Music - Videos - Development - Translations - Homebrew |
![]() |
| Author | Message |
|---|---|
|
Meka Debugger Thread
|
| Please use this thread to ask question about the debugger, provide feedback, bug reports or new features requests. | |
|
|
|
|
|
( 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. |
|
|
|
|
|
|
|
I only looked at the debug pane using "H" and "H B".
With "H B" i'd expected it to also state labels. E.g. Parameter: address : breakpoint address, can be range or symbol (label) That would have helped. |
|
|
|
|
|
|
|
For reference current full help for breakpoints is:
Debugger command - B
-------------------- B/BREAK: Manage breakpoints Usage: 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 Parameters: 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 Examples: 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: B nopnop 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: Expression evaluator
-------------------- Mathematical expression can be evaluated by the debugger. Supported features are: - Values: - Immediate hexadecimal integer (eg: 1234, or $1234 or 0x1234) - Immediate binary integer (eg: %00101010) - Immediate decimal integer (eg: #256) - Symbols gets replaced by their address. (eg: function_label) - 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. - Operators: - 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. |
|
|
|
|
|
|
|
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
Thanks |
|
|
|
|
|
|
|
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. |
|
|
|
|
|
|
|
Paul,
I have now added this feature.
Please download from following thread: http://smspower.org/forums/viewtopic.php?p=69794#69794 Feedback welcome. |
|
|
|
|
|
|
|
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. |
|
|
|
|
|
|
|
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. Example: Good version SMS version (initial sfx on start is from the PSG not the FM) |
|
|
|
|
|
|
|
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? |
|
|
|
|
|
|
|
Thanks.
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. |
|
|
|
|
|
|
|
Small update:
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. |
|
|
|
![]() |