Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GetJoypadState; 984
- push af
- push hl
- push de
- push bc
- ld a,[$c2c7]
- cp a, $ff
- jr z, .asm_9a7
- ld a,[$ff00+$a4]
- ld b, a
- ld a,[$ff00+$a8]
- ld e, a
- xor b
- ld d, a
- and e
- ld [$ff00+$a6], a
- ld a, d
- and b
- ld [$ff00+$a7], a
- ld c, a
- ld a, b
- ld [$ff00+$a8], a
- .asm_9a2
- pop bc
- pop de
- pop hl
- pop af
- ret
- ;9a7
- .asm_9a7
- ld a,[$ff00+$9d]
- push af
- ld a, [$c2ca]
- rst $10
- ld hl, $c2c8
- ldi a, [hl]
- ld h, [hl]
- ld l, a
- ld a, [$c2cb]
- and a
- jr z, .asm_9c2
- dec a
- ld [$c2cb], a
- pop af
- rst $10
- jr .asm_9a2
- .asm_9c2
- ldi a, [hl]
- cp a, $ff
- jr z, .asm_9e0
- ld b, a
- ldi a, [hl]
- ld [$c2cb], a
- cp a, ff
- jr nz, .asm_9d6
- dec hl
- dec hl
- ld b, $00
- jr .asm_9e5
- .asm_9d6
- ld a, l
- ld [$c2c8], a
- ld a, h
- ld [$c2c9], a
- jr .asm_9e5
- .asm_9e0
- call Functiona0a
- ld b, $00
- .asm_9e5
- pop af
- rst $10
- ld a, b
- ld [$ff00+$a7], a
- ld [$ff00+$a8], a
- jr .asm_9a2
- ld [$c2ca], a
- ld a, l
- ld [$c2c8], a
- ld a, h
- ld [$c2c9], a
- xor a
- ld [$c2cb], a
- xor a
- ld [$ff00+$a7], a
- ld [$ff00+$a6], a
- ld [$ff00+$a8], a
- ld a, $ff
- ld [$c2c7], a
- ret
- ;a0a
- Functiona0a:
- xor a
- ld [$c2ca], a
- ld [$c2c8], a
- ld [$c2c9], a
- ld [$c2cb], a
- ld [$c2c7], a
- ret
- ;a1b
- PrintLetterDelay: ; 313d
- ; This function is used to wait a short period after printing a letter to the
- ; screen unless the player presses the A/B button or the delay is turned off
- ; through the [$cfcc] or [$cfcf] flags.
- ld a, [$cfcc]
- bit 4, a
- ret nz
- ld a, [$cfcf]
- bit 1, a
- ret z
- push hl
- push de
- push bc
- ld hl, $ffd8
- ld a, [hl]
- push af
- ld [hl], a
- ld a, [$cfcf]
- bit 0, a
- jr z, .asm_3160
- ld a, [$cfcc]
- and a, $07
- jr .asm_3162
- .asm_3160
- ld a, $01
- .asm_3162
- ld [$cfb2], a
- .joypad
- call GetJoypadState
- ld a, [$c2d7]
- and a
- jr nz, .asm_317f
- ld a, [$ff00+$a8] ; joypad
- bit 0, a ; a
- jr z, .asm_3176
- jr .asm_317a
- .asm_3176
- bit 1, a ; b
- jr z, .asm_317f
- .asm_317a
- call DelayFrame
- jr .end
- .asm_317f
- ld a, [$cfb2]
- and a
- jr nz, .joypad
- .end
- pop af
- ld [$ff00+$d8], a
- pop bc
- pop de
- pop hl
- ret
- ;318c
Add Comment
Please, Sign In to add comment