NOTABLE HARDSHIPS I WENT THROUGH AND THEIR (MOSTLY UGLY) SOLUTIONS
- Banzai Bill and Big Boo couldn't be in the same level due to GFX limitations
Solution: Hex edit to remap both their tilemaps to a GFX file which contained both of the sprites. As a result, they look broken in other levels but hey, this is basically a 1 (okay well, 2)-level hack.
- Making Mario look pretty shocked on the overworld when he's in the whirlpool
Solution: Add shocked graphics to Mario's OW GFX file. Hijack Mario's OAM and when he's in a certain position, do some really, really -really- ugly math:
CodeLDA $629E,x
CMP #$0A
BEQ +
CMP #$0B
BEQ +
CMP #$0C
BEQ +
CMP #$0D
BEQ +
CMP #$1A
BEQ +
CMP #$1B
BEQ +
CMP #$1C
BEQ +
CMP #$1D
BEQ +
BRA .end
+
CLC
ADC #$3C
STA $629E,x
Basically, it's the walking frames + #$3C tiles, which ended up resulting in my shocked walking tiles GFX. Thanks
Medic for being very patient with me and helping me out with this.
Side note: Mario's OAM on the overworld is 4x 8x8 tiles. Why Nintendo
WHY?! The graphics file is made so that you could load a single 16x16 tile instead, that would make life so much easier.
- Huge slowdown during the thwomps part and the boss fight
Solution: SA-1. Required me to basically restart the hack, but it was worth it.
- Podoboos caused OAM issues during the boss fight because it used 4 OAM slots because it's made of 4 8x8 tiles.
Solution: Download imamelia's podoboo sprite disassembly from the sprites section and edit its GFX routine to make it a single 16x16 tile instead. It went from this:
to this:
- The health bars wasted unnecessary OAM space. See above screenshots, the 4th-last row and the 3rd-last row, you'll see empty health bar frames. This also caused OAM issues.
Solution: fix the bug. I mean, it's a bug, after all. Of course I fix it. Special thanks to VitorVilela for helping me code the function where the health bar reduces 1 by 1 graphically, it was really tricky to get that to work. Special thanks to Dotsarecool for helping me out and telling me about no$sns' VRAM viewer thing. He also explained to me about OAM queues and everything which sounds like a fancy system, but I ended up not coding one.
- The boss fight needed a custom hurt routine to make Mario's life health-based rather than powerup-based
Solution: A small patch to make Mario's life health-based during a certain level:
CodeORG $00F5C6
JSL NewHurt
BRA $00
then in some free space:
!MarioHP = $747B
!FreeRAM = $610B ;basically the level number which is used in most level-based patches (uberasm for example)
NewHurt:
REP #$20
LDA !FreeRAM
CMP #$0026
SEP #$20
BNE .normal
DEC !MarioHP
BEQ .rip
LDA #$04
STA $7DF9
LDA #$7F
STA $7497
PLA
PLA
PLA
RTL
.normal
STZ $78E3
LDA $73E3
RTL
.rip
JSL $00F606
PLA
PLA
PLA
RTL
I don't even know if those triple PLAs are working correctly, it was just a random guess and they don't seem to cause any problem SO EH.
- The End screen: Mario's and Luigi's torso are shared graphically, so I couldn't make it so that Luigi's torso was bloody while Mario's was normal.
Solution: none, I was too lazy for this one. I could've made the screen a separate game mode (mode 5? the one with 256 colors for 1 layer) but yeah. Laziness prevailed. I just made Luigi's shoulders a bit bloody that's all. Also, Mario had double eyebrows in the creepypasta, I fixed that. I don't think the author noticed that error.
- More OAM issues during the boss fight, especially with those falling flames.
Solution: At this point I just wanted to release the hack so I didn't bother with it. Sorry.
- Coding the Luigi boss fight itself
Solution: I was thinking this would be impossible for me because the only boss I have coded is that shitty Spiny boss for SMWCP, but I guess I underestimated myself. Just need to go about the process very logically and everything just kind of happens... naturally.
- Sound effects spazzing out on snes9x during the boss fight. I guess I can blame AddmusicK.
- Normally in the first level, when you encounter the keyhole and the blind boo the music was supposed to fade out, but I ditched that idea, because apparently the fadeout command doesn't like to work with music which affect the global volume (the w command). I'd actually go as far as calling this an AddmusicK bug which probably *should* be fixed sometime.
My blog. I could post stuff now and then
My
Assembly for the SNES tutorial (it's actually finished now!)