News
Welcome to NeoRHDN! This place is still a work-in-progress, so pardon the construction...

Site registration now fixed. Oops!
Views: 434,351
Sections: Documents | Utilities | ROM Hacks | Games | Translations | Homebrew | Fonts
Site: Main | Rules/FAQ | Discord | Memberlist | Latest posts | Stats | Ranks | Online users
09-19-24 10:44 PM
Guest: Register | Login

Main - Posts by ShaneM


ShaneM
Posted on 08-23-24 11:52 PM, in Super Mario Bros. Fixes (rev. 4 of 08-23-24 11:57 PM by ShaneM) Link | ID: 436
Newcomer

Level: 3

Posts: 1/8
EXP: 123
Next: 5

Since: 08-21-24

Last post: 4 days
Last view: 38 min.
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
Posted on 09-02-24 05:38 AM, in Super Mario Bros. Fixes (rev. 7 of 09-02-24 05:58 AM by ShaneM) Link | ID: 617
Newcomer

Level: 3

Posts: 2/8
EXP: 123
Next: 5

Since: 08-21-24

Last post: 4 days
Last view: 38 min.
Posted by SMB2J-2Q
In SMB2J (SMBLL) there is a penalty for those who like to warp: do not allow world 9 to be activated unless the player completes all 8 worlds first.



Actually, that isn't true. SM2DATA3 does a check in the subroutine "BackToNormal" on which it is commented:


lda CompletedWorlds ;if completed all worlds without skipping over any
cmp #$ff ;then branch elsewhere (note warping backwards may
beq GoToWorld9 ;allow player to complete skipped worlds)


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:


ldy WorldNumber
lda WorldBits,y
ora CompletedWorlds ;set bit according to the world the player was in
sta CompletedWorlds


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
Posted on 09-05-24 05:00 AM, in Super Mario Bros. Fixes (rev. 6 of 09-05-24 05:10 AM by ShaneM) Link | ID: 690
Newcomer

Level: 3

Posts: 3/8
EXP: 123
Next: 5

Since: 08-21-24

Last post: 4 days
Last view: 38 min.
Posted by SMB2J-2Q

Under SetStPos, after the player's sprite attributes are set up, X is then cleared and a JSR to BoundingBoxCore is performed. I wonder what this was supposed to do in SMAS?


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:


SetStPos: lda PlayerStarting_X_Pos,y ;load appropriate horizontal position
sta Player_X_Position ;and vertical positions for the player, using
lda PlayerStarting_Y_Pos,x ;AltEntranceControl as offset for horizontal and either
sta Player_Y_Position ;the original offset from the header or alt offset for vertical
lda PlayerBGPriorityData,x
sta Player_SprAttrib ;set player sprite attributes using offset in X
ldx #$00 ;SMAS set offset for player object
jsr BoundingBoxCore ;SMAS get player's bounding box coordinates
jsr GetPlayerColors ;get appropriate player palette


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
Posted on 09-08-24 10:50 PM, in Hi! Just stopping by. (rev. 2 of 09-08-24 10:54 PM by ShaneM) Link | ID: 756
Newcomer

Level: 3

Posts: 4/8
EXP: 123
Next: 5

Since: 08-21-24

Last post: 4 days
Last view: 38 min.
So do y’all think this new site will be the “official” successor to the original RHDN? I guess time will tell.

ShaneM
Posted on 09-11-24 05:10 AM, in Super Mario Bros. Fixes (rev. 6 of 09-11-24 05:27 AM by ShaneM) Link | ID: 777
Newcomer

Level: 3

Posts: 5/8
EXP: 123
Next: 5

Since: 08-21-24

Last post: 4 days
Last view: 38 min.
@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
Posted on 09-11-24 08:44 PM, in Super Mario Bros. Fixes Link | ID: 785
Newcomer

Level: 3

Posts: 6/8
EXP: 123
Next: 5

Since: 08-21-24

Last post: 4 days
Last view: 38 min.
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
Posted on 09-12-24 12:42 AM, in Super Mario Bros. Fixes (rev. 10 of 09-12-24 03:34 PM by ShaneM) Link | ID: 790
Newcomer

Level: 3

Posts: 7/8
EXP: 123
Next: 5

Since: 08-21-24

Last post: 4 days
Last view: 38 min.
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
Posted on 09-15-24 04:45 PM, in Super Mario Bros. Fixes (rev. 5 of 09-15-24 05:06 PM by ShaneM) Link | ID: 830
Newcomer

Level: 3

Posts: 8/8
EXP: 123
Next: 5

Since: 08-21-24

Last post: 4 days
Last view: 38 min.
Posted by SMB2J-2Q
Hi Shane,

I am curious as to the ChkGERtn routine:

ChkGERtn: lda GameEngineSubroutine ;get number of game engine routine running
cmp #$07
beq ExCSM ;if running player entrance routine or
cmp #$08 ;player control routine, go ahead and branch to leave
bne ExCSM
lda #$02
sta GameEngineSubroutine ;otherwise set sideways pipe entry routine to run
rts ;and leave

Specifically, this checks the GameEngineSubroutine variable for either routine $07 (for player entrance) or $08 (for player control) in action, and to branch to exit (ExCSM) if so. However, when checking for routine $08 it then says BNE (if not equal) and also leave the routine (to ExCSM), so unless they had intended to add additional code after this, then shouldn't that also be a BEQ or else if it is supposed to be a BNE branch, then shouldn't it be to StopPlayerMove? I am going to try that to see if any anomalies happen during the pipe intro scene.

UPDATE: I played the game with the change I applied and so far I have found no outstanding anomalies during Mario's automatic movement during the pipe intro scene.

~Ben


I optimized it and commented it anew. Use this one and credit me if borrowed.


ChkGERtn: lda GameEngineSubroutine ;load number of game engine routine running
cmp #$08 ;compare against the player control routine
bne ExChkGERtn ;if any other routine, branch to leave
lda #$02 ;otherwise load value to
sta GameEngineSubroutine ;set sideways pipe entry routine to run
ExChkGERtn:rts ;leave


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



Main - Posts by ShaneM


Acmlmboard v2.5.6+neo (2024-08-13)
© 2005-2024 Acmlm, Emuz, NinCollin, et al.

Page rendered in 0.064 seconds. (809KB of memory used)
MySQL - queries: 62, rows: 408/414, time: 0.053 seconds.