v9990 interrupt handler

Door Metalion

Paragon (1509)

afbeelding van Metalion

09-05-2022, 21:05

Hi everyone,

Is this interrupt handler correct for the v9990 ?
It would be called on the H_KEYI hook.
IEH and IEV are set up in R#9, and the HBLANK line is specified in R#10 and R#11.

; VBLANK or HBLANK ?
	in	a,(v9990.interrupt)
	bit	0,a
	jp	nz,.vblank
	bit	1,a
	jp	nz,.hblank
	ret

.vblank	push	af
	call	handles_vblank
	pop	af
	out	(v9990.interrupt),a	; resets flag
	ret	

.hblank	push	af
	call	handles_hblank
	pop	af
	out	(v9990.interrupt),a	; resets flag
	ret
Aangemeld of registreer om reacties te plaatsen

Van Metalion

Paragon (1509)

afbeelding van Metalion

10-05-2022, 14:44

To answer myself (and for future references), this is a correct v9990 interrupt handler, to be called from H_KEYI:

; VBLANK or HBLANK ?
	in	a,(v9990.interrupt)
	and	3
	out	(v9990.interrupt),a	; resets flags
	rra
	jp	c,handles_vblank
	rra
	jp	c,handles_hblank
	ret

Van PingPong

Prophet (3889)

afbeelding van PingPong

10-05-2022, 21:11

what a beautiful device is the v9990. How it's easy, linear and clean to interact with it.
Handle the interrupt with only one register with flags, the out does sw acknowledge without the risk of missing the int as happens with the tms-crappy-vdps descendants.

Van Metalion

Paragon (1509)

afbeelding van Metalion

11-05-2022, 19:55

Yeah, well, all is not so rosy after all ...

I disabled completely the standard VDP in my code (by writing 0 in R#0 and R#1) before switching to v9990, and as a result, the interruption does not work anymore. Looks like the H_KEYI hook is not called, which does not make any sense.

oO

EDIT: Problem solved. It was just a matter of disabling the H_TIMI hook, which was somehow messing with my interruption, because the S#0 register still contains a value, even if the standard VDP is disabled.

Van Grauw

Ascended (10580)

afbeelding van Grauw

11-05-2022, 19:57

Indeed, that does not make sense.

https://sourceforge.net/p/msxsyssrc/git/ci/master/tree/base3...

KEYINT:
J0C3C:  PUSH    HL
        PUSH    DE
        PUSH    BC
        PUSH    AF
        EXX
        EX      AF,AF'
        PUSH    HL
        PUSH    DE
        PUSH    BC
        PUSH    AF
        PUSH    IY
        PUSH    IX
	CALL    H.KEYI

Edit: Never mind! :)