![]()  | 
Routines | 
| Prev: 634C | Up: Map | Next: 6400 | 
| 
 
Used by the routine at 64BD. Compares Sam's location with those of the two banknotes. If there's a match, and Sam has just finished a somersault, the banknote is added to Sam's cash supply.
 
  | 
||||||||
| 63C3 | BIT 5,(HL) | Byte 0x0C of Sam's buffer holds the LSB of the current roll/somersault animation phase table entry | ||||||
| 63C5 | RET Z | Return if Sam was rolling | ||||||
| 63C6 | LD L,$01 | Collect Sam's x- and y-coordinates in E and D | ||||||
| 63C8 | LD E,(HL) | |||||||
| 63C9 | INC L | |||||||
| 63CA | LD D,(HL) | |||||||
| 63CB | LD B,L | B=2 (there are 2 banknotes) | ||||||
| 63CC | DEC H | H=0xE4 or 0xE5 | ||||||
| 63CD | LD A,D | A=Sam's y-coordinate | ||||||
| 63CE | CP (HL) | Compare it with the banknote's y-coordinate | ||||||
| 63CF | DEC HL | Point HL at byte 0x01 of the banknote's buffer | ||||||
| 63D0 | JR NZ,$63D6 | Jump unless Sam's y-coordinate matches the banknote's | ||||||
| 63D2 | LD A,E | A=Sam's x-coordinate | ||||||
| 63D3 | CP (HL) | Has Sam landed on a banknote? | ||||||
| 63D4 | JR Z,$63DA | Jump if so | ||||||
| 63D6 | INC HL | Point HL at byte 0x02 of the banknote's buffer | ||||||
| 63D7 | DJNZ $63CC | Jump back until both banknotes have been checked | ||||||
| 63D9 | RET | |||||||
| 
 
Sam has landed on something that is using one of the banknote buffers. Here we check that the object looks like a banknote. But this check is redundant, since no object except a banknote or the hook can use buffer 0xE4 or 0xE5, and Sam cannot land on the hook.
 
 | 
||||||||
| 63DA | DEC L | L=0x00 | ||||||
| 63DB | LD A,(HL) | A=banknote's animatory state | ||||||
| 63DC | AND $7F | Discard bit 7 | ||||||
| 63DE | SUB $3E | Is the banknote's animatory state 0x3E or 0xBE? | ||||||
| 63E0 | JR Z,$63E5 | Jump if so | ||||||
| 63E2 | SUB $08 | Is the banknote's animatory state 0x46 or 0xC6? | ||||||
| 63E4 | RET NZ | Return if not (this never happens) | ||||||
| 
 
Sam has landed on something that looks like a banknote.
 
 | 
||||||||
| 63E5 | LD L,$0A | Set byte 0x0A of the banknote's buffer to 1 to indicate that Sam's just landed on it (see 634C) | ||||||
| 63E7 | INC (HL) | |||||||
| 63E8 | CALL $61CF | Add 1, 5, 10 or 20 bucks to Sam's total | ||||||
| 
 
Finally we make an appropriate sound effect.
 
 | 
||||||||
| 63EB | XOR A | Prepare the sound effect parameters: A=0x00 (initial border colour), D=0x05 (duration), E=0xF9 (initial pitch) | ||||||
| 63EC | LD DE,$05F9 | |||||||
| 63EF | INC A | Increment the border colour | ||||||
| 63F0 | XOR $10 | Flip bit 4 of A | ||||||
| 63F2 | AND $17 | Retain only bits 0-2 (border colour) and 4 (speaker state) | ||||||
| 63F4 | OUT ($FE),A | Change the border colour and speaker state | ||||||
| 63F6 | LD B,E | Perform the pitch delay | ||||||
| 63F7 | DJNZ $63F7 | |||||||
| 63F9 | DEC E | Decrement the pitch delay | ||||||
| 63FA | JR NZ,$63EF | Jump back unless it's zero | ||||||
| 63FC | DEC D | Decrement the duration counter | ||||||
| 63FD | JR NZ,$63EF | Jump back unless it's zero | ||||||
| 63FF | RET | |||||||
| Prev: 634C | Up: Map | Next: 6400 |