|
||||||
Views:
1,283,554 |
![]() |
04-01-25 09:36 PM |
||||
Guest: Register | Login |
Main - Posts by |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 1/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Cool find, SMB2J-2Q!
Is that limited to SMB1 or The Lost Levels as well? I know the FDS SMB2J has a check for that under "CheckInvalidWorldNum:". On that version, it cannot be done after "FindAreaPointer:" because sm2data4.asm is loaded over that old code be it identical. |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 2/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Posted by SMB2J-2Q Actually, that isn't true. SM2DATA3 does a check in the subroutine "BackToNormal" on which it is commented:
But that comment also isn't completely true. Whenever you complete a castle, one of the 8 bits in "CompletedWorlds" ($07FA) is set. (To make this comment correct just remove the word "backwards" from the cmp #$ff line of doppleganger's disassembly though that isn't really important.) This bit is determined in "SetupVictoryMode" subroutine in SM2MAIN:
The bits in the WorldBits table start with #%00000001 for world 1 and multiplies for each world in table values. So world 8 would set #%10000000. It is ORA'd to save the previous bits hence how "CompletedWorlds" would be #$FF if you complete all 8 worlds. But, the set bits remain set even after taking a warpzone. I'll put it in layman's terms for you: Say you complete worlds 1 and 2, at the start of world 3 "CompletedWorlds" would have bits #%00000011 set. Let's say you take the negative warp zone on 3-1 back to 1-1, those bits aren't reset. Now, let's say after taking the negative warp you take the warp on 1-2 back to world 3. Well, the bits remain set. So you would still get to world 9 while taking these warps because you completed the first two castles (assuming you complete castles 3-8). The same could be said if you complete up to the start of world 8 (#%01111111 set) and on 8-1 take the negative warp zone back to 5-1 and then on 5-2 warp ahead back to 8-1. Well, after completing 8-4 $07FA would still be set to #$FF, hence even taking a possible 4 warp zones (2 regular and 2 negative) you would still end up on world 9. Does that make sense? |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 3/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Posted by SMB2J-2Q X is used as the offset for the player object, it is not "cleared" as in clearing a flag or bit but used as the offset for the player. I'll comment it more clearly for you:
This isn't a bugfix that needs to be ported to the NES/FDS. The display intermediate screen (lives screen) on the SNES SMB1 and TLL is set up differently, with a picture of the current level being displayed before the level starts. The player's bound box is set during this sequence on SNES but not NES/FDS because the routine isn't called during display intermediate on there. I NOP'd it on the SNES to see what would happen and it makes no difference. Perhaps this is quite possibly residual code as it may have been meant to be animated at one point including the player in the level intro picture. So not a bugfix or anything like that. -ShaneM EDIT: Also, the code you posted about castle timer awards has already been in my builds for the past year or so. You're mentioning really old code. I'd prefer you not guessing my code if you don't understand exactly what I did because it's creating false labels or comments to a disassembly that is private. Thanks. |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 4/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
So do y’all think this new site will be the “official” successor to the original RHDN? I guess time will tell. |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 5/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
@SMB2J-2Q,
In a hex editor, did you try nopping all occurrences of “ AutoCtrlPlyrFlag” on a backup copy? What happened/what changes did you notice when you did? It looks like if the player is being autocontrolled it sets a flag to disable pausing in the check start routine and if you’re manually controlling the player it is cleared. I wouldn’t know exactly for what unless I test it. Edit: If I had to guess that’s what prevents pausing during flagpole slide or castle victory routine. A good way to test it is to NOP it and see if you can pause after touching flagpole, entry to 1-2 or castle victory. Let me know if my guess wasn’t right and I’ll figure it out when I get time if it isn’t. About the RTS thing, Nintendo is known to do branches to not necessarily the closest RTS. It really doesn’t matter which one except farther branching. If I understood what you’re saying correctly. |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 6/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Nop “lda #$01 and sta AutoCtrlPlyrFlag” in AutoControlPlayer and “stz AutoCtrlPlyrFlag” in PlayerControlRoutine and then nop” lda AutoCtrlPlyrFlag bne ExChkStart” in Chkstart. 5 different instructions in total. If not, I’ll get around to it when I can. Thanks. |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 7/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
I had you NOP the other stuff for neatness. The code is really only used in the conditional statement in ChkStart. It is only set/cleared in the other two routines. It did exactly what I thought it would. There are a few ways to do that. I’ve coded mine a different way.
Also, $0B7A is not a valid flag on SMB1 NES. I’d use a different one. |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 8/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Posted by SMB2J-2Q I optimized it and commented it anew. Use this one and credit me if borrowed.
Also, in the future could you please ask in a more generalized way instead of specifically calling me in every post for an answer? This is a community thread for everyone to participate in not just me. Thanks. LOL |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 9/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
@SMB2J-2Q great find! I didn't realize SMB Deluxe GBC did that. I optimized it for you. My whole routine is different in SMB2J where it does the modern powerdown so if you're fiery you become super and having multiple powerups on screen at once so I did it from scratch from Doppleganger's SMB1 disassembly. Test it and let me know. It doesn't require new space, actually saves 6 bytes and fixes:
*powerup sound playing with 1-UP mushroom *powerup sound playing with Starman *double jump glitch when grabbing a powerup
Credit me if borrowed. -ShaneM EDIT: I was able to save another byte by using Y register in "Shroom_Flower_PUp:". |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 10/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
@SMB2J-2Q
Replace with “;SM let's use Y register” to get it to assemble. I added that comment last minute. Did you find any more changes from SMB Deluxe or SMAS? |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 11/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
I was able to optimize the routine even further. Saving yet another byte:
What I did was use the Y register in "UpToSuper" instead. That subroutine is only taken if Y=#0. So I just made it INY STY instead of LDA #$01 STA. Also in "UpToFiery" changed it to "ldy Player_State". I meant to do that but it was a typo. -ShaneM |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 12/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
@SMB2J-2Q
I haven’t had time to look into it yet. It doesn’t fix any glitch I’m aware of. I know the music engine is set up differently on SNES. I looked up a Youtube video of the NES version and SNES. I notice that on NES the end of level music doesn’t play until after Mario gets off the flag and there’s a brief sound pause. But on SNES it plays while still on the flag. That lines up with the code’s order. My guess is that is what it does - changes a moment of silence from the NES version to make the transition more fluid. I’ll know more when I test it. Edit: Yeah; that’s exactly what it does. |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 13/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
SMB2J-2Q,
If you already knew the answer then why did you ask the question? Lol You could have just shared what it did. What the SNES does is run the end level music one frame sooner than the NES version does. I do like that change. Here’s one I noticed: On SNES it just uses big Mario’s jump sound for both size players when jumping. |
ShaneM |
| |||
![]() Micro-Goomba Level: 7 Posts: 14/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
On the original, when Bowser turns to face the player he flips but in an odd way. It makes him go into the ax at times. SMAS fixes this and SMB Deluxe GBC partially fixes this by making him properly turn. I wrote this code from scratch to fix it, it was made with SMB2J in mind but should work on SMB1; credit me if borrowed:
I also discovered that on 1-2 of SMB2J if you collect the Starman and run to the sideways warp pipe the SFX will not play most of the time if still invincible. SMB Deluxe and SMAS fixes this. I don't know offhand if Starman + sideways pipe ever occurs in the same room on SMB1. I don't think so hence this oversight. My code is from scratch, credit me if borrowed:
Yes, the Bowser fix does take up a lot of space, but it's worth it IMO. -ShaneM |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 15/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Posted by SMB2J-2Q Thanks. I tried to make it more dynamic than SMAS. It should be more responsive and better coded than that version. If you try it out do share your thoughts. EDIT: I revised the play pipe down SFX routine because A is immediately ORA'd by #$20 and stored as the new player sprite attribute. This sets the background priority bit and whatever else was previously loaded. The new fix corrects any data previously loaded in A to Player_SprAttrib:
-ShaneM |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 16/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Posted by SMB2J-2Q It would be more efficient to just use Y register like this:
But to answer your question, yes - it is safe to remove the LDA #$00. INC affects incrementing memory (RAM), not an immediate value loaded into the accumulator. That instruction also affects the negative and zero flag. INY and INX affects said registers directly though. -ShaneM |
ShaneM |
| ||||||
![]() Micro-Goomba Level: 7 Posts: 17/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Posted by SMB2J-2QPosted by ShaneM Actually, your code is inaccurate. The SNES version actually adds more code at the end to check Podoboo's vertical position to determine if to launch him anew. Also, SNES Podoboo jumps up inside the status bar at times and has SFX. I wrote this code from scratch to emluate SMAS' behavior on this 6502 program, credit me if borrowed:
That's all that needs to be changed. Nothing in "InitPodoboo:" Posted by SMB2J-2Q Change the ldx #$04 to ldx #$05 to get your outcome. I wouldn't recommend it unless you do more ASM work because powerups, vine and flagpole flag share the sixth slot on vanilla SMB1/2J:
-ShaneM |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 18/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Posted by SMB2J-2Q On NES, Player size and status are changed during the lives screen. It does nothing game-wise adding that code there. Sure, it resets the values but the player is already offscreen, hence it makes no difference. SNES must be set up differently to need it for some reason. I would say it's a waste of space and resources, unless you can pinpoint a certain function adding that would do. |
ShaneM |
| ||
![]() Micro-Goomba Level: 7 Posts: 19/19 EXP: 1238 Next: 210 Since: 08-21-24 Last post: 155 days Last view: 114 days |
Posted by SMB2J-2Q The following is with SMB2J in mind. It wasn't one thing in particular but many: 1) I changed how powerups are loaded in the enemy slot from always being in slot 6 to using the first available slot but still preferring slot 6. This is in line with SMB Deluxe GBC and SMB Special. This makes it so multiple powerups can be on screen at once which also fixes disappearing powerups. Reference posts #112 & #113 on the old thread on RHDN (page 6) to see how this was done. 2) I simply moved some enemies over one spot, which isn't noticeable. 3) I did some ASM stuff with springboards to get them to load in the sixth slot at times or specifially an always-free slot on worlds A-D. A-3 was coded differently. Here's what I added in SM2DATA4 with a jump from SM2MAIN:
4. I hardcoded how Piranha Plants are loaded in certain stages because sometimes it would be impossible even in the sixth slot to load them all. This took a lot of space and is in my current build. 5. Certain levels like 1-2 and 3-1 I had to hardcode because there's a spot on 1-2 for example with 4 powerups, a vine and platforms (treated as enemies) on the same screen and I had to make them all load a specific way. As you can see, gameplay-wise it's nice, but took a lot of work. And also keep in mind this is SMB2J. I hope it helps. It would probably be easier to wait for a more finalized version to be released when I do. -ShaneM |
Main - Posts by |
![]() ![]() |
Acmlmboard v2.5.6+neo (2024-08-13) © 2005-2025 Acmlm, Emuz, NinCollin, et al. |
MySQL - queries: 105, rows: 462/468, time: 0.115 seconds. |