Far from being a hires expert, but curious of this driver I had a look at the LightningDriver.asm, and the source is wonderfully documented and is not long at all to be read. Moreover itself is a demo, and the part that is writing the screen (simply cleaning it in this case) is:
Code: Select all
CLEAR_HIRES_DFILE:
LD HL,HR_DFILE
LD C,DISPLAY_LINES
LD DE,HDO_NEXT_LINE
LD A,$1E ; Use the Sinclair I register value for the line.
JR CDF_ROW ; Jump ahead to fill the first line.
CDF_ROW_JP:
LD (HL),Z80_JP ; Insert the end of line terminator routine.
INC HL
SET 7,H
LD (HL),E
INC HL
LD (HL),D
RES 7,H
INC HL
CDF_ROW:
CALL FILL_LINE ; Fill all column positions of the line.
DEC C
JR NZ,CDF_ROW_JP ; Repeat for all display lines.
LD (HL),Z80_RET ; Insert the terminator routine for the final line.
RET
; ----------------------
; Fill Display File Line
; ----------------------
; Entry: HL=Address of the display file line.
; A=Value of the I register value for this line.
FILL_LINE:
SET 7,H
LD (HL),A ; Insert the I register value.
RES 7,H
INC HL
LD B,DISPLAY_COLUMNS
CDF_COL:
LD (HL),_BLACK ; Fill a column position.
INC HL
DJNZ CDF_COL ; Repeat for all columns.
RET
Now you can change this piece of code to write whatever you want on the screen, all based on the structure of each line that is (the number is the offset of the value in the line):
Code: Select all
; 0 I register value to use for the line.
; 1-32 Character codes for the 32 display columns.
; 33-35 End of line terminator bytes (JP HDO_NEXT_LINE, or RET for the final line).
If you will be more specific on your doubts maybe I (if I'll be able) or some expert might try to answer.
This of course is regarding the display driver. A different type of beast is managing sprites, scrolling, game logic, etc...