Compare commits

...

18 Commits

Author SHA1 Message Date
Christophe Parent b8fb494ffd Simplify defines/constants 2024-07-08 22:44:15 -07:00
Christophe Parent 3c187e26d7 Optimize CMP instruction using a constant 2024-07-08 17:57:04 -07:00
Christophe Parent 8091eca69b Correct comment about swimming flag 2024-07-02 14:29:59 -07:00
Christophe Parent 889c5b5257 Reformat comments and enemy/music data 2024-07-02 11:30:09 -07:00
Christophe Parent 45504ea22b Optimize CMP/CPX/CPY instructions 2024-06-08 23:58:39 -07:00
Christophe Parent 23528e5ab0 Optimize ADC and SBC instructions 2024-06-01 08:52:35 -07:00
Christophe Parent fd54208307 Optimize checks on upper bit 2024-05-30 16:26:48 -07:00
Christophe Parent 54d1bc7511 Remove JMP instruction to RTS 2024-05-29 00:39:00 -07:00
Christophe Parent 59f2a9b312 Optimize subroutine tail calls 2024-05-29 00:33:48 -07:00
Christophe Parent e2cf3e8ee0 Remove residual/unnecessary code and data 2024-05-28 23:46:27 -07:00
Christophe Parent 7e8c442c8d Remove unused bytes 2024-05-21 11:36:05 -07:00
Christophe Parent 0f21037f79 Homogenize indentation 2024-05-19 22:33:39 -07:00
Christophe Parent f4d824625b Add space in front of every comment 2024-05-19 21:53:30 -07:00
Christophe Parent 87c7aabce7 Remove trailing spaces 2024-05-01 22:53:24 -07:00
Christophe Parent 48380aa02c Switch to cc65 for building 2024-05-01 14:10:53 -07:00
Christophe Parent a89ac25a7b Switch to Unix-style EOL 2024-04-30 16:03:35 -07:00
Christophe Parent 85abe4e11b Rename disassembly file 2024-04-30 15:56:35 -07:00
Christophe Parent 8511a3d586 Add original disassembly file 2024-04-26 14:34:33 -07:00
6 changed files with 17292 additions and 2 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
src/chars.bin
src/*.o
target/

24
LICENSE Normal file
View File

@ -0,0 +1,24 @@
Super Mario Bros. Corrected is published with no license. It is distributed as is in the hope that it will be useful, but WITHOUT ANY WARRANTY.
---
Credits:
* Original work on Super Mario Bros.: Copyright 1985 Nintendo
* Original work on disassembly: Copyright 2012, 2015 doppelganger
* Additional work: Copyright 2024 Christophe Parent
---
Original words from doppelganger (doppelheathen@gmail.com):
There are so many people I have to thank for this, and without their help this would
probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
way I could have done this without your help), as well as the authors of x816 and SMB
Utility, and the reverse-engineers who did the original Super Mario Bros. Hacking Project,
which I compared notes with but did not copy from. Last but certainly not least, I thank
Nintendo for creating this game and the NES, without which this disassembly would
only be theory.
Update: removed residual note under ChkStart label. Thanks to ShaneM for pointing out
the error.

View File

@ -1,3 +1,54 @@
# super-mario-bros-corrected
# Super Mario Bros. Corrected
Super Mario Bros. with as many bugs and inaccuracies corrected as possible. Includes every optimization from super-mario-bros-optimized.
Super Mario Bros. with as many bugs and inaccuracies corrected as possible; includes every optimization from Super Mario Bros. Optimized.
![Super Mario Bros. Corrected in action](/demo.png)
## Usage
### Requirements
cc65 must be installed on your system; the oldest supported version is `2.18`. No other dependencies are required.
Additionally a file containing the graphics for the original Super Mario Bros. game must be present on your system. This file is not provided.
### Installing
Clone this repository locally:
```shell
$ git clone https://forge.thatspaceandtime.org/ooxie/super-mario-bros-corrected.git super_mario_bros_corrected
$ cd super_mario_bros_corrected
```
Copy the graphics file:
```shell
$ cp <path_to_the_graphics_file> src/chars.bin
```
Create the target directory:
```shell
$ mkdir target
```
### Building
To build the binary, execute:
```shell
$ cl65 -t nes -o target/super_mario_bros_corrected.nes -C src/linker.cfg src/main.asm
```
### Running
To run the game, open the file `target/super_mario_bros_corrected.nes` in your favorite NES emulator. Alternatively you can run it on original hardware.
### Playing
Refer to the original manual for Super Mario Bros.
## License
The source code of this project is not licensed, as the original work it is based on is not (see [LICENSE](/ooxie/super-mario-bros-corrected/src/branch/master/LICENSE)).

BIN
demo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

19
src/linker.cfg Normal file
View File

@ -0,0 +1,19 @@
MEMORY {
ZP: file = "", start = $0000, size = $0100;
OAM: file = "", start = $0200, size = $0100, define = yes;
RAM: file = "", start = $0300, size = $0500;
HDR: file = %O, start = $0000, size = $0010, fill = yes;
PRG0: file = %O, start = $8000, size = $7FFA, fill = yes, fillval = $FF;
PRGV: file = %O, start = $FFFA, size = $0006, fill = yes, fillval = $FF;
CHR: file = %O, start = $0000, size = $2000, fill = yes, fillval = $FF;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes;
SPRITE: load = OAM, type = bss, optional = yes;
BSS: load = RAM, type = bss, optional = yes;
HEADER: load = HDR, type = ro;
STARTUP: load = PRG0, type = ro;
VECTORS: load = PRGV, type = ro;
CHARS: load = CHR, type = ro, optional = yes;
}

17193
src/main.asm Normal file

File diff suppressed because it is too large Load Diff