Emulator quick question

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
User avatar
TobyLobster
Posts: 622
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Emulator quick question

Post by TobyLobster »

Help - my memory and search skills are failing me!

Normally in emulators, when you pause the CPU in a debugger what is shown on the screen isn't exactly what's in screen memory - it's only updated as far as the electron gun / video memory circuitry have actually managed to reach at that point.

I feel sure I have seen an option somewhere to update the display to show what exactly is in screen memory at the point the CPU was paused.

Am I right? Where does this feature exist?
tom_seddon
Posts: 899
Joined: Tue Aug 30, 2005 12:42 am
Contact:

Re: Emulator quick question

Post by tom_seddon »

There is no such option in b2, but supporting this better is on the to-do list. I thought there was an issue for this, but there wasn't, until now: https://github.com/tom-seddon/b2/issues/298

--Tom
User avatar
TobyLobster
Posts: 622
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: Emulator quick question

Post by TobyLobster »

Oh no - It's looking like I dreamt this feature up, or maybe it was for a different system?

Any emulator coders out there --- this would be a useful feature, please!
User avatar
tricky
Posts: 7722
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Emulator quick question

Post by tricky »

I added it to my version of beebem and posted the exe and source, but I don't think that it ever got adopted.
It works by remembering the palette and start address of each line and using them to display the current contents of memory.
This is enough in beebem (old version and maybe current) as it draws a line at a time with a single palette.
In my version it's is called live update, so you can watch each byte change if you like, quite handy for spotting screen corruption as it happens.
Coeus
Posts: 3560
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: Emulator quick question

Post by Coeus »

Sorry, missed this earlier.

In the B-Em debugger, the vrefresh command does something that may be useful, i.e. when execution stops and enters the debugger it runs a whole video frame so you can see what is in the screen memory. I can't say it will do the right thing with rupture, i.e. where the palette and/or CRTC are re-programmed part way down the screen, but should be useful for simpler cases.

vrefresh takes arguments on or off and works automatically after being turned on.
User avatar
kieranhj
Posts: 1104
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Emulator quick question

Post by kieranhj »

TobyLobster wrote: Thu Nov 16, 2023 10:43 pm Oh no - It's looking like I dreamt this feature up, or maybe it was for a different system?
This is a standard feature of Stella, the Atari 2600 emulator. Because the 6502 clock is driven by the TIA you get the exact video state after every instruction and can step a literal scanline at a time etc. Its really good!
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/
User avatar
TobyLobster
Posts: 622
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: Emulator quick question

Post by TobyLobster »

kieranhj wrote: Fri Dec 01, 2023 8:53 pm This is a standard feature of Stella, the Atari 2600 emulator. Because the 6502 clock is driven by the TIA you get the exact video state after every instruction and can step a literal scanline at a time etc. Its really good!
Interesting, good to know, but...
Coeus wrote: Fri Dec 01, 2023 7:01 pm Sorry, missed this earlier.

In the B-Em debugger, the vrefresh command does something that may be useful, i.e. when execution stops and enters the debugger it runs a whole video frame so you can see what is in the screen memory. I can't say it will do the right thing with rupture, i.e. where the palette and/or CRTC are re-programmed part way down the screen, but should be useful for simpler cases.

vrefresh takes arguments on or off and works automatically after being turned on.
That's what I was trying to remember! Thank you Coeus.
User avatar
tricky
Posts: 7722
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Emulator quick question

Post by tricky »

kieranhj wrote: Fri Dec 01, 2023 8:53 pm ...
This is a standard feature of Stella,
...
The thing I find useful is to see what I have drawn or scribbled on that won't be visible until the beam gets there.

With the Tia, it doesn't exist until you can see it :) I must have another look at the 2600.
User avatar
Rich Talbot-Watkins
Posts: 2054
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Emulator quick question

Post by Rich Talbot-Watkins »

TobyLobster wrote: Thu Nov 16, 2023 10:43 pm Oh no - It's looking like I dreamt this feature up, or maybe it was for a different system?

Any emulator coders out there --- this would be a useful feature, please!
I feel like jsbeeb used to work like this (even showed the current raster position) but then something about the rendering code changed and it was no longer possible.
Post Reply

Return to “programming”