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

Site registration now fixed. Oops!
Views: 435,290
Sections: Documents | Utilities | ROM Hacks | Games | Translations | Homebrew | Fonts
Site: Main | Rules/FAQ | Discord | Memberlist | Latest posts | Stats | Ranks | Online users
09-20-24 04:37 AM
Guest: Register | Login

0 users currently in Hacking Discussion | 1 bot

Main - Hacking Discussion - Super Mario Bros. Fixes (1)

Pages: 1 2

ShaneM
Posted on 09-12-24 12:42 AM, in (rev. 10 of 09-12-24 03:34 PM by ShaneM) Link | ID: 790
Newcomer

Level: 3

Posts: 7/8
EXP: 124
Next: 4

Since: 08-21-24

Last post: 4 days
Last view: 6 hours
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.

SMB2J-2Q
Posted on 09-12-24 03:39 PM, in (rev. 3 of 09-12-24 03:41 PM by SMB2J-2Q) Link | ID: 794

Goomba

Level: 6

Posts: 18/22
EXP: 566
Next: 341

Since: 08-21-24
From: Oak Grove, OR

Last post: 2 hours
Last view: 16 min.
Posted by ShaneM
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.

In my case, I did assign it to a different one: $06B7, formerly used by JumpCoinMiscOffset.

I will use your version of the code, though, but I was curious as to what it did.

~Ben

SMB2J-2Q
Posted on 09-15-24 01:52 AM, in (rev. 7 of 09-15-24 02:32 AM by SMB2J-2Q) Link | ID: 819

Goomba

Level: 6

Posts: 19/22
EXP: 566
Next: 341

Since: 08-21-24
From: Oak Grove, OR

Last post: 2 hours
Last view: 16 min.
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

ShaneM
Posted on 09-15-24 04:45 PM, in (rev. 5 of 09-15-24 05:06 PM by ShaneM) Link | ID: 830
Newcomer

Level: 3

Posts: 8/8
EXP: 124
Next: 4

Since: 08-21-24

Last post: 4 days
Last view: 6 hours
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



SMB2J-2Q
Posted on 09-15-24 05:43 PM, in (rev. 2 of 09-15-24 05:47 PM by SMB2J-2Q) Link | ID: 831

Goomba

Level: 6

Posts: 20/22
EXP: 566
Next: 341

Since: 08-21-24
From: Oak Grove, OR

Last post: 2 hours
Last view: 16 min.
Posted by ShaneM
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




Sorry about that.

I will try your optimized fix.

~Ben

SMB2J-2Q
Posted on 09-18-24 12:04 AM, in (rev. 2 of 09-18-24 12:06 AM by SMB2J-2Q) Link | ID: 862

Goomba

Level: 6

Posts: 21/22
EXP: 566
Next: 341

Since: 08-21-24
From: Oak Grove, OR

Last post: 2 hours
Last view: 16 min.
I was just told by the person who compiled the SMAS-style level breakdown for SMB that the new $BA RAM flag was a flag created specifically for the underwater scene in world 8-4 in both SMB and SMBLL, which although it has the map type of underwater it keeps the palette and music attributes related to the castle level, hence why we're hearing the castle level music here.

~Ben (SMB2J-2Q)

SMB2J-2Q
Posted on 09-20-24 01:53 AM, in (rev. 4 of 09-20-24 04:21 AM by SMB2J-2Q) Link | ID: 890

Goomba

Level: 6

Posts: 22/22
EXP: 566
Next: 341

Since: 08-21-24
From: Oak Grove, OR

Last post: 2 hours
Last view: 16 min.
Could anyone please let me know what you think of my new fix for HandlePowerUpCollision?


HandlePowerUpCollision:
jsr EraseEnemyObject ;erase the power-up object
lda #$06
jsr SetupFloateyNumber ;award 1000 points to player by default
lda PowerUpType ;check power-up type
cmp #$02
beq SetForStar ;if star, branch
cmp #$03
beq SetFor1Up ;if 1-up mushroom, branch
lda #Sfx_PowerUpGrab
sta Square2SoundQueue ;otherwise super mushroom or fire flower, so play the power-up sound
bne Shroom_Flower_PUp ;then do unconditional branch ahead to corresponding routine
SetForStar:
lda #$23 ;set star mario invincibility timer,
sta StarInvincibleTimer ;and load the star mario music
lda #StarPowerMusic ;into the area music queue, then leave
sta AreaMusicQueue
rts

Here, both the invincibility star and 1-UP are checked first, and if either are found, to bypass playing the power-up grab sound (SMB2USA, SMB3 and SMBDX all have it not play the power-up sound when a Star is collected), otherwise if it's the Super Mushroom or Fire Flower, the power-up sound is played and we then do an unconditional branch (BNE) to the Shroom_Flower_PUp routine.

~Ben
Pages: 1 2


Main - Hacking Discussion - Super Mario Bros. Fixes (1)


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

Page rendered in 0.046 seconds. (820KB of memory used)
MySQL - queries: 73, rows: 429/437, time: 0.039 seconds.