VBlank - SGL - SGL replacement

vbt

Staff member
I've added a frame counter by redefining vblankout in Phoenix emu and not vblankin because i loose paddle control in that case. The is no sample about what we can do with vblankin/out using the SGL is it "forbidden" to do such thing ?

I'd say the SGL replacement can give a good clue on what to do on such case.
 
SGL performs several "internal" duties both at vblank-in and vblank-out (some of these are mentioned in either one of the PDFs or the text files in the SGL doc directory). If you just override the interrupt vectors you can expect things to break. Instead you should use the SGL slIntFunction() call to register a function that will be called on vblank-in. I don't think there is a corresponding function for vblank-out.

If you're interested in what SGL does during the vblank interrupts, disassemble the functions BlankIn and BlankOut in sglI00.o (use "ar x" to extract the individual object files from libsgl.a)

ETA: The functions performed by SGL during the vblank interrupts are detailed in sglfaq_f.txt in the doc directory, section 3. "SGL Internal Processing".
 
antime said:
If you just override the interrupt vectors you can expect things to break. Instead you should use the SGL slIntFunction() call to register a function that will be called on vblank-in.

Really interesting, I will test this, thanks for all these info Antime :bigthumb:

I don't think there is a corresponding function for vblank-out.


If you're interested in what SGL does during the vblank interrupts, disassemble the functions BlankIn and BlankOut in sglI00.o (use "ar x" to extract the individual object files from libsgl.a)

I can check this but I don't like much assembler. :)

ETA: The functions performed by SGL during the vblank interrupts are detailed in sglfaq_f.txt in the doc directory, section 3. "SGL Internal Processing".


I've read quickly the file and it appears "* Read Peripheral Data" is done during vblank out, and not vblank in. But paddle control was lost when I redefined vblank in not vblank out.
 
vbt said:
I've read quickly the file and it appears "* Read Peripheral Data" is done during vblank out, and not vblank in. But paddle control was lost when I redefined vblank in not vblank out.


"Read Peripheral Data" is listed under both vblank-in and vblank-out, but looking at the code slSmpcDirectAccess() is called during vlank-in and there is no immediately obvious peripheral-reading code called during vblank-out so I suspect that's an error in the FAQ.
 
Back
Top