Interrupts and gfx9000

Page 4/5
1 | 2 | 3 | | 5

By MsxKun

Paladin (924)

MsxKun's picture

08-10-2019, 21:46

Manel46 wrote:
MsxKun wrote:

And related to that, as it also depends on R#11, if i keep R#11 at cero, it ignores the line. No matter where i set it. But, if I put R#11 to 1, then it works. Not sure that's the normal behaviour...

In R # 11, bits 0 and 1, are to complete the number of lines, in cases of "Y", greater than 256. If you write something, it exceeds the normal height.
Bit 7 to 1 (IEHM), generates interruption in all lines.

I know. It doesn't make sense, but something is happening here that makes these strange things.
I bet that is, as usual, something very silly... Eek!

By MsxKun

Paladin (924)

MsxKun's picture

08-10-2019, 22:39

So you get an idea... as an example... and this is out of interrupt, after reset the G9K, and disable the VDP interrupt.

    
G9kWriteReg G9K_INT_V_LINE_LO,128
G9kWriteReg G9K_INT_V_LINE_HI,00000000b
G9kWriteReg G9K_INT_H_LINE,0
G9kWriteReg G9K_INT_ENABLE,G9K_INT_IEH

Doesn't make any split at all, tho right, it should!

    
G9kWriteReg G9K_INT_V_LINE_LO,128
G9kWriteReg G9K_INT_V_LINE_HI,00000001b
G9kWriteReg G9K_INT_H_LINE,0
G9kWriteReg G9K_INT_ENABLE,G9K_INT_IEH

Does it!

    
G9kWriteReg G9K_INT_V_LINE_LO,128 ; <- or whatever
G9kWriteReg G9K_INT_V_LINE_HI,00000000b
G9kWriteReg G9K_INT_H_LINE,0
G9kWriteReg G9K_INT_ENABLE,G9K_INT_IEH+G9K_INT_IEV

Hang.

and here... in the interrupt routine.

di
push af
in	a,(G9K_INT_FLAG) ;<----------- I always get a 3 value here, no matter if I enabled IEH or IEV.
and	3
out	(G9K_INT_FLAG),a

...

; Any attempt to copy data from RAM to VRAM here (for ex. to update an sprite), causes gfx mess
; I can send data to registers, but no to G9K_WRITE_ADDR (necessary to copy data), this one causes mess
...
pop af
ei
ret

After interrupt ends, if I try to copy to vram, it works fine.

By MsxKun

Paladin (924)

MsxKun's picture

08-10-2019, 23:04

Maybe it's worthy to note that, debugging, I can see that after

in a,(G9K_INT_FLAG)
and 3
out (G9K_INT_FLAG),a

The flags are indeed reset.

By Manel46

Champion (458)

Manel46's picture

09-10-2019, 00:06

I do not understand. You're from here, right?
Send me an email, and we will understand each other better.

By MsxKun

Paladin (924)

MsxKun's picture

09-10-2019, 11:31

Manel46 wrote:

I do not understand. You're from here, right?
Send me an email, and we will understand each other better.

From right here Tongue
Cuando este en casa ya te escribo,gracias Smile

By MsxKun

Paladin (924)

MsxKun's picture

09-10-2019, 22:05

So, with the help of Manel46 I solved 2 of the 3 issues easily.
Interrupts work ok now, and split works the way it should.
For the record, the problem was that I was using HTIMI hook instead of HKEY, tho I changed the hook to HKEY when I had problems and kept failing, probably cause by then the code was a bunch of try-this-to-see-if-it-fixes-the-crap code. Big smile

Now I only have 1 issue. I still can't copy a single byte from RAM to VRAM inside the interrupt routine, only outside, unless I want to get corrupted gfx.
No idea why can't I copy anything when on vblank... but i'll keep trying.

By assembler

Champion (378)

assembler's picture

10-10-2019, 08:14

Do you write something to the vram outside the Interruption?

Maybe the interruption is interrupting some VRAM writing.

By MsxKun

Paladin (924)

MsxKun's picture

10-10-2019, 09:57

assembler wrote:

Do you write something to the vram outside the Interruption?

Maybe the interruption is interrupting some VRAM writing.

Well, I do some copies after the interrupt, but maybe the 2nd one messes it... but it happened before, when only 1 was working. Anyway I'll take a look, disabling these copies outside the int. Ty.

By Manel46

Champion (458)

Manel46's picture

10-10-2019, 13:33

assembler wrote:

Do you write something to the vram outside the Interruption?

Maybe the interruption is interrupting some VRAM writing.

This may be the problem, sure.
If you write during the interruptions in the VRAM, you must deactivate them in each writing to the VRAM, which is done in the rest of the program.

By MsxKun

Paladin (924)

MsxKun's picture

10-10-2019, 20:06

Well, my program outside the interrupt is now:

.loop: halt
jr .loop

Still getting junk on screen when trying to copy 4 bytes to G9K_P1_SPR_ATTRIB_TABLE (or anywhere, anyway)

Page 4/5
1 | 2 | 3 | | 5