All numbers here are hex. Format: Lunar magic version that was tested on: 2.43 Note that branch opcodes are 2 bytes long. Do note that opcodes shown here are actually excuted, garbage opcode commands are cleaned out. Notes: -Every subroutine call of [JSL $00F545] in smw's code is adopted to use LM's map16 handling behavors. In SMWC's smw hijacks, its +1 from the JSL opcode since kept the opcode byte intact (only modifies the address it goes to). Here are the hijacks: 00f4dd jsl $06f660 ;>mario offsets (above, below, side, topcorner, head and body). 019533 jsl $06f700 ;>sprite offsets (SpriteV and SpriteH). 02961a jsl $06f760 ;>Cape 02a6eb jsl $06f7a0 ;>Fireball -I'm using {bsnes-plus version 073+3 (Nov 22 2016)} The branch destination are labeled as 2-byte "page", as in they obviously branch to another area in the same bank (so BEQ $3456 in bank 12 would go to $123456). FuSoYa readme about the map16 behavors (titled "Map 16 gameplay"): 0x37890 (SNES: $06F690) Mario touched a block from below. 0x378A0 (SNES: $06F6A0) Mario touched a block from above. 0x378B0 (SNES: $06F6B0) Mario touched a block from the side. 0x378C0 (SNES: $06F6C0) Mario touched the top corner of a block. *new to version 1.64 0x378D0 (SNES: $06F6D0) Mario is within a block (body). *new to version 1.64 0x378E0 (SNES: $06F6E0) Mario is within a block (head). *new to version 1.64 0x378F0 (SNES: $06F6F0) Reserved for future use. 0x37920 (SNES: $06F720) Sprite touched a block from above/below. 0x37930 (SNES: $06F730) Sprite touched a block from the side. 0x37940 (SNES: $06F740) Reserved for future use. 0x37950 (SNES: $06F750) Reserved for future use. 0x37980 (SNES: $06F780) Mario hit a block from the side with his cape. 0x37990 (SNES: $06F790) Reserved for future use. 0x379C0 (SNES: $06F7C0) Mario hit a block with a fireball. Also, GPS updates the above info for custom block handling. See main.asm about its code. Random note: Thanks to the new debugger, I'm able to even find the wall-running (after running up a triangle) block offset interaction code, its located at $00EB37 after CTRL+F "JSR.W CODE_00F44D". Therefore, it is likely that someone might update so that you can interact with custom blocks while wall-running. ;----------------------------------------------------- 06f602 tya ;>Transfer Y to A 06f603 jml $00f545 ;>Go back into smw's code 06f608 ldy $0d9b ;\If level mode activator isn't boss rooms branch 06f60b bpl $f619 ;/behavor number routine 06f60d ply ;\Pull out Y for someting? 06f60e ply ;/ 06f60f bra $f603 ;>Go to restore and go back to smw's code 06f619 xba ;>Swap bytes in A (handle high byte) 06f61a lda $1693 ;>Block behavor 06f61d phx ;>Preserve X (used by sprite index) 06f61e rep #$30 ;>16-bit AXY 06f620 tay ;>Transfer block behavor 06f621 asl a ;>Left shift (pointer table is 2 bytes each) 06f622 tax ;>Transfer to index 06f623 lda $118000,x ;>Load behavor acts like table from the ROM (this is altered by changing the behavor in LM). 06f627 cmp #$0200 ;\If map16 page 2 and beyond, branch to loop back to $06F620 06f62a bcs $f620 ;/(FuSoYa mentions you shouldn't "chain" your block behavor (block #$0200 acts like #$2001, which that acts like #$0130)) 06f62c sty $03 ;>$03 = current map16 number 06f62e sep #$30 ;>8-bit AXY 06f630 plx ;>Restore X 06f631 sta $1693 ;>Set block behavor by LM (allows for example: block $0200 to act like $0130) 06f634 xba ;>Swap bytes in A again 06f635 tay ;>Transfer high byte behavor number again 06f636 lda $08,s ;>Load the 8th last item in stack (determines what offsets), 06f638 rts ;>And done. ;;The lda $08,s basically loads what the JSR/JSL stores the address in the stack. In smw, ;;since each mario offset is located at different addresses, the code loads the address ;;stored in the stack to determine what offset it uses. Remember that when JSL/JSR, it ;;pushes the next instruction's address minus 1 into the stack. Also note that it only ;;loads the low byte of the address minus 1 ($****xx - 1) saved in the stack and the xx ;;is the CMP value below here. 06f660 jsr $f608 ;>Boss room check and loading custom behavor 06f663 cmp #$8c ;\$00EC8D-1 MarioBelow 06f665 beq $f690 ;/ 06f667 cmp #$4c ;\$00ED4D-1 MarioAbove 06f669 beq $f6a0 ;/ 06f66b cmp #$26 ;\$00EC27-1 MarioSide 06f66d beq $f6b0 ;/ 06f66f cmp #$eb ;\$00EDEC-1 TopCorner 06f671 beq $f6c0 ;/ 06f673 cmp #$b1 ;\$00EBB2-1 MarioBody 06f675 beq $f6d0 ;/ 06f677 cmp #$3c ;\$00EC3D-1 MarioHead 06f679 beq $f6e0 ;/ 06f67b jmp $f602 ;>Go to restore and go back to smw's code 06f690 jmp $f602 ;>Go to restore and go back to smw's code 06f6a0 jmp $f602 ;>Go to restore and go back to smw's code 06f6b0 jmp $f602 ;>Go to restore and go back to smw's code 06f6c0 jmp $f602 ;>Go to restore and go back to smw's code 06f6d0 jmp $f602 ;>Go to restore and go back to smw's code 06f6e0 jmp $f602 ;>Go to restore and go back to smw's code 06f700 jsr $f608 ;>Boss room check and loading custom behavor 06f703 cmp #$71 ;\$019272-1 SpriteV 06f705 beq $f720 ;/ 06f707 cmp #$57 ;\$019158-1 SpriteH 06f709 beq $f730 ;/ 06f70b cmp #$d2 ;\$0192d3-1 SpriteV (unused?) 06f70d beq $f720 ;/ 06f70f cmp #$93 ;\$019294-1 SpriteH (unused?) 06f711 beq $f730 ;/ 06f713 cmp #$7f ;\Another spriteH (unused?) 06f715 beq $f730 ;/ 06f717 jmp $f602 ;>Go to restore and go back to smw's code 06f720 jmp $f602 ;>Go to restore and go back to smw's code 06f730 jmp $f602 ;>Go to restore and go back to smw's code 06f760 jsr $f608 ;>Boss room check and loading custom behavor 06f763 cmp #$09 ;\$02950A-1 MarioCape 06f765 beq $f780 ;/ 06f767 jmp $f602 ;>Go to restore and go back to smw's code 06f780 jml $f602 ;>Go to restore and go back to smw's code 06f7a0 jsr $f608 ;>Boss room check and loading custom behavor 06f7a3 cmp #$da ;\029FDB-1 MarioFireball 06f7a5 beq $f7c0 ;/ 06f7a7 jmp $f602 ;>Go to restore and go back to smw's code 06f7c0 jml $f602 ;>Go to restore and go back to smw's code