Mednafen Members Members   Search Search   Help Help   Register Register   Login Login   Home Home
Home » Other » PC Engine, PC-FX » New Hsync lib routine for HuC w/ SGX support
Show: Today's Messages  :: Show Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
New Hsync lib routine for HuC w/ SGX support [message #672] Thu, 08 February 2007 19:14 Go to next message
Administrator  [PM]
I've written a basic replacement VDC irq1 routine for HuC 'C' compiler. The code is written in ASM.

Here's a rundown of the features.

- Hsync routine with a 64 individual line attachment array. You can update the VDC1 BG x/y, the VDC2 BG x/y, the VPC regs($0008/$0009), or any combonation including all three at once.

- Mid frame temporary switching of Hsync routines. You can tact the hsync switch request on the same line as the above parameters. The default Hsync routine has 64 entrys and the mid frame switch request can be attached to all 64 slots, since it returns control of the IRQ1 vector to the parent Hsync routine when it's finished.

- Normal Hsync switching routine. Takes effect during the first available vblank. The Hsync routine is not switch back to the default routine like in the above mode. The user must switch it back with another Hsync switch call.

- A WIP sin wave BG Hsync routine for VDC1 & VDC2. An 16-bit reg is loaded from the sin wave array. The MSB is the number if scanlines the routine is active( before switching back to primary Hsync routine if not set as the primary routine). The LSB is the control mask for the display attributes. So far only 'reset Y' for SGX/PCE(bit0-1) is recognised in the mask. The sin wave routine reads from a 256byte array(_sin:) loaded into the const bank. I provided a sample sinwave.dat.

- Initialize and restore functions for giving IRQ1 control back to HuC lib.

- A few other replacement and new functions like PCE scroll X/Y, SGX scroll X/Y, Vblank(char) to replace Vsync(char), etc.



Download here - http://pcedev.net/HuC/user_irq1_rtn.zip.


-Rich
Re: New Hsync lib routine for HuC w/ SGX support [message #673 is a reply to message #672 ] Thu, 08 February 2007 19:14 Go to previous messageGo to next message
Administrator  [PM]
A question on a related topic. A while back I made a bit similar thing that played with rasters and hsync IRQs (old school 'copperbar' effects). It looks like I don't actually get IRQ triggered at raster line 0 (i.e. RCR set to 0x40). The rest of the display is OK. I tried setting the VDC according to code coming with HuC's libs and also preset default values as in various online docs (that typically differ a bit from what is in HuC libs)... so I wonder if there is something 'known' that I have missed or just having bad mushrooms again..
Re: New Hsync lib routine for HuC w/ SGX support [message #674 is a reply to message #672 ] Thu, 08 February 2007 19:15 Go to previous messageGo to next message
Administrator  [PM]
if you set the RCR to 0x40 and make changes to the VDC, they take effect on the next scanline. I think you can: turn display off( before active display - like during vblank), set RCR to 0x40, makes changes for the next scanline(0x41), turn on BG+SPR, RTI. That should get rid of the "fixed" scanline at the top if you're doing scanline-to-scanline effects( i.e. sinwave).
Re: New Hsync lib routine for HuC w/ SGX support [message #693 is a reply to message #674 ] Sun, 11 February 2007 05:53 Go to previous message
mr.spiv  [PM]
I think this is pretty much what I'm doing already, except for not switching off the display during vblank. And I am not changing VDC registers (except the RCR of course) but just the background color. Need to try that switching off the display..


..more coffee..
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic:Developing with GCC HOWTO
Next Topic:CD-DA Playback Rate
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ ]

Current Time: Sat May 11 13:47:29 CDT 2024
.:: Contact :: Home ::.

Powered by FUDforum.
Copyright © FUDforum Bulletin Board Software