i was playing around with the Excalibur 64 and noticed this clearing routine within z88dk :
Code: Select all
generic_console_cls:
in a,($50)
bit 4,a
jr z,generic_console_cls
push af
res 1,a
set 0,a
out ($70),a
ld hl, DISPLAY
ld de, DISPLAY +1
ld bc, +(CONSOLE_COLUMNS * CONSOLE_ROWS) - 1
ld (hl),32
ldir
ld hl, COLOUR_MAP
ld de, COLOUR_MAP+1
ld bc, +(CONSOLE_COLUMNS * CONSOLE_ROWS) - 1
ld a,(__excali64_attr)
ld (hl),a
ldir
ld hl, HIRES_MAP
ld de, HIRES_MAP + 1
ld bc, +(CONSOLE_COLUMNS * CONSOLE_ROWS) - 1
ld (hl),4 ;PCG bank 0
ldir
pop af
out ($70),a
ret
so i copied it in my project instead of just calling just clg and then modify it later for my use...
except that it freezes when i do so.
Here's some it is in my test project :
Code: Select all
PUBLIC _cleartxt
defc DISPLAY = $2000
defc __console_w = 80
defc CONSOLE_COLUMNS = 80
defc CONSOLE_ROWS = 20
defc COLOUR_MAP = $2800
defc HIRES_MAP = $3000
.__excali64_attr defb $70 ; White on Black
_cleartxt:
in a,(50h)
set 0,a
out (70h),a
push af
ld hl, DISPLAY
ld de, DISPLAY +1
ld bc, +(CONSOLE_COLUMNS * CONSOLE_ROWS) - 1
ld (hl),32
ldir
ld hl, COLOUR_MAP
ld de, COLOUR_MAP+1
ld bc, +(CONSOLE_COLUMNS * CONSOLE_ROWS) - 1
ld a,(__excali64_attr)
ld (hl),a
ldir
ld hl, HIRES_MAP
ld de, HIRES_MAP + 1
ld bc, +(CONSOLE_COLUMNS * CONSOLE_ROWS) - 1
ld (hl),4 ;PCG bank 0
ldir
in a,(50h)
res 0,a
out (70h),a
pop af
ret
Looking at the memory mapping in rombasic.asm on the techrepo, i'm even more confused :
https://github.com/z88dk/techdocs/blob/ ... sic.asm#L8
It would seem that whenever screen RAM gets enabled, all of the RAM becomes inaccesible.
But if that's the case then why would it work for generic_console_cls and not for me ?
I'm not sure who to ask about it so i thought i would ask you guys instead.
(And yes, i'm using z88dk with the CP/M Excalibur 64 target)