Page 1 of 1

HSync ???

Posted: Wed Sep 01, 2004 12:02 am
by Shazz
Hello,

Coming from da oldschool scene, I'm starting developping things using the homebrew tools... obviously my brain tells me to code oldsk00l effects :D

So I'd like for fun to code some rasters effects (you know those ugly overscan bars !), so I looked into the docs and I found how to detect the HBL interrupts using the CSR register... that's ok but using C code I jsut find that I have to wait (in fact my code) this register to change (so a blocking call) until doing something (in this case changing bgcolor)...

So I'm wondering if in MIPS assembly it is possibe llike I was doing onb good old 68k CPU based machines to set a routine into a dedicated interrupt vector (in this case the HBL vector if existing) to automatically trigger this routine at each HBL ?

...or should I really make a virtual frame buffer and send it to the GS as a texture at each frame to be displayed within a screen sized square.... (which is really not as funny :D)

Other question, I read that the GS as a special mode or trick to draw particules effects, it is right ? Is it based on a particule texture + fog effect to simulate movement blur ? (I really wonder how to code a radial blurring effect with the GS but that will come later...)

Let's c0de ! :D

Posted: Wed Sep 01, 2004 12:34 am
by blackdroid
yes you can hook a hanlder to an interrupt. afaik there are even examples in ps2sdk on how to do it.

di
; install handler
ori a0, zero, 0x2 ; Interrupt Channel
la a1, your_hr_handler
move a2, zero
ori v1, zero, 0x18 ; afair H-sync irq
syscall ;
nop

; you might want to save away your handler id here ( v0 )

; enable handler
ori a0, zero, 2
ori v1, zero, 0x14
syscall ; enable it
nop

ei

there is a "copperbar" routine floating around aswell, written ages ago by vzzrzzn. that being said, ps2's "chipmem" is not accessible, so forget about most "oldsk00l" tricks :)

Posted: Wed Sep 01, 2004 1:14 am
by Shazz
Greeeeat !!!!

Thanks blackdroid ! And how could I have missed this piece of code on ps2dev.org ?? (http://ps2dev.org/kb.x?T=263) !!!

eh eh time to play :D

Posted: Wed Sep 01, 2004 1:58 am
by mrbrown
Because of a bug in the EE's kernel, always end your interrupt handler with the following two instructions:

Code: Select all

sync.l
ei
Also, interrupt latency is pretty high (again a kernel issue) so keep it short and simple :).