2
1

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-6001] キー入力 & ジョイスティック入力

Last updated at Posted at 2013-04-30

#キー入力
##BIOSを使う

call    $1061   ;Aregに状態が返ってくる
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
SPACE reserved STOP SHIFT
  • 0:OFF, 1:ON
  • BASICのSTICK(0),STRIG(0)に相当

#ジョイスティック入力
##BIOSを使う

ld      a,no    ;ジョイスティック番号(#1:$01,#2:$02)
call    $1CA6   ;Aregに状態が返ってくる
bit7-6 bit5 bit4 bit3 bit2 bit1 bit0
reserved TRIGGER1 TRIGGER2
  • 0:OFF, 1:ON
  • BASICのSTICK(n),STRIG(n)に相当(n=1~2)

ただし、BIOSの前半部分にバグがありPSGにノイズが乗ってしまうことがあるので、下記のようにして回避します。

entry:
        rrca
        rrca
        or      %10000000
        push    bc
        ld      b,a
        ld      a,$07   ;PSG/R7
        di
        out     ($A0),a
        in      a,($A2)
        ld      c,a
        ;ここまではBIOSからの抜粋
        or      %10000000       ;ここがBIOSでは ld a,%10000000 になっている
        jp      $1CB6           ;BIOSの途中に飛ぶ
2
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?