Skip to content

Commit

Permalink
vdp: fix 0 checks across various versions/ports
Browse files Browse the repository at this point in the history
As noted in #994
  • Loading branch information
EtchedPixels committed May 28, 2023
1 parent 680bb18 commit a26d1f8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Kernel/dev/vdp1.s
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ clear_lines:
pop de ; E = line, D = count
push de
push hl
xor a
cp d
ret z
ld a,(_int_disabled)
push af
di
Expand Down Expand Up @@ -509,6 +512,9 @@ clear_across:
push bc
push de
push hl
xor a
cp c
ret z
ld a,(_int_disabled)
push af
di
Expand Down
6 changes: 4 additions & 2 deletions Kernel/platform-geneve/vdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ void clear_lines(int8_t y, int8_t ct)

addr = VT_BASE + vt_offset + y * VT_WIDTH;
v99xx_set_vram_page(addr / V99xx_VRAM_PAGE_SIZE);
v99xx_memset_vram(addr, ' ', ct * VT_WIDTH);
if (ct)
v99xx_memset_vram(addr, ' ', ct * VT_WIDTH);
}

void clear_across(int8_t y, int8_t x, int16_t l)
Expand All @@ -56,7 +57,8 @@ void clear_across(int8_t y, int8_t x, int16_t l)

addr = VT_BASE + vt_offset + y * VT_WIDTH + x;
v99xx_set_vram_page(addr / V99xx_VRAM_PAGE_SIZE);
v99xx_memset_vram(addr, ' ', l);
if (l)
v99xx_memset_vram(addr, ' ', l);
}

void cursor_off(void)
Expand Down
6 changes: 6 additions & 0 deletions Kernel/platform-mtx/vdp.s
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ _clear_across:
push bc
push de
push hl
xor a
cp c
ret z
call videopos6 ; HL is now the offset we need
ld b, c
clearbyte:
Expand All @@ -157,6 +160,9 @@ _clear_lines:
pop de
push de ; E = line, D = count
push hl
xor a
cp d
ret z
ld c,d ; Lines to copy
ld d, #0 ; E = y, D = X
ld b, #80
Expand Down
6 changes: 6 additions & 0 deletions Kernel/platform-rc2014/vdp1.s
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ _tms_clear_lines:
push de
push hl
push bc
xor a
cp d
ret z
ld a,(_int_disabled)
push af
di
Expand Down Expand Up @@ -295,6 +298,9 @@ _tms_clear_across:
push de
push hl
push af
xor a
cp c
ret z
ld a,(_int_disabled)
push af
di
Expand Down
5 changes: 5 additions & 0 deletions Kernel/platform-rcbus-8085/vdp1.S
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ _clear_lines:
ldsi 2
lhlx ; Check do we push 2 x 16bit or 2 x 8bit ? FIXME
xchg ; E = line, D = count
xra a
cmp d
rz
lda _int_disabled
push psw
di
Expand Down Expand Up @@ -240,6 +243,8 @@ _clear_across:
xchg ; DE = coords
ldsi 2
ldax d
ora a
rz
mov c,a ; C = count

lda _int_disabled
Expand Down

0 comments on commit a26d1f8

Please sign in to comment.