News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: Remove Intro Demo From SMB  (Read 358 times)

Magic_Man_5000

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Remove Intro Demo From SMB
« on: June 01, 2018, 09:21:51 am »
Is there a way to remove the intro demo from SMB? Currently I have an intro demo without movement, but it still resets if you press start instead of starting the game once the demo starts.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6463
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Remove Intro Demo From SMB
« Reply #1 on: June 01, 2018, 12:43:17 pm »
Well, the demo activation is on a timer. So you could disable the code that changes the timer, so the demo will never activate.
You could check the Disassembly to find it.
Quote
Sir Howard Stringer, chief executive of Sony, on Christmas sales of the PS3:
"It's a little fortuitous that the Wii is running out of hardware."

nesrocks

  • Hero Member
  • *****
  • Posts: 502
    • View Profile
Re: Remove Intro Demo From SMB
« Reply #2 on: June 01, 2018, 01:35:37 pm »
Code: [Select]
00:825A:F0 1A     BEQ $8276
 00:825C:AE A2 07  LDX $07A2 = #$0F
 00:825F:D0 0B     BNE $826C
 00:8261:8D 80 07  STA $0780 = #$00
 00:8264:20 6B 83  JSR $836B

When 7A2 becomes zero it goes to demo mode.

Code: [Select]
00:8113:DE 80 07  DEC $0780,X @ $0785 = #$00
Replace these three bytes with EA EA EA and it won't do that anymore, but looking at it now that code must probably be used for other things (I think it's the general timer function), so you may want to test the game or use another solution. But it's there or in the above code you can easily get it working.

edit: you're probably safe by changing the "LDA 7A2" line to a jump to "not demo mode" like so
Code: [Select]
00:825C:4C 6C 82  JMP $826C
« Last Edit: June 01, 2018, 01:45:07 pm by nesrocks »

Magic_Man_5000

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Remove Intro Demo From SMB
« Reply #3 on: June 01, 2018, 04:36:06 pm »
Code: [Select]
00:825A:F0 1A     BEQ $8276
 00:825C:AE A2 07  LDX $07A2 = #$0F
 00:825F:D0 0B     BNE $826C
 00:8261:8D 80 07  STA $0780 = #$00
 00:8264:20 6B 83  JSR $836B

When 7A2 becomes zero it goes to demo mode.

Code: [Select]
00:8113:DE 80 07  DEC $0780,X @ $0785 = #$00
Replace these three bytes with EA EA EA and it won't do that anymore, but looking at it now that code must probably be used for other things (I think it's the general timer function), so you may want to test the game or use another solution. But it's there or in the above code you can easily get it working.

edit: you're probably safe by changing the "LDA 7A2" line to a jump to "not demo mode" like so
Code: [Select]
00:825C:4C 6C 82  JMP $826C
thanks. if only i knew how to actually do that.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6463
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Remove Intro Demo From SMB
« Reply #4 on: June 02, 2018, 11:58:39 am »
$825C is the CPU address.
For the NES, that means that since SMB has a 32KB PRG-ROM, is uses CPU addresses $8000-FFFF.
So that would be address $25C (plus $10 bytes for the header for a total of $26C).

So in a hex editor go to address $26C and replace the data with 4C 6C 82 to make that change.
Quote
Sir Howard Stringer, chief executive of Sony, on Christmas sales of the PS3:
"It's a little fortuitous that the Wii is running out of hardware."

Psyklax

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
    • Psyklax Translations
Re: Remove Intro Demo From SMB
« Reply #5 on: June 02, 2018, 01:02:33 pm »
go to address $26C and replace the data with 4C 6C 82 to make that change.

That's a good start, it stops the demo. But if you press start after 500 or so frames, it still goes back to the title screen as if the demo was playing, rather than go straight into the game, so there's something else happening - in fact, I think the OP had the exact same situation when he started the thread.

After making that change, you can see in the RAM that $7A2 still decrements, so clearly it won't let you start the game if $7A2 is zero. So I did a read breakpoint on $4016 - the controller 1 register - to see what would happen when I pressed Start before the demo starts. I predicted it would store the controller value somewhere, then check $7A2 to make sure it's time to start the game. Sure enough, it stores the controller value at $6FC, then first checks if it's $10 (Start button pressed) then does a Branch on Equal with $7A2 - in other words, jump to the reset routine if $7A2 is zero, otherwise Start the game.

So the simple option is to go to $2EB in the ROM and replace F0 EC with EA EA. Now the game starts when you press Start, even if the demo is playing (why couldn't Nintendo have done this in the first place?!). Combine that with what I quoted from KingMike at the top of my post, and you've got no demo and no reset problem. There you go! :)

Magic_Man_5000

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Remove Intro Demo From SMB
« Reply #6 on: June 02, 2018, 05:21:49 pm »
thank you, but what about pressing select?
« Last Edit: June 02, 2018, 05:53:23 pm by Magic_Man_5000 »

Psyklax

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
    • Psyklax Translations
Re: Remove Intro Demo From SMB
« Reply #7 on: June 02, 2018, 06:09:19 pm »
thank you, but what about pressing select?

Replace $289 with EA EA. ;) Actually, try it on its own when the demo is playing: Mario will stop dead and probably get killed by a Goomba. :D

Magic_Man_5000

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Remove Intro Demo From SMB
« Reply #8 on: June 02, 2018, 06:10:32 pm »
Replace $289 with EA EA. ;) Actually, try it on its own when the demo is playing: Mario will stop dead and probably get killed by a Goomba. :D
thanks for all your help