- As usual, chuck glitch makes the code jump to
- which is open bus so it executes the last value on data bus which is 0x01 (the bank from the jump that just occured) or as an instruction
- ORA ($01,x)
- and since the chuck spawns in slot #9, X is also 0x09 meaning we have to look at the address in $0A (1+9=A)
- ORA ($0A)
- which is set by the xposition of the lowest sprite ID that is still existent + 2.
- this sprite is the pswitch in slot #7 that is at xposition 3250 or 0x0CB2 which makes $0A hold 0x0CB4 so
- ORA $0CB4
- now $0CB4 holds some decompressed graphics value for tiles so it's always the same value in that level, which is 0xFC so data bus is now 0xFC which means the next instruction is
- JSR (addr,X)
- usually addr would be $FCFC because of open bus, but the SNES does stuff in a different order when dealing with jumps
- 1. the low byte of the new address is read -> data bus is still 0xFC -> addr is $xxFC
- 2. the high byte of the old address is pushed to stack -> data bus turns to 0x4A (because $4A17)
- 3. the low byte of the old address is pushed to stack -> data bus turns to 0x17 (because $4A17)
- 4. the high byte of the new address is read -> data bus is now 0x17 -> addr is $17FC
- since X is still 0x09 the resulting address is 17FC+9=1805
- JSR ($1805)
- $1805 is inside the yposition (low byte) table for minor extended sprites (dust clouds, coin sparkles, etc)
- so 2 ypositions have to be set up to get E4 00 forming an address of $00E4 (the 0xE4 can also be a bit lower, but then it will run over code that could ruin the setup)
- JSR $00E4
- $00E4 is the xposition (low byte) table of normal sprites where you can write code by despawning (destroying) sprites in different slots and then making sure no other sprite spawns in that slot
- so say you destroy sprites in slot #1 and #2 at xposition 0x68, #3 in 0x4A, #4 in 0x92, #5 in 0x75 and #6 in 0x60 which forms the code
- PLA : PLA : LSR A : STA ($75) : RTS
- PLA : PLA
- that effectively gets rid of the wrong stack address (we don't want to return to open bus) and because of $4A17 that was on the stack, A is now 0x4A
- LSR A
- shifts A one bit to the right, meaning the same as dividing by 2 so A is now 0x25
- STA ($75)
- $75 is 0x01 when in water and 0x00 when not, $76 is 0x01 when facing right and 0x00 when left so facing right makes that a
- STA $0100
- $0100 is the game mode and is set to 0x25 which is the ending with the enemies
- returns to the place that would have been normally executed if Yoshi had eaten a usual powerup
- Game Mode changed -> Enemies show
- THE END
- Simple isn't it?
- Just set up the pswitch in slot #7 at a pixel perfect xposition.
- Then manipulate two minor extended sprite ypositions.
- Additionally write code with 6 xpositions of sprites, pixel perfect of course.
- Finally just do the chuck glitch while facing right.
- (oh and of course always keep track of the sprite slots and don't you dare overwrite one of the values because you accidentally spawned a sprite or collected a coin)
smw credits glitch strategy documentation
Masterjun Jul 29th, 2014 46,398 Never
RAW Paste Data