A reimplementation of Zelda 3 for the Original Xbox. Being my first Xbox port, things could, and probably will, go wrong. It is based on an old port that lacks some of the most recent changes made in the original repository.
The savegame can be found inside the E:\UDATA\Zelda3\Saves
folder.
Known problems:
- Sometimes audio doesn't start;
- Missing some features from the original repository;
- Changing ExtendedAspectRatio to 4:3 in the zelda3.ini file makes the screen uncentered.
This project is made with Nxdk, so make sure you set it up first. Clone this repository:
git clone https://github.com/Calistex/zelda3-xbox.git
Remember to change the Nxdk directory (NXDK_DIR
) inside the platform/xbox/Makefile
according to your installation.
To build it:
cd platform/xbox
make
This will generate a bin
folder with the default.exe and the files needed. After having extracted and compiled the resources from the original rom and generated the zelda3_assets.dat
file using the instructions in the original readme below, put it inside the bin/tables
folder.
Rename the bin
folder to anything you like and put it on your Xbox.
I've built the project using a modified version of SDL2 by fgsfds that enables hardware acceleration, but it should be fine even with the version bundled with Nxdk.
- Rinnegatamante for the original Ps Vita port, which this port is based on;
- Daniel Pinheiro for the Celeste Classic port, which Makefile I used for this one;
- fgsfds for the modified SDL2 version;
- fgsfds and Ryzee119 for all the help they gave me on the XboxDev Discord server, which was critical to get this to work;
- Haguero for testing;
- Everyone on the XboxDev Discord server who showed interest and support for this project.
A reimplementation of Zelda 3.
Our discord server is: https://discord.gg/AJJbJAzNNJ
This is a reverse engineered clone of Zelda 3 - A Link to the Past.
It's around 70-80kLOC of C code, and reimplements all parts of the original game. The game is playable from start to end.
You need a copy of the ROM to extract game resources (levels, images). Then once that's done, the ROM is no longer needed.
It uses the PPU and DSP implementation from LakeSnes, but with lots of speed optimizations. Additionally, it can be configured to also run the original machine code side by side. Then the RAM state is compared after each frame, to verify that the C implementation is correct.
I got much assistance from spannierism's Zelda 3 JP disassembly and the other ones that documented loads of function names and variables.
Some features have been added that are not supported by the original game.
Secondary item slot on button X (Hold X in inventory to select).
Displays max rupees, bombs and arrows with yellow or orange color.
Extends throwing bombs to four instead of two.
Support for MSU audio tracks.
Support for enhanced aspect ratios of 16:9 or 16:10.
Switching current item with L/R keys.
Reordering of inventory by pressing Y+Arrows.
Higher quality map screen.
Disable low health beep.
Pick up items and destroy pots with Sword.
- the
libsdl2-dev
library- Windows: automatically installed with NuGet
- Ubuntu:
apt install libsdl2-dev
- macOS:
brew install sdl2
- a
tables/zelda3.sfc
US ROM file (for asset extraction step only)- SHA256 :
66871d66be19ad2c34c927d6b14cd8eb6fc3181965b6e517cb361f7316009cfb
.
- SHA256 :
- The
pillow
andpyyaml
python dependencies used by the assets extractor.python -m pip install -r requirements.txt
Look at the wiki at https://github.com/snesrev/zelda3/wiki for more help.
First extract and compile resources.
cd tables
Run python3 extract_resources.py
to extract resources from the ROM into a more human readable format.
Run python3 compile_resources.py
to create a file called zelda3_assets.dat
that gets loaded by the executable.
In case you're planning to move the .exe to a different folder, please include zelda3_assets.dat
.
Then build the .sln file with Visual Studio.
You can also build and run it through TCC in case you don't have Visual Studio. Note that TCC builds without optimizations so the game will run considerably slower.
Read about how to use TCC here...
Extract the assets as detailed above.Unzip TCC for win64 into third_party/tcc
.
Unzip SDL2 into third_party/SDL2-2.24.0
.
Start run_with_tcc.bat
. It will perform some basic error checks and then start the game.
make
Advanced make usage ...
make -j$(nproc) # run on all core
make clean all # clear gen+obj and rebuild
CC=clang make # specify compiler
You need DevKitPro and Atmosphere installed.
(dkp-)pacman -S git switch-dev switch-sdl2 switch-tools
cd platform/switch
make # Add -j$(nproc) to build using all cores ( Optional )
# You can test the build directly onto the switch ( Optional )
nxlink -s zelda3.nro
In case you're planning to move the executable to a different location, please include the file tables/zelda3_assets.dat
.
The game supports snapshots. The joypad input history is also saved in the snapshot. It's thus possible to replay a playthrough in turbo mode to verify that the game behaves correctly.
The game is run with ./zelda3
and takes an optional path to the ROM-file, which will verify for each frame that the C code matches the original behavior.
Button | Key |
---|---|
Up | Up arrow |
Down | Down arrow |
Left | Left arrow |
Right | Right arrow |
Start | Enter |
Select | Right shift |
A | X |
B | Z |
X | S |
Y | A |
L | C |
R | V |
The keys can be reconfigured in zelda3.ini
Additionally, the following commands are available:
Key | Action |
---|---|
Tab | Turbo mode |
W | Fill health/magic |
Shift+W | Fill rupees/bombs/arrows |
Ctrl+E | Reset |
P | Pause (with dim) |
Shift+P | Pause (without dim) |
Ctrl+Up | Increase window size |
Ctrl+Down | Decrease window size |
T | Toggle replay turbo mode |
O | Set dungeon key to 1 |
K | Clear all input history from the joypad log |
L | Stop replaying a shapshot |
R | Toggle between fast and slow renderer |
F | Display renderer performance |
F1-F10 | Load snapshot |
Alt+Enter | Toggle Fullscreen |
Shift+F1-F10 | Save snapshot |
Ctrl+F1-F10 | Replay the snapshot |
1-9 | run a dungeons playthrough snapshots |
Ctrl+1-9 | run a dungeons playthrough in turbo mode |
This project is licensed under the MIT license. See 'LICENSE.txt' for details.