Re: [hatari-devel] Using hatari to generate YM register dump |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Le 03/11/2023 à 22:49, Georges Kesseler a écrit :
Some may know me creating videos of chiptune register dumps.
Hi
Yes, I saw these videos, quite nice to see real time dumping of all the
regs :)
And also your hidden screen in "Oh Crickey" by TLB is still one my all
time favourite fullscreen/hardscroll combination :)
I currently use sc68 which has a realtime dump feature of the YM2149
registers.
I process that with a result like this:
https://www.youtube.com/watch?v=2cLCJ3gRBgw
(read video description for details of whats shown)
As sc68 does often not play DMA channel, I want to use another engine,
i.e. why not hatari.
My idea is to hook somewhere (that's the question of this email) into
hatari to write all YM registes and the system clock every time a
register is updated. This is on linux. So write to stdout, then
postprocess for "nice" display.
The dump won't include DMA, too much data. So only YM.
Before I start digging into the code, maybe there is already something
available?
George/Gunstick
you can add some code in sound.c in function Sound_WriteReg() . As you
can see you get the reg number and its new value.
Then to have some counters, you can use :
- nVBLs : number of VBL since hatari started
- nHBL : HBL number in current VBL (from 0 to 312, depends on video
freq 50 or 60 Hz)
or for very precise clock measure, use
Cycles_GetClockCounterOnWriteAccess() which will return uint64_t with
the total number of cycles since hatari started.
so for example in Sound_WriteReg() you could add :
printf ( "write %x to reg %x VBL=%d HBL=%d clock=%ld\"n , data, reg,
nVBLS, nHBL , Cycles_GetClockCounterOnWriteAccess() );
Nicolas