Anonymous user
Remote control Pikachu: Difference between revisions
→Notes
>Torchickens No edit summary |
(→Notes) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 18:
xor a
ld a,
or a
ld a,
sub a,80
Line 34:
ld a,01
ld
ld
ret
ld a,
sub a,40
Line 52:
ld a,02
ld
ld
ret
ld a,
sub a,20
Line 70:
ld a,03
ld
ld a,01
ld
ret
ld
sub a,10
Line 90:
ld a,04
ld
ld a,01
ld
ret
ld a,
sub a,04
Line 110:
xor a
ld
ret
3. Change D36D/D36E (map script pointer) to point to the little-endian (smaller byte first) address where you wrote your code. For example, if you wrote your code at DB7D the values would be 7D and DB.
===Notes===
This code reads from FFB3; a joypad address in the HRAM.
The value in FFB3 is determined by the combination of the bits set when pressing buttons, for example, moving down enables bit 0x7 (+0x80 to the value). If one wanted to modify the code for an input with (for instance) down and left at the same time, FFB3 would read 0xA0 (0x80+0x20).
<pre>
Bit 0x7/+0x80 - Down
Bit 0x6/+0x40 - Up
Bit 0x5/+0x20 - Left
Bit 0x4/+0x10 - Right
Bit 0x3/+0x08 - Start
Bit 0x2/+0x04 - Select
Bit 0x1/+0x02 - B
Bit 0x0/+0x01 - A
</pre>
==How to move Pikachu==
|