I use Linux, and Fuse is my emulator of choice. Its debugger isn't great, however, and has a significant issue which bugs me: if I single step code which writes into screen memory, Fuse doesn't update the main display window. It's not until you click the Continue button that the display updates.
What I want is to see how patterns of bits being written into screen memory affect the display, byte by byte. That would allow me to see masking and ORing at work, which I have trouble visualising in my head.
Does anyone know of an emulator with a debugger which supports this? Ideally Linux, but I can use Winders at a push.
Emulator with debugger which updates screen on single step
Emulator with debugger which updates screen on single step
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
- bob_fossil
- Manic Miner
- Posts: 654
- Joined: Mon Nov 13, 2017 6:09 pm
Re: Emulator with debugger which updates screen on single step
I run SpecEmu on Ubuntu Mate 16.04 with WINE and that seems to update the screen when you step through the code using it's debugger. I just tried it with the following bit of code:
Doing step on the ld (hl),a makes a black horizontal line appear in the top left corner of the screen.
Bob Fossil
Code: Select all
ld a,255
ld hl,16384
ld (hl),a
ret
Bob Fossil
Re: Emulator with debugger which updates screen on single step
If you mean like masked sprites and whatnot, you won't be able to see the individual steps of AND and OR that way, since typically each byte is only written back once with the combined result:
Think of it like this: masking puts the 'black' parts of the sprite, ORing puts the 'white' parts of the sprite.
Code: Select all
pop de
ld a,(hl)
and e
or d
ld (hl),a
inc l
...
Inactive account
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: Emulator with debugger which updates screen on single step
Well, not quite. Your hitting Continue has nothing to do with screen updates per se. What does is the interrupt timing (as on a real machine). So if you continue stepping through your code long enough for an interrupt to trigger, the screen will update.
It would be great if it could be switching to a “virtual display update” mode to see exactly “what would have happened if the screen had updated at arbitrary times.” Alternatively, it would be nice to see a slowed down “virtual electron beam” as it passes through the entire screen area. Unfortunately, that’s just a coulda-shoulda-woulda kind of thing. But yes, Fuse does update the screen when you step through.
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: Emulator with debugger which updates screen on single step
Use a programmer’s calculator (they have commands for most Boolean operators) switched to display binary:
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: Emulator with debugger which updates screen on single step
I remember having similar discussion on WOS some years ago.
I was asking for the same - you write a byte to screen memory and you see it on the screen. Unfortunately in many emulators you won't see it.
I was told by some guys it would be very wrong request as real Spectrum doesn't work this way and emulators should behave like real Spectrum
Explanation for less technically experienced people:
Spectrum refreshes screens 50 times per second at the beggining of each display frame. It doesn't do it immediately but row by row from top to bottom which lasts for a while. It executes code at the same time so you can for example replace some attributes on the fly and get multicolor effect
So if you write some byte to screen memory in debugger, you want it to appear on screen and you want it all kosher, in theory you should click through thousands of instructions until you reach refresh of this particular pixel line
But now I hear that it is possible in some emulator and I'm quite happy about it
I was asking for the same - you write a byte to screen memory and you see it on the screen. Unfortunately in many emulators you won't see it.
I was told by some guys it would be very wrong request as real Spectrum doesn't work this way and emulators should behave like real Spectrum
Explanation for less technically experienced people:
Spectrum refreshes screens 50 times per second at the beggining of each display frame. It doesn't do it immediately but row by row from top to bottom which lasts for a while. It executes code at the same time so you can for example replace some attributes on the fly and get multicolor effect
So if you write some byte to screen memory in debugger, you want it to appear on screen and you want it all kosher, in theory you should click through thousands of instructions until you reach refresh of this particular pixel line
But now I hear that it is possible in some emulator and I'm quite happy about it
Re: Emulator with debugger which updates screen on single step
Oh, I see. Yes, that's clearly how it should work. Doesn't quite help for what I want though.Ast A. Moore wrote: ↑Sat Dec 23, 2017 10:48 am Well, not quite. Your hitting Continue has nothing to do with screen updates per se. What does is the interrupt timing (as on a real machine). So if you continue stepping through your code long enough for an interrupt to trigger, the screen will update.
Bob says SpecEmu does what I want, which presumably would have to be interpreted as a weakness of the emulator.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
Re: Emulator with debugger which updates screen on single step
You could get the best of both if the emulator has a "graphics ripper" view that lets you directly inspect memory as a screen bitmap, if it updated live. I tried Spin but that doesn't seem to refresh that view unless you change one of the settings. It might be worth seeing how other emulators handle it though.
Re: Emulator with debugger which updates screen on single step
SpecEmu updates the entire display by default in the debugger and optionally can be switched to the cycle-accurate update.dfzx wrote: ↑Sat Dec 23, 2017 11:48 amOh, I see. Yes, that's clearly how it should work. Doesn't quite help for what I want though.Ast A. Moore wrote: ↑Sat Dec 23, 2017 10:48 am Well, not quite. Your hitting Continue has nothing to do with screen updates per se. What does is the interrupt timing (as on a real machine). So if you continue stepping through your code long enough for an interrupt to trigger, the screen will update.
Bob says SpecEmu does what I want, which presumably would have to be interpreted as a weakness of the emulator.