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

Author Topic: Super Mario Bros. 2-Player Alternating?  (Read 824 times)

KevvyLava

  • Jr. Member
  • **
  • Posts: 41
    • View Profile
Super Mario Bros. 2-Player Alternating?
« on: November 25, 2020, 06:24:50 pm »
Hi all,

I was wondering if anyone knew of a hack of the original Super Mario Bros. where all that was changed was that instead of having to wait until the other player died to get your turn, it would switch after each level, like how Super Mario Bros. 3 is natively. I love the co-op hack, but this is something that I wondered about for some time.  Have a great Thanksgiving to everyone in 'Merica.

-Kevin

FAST6191

  • Hero Member
  • *****
  • Posts: 3023
    • View Profile
Re: Super Mario Bros. 2-Player Alternating?
« Reply #1 on: November 26, 2020, 10:14:53 am »
I would be sort of surprised if such a thing has not been made, though I imagine between straight co-op and the lives thing most are probably content, or will do something like run two instances of an emulator at once and go head to head as it were.

There is a possibility that this could be a fairly easy hack, if not terribly elegant. If you alternate on death then the trick would be to make you die at the end of each level (might be harder for warp zones) and if calling the death function makes you alternate then you have your answer. If it costs you a life then maybe add a bonus life at the start of each level. This you might be able to do with a level editor.

Two main ways I would set about this.
If you put a pit between the flag and the castle does it count, and does it allow you to start the next level?
If you fire the death routine after the timer, fireworks and whatnot happen does it shuffle you over?

Granted if you can alter the latter then you could probably be able to find the alternate character thing and do that instead. Bonus for you is the Super Mario on the NES is one of the most well hacked games with a nice commented disassembly.
https://gist.github.com/1wErt3r/4048722 (warning a bit of a browser grinder)
The death routine starting at 2906 (though the bit you probably want being a bit lower) being something good there. Might be able to go to an end level function (line 1231) and add a bit more/jump to somewhere to add a bit more to do the player swap instead, looks fairly small as well (or at least is a function in the disassembly called TransposePlayers located at line 3004, which means end of level could well have a little JSR to the location of the TransposePlayers thing. You could also NOP (short for no operation) the death swap over if you wanted and have deaths continue until level end or maybe out of lives (haven't checked the code to see what goes but would be worried about a crash or something odd in that scenario).