Setting up a command on V9990

Door Metalion

Paragon (1096)

afbeelding van Metalion

01-01-2020, 14:03

Hello and happy new year to everyone,

I've tried to set up a LMMV command on the V9990, but it does not work.
Not only that, but the registers 32-52 values do not change.

	ld	hl,test
	call	do_command
	
test
	word	0,0,32,32,64,64,0,0FFh,6666h,6666h
	byte	20h

do_command
	ld	a,32
	out	(reg_select),a
	ld	bc,21:reg_data
	otir
	ret

I have used to same technique to set up the P1 mode, and I can see the registers changing in that routine. But here, nothing changes, they stay at zero.

Am I missing something ?

EDIT : it seems I cannot write any value to the V9990 registers ... weird. I don't know what happens.
Even this snippet of code does not change the value of register 32 in the debugger window

	ld	a,32
	out	(reg_select),a
	
	ld	a,255
	out	(reg_data),a
Aangemeld of registreer om reacties te plaatsen

Van Manel46

Champion (492)

afbeelding van Manel46

01-01-2020, 18:31

I put code for this:

DrawFilledBox:
; HL = pointer to parameters (format: left,top,width,height)
; DE = Color
		LD      A,G9K_DS_X  ;32
		OUT     (G9K_REG_SELECT),A
		LD      BC,8*256+G9K_REG_DATA
		G9kCmdWait
		OTIR
		LD      A,G9K_FC
		OUT     (G9K_REG_SELECT),A
		OUT     (C),E
		OUT     (C),D   ; Set color
		G9kWriteReg G9K_OPCODE,G9K_OPCODE_LMMV
		RET
		MACRO G9kWriteReg register,data
; Write gfx9000 register
; modifies: A
		LD	A,register
		OUT	(G9K_REG_SELECT),A
		LD	A,data
		OUT	(G9K_REG_DATA),A
		ENDM
		MACRO	G9kCmdWait
; Wait for command execution completion
; Modifies A
		IN	A,(G9K_STATUS)
		RRA
		JR	C,$-3
		ENDM

I can add the list of constants, if necessary.

Van Metalion

Paragon (1096)

afbeelding van Metalion

01-01-2020, 18:29

It works at last, my "logical operator" register value was incorrect !

But the value of the V9990 registers not showing in the "debuggable viewer" seems to me like a bug in the OpenMSX debugger.

Van Manel46

Champion (492)

afbeelding van Manel46

01-01-2020, 18:34

G9K_OPCODE_LMMV EQU 20h ; VRAM rectangle area is painted out

Van Grauw

Ascended (8697)

afbeelding van Grauw

01-01-2020, 19:45

Metalion wrote:

But the value of the V9990 registers not showing in the "debuggable viewer" seems to me like a bug in the OpenMSX debugger.

You can also inspect the V9990 registers debuggable from the openMSX console with:

debug read Sunrise\ GFX9000\ regs [n]

Where [n] is 0..63.

Or, to dump all registers:

showdebuggable Sunrise\ GFX9000\ regs

If that works then it is indeed a problem in the debugger; otherwise it is a bug in openMSX itself.

Van GhostwriterP

Hero (527)

afbeelding van GhostwriterP

01-01-2020, 19:42

stand corrected, with the debugger version I have also the high regs always show 0, perhaps a bug indeed

Van Manuel

Ascended (16029)

afbeelding van Manuel

01-01-2020, 22:06

A bug in the debugger is possible, but unlikely. All generic debuggable viewers work the same. So please check what Grauw suggested in the console. If it's wrong, I'd like to know.

Van Metalion

Paragon (1096)

afbeelding van Metalion

02-01-2020, 10:53

Grauw wrote:

You can also inspect the V9990 registers debuggable from the openMSX console with:

debug read Sunrise\ GFX9000\ regs [n]

Where [n] is 0..63.
Or, to dump all registers:

showdebuggable Sunrise\ GFX9000\ regs

I'm not sure how to do that.
Where is that console ?
I'm using Catapult.

Van Grauw

Ascended (8697)

afbeelding van Grauw

02-01-2020, 12:04

See https://openmsx.org/manual/user.html#controlling

It’s very useful. You can also create scripts yourself.