Re: [hatari-devel] Using hatari to generate YM register dump

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

Debugger can also show variables:

> variables
Hatari debugger builtin symbols and their values are:
....
           HBL: $00000000 (0)          number of HBL interrupts
....
           VBL: $000000BC (188)        number of VBL interrupts
....
Some of the variables are valid only in specific situations.

> info dmasnd
$FF8900.b : Sound DMA control  : 05
$FF8901.b : Sound DMA control  : 00
$FF8903.b : Frame Start High   : ff
$FF8905.b : Frame Start middle : ff
$FF8907.b : Frame Start low    : fe
$FF8909.b : Frame Count High   : ff
$FF890B.b : Frame Count middle : ff
$FF890D.b : Frame Count low    : fe
$FF890F.b : Frame End High     : ff
$FF8911.b : Frame End middle   : ff
$FF8913.b : Frame End low      : fe

$FF8920.b : Sound Mode Control : 00
$FF8921.b : Sound Mode Control : 0

> info ym
Reg $00 : $00
Reg $01 : $00
Reg $02 : $00
Reg $03 : $00
Reg $04 : $00
Reg $05 : $00
Reg $06 : $00
Reg $07 : $C0
Reg $08 : $00
Reg $09 : $00
Reg $0A : $00
Reg $0B : $00
Reg $0C : $00
Reg $0D : $00
Reg $0E : $05
Reg $0F : $00

NOTE: If "info" command values are IO registers, instead of Hatari internal values, there are some cases where those values will not reflect the Hatari internal state, unless some emulated code actually reads or writes those register values, so that they get updated in the emulated memory.

	- Eero

On 4.11.2023 15.17, Nicolas Pomarède wrote:
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






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/