2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PC-88 z80asmでVBLANK

Last updated at Posted at 2018-08-08

直接テキストVRAMをクリアして書き込むより、仮想テキストVRAMに書き込んでからVBLANKで一気に転送する方がいいかもしれない。

vblank.asm
; z88dk / PC-88 mon
; z80asm -b -l vblank.asm

tvram   equ     $f3c8

        org     $b000
start:
        call    crtset
.loop
        ld      e, a
        call    vblank
        ld      a, e
        call    cls
        inc     a
        jr      loop

crtset:
        ld      hl, $e6b4
        ld      (hl), $f8       ; アトリビュート
        inc     hl
        inc     hl
        inc     hl
        inc     hl
        ld      (hl), $00       ; ファンクション・キー表示スイッチ
        inc     hl
        ld      (hl), $ff       ; カラー/白黒スイッチ
        ld      b, 80
        ld      c, 25
        call    $6f6b           ; CRTSET
        ret

vblank:
        in      a, ($40)
        and     $20
        jr      nz, vblank
.wait
        in      a, ($40)
        and     $20
        jr      z, wait
        ret

cls:
        ld      hl, tvram
        ld      de, 40
        ld      c, 25
.clsy
        ld      b, 80
.clsx
        ld      (hl), a
        inc     hl
        djnz    clsx
        add     hl, de
        dec     c
        jr      nz, clsy
        ret

vblank.png

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?