Need help with padding an 8F script
Posted by: Couldntthinkofaname
Date: 2017-10-08 10:25:10
For example, if you wanted Mew, you would press:
RIGHT x21
SELECT - exit
Here's The code, commented to the best of my ability:
dec a ;-padding-
ld c,d ; c = $00
start:
call $3ffa ; calls joypad subroutine
ldh a,($b2) ; Grab most recently released button
cp $10 ; If that button is right...
jr z,righthandler ; ...then go to righthandler
cp $20 ; If that button is left...
jr z,lefthandler ;...then go to lefthandler
ldh a,($f8) ; Get current held button
cp $04 ; If that button is select...
jr z,end ; Go to the end
jr start ; Keep listening for inputs
righthandler:
inc c ; Every time right is pressed, increment c
jr start ; Keep listening for inputs
lefthandler:
dec c ; Every time left is pressed, decrement c
jr start ; Keep listening for inputs
end:
ld b,c ; B = C, B is used as the Species Index
ld c,$32 ;c + $32(50) , C is used as level.
call $3e48 ; Calls pokemon recieve subroutine
ret ; "It''s first grade, Spongebob!"
The code works perfectly fine as written, the only problem is I've been attempting to add padding (useless filler to prevent glitch items) to the code, but I can't seem to figure out how I would go about padding this script. Every time I add padding to fix one problem, another arises, and it's frustrating because I want to finish this soon.
Any and all help is appreciated.