Compare commits

...

30 Commits

Author SHA1 Message Date
Christophe Parent 3f9725dba5 Simplify defines/constants 2024-07-08 23:06:43 -07:00
Christophe Parent 6b19efaa2c Optimize CMP instruction using a constant 2024-07-08 18:03:03 -07:00
Christophe Parent 296a3233c2 Correct comment about swimming flag 2024-07-02 14:31:41 -07:00
Christophe Parent a09108a349 Reformat comments and enemy/music data 2024-07-02 11:31:54 -07:00
Christophe Parent ca736cc7a6 Optimize CMP/CPX/CPY instructions 2024-06-09 00:26:04 -07:00
Christophe Parent 4b3dcd6d60 Optimize ADC and SBC instructions 2024-06-01 08:54:07 -07:00
Christophe Parent fb8a5fcda3 Correct header for end of level music 2024-05-21 11:46:22 -07:00
Christophe Parent 5fcfb5ac61 Add missing step in README file 2024-05-01 14:12:56 -07:00
Christophe Parent acfebaaae9 Update screenshot to palette Smooth (FBX) 2024-05-01 13:31:03 -07:00
Christophe Parent 609828b274 Optimize checks on upper bit 2024-03-02 11:11:12 -08:00
Christophe Parent 0b81c08d8d Remove JMP instruction to RTS 2024-02-08 23:52:24 -08:00
Christophe Parent f7793b12e4 Optimize subroutine tail calls 2024-02-07 23:12:51 -08:00
Christophe Parent acc90317a8 Remove residual/unnecessary code and data 2024-02-02 13:12:14 -08:00
Christophe Parent c98ecb4e2d Remove unused bytes 2024-01-19 15:10:15 -08:00
Christophe Parent 8eed2bd31a Inline CopyChars subroutine back to Bank 3 2023-12-29 00:18:08 -08:00
Christophe Parent 9711b4ecc1 Remove CurrentBank as game runs in NMI handler only 2023-12-28 00:36:20 -08:00
Christophe Parent 23ac63a261 Add comments to bank switching 2023-12-26 19:03:13 -08:00
Christophe Parent 3df5a940a4 Homogenize indentation 2023-12-25 23:40:12 -08:00
Christophe Parent 2a307755a3 Add space in front of every comment 2023-12-20 17:03:39 -08:00
Christophe Parent 6a75efded7 Remove trailing spaces 2023-12-18 20:51:21 -08:00
Christophe Parent b58b4dbc1f Merge branch 'unrom' into develop 2023-12-13 23:07:46 -08:00
Christophe Parent 839982c7bd Move area and enemy data to Bank 1 2023-12-13 00:22:53 -08:00
Christophe Parent 2072532f1b Rename source files 2023-12-10 00:30:34 -08:00
Christophe Parent 2627bc1ac3 Switch to UNROM, Chars and Sound engine in new Bank 2 2023-12-10 00:00:18 -08:00
Christophe Parent 2c48f59c68 Use linker script 2023-12-03 23:48:15 -08:00
Christophe Parent 77f35f881d Remove unused directives 2023-12-03 14:41:39 -08:00
Christophe Parent 9e5c548b34 Switch to Unix-style EOL 2023-12-03 14:37:50 -08:00
Christophe Parent 7076a091c9 Correct link in README file 2023-12-03 14:01:11 -08:00
Christophe Parent 053db6ea68 Switch to cc65 for building 2023-12-03 13:31:09 -08:00
Christophe Parent 2fa07f41f4 Add original disassembly file 2023-12-02 17:55:18 -08:00
6 changed files with 17402 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.: Tale of the Black Koopa 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 2023 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-tale-of-the-black-koopa
# Super Mario Bros.: Tale of the Black Koopa
A hack of Super Mario Bros.
A hack of Super Mario Bros.
![Super Mario Bros.: Tale of the Black Koopa 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-tale-of-the-black-koopa.git super_mario_bros_tale_of_the_black_koopa
$ cd super_mario_bros_tale_of_the_black_koopa
```
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_tale_of_the_black_koopa.nes -C src/linker.cfg src/main.asm
```
### Running
To run the game, open the file `target/super_mario_bros_tale_of_the_black_koopa.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-tale-of-the-black-koopa/src/branch/master/LICENSE)).

BIN
demo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

27
src/linker.cfg Normal file
View File

@ -0,0 +1,27 @@
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 = $4000, fill = yes, fillval = $FF;
PRG1: file = %O, start = $8000, size = $4000, fill = yes, fillval = $FF;
PRG2: file = %O, start = $8000, size = $4000, fill = yes, fillval = $FF;
PRG3: file = %O, start = $C000, size = $3FFA, fill = yes, fillval = $FF;
PRGV: file = %O, start = $FFFA, size = $0006, 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;
BANK0: load = PRG0, type = ro, optional = yes;
AREADATA: load = PRG1, type = ro, optional = yes;
ENEMYDATA: load = PRG1, type = ro, optional = yes;
CHARS: load = PRG2, type = ro, optional = yes;
SOUNDENGINE: load = PRG2, type = ro, optional = yes;
BANK3: load = PRG3, type = ro, optional = yes;
BANKSWITCH: load = PRG3, type = ro, optional = yes;
VECTORS: load = PRGV, type = ro;
}

17295
src/main.asm Normal file

File diff suppressed because it is too large Load Diff