.include "defines.inc" .include "macros.inc" .code ; // Patch $0CB2B ($8B2B), which has: lda $468 ; // with: ; // lda $F7 (Input_CurrentJoyButtonsWork) ; // bmi + ; // - lda $468 ; // jmp $8B2E ; // + // Dropping from stairs ; // lda $03D8 ; // cmp #8 ; // beq - ; // jmp $86E0 (which sets up Simon for falling) next_PART .if PART=::CURPART ; LINK_IN_PATCH places the blob in that address. ; It does not care whether the space is marked free or not, ; and it does not update the free-space listing. ; ; LINK_IN_ADDR has the same syntax, but requires that the address ; is marked as free space, and then marks it allocated. ; ; We use LINK_IN_PATCH here because we are just replacing ; a 3-byte instruction with another 3-byte instruction ; and we are not changing the code length at all. ; LINK_IN_PATCH $CB2B ; This is in bank 3 DEBUG_LABEL StairsPatch JMPF AllowSimonDropFromStairs PUBLIC_LABEL AllowSimonDropFromStairs_Continue ; the rest of the code continues just like before. .endif next_PART .if PART=::CURPART LINK_IN_BANK_OR_COMMON 3 PUBLIC_LABEL AllowSimonDropFromStairs lda $F7 ;Input_CurrentJoyButtonsWork Jmi drop m: lda $468 ; This instruction was replaced by PART 1 JMPF AllowSimonDropFromStairs_Continue drop: lda $3D8 cmp 38 Jne m jmp $86E0 ; Sets up Simon for falling .endif