瀏覽代碼

sms/vdp: properly protect AF on PutC

pull/10/head
Virgil Dupras 5 年之前
父節點
當前提交
162e503291
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. +7
    -4
      kernel/sms/vdp.asm

+ 7
- 4
kernel/sms/vdp.asm 查看文件

@@ -133,6 +133,8 @@ vdpPutC:
cp ASCII_BS
jr z, vdpBS

push af

; ... but first, let's convert it.
call vdpConv

@@ -140,20 +142,21 @@ vdpPutC:
call vdpSpitC

; Move cursor. The screen is 32x24
ex af, af'
ld a, (VDP_ROW)
cp 31
jr z, .incline
; We just need to increase row
inc a
ld (VDP_ROW), a
ex af, af' ; bring back orig A

pop af
ret
.incline:
; increase line and start anew
ex af, af' ; bring back orig A
call vdpCR
jr vdpLF
call vdpLF
pop af
ret

vdpCR:
call vdpClrPos


Loading…
取消
儲存