View Single Post
Old 24 April 2020, 20:30   #1
Registered User

Join Date: Dec 2019
Location: North Dakota
Posts: 316
timer.device:GetSysTime:UNIT_VBLANK not recognized

I'm trying to do some profiling of my 3D engine and need a detailed breakdown of all pipeline stages.

For that, historically, on Jaguar, I've used a method of drawing over 1,000 vblanks (16.6 seconds) which is more than enough precision for my purposes. Unlike cycle counters, this approach shows a stable&reliable value across a gameplay-significant portion of time, so all the system-level spikes are averaged out.

On Jaguar, I already had an interrupt, where I simply incremented FrameCounter variable.

At this moment, I don't wish to indulge in Amiga's idiosyncrasies in IRQ handling, so I figured using timer.device should be safer and easier, given that I already have a working OS calls routines. Right?

Well, it wasn't, but after about a day of troubleshooting, I got the GetSysTime initialized and now I have a GetSysTime () working.

However, changing UNIT_MICROHZ into UNIT_VBLANK during initialization didn't accomplish anything. In fact, nothing changed and the timeval struct (which the docs say is still to be used for UNIT_VBLANK) still returns elapsed time in seconds.

As per the documentation, UNIT_VBLANK (register d0 prior to jsr _LVOOpenDevice (a6) ) doesn't need my own IRQ but relies on power supply strobe mechanism. Might not be implemented on WinUAE, perhaps ?

Potential workarounds, sorted by level of WTF-ness:
1. Utterly Ridiculous: Screw timer.device and implement IRQ (FrameCounter++)
2. Stupidly Ridiculous: Convert timeval.seconds/microseconds into vblank count
3. Plain Ridiculous: Start sending builds for external testing to see if it maybe works on real HW already

Is there anything I have apparently missed in docs with regards to UNIT_VBLANK behavior/set-up ? It appears that I should just do move.l #UNIT_VBLANK,d0 prior to jsr _LVOOpenDevice(a6)

Maybe I need to enable something in the WinUAE ?
VladR is offline  
Page generated in 0.06516 seconds with 11 queries