mirror of
https://github.com/catseye/SixtyPical.git
synced 2024-12-01 01:51:33 +00:00
50 lines
926 B
Plaintext
50 lines
926 B
Plaintext
word screen @ 1024
|
|
byte joy2 @ $dc00
|
|
|
|
word delta
|
|
|
|
routine read_stick
|
|
inputs joy2
|
|
outputs delta
|
|
trashes a, x, z, n
|
|
{
|
|
ld x, joy2
|
|
ld a, x
|
|
and a, 1 // up
|
|
if z {
|
|
copy $ffd8, delta // -40
|
|
} else {
|
|
ld a, x
|
|
and a, 2 // down
|
|
if z {
|
|
copy word 40, delta
|
|
} else {
|
|
ld a, x
|
|
and a, 4 // left
|
|
if z {
|
|
copy $ffff, delta // -1
|
|
} else {
|
|
ld a, x
|
|
and a, 8 // right
|
|
if z {
|
|
copy word 1, delta
|
|
} else {
|
|
copy word 0, delta
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
routine main
|
|
inputs joy2
|
|
outputs delta
|
|
trashes a, x, z, n, screen
|
|
{
|
|
repeat {
|
|
call read_stick
|
|
copy delta, screen
|
|
ld a, 1
|
|
} until z
|
|
}
|