As part of the July 2020 Giga leak, the source code for the Super Nintendo game F-Zero was leaked, this post covers all the files related to F-Zero with a brief explanation of the purpose. If you know of any interesting finds from the F-Zero source code please get in touch!
Gigaleak - SNES Source Code Leak
For more information on the rest of the Gigaleak check out this post.
When the Gigaleak SFC.7z archive (located inside Other.7z) is extracted it contains the source code for a bunch of Super Nintendo games, F-Zero is one of them, this post will cover evertthing in the FZERO directory from the extracted archive.
This folder contains the following sub-directories:
This folder contains the main game source code for the PAL version of F-Zero for the Super Nintendo which is also called SFX CAR RACE in some of the source files.
The files in this folder are described in the table below:
File Name | Extension | Description |
---|---|---|
ALPHA | N/A | Header file defining Alpha constants SP,RO,QU etc, unsure of purpose (18th June 1990) |
ALPHA2 | N/A | Header file defining Alpha constants N0, N1 etc, unsure of purpose (5th December 1989) |
ANK | N/A | ANK character font graphics in assembly format |
ANK8 | N/A | Header file defining Alpha constants N0, N1 etc, unsure of purpose (5th December 1989) |
BUFFER | N/A | Header file defining the main game buffer variables such as car acceleration etc (24th July 1990) |
RP5A22_ | N/A | Header file defining SFX CPU registers |
RP5C77_ | N/A | Header file defining SFX PPU registers |
TITLE | .DOC | Just has some meta data information such as the dates this game was worked on, the programmers and copyright information |
VARIABLE | N/A | Header file defining the main game variables such as game_level (23rd April 1990) |
WORK | N/A | Header file defining variables stored in WORK RAM |
calculate | .asm | Contains functions such as Calculate_score |
calculate_usa | .asm | Same as calculate.asm with a change to the Demo_stick_data variable |
car_control | .asm | Car movement functions such as Drift_ctrl |
control_data | .asm | Data for each of the cars such as maximum speed |
data-5 | .asm | Contains Course (Track) data (no actual code) |
data-6 | .asm | Contains Rival speed data (no actual code) |
effect | .asm | Contains functions for special effects like shadows and lazers |
en-check | .asm | Contains enemy check functions such as if they are on screen |
en-data-1 | .asm | Contains enemy OAM data (no code) |
en-data-2 | .asm | Second part of enemy OAM data |
en-drive | .asm | Contains Ememy driving functions, controlling speed and acceleration |
en-init-1 | .asm | enemy car Initialize Routine |
en-init-3 | .asm | Open drive data sub routine |
en-init-4 | .asm | enemy car Initialize Routine |
fzero_main | .asm | Program entry for the game |
fzero_main_pal | .asm | Program entry for the PAL version of the game |
fzero_main_usa2 | .asm | Same as fzero_main.asm but fixes a few bugs |
fzero_pal | .make | Makefile for the PAL version of the game |
game_over | .asm | Contains game pause functions and the game over logic |
game_over_usa | .asm | Same as game_over.asm but changes the Roll Data |
makefile | N/A | Used to build the source code in the folder (run make) |
play_main | .asm | Functions for screen select and initialization |
play_main_pal | .asm | Same as play_main.asm but changes the frame count timer logic (50hz) |
player | .asm | Player control functions such as Player_explode |
set-obj | .asm | Obj functions like Smoke and explosions |
set_back | , .asm | Background setup functions |
set_bg1 | .asm | functions for transferring world and slit data |
set_bg2 | .asm | functions for calculating perspective |
set_bg2_usa | .asm | Same as set_bg1.asm with slightly different title data |
sound | .asm | sound and music functions |
title_main | .asm | title and car select screens |
title_main_usa | .asm | same as title_main.asm with slightly different cusrsor values |
All the .asm files get assembled with the official SNES SDK assember (as65c) and then linked together with the link tool.
This folder contains the source code for various C-program that were used to help develop the game, such as file format converters for maps.
They read and write a number of file formats:
The files in this folder are described in the table below:
File Name | Extension | Description |
---|---|---|
armap | .c | Map data archiver, seems to read a .MTB file and exports a .MAP file |
carmap | .c | Map data generator, seems to read a .TBL and .SCR file and exports a .MAP file |
chrar | .c | Character data archiver, takes in a table (.TBL?) and CHR files and exports a ? |
cmpbuf | .s | Assembly source file containing an efficient buffer comparison routine |
cmppnl | .s | Assembly source file containing an implementation of a function int cmppnl( char* pnlbuf, char* panel, int pnlcnt ) , compare panels? |
enemy | .c | OBJ character data archiver, takes in a .TBL and writes to a .CHR file |
mkback | .c | Back screen data compress |
mkbgchr | .c | Convert 8bit mode file into screen mode 7 file, takes in a .CGX file and exports to a .CHR file |
mkenemy | .c | Enemy car character data archiver takes in a .TBL and exports to a .CHR file |
mkmap | .c | Map data generator takes in .PCK and .WTB files and exports to SLT and WLD files |
mkpanel | .c | Map panel data generator takes in a .TBL and generates a .PCK and .PNL file |
mkpers | .c | Demo pers data compress |
mkrival | .c | Rival car character data archiver, reads a .TBL file and exports a .CHR file |
mkselect | .c | Car select screen data compress |
mkspchr | .c | OBJ character data compress takes in OBJ and CHR files and creates a OBJECT.CHR file |
schpnl | .s | Assembly source file containing implementation for int schpnl(char* pnlofs, char* pnlbuf, char* panel, int pnlcnt ) |
setbomb | .c | Set bomb data takes in a slit address and a Panel data file (.PNL), Map (.WLD) and a slit data file (.SLT) |
slitpress | .c | Slit data compress takes in .SLT and compresses to .SLT2 |