Jump to content
IGNORED

FLI-ish and similar tricks with F18A.....


Wildstar

Recommended Posts

I don't really have anything to add until new information becomes available... but I suppose I can give you the test program I did. You'll need a MiniMemory though, I entered it by hand in EasyBug. (You have to manually change the color table so that space has a transparent background color).

 

I tried a number of variations of this, but this version of the code was trying to do 64 palette changes per scanline. It basically polls for the blanking bit, then runs a countdown loop 64 entries long, each time inverting the color of palette entry 0. This gives a nice dramatic display which shows the jitter well. You can also see how it jumps when the CPU access the VDP (since EasyBug is still running).

 

* test for minimem
* F18A GPU just changing BG color as fast as possible
	
	AORG >7000

* save return address
	MOV R11,R10
	LI R9,VDPADR		* we use this a lot
	
* Copy GPU program to VDP
	LI R0,>4400		* vdp write address >400
	BL *R9
	LI R0,GPUST
LP
	MOVB *R0+,@VDPWD
	CI R0,GPUEND
	JNE LP
	
* Unlock F18A
	LI R0,>B91C         * VR1/57, value 00011100
	BL *R9              * write once (corrupts VDPR1)
	BL *R9              * write again (unlocks enhanced mode)
	LI R0,>81E0			* restore VDPR1
	BL *R9
	
* Start F18A GPU at >0400
	LI R0,>B604			* MSB
	BL *R9
	LI R0,>B700			* LSB (will start program)
	BL *R9
	
* and back to EasyBug
    B *R10

* Write address or register
VDPADR
	SWPB R0
	MOVB R0,@>8C02
	SWPB R0
	MOVB R0,@>8C02
	B *R11  

* GPU program (using relative code)
* VDP registers start at >6000 in GPU memory space
GPUST
	LI R1,>5000		* color palette register #0
	LI R2,>7000		* scanline+blanking register
	LI R3,>0001		* blank bit
GPULN
	CLR R0
	LI R4,64		* how many loops
GPULP
	MOV R0,*R1
	INV R0
	DEC R4
	JNE GPULP
	
* now immediately wait for hblank
* (will also trigger during vblank)	
GPUWT
	COC *R2,R3		* is it set?
	JNE GPUWT		* no
	JMP GPULN		* yes!
	
GPUEND
	idle

NEXT	
	END
Link to comment
Share on other sites

Oh! I should mention that it's helpful to know how to stop the GPU program, which you should do before uploading changes (to prevent unexpected behavior). See the last JMP right above GPUEND? When you enter the code into Easy Bug, take a note of what address it's at, and then use the offset from GPUST to work out where in VDP RAM it's running (VDP program loads at >0400). Once you find it, it will be "F0 xx" (where xx is the negative jump). Replace that 'xx' with '00' in EasyBug and the code will fall through to the IDLE and stop the GPU. (Code modification needs to be single byte changes, since you can't write from the 9900 fast enough to change two bytes in time ;) ).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...