>I guess Paul just reads the position of DFILE when accessed and mixes the attributes then.
>As far as I understood the documentation there is only character map supported in 2 ways (modes):
>Defining the color for specific characters - OR - defining attributes for every char position.
>I think the first one is more easy to implement in exisiting games/programs.
Too late
I was curious to try to get the traditional WRX mode working in colour, so now I'm working on a new weird experimental mode.
The resolution should be 136x128. The D-FILE length will be of 2176 bytes for graphics (it should be possible to place it also outside the conventional memory), plus an unmoveable attributes area of 2304 bytes, permitting one attribute byte per graphics byte (only one byte is wasted each line for the row termination).
Let's call it SBWRX (Stefano Bodrato's WRX variant)
:
Code: Select all
HRG_handler:
ld b,4 ; delay sets the left edge of the screen
HRG_wait_left:
djnz HRG_wait_left ; delay loop
nop ; delay fine tuning here! Do not change!
; (Originally the delay was obtained setting B to 7)
dec b ; make Z flag=0
ld hl,(base_graphics)
ld b,128 ; 128 lines per hires screen
push hl
ld hl,HRG_LineStart + $8000
ex (sp),hl
ld de,17 ; 17 bytes offset is added to HL for next hline AND 18 bytes for the next dummy line ptr
HRG_outloop:
ld a,h ; get HGR address MSB from HL
ld i,a ; load MSB into I register which is RFSH address MSB
ld a,l ; get HGR address LSB from HL
ex (sp),hl
call HRG_CallHL ; HRG_LineStart + $8000 + row offset
inc e
add hl,de ; add 18 to HL to point to next hline
ex (sp),hl
dec e
add hl,de ; add 17 to HL to point to next hline
dec b ; decrement line counter
jp nz,HRG_outloop ; test for last line
pop hl
; -------------------------------------------------------
;
HRG_postproc:
(...)
;------------------------------------------------------------------------------
Pivot trick by Stefano Bodrato :)
;------------------------------------------------------------------------------
HRG_CallHL:
ld r,a ; load LSB to R register which is RFSH address LSB
jp (hl)
;------------------------------------------------------------------------------
;
; This is a dummy-line used for HRG output (17 bytes) repeated 128 times !!!
;
;------------------------------------------------------------------------------
HRG_LineStart:
defb 0, 0, 0, 0 ; 17 NOPs = 17x8 bits = 136 pixels each HLINE
defb 0, 0, 0, 0
defb 0, 0, 0, 0
defb 0, 0, 0, 0
defb 0
ret
defb 0, 0, 0, 0 ; 17 NOPs = 17x8 bits = 136 pixels each HLINE
defb 0, 0, 0, 0
defb 0, 0, 0, 0
defb 0, 0, 0, 0
defb 0
ret
(...)