Started by cpcitor, 12:46, 29 December 20
0 Members and 1 Guest are viewing this topic.
On time 0x000123456, PC=0x01b9, opcode xor b changed register A, old value 0xf0, new value 0xcdOn time 0x000123457, PC=0x01ba, opcode ld (hl),a changed memory address 0xC234, old value 0xab, new value 0xcd
Quote from: Targhan on 20:37, 29 December 20This is probably not exactly what you want, but since you're a developer, maybe you could use some C++ Z80 emulator out there, inject some data and check the states by yourself.For AT2 test units, I embedded a Z80 emulator, run my compiled played and checked, frame by frame, if the output to the PSG matches the C++ player. Very useful and totally automatized!You can check the emulator link from AT2 webpage. Including it to my own code was quite easy. Of course, you would have preferred a build-in solution, but...Maybe you can create a simple monitor around that.
Quote from: cpcitor on 21:55, 29 December 20"You can check the emulator link from AT2 webpage."
Quote from: norecess on 23:24, 29 December 20What @Targhan said. From what I experienced, for example cpcec from @cngsoft is a pretty hackable emulator and it would be relatively easy to implement such a log.
Quote from: norecess on 23:24, 29 December 20But first, and I may be potentially off topic here (sorry !), don't forget WinAPE emulator features memory breakpoints, cf. trigger when memory at specific location changes or has a predefined value.
QuoteYes, cpcec is the one I favor: open-source, lightweight, faithful emulation, fast, advanced debugging features. (It would be even better if the debugger layout would benefit from the bigger definition of modern screens.)
QuoteThe handler saves regular and alternate registers then restores them
QuoteWould a "memory breakpoint" be relevant in such a situation? What parameters would you suggest?
Quote from: norecess on 00:38, 30 December 20Double-check you are not using IX / IY. I may be wrong, but I think the firmware makes also use of those registers.
Quote ;; Read SOFT968 ;; section 11. ;; section 12. ;; appendix 10. ;; Thanks Kevin Thacker for the scan+OCR job!_hook_interrupt:: ; Ask firmware to call at each video frame "play_one_music_frame". ld hl, #frame_flyback_event_block ld b, #0x81 ld c, #0 ld de, #on_frame_flyback ;; This routine enables interrupts. call FIRMWARE_KL_NEW_FRAME_FLY reton_frame_flyback:: ; Arkos Tracker routine uses alternate Z80 register set, ; that the firmware expects unchanged. So save the full Z80 state. ; The firmware documentation does not say so, but interrupts ; are enabled here in interrupt handler. ; This is done so that an interrupt handler can itself be interrupted. ; So far, so good, but this assumes that the code is ready to be interrupted. ; at any time, which implies not using the alternate register set. ; But Arkos Tracker playing routine uses both register sets! ; So, we are going to not only save both Z80 register sets, ; but also disable interruptions until we put them back. di push af push bc push de push hl push ix push iy exx ex af, af' push af push bc push de push hl call play_one_music_frame pop hl pop de pop bc pop af ex af,af' exx ld a, #1 ld (interrupt_occured),a pop iy pop ix pop hl pop de pop bc pop af ei ret
Quote from: norecess on 00:38, 30 December 20I don't know if a memory breakpoint may be relevant for your situation. But this may be give you ideas, like building a temporary array that you could continuously check with the debugger ?..
Quote from: norecess on 00:38, 30 December 20Honestly, those bugs are hard to chase.If really you are blocked, try removing some block of code and see what happens -- maybe by proceeding like this you would be able to isolate the issue.
Quote from: norecess on 00:21, 30 December 20I made a custom version of cpcec, Linux-only, not really "advertised" yet but available here -- please note I don't provide any support for it. The addition provides a more usable debugger (no worries, @cngsoft is aware) and it's now my primary emulator to develop SonicGX.
Quote from: mahlemiut on 23:05, 29 December 20MAME has a trace command in its debugger - it records executed opcodes to a file, and it is possible to add register values or other data to the output.
Quote from: mahlemiut on 13:20, 30 December 20You can do a single driver build of MAME:Code Select Expandmake SOURCES=src/mame/drivers/amstrad.cppwill produce a build with just the CPC/CPC+ drivers.
Quote from: Targhan on 01:03, 30 December 20Out of curiosity, why do you use system interruption when you could ditch the system, be faster and safer?
Quote from: pelrun on 05:42, 31 December 20I think it's about time I revisited that project to integrate a gdb stub into cpcec... stuff implementing my own debugger, I want the big gun!
Quote from: pelrun on 05:42, 31 December 20In my latest released game, optimizing ASM routines yielded much higher speed benefit than what the whole firmware interrupt + keyboard scan + AT2 player could even consume.
Quote from: Targhan on 15:59, 31 December 20Of course, but this is not the same scale. There are already some read-to-use code that is much faster than the system's one, with less memory footprint, and by using them, you save memory and CPU time, and with all that combined, you maybe don't have to optimize the rest of your code like crazy.
Quote from: Targhan on 15:59, 31 December 20Plus a system, even though reliable like the one we're lucky to have, is dependent to the state of the machine BEFORE you even run your own production. How many productions crashed because the developer didn't expect many ROMs to be used?
Quote from: Targhan on 15:59, 31 December 20Anyway, I was just curious. but if you wanted to load Amsdos files without the system, I have a ready-to-use lib for that (see my signature).
Quote from: reidrac on 15:54, 31 December 20What I have found very useful is a "rewind" feature.When I have an unexpected crash, I can rewind until before the crash and then start the debugger until I see the problem.
## CORE STATE/PLAYBACK OPTIONS#-state saved state to load-autosave automatically restore state on start and save on exit for supported systems-rewind enable rewind savestates-rewind_capacity rewind buffer size in megabytes-playback playback an input file-record record an input file-record_timecode record an input timecode file (requires -record option)-exit_after_playback close the program at the end of playback-mngwrite optional filename to write a MNG movie of the current session-aviwrite optional filename to write an AVI movie of the current session-wavwrite optional filename to write a WAV file of the current session-snapname override of the default snapshot/movie naming; %g == gamename, %i == index-snapsize specify snapshot/movie resolution (<width>x<height>) or 'auto' to use minimal size -snapview snapshot/movie view - 'auto' for default, or 'native' for per-screen pixel-aspect views-snapbilinear specify if the snapshot/movie should have bilinear filtering applied-statename override of the default state subfolder naming; %g == gamename-burnin create burn-in snapshots for each screen
Page created in 0.190 seconds with 51 queries.