NES code portability
Moderator: Moderators
NES code portability
Hi everyone!
Since it's the holiday season I watched Home Alone 1 & 2 for the hundredth time. This reminded me of the video game adaptations made at the time. Specifically Home Alone 2 which was ported both to the NES and the SNES. The graphics and sound are different but other than that it's pretty much the same exact game.
So I was wondering, considering that the SNES's 65C816 is compatible with the NES's 6502, when porting a game from the NES to its successor, can the code that handles the game's logic simply be "pasted" into the new game? In fact I ask myself the same question every time I play Super Mario All Stars.
Since it's the holiday season I watched Home Alone 1 & 2 for the hundredth time. This reminded me of the video game adaptations made at the time. Specifically Home Alone 2 which was ported both to the NES and the SNES. The graphics and sound are different but other than that it's pretty much the same exact game.
So I was wondering, considering that the SNES's 65C816 is compatible with the NES's 6502, when porting a game from the NES to its successor, can the code that handles the game's logic simply be "pasted" into the new game? In fact I ask myself the same question every time I play Super Mario All Stars.
Re: NES code portability
"Mostly", "it depends". Organization is different.
Re: NES code portability
Ok I see. At least now I know it's possible to some degree.
Does anyone know if SMAS shares some pieces of code with Super Mario Bros. 1 through 3? (I don't expect anyone to know about the terrible Home Alone games though
)
Does anyone know if SMAS shares some pieces of code with Super Mario Bros. 1 through 3? (I don't expect anyone to know about the terrible Home Alone games though

Re: NES code portability
Super Mario Allstars SMB1 and Lost Levels managed to have one notable bug not present in the NES version: When you break a brick, you get *sucked in* to the brick instead of bounced back from the brick.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Re: NES code portability
EAD's first SFC project was porting SMB3 so it's likely that game at least is mostly the same.
-
- Posts: 2980
- Joined: Wed May 19, 2010 6:12 pm
Re: NES code portability
Is VRAM arranged the same way on both versions of SMB3?
Re: NES code portability
I doubt it, considering the weird height of NES name tables. But that's the kind of thing that's expected to change between ports anyway, while the game logic has a much better chance of being reused.psycopathicteen wrote: ↑Wed Dec 30, 2020 11:50 amIs VRAM arranged the same way on both versions of SMB3?
-
- Posts: 2980
- Joined: Wed May 19, 2010 6:12 pm
Re: NES code portability
I mean, are the tiles and sprite patterns in the same spot?tokumaru wrote: ↑Wed Dec 30, 2020 12:03 pmI doubt it, considering the weird height of NES name tables. But that's the kind of thing that's expected to change between ports anyway, while the game logic has a much better chance of being reused.psycopathicteen wrote: ↑Wed Dec 30, 2020 11:50 amIs VRAM arranged the same way on both versions of SMB3?
- rainwarrior
- Posts: 8002
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: NES code portability
Mesen-S seems the best tool to compare this.psycopathicteen wrote: ↑Wed Dec 30, 2020 2:14 pmI mean, are the tiles and sprite patterns in the same spot?tokumaru wrote: ↑Wed Dec 30, 2020 12:03 pmI doubt it, considering the weird height of NES name tables. But that's the kind of thing that's expected to change between ports anyway, while the game logic has a much better chance of being reused.psycopathicteen wrote: ↑Wed Dec 30, 2020 11:50 amIs VRAM arranged the same way on both versions of SMB3?
It still has a "two screens high" arrangement, but there's 3 layers now instead of just 1, and it's wider than the screen now, so it has no seam.
The tiles have a similar arrangement, but they are redrawn in 4bpp and aren't constrained to pages of 256 tiles. The MMC3 bankswitching function to animate them seems to be duplicated with DMA.
So I don't know if that's a "no" or a "yes" to your question that probably deserves a much more complicated answer.