The credits is all for zsolt, I only change the code to work with a full dummy dfile
Code: Select all
; ##############################################################
; # HR Driver from Sponzy, by zsolt. #
; # This driver simulate in ZX81 the ZX Spectrum Screen format #
; ##############################################################
HRON
LD IX,HRDRV
ret
HROFF:
ld a,$1e ; restore pattern table pointer
ld i,a
ld ix,$0281 ; The 'VIDEO-1' routine
xor a ; disable the color mode
ld bc,$7fef
out (c),a
ret
SAVE_SP dw 0
HRDRV
LD A,R ;delay [9]
LD B,$05 ;delay [7]
DLY DJNZ DLY ;delay [13/8]
LD (SAVE_SP),SP ; 4 ! 20 ! SAVE SP.
LD SP,NMISTACK ; 3 ! 10 ! because of nonlinear HFILE
POP HL ; 1 ! 10 ! 1st ROWADDRESS FROM NMISTACK
POP IX ; 2 ! 14 ! "ld ix,DFILE"
RET ; 1 ! 10 ! jump to DF_EXEC via NMISTACK
; -------------------------------------------------------
; End of displaytask:
DF_EXIT
LD SP,(SAVE_SP) ; 4 ! 20 ! restore SP
call $292 ;return to application program
call $220 ;extra register push and vsync
ld ix,HRDRV ;load the hr vector
jp $2a4 ;return to application program
;
; ------------------------------------------------------------------------------
; Executing D-File cont. (from NMISTACK)
; ------------------------------------------------------------------------------
DF_0100
and (hl) ; 1 ! 7 ! delay
and (hl) ; 1 ! 7 ! delay
ld bc,$0100 ; 3 ! 10 ! an offset value for computing
add hl,bc ; 1 ! 11 ! address of the next row
DF_EXEC
LD A,H ; 1 ! 4 ! high byte of rowaddr.
LD I,A ; 2 ! 9 ! to "I" reg.
LD A,L ; 1 ! 4 ! low byte of rowaddr.
LD R,A ; 2 ! 9 ! to "R" reg.
JP (IX) ; 2 ! 8 ! execute DFILE echo
; 32x NOP ; 32 ! 128 !
; RET (from DFILE) ; 1 ! 10 ! => "RET" to DF_xxxx
; ! ! or "RET" to DF_EXIT
;
; -----------------------
DF_00A0
ld bc,$00a0 ; 3 ! 10 ! an offset value...
add hl,bc ; 1 ! 11 ! address of the next row
pop ix ; 2 ! 14 ! "ld ix,DF_LINxx"
LD A,H ; 1 ! 4 ! high byte of rowaddr.
LD I,A ; 2 ! 9 ! to "I" reg.
LD A,L ; 1 ! 4 ! low byte of rowaddr.
LD R,A ; 2 ! 9 ! to "R" reg.
JP (IX) ; 2 ! 8 ! execute DFILE echo
;
; -----------------------
DF_F8A0
ld bc,$f8a0 ; 3 ! 10 ! 164 ! an offset value...
add hl,bc ; 1 ! 11 ! address of the next row
pop ix ; 2 ! 14 ! "ld ix,DF_LINxx"
LD A,H ; 1 ! 4 ! high byte of rowaddr.
LD I,A ; 2 ! 9 ! to "I" reg.
LD A,L ; 1 ! 4 ! low byte of rowaddr.
LD R,A ; 2 ! 9 ! to "R" reg.
JP (IX) ; 2 ! 8 ! execute DFILE echo;
; -----------------------
DF_F920
ld bc,$f920 ; 3 ! 10 ! 164 ! an offset value...
add hl,bc ; 1 ! 11 ! address of the next row
pop ix ; 2 ! 14 ! "ld ix,DF_LINxx"
LD A,H ; 1 ! 4 ! high byte of rowaddr.
LD I,A ; 2 ! 9 ! to "I" reg.
LD A,L ; 1 ! 4 ! low byte of rowaddr.
LD R,A ; 2 ! 9 ! to "R" reg.
JP (IX) ; 2 ! 8 ! execute DFILE echo
;
; -----------------------
DF_F9A0
ld bc,$f9a0 ; 3 ! 10 ! 164 ! an offset value...
add hl,bc ; 1 ! 11 ! address of the next row
pop ix ; 2 ! 14 ! "ld ix,DF_LINxx"
LD A,H ; 1 ! 4 ! high byte of rowaddr.
LD I,A ; 2 ! 9 ! to "I" reg.
LD A,L ; 1 ! 4 ! low byte of rowaddr.
LD R,A ; 2 ! 9 ! to "R" reg.
JP (IX) ; 2 ! 8 ! execute DFILE echo
;
; ------------------------------------------------------------------------------
;
NMISTACK
dw $807E ; the addr. of scanline 1 - corrected for 'JP (IX)'
; because the refresh register (R) increments by 2,
; but the 7th bit of 'R' not changes!!!
dw DF_LIN00+$8000 ; this becomes to 'IX' (for jump to D-FILE execution)
dw DF_EXEC ; the entry point of the display generator
;
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN01+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN02+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN03+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F9A0,DF_LIN04+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN05+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN06+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN07+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_00A0,DF_LIN08+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN09+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN10+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN11+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F9A0,DF_LIN12+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN13+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN14+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN15+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_00A0,DF_LIN16+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN17+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN18+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN19+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F9A0,DF_LIN20+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN21+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN22+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN23+$8000
dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_EXIT
DummyDfile:
DF_LIN00 fill 32,$00 \ db $c9
DF_LIN01 fill 32,$00 \ db $c9
DF_LIN02 fill 32,$00 \ db $c9
DF_LIN03 fill 32,$00 \ db $c9
DF_LIN04 fill 32,$00 \ db $c9
DF_LIN05 fill 32,$00 \ db $c9
DF_LIN06 fill 32,$00 \ db $c9
DF_LIN07 fill 32,$00 \ db $c9
DF_LIN08 fill 32,$00 \ db $c9
DF_LIN09 fill 32,$00 \ db $c9
DF_LIN10 fill 32,$00 \ db $c9
DF_LIN11 fill 32,$00 \ db $c9
DF_LIN12 fill 32,$00 \ db $c9
DF_LIN13 fill 32,$00 \ db $c9
DF_LIN14 fill 32,$00 \ db $c9
DF_LIN15 fill 32,$00 \ db $c9
DF_LIN16 fill 32,$00 \ db $c9
DF_LIN17 fill 32,$00 \ db $c9
DF_LIN18 fill 32,$00 \ db $c9
DF_LIN19 fill 32,$00 \ db $c9
DF_LIN20 fill 32,$00 \ db $c9
DF_LIN21 fill 32,$00 \ db $c9
DF_LIN22 fill 32,$00 \ db $c9
DF_LIN23 fill 32,$00 \ db $c9