The Source Code for “Home Alone 2” was kindly released by Frank Cifaldi from GameHistoryorg (@frankcifald).
The same Game Engine seems to have been used in at least 5 games developed by Imagineering for the Nintendo Entertainment System.
This section will analyze the source code for Home Alone 2 on the Nintendo Entertainment system.
Thanks to “freem” on the NesDev forums we have a good description of the tools available in the UTL directory of the source code.
|A65.EXE||6502 NES Assembler Usage: a65 [path]infile[.a65] [[path]outfile[.lod]]|
|CMERGE.EXE||Merge Char sets (e.g merge family char set and jail1 set) and returns a NIN file|
Most likely; here are some results after looking through the files in the "UTL" directory: * A65.EXE looks to be a 6502 assembler. * CMATCH.EXE and CMERGE.EXE are probably dev tools, but I'm not sure what they're for. * CNGNIN.EXE: "This utility replaces the color palette information in dest.nin with the palette information from source.nin" * CSM.EXE: "merge part of font from source to destination." * DL.EXE, if I had to guess, seems to be used for downloading data to a development cartridge... * L2G.EXE: "LBM2GRP - LBM to GRP Converter Rev 1.0 (1/22/92)" (as a USA company, that'd be 1992/01/22 under YYYY/MM/DD) * L2N.EXE: "LBM2NIN - lbm to nin Converter Rev 1.0 June 7, 1991" (Probably the main tool used for graphics conversion, given the number of LBM files in the archive) * LOD2BIN.EXE: Converts .LOD to binary files, presumably. * LOD2RAW.EXE: "LOD2RAW - .LOD to .RAW File Conversion Utility Rev 0.0" * MW.EXE: "MakeWorld" graphical program (uses a mouse) * NIN2LOD.EXE: Converts .NIN files to .LOD files, whatever each of those are. * NIN2OBJ2.EXE: Converts a .NIN to assembler source? * NIN2RAW.EXE: Converts .NIN files to a .RAW file. * TXTCMP.EXE: "TXTCMP - Text Compression Rev 1.0" * RAWMRG.EXE: "RAWMRG - Raw Screen Map Merge Rev 0.1" * RLCMP.EXE: "RLCMP - Run-Length Compression Rev 0.1" * TXTCMP.EXE: "TXTCMP - Text Compression Rev 1.0"
The file formats used in the source are listed in the following table:
|.NIN||Nintendo image format?|
|.RAW||RAW image format (why have these when we have the LBM files?)|
|.LOD||I think this is compiled object files from assembly but not sure why its called LOD|
|.LBM||Deluxe Paint Images (Interlaced bitmaps), can be opened with XnViewMP|
|.SRC||6502 Assembler Header files used for includes|
|.A65||6502 Assembler Source Code Implementation files|
|.CEW||6502 Assembler Source Code but with some minor differences|
|.GME||6502 Assembler Source Code Implementation files, these are only located in the Engine folder so does it stand for Game Engine?|
The game uses GNU Makefiles to build its assets into the shippable product. It all starts with Deluxe Paint on the Amiga, the artists draw pixel art on pre-defined templates and save them as the standard Deluxe Paint .LBM files.
Those LBM files need to be converted into a format that the game engine can read and display on the screen. To convert the .LBM format into a NES friendly (2bpp) image format the developers use a tool called “l2n” which I presume they developed themselves or license from another game development studio.
The .MAK makefiles have the format:
movie1.nin: movie1.lbm # # "create movie 1 screen" # l2n movie1
Where movie1.nin is the output file expected by the makefile and movie1.lbm is the input file.
The BASE directory contains all the glue code that puts everything together, sets up the banking etc.
There seems to be three different versions of the “BASE” file, all with minor differences. I’m trying to figure out what CEW stands for as I presume the main build is the BASE.A65 file.
It looks like BASE.CEW is older than its .A65 sibling as the A65 version has additional code plus some of the CEW code commented out.
The third file is BASE.OLD which presumably is just an older version of BASE.A65 and not that interesting.
This directory contains some very interesting documentation written by the developers for how to use the game engine, scripting etc.
|ADDING.DOC||Describes how to go about creating a new ll* directory for the game (local levels).|
|FILEINFO.FI||Information about the other files in the directory, mentions Game Boy but not sure the purpose of this file.|
|INSTALL.DOC||Installing a new project directory on your hard drive|
|NEWNES.DOC||Documents how to build the project for different environments, such as Prod, Demo etc|
|SCRPDOC.DOC||Engine scripting documentation, how to use the scripting language|
|TEMPLATE||A bunch of Comment Templates for use in the assembly code, for example how to document a function similar to javadoc.|
This directory seems to contain all the assets that are required on every level, for example the main character sprites and pickups.
I presume its called public because other developers can work on their own “local levels” but share the PUB folder with each other when they make changes.
Mainly contains LBM files (Deluxe Paint) for Kevin and pickups used in all the other levels.
I presume these are the different game levels?
|CLEAN.BAT||Clean the folder by removing all the compiled files (*.nin, *.lod, *.spr, *.mem etc)|
It looks like there are 2 different ways to compile the game, one is a ‘local build’ which only contains a certain level (ll0, ll1 etc) and the other is the full game which contains all the levels.