In Grauw's test program you could change ModifyR18 (at line 141 in VDPReg18.asm) as follows
ModifyR18: PROC ld b,0 ld c,VDP_PORT_1 ld d,18 | VDP_REGISTER ld e,0FH Loop: ld a,b and e reverse: equ $ cpl di out (c),a in a,(0x98) out (c),d ei djnz Loop ret ENDP
In Grauw's test program you could change ModifyR18 (at line 141 in VDPReg18.asm) as follows
ModifyR18: PROC ld b,0 ld c,VDP_PORT_1 ld d,18 | VDP_REGISTER ld e,0FH Loop: ld a,b and e reverse: equ $ cpl di out (c),a in a,(0x98) out (c),d ei djnz Loop ret ENDP
Will do.
Here is the video of old version (Grauw original) and a new modified version (with ARTRAG's code):
It seems that you cannot read the data port between two accesses to the command port without resetting its logic.
R18 doesn't change at all
We could maybe use R17....
I will try a different test using it
maybe one could try something like
in a,(0x98)
then following out(c), ... out(c), .... to change the register?
or the vdp could have enough time between the first out to fetch vram data and be free for the cmd engine, before the cpu could have finisced to set r18?
I would try to be as tight as possible
This is the fastest thing I came with
ModifyR18: PROC di ld a,18 + 128 ; no auto increment out (0x99),a ld a,17 + 128 ei out (0x99),a ld bc,0x0098 ld e,0FH Loop: ld a,b and e reverse: equ $ cpl in f,(c) ; db EDh,70h ; read data port out (0x9B),a ; set R#18 djnz Loop ret ENDP
Max could you try this ?
I would try to be as tight as possible
This is the fastest thing I came with
ModifyR18: PROC di ld a,18 + 128 ; no auto increment out (0x99),a ld a,17 + 128 ei out (0x99),a ld bc,0x0098 ld e,0FH Loop: ld a,b and e reverse: equ $ cpl in f,(c) ; db EDh,70h ; read data port out (0x9B),a ; set R#18 djnz Loop ret ENDP
Max could you try this ?
yes, will compile and try shortly.
I assume in f,(c) is an attempt to read data into nowhere? It wouldn't compile. I tried to write in (HL),(C) and it also didn't work. So I just inserted DB EDh,70h there and it compiled. I wonder is there profer way to write it in assembler without using DB...
Use in (c)
.
All in r,(c)
instructions set the flags, this variant sets only the flags and does not load into a register.
Use in (c)
.
All in r,(c)
instructions set the flags, this variant sets only the flags and does not load into a register.
Done. Here is the results:
Here is a slightly different video of the same program. I didn't disable the internal LAN module before executing, so I think it slightly affected the result.