MayDay, on Sat Feb 4, 2006 2:19 AM, said:
Quote
I wrote a simple little QuickBASIC program to split 8K (or larger) ROMS into two (or more) 4K segments. If you have Windows or MS-DOS (i.e., if you can run QuickBASIC executables), I'd be happy to spruce it up a little and share it.
Michael Rideout
I have an XP upgrade. Pretty please, with sugar on top? I'd really like to see some of the code for these games without having to ask someone to disassemble a bunch of games for me. I'm gone for the weekend, but you can be sure it'll have a download early next week if it's ready.
Thanks,
-JD

Sorry for the delay! The original program was a QAD ("quick and dirty") hack that had the input and output filenames hardcoded (!) into the program, and I would just change the names and then run the program directly in QuickBASIC without even bothering to compile it. I had to totally rewrite it to be a true "command line" utility program, which is called "SplitFile." If you need help with it, you can just type "splitfile" at the command prompt and it will display a brief help guide, as so:
Quote
Nothing to do!
Usage: SPLITFILE [<path>]<filename> [<size>]
Where: [<path>] is optional path (e.g., C:\Atari\2600\ROMs\)
<filename> is name of file to split (required)
[<size>] is optional size of output files (e.g., 4K)
Notes: <size> may be 1K, 2K, or 4K (case insensitive)
1K may be typed as 1K, 1KB, 1024, or 1024B
2K may be typed as 2K, 2KB, 2048, or 2048B
Anything else (including no size) is 4096
Output files will be named file_#.ext
where # is number of file, and .ext is original extension
As the preceding help guide states, the original input file can be split into one or more output files which are 1K, 2K, or 4K in size-- the reason being that (according to the bankswitching documentation by Kevin Horton) the various Atari 2600 bankswitching schemes can be grouped into three categories: (1) those that use banks which are 4K in size, (2) those that use banks which are 2K in size, and (3) those that use banks which are 1K in size. If no size is specified, then 4K will be assumed. Thus, if you know the bankswitching method used by a game, you can split the ROM into the individual banks, whether they are 1K, 2K, or 4K in size.
The output files will be placed in the same directory as the input file, and will have numbers appended to their names, preceded by an underline character (e.g., "_1," "_2," "_3," etc.). The original extension will be kept. If the input file is less than or equal to the stated bank size, then only one file will be output. And if the input file is not an integer multiple of the stated bank size, then the last output file will be however many bytes were left over.
For example, let's suppose that the SplitFile.exe program has been placed into the directory named C:\Atari\2600\Distella, and that a Burgertime.bin ROM file is in the directory named C:\Atari\2600\ROMs. The Burgertime ROM uses M-Network's bankswitching method ("E7"), which uses 2K bank sizes. So to split the Burgertime ROM into the appropriate 2K banks, you could type any of the following commands at the command prompt:
Quote
c:
cd \atari\2600\distella
splitfile ..\roms\burgertime.bin 2k
or
Quote
c:\atari\2600\distella\splitfile c:\atari\2600\roms\burgertime.bin 2048
or
Quote
c:
cd \atari\2600\roms
..\distella\splitfile burgertime.bin 2kb
and so forth. In each of these examples, the output files would be as follows:
Quote
c:\atari\2600\roms\burgertime_1.bin
c:\atari\2600\roms\burgertime_2.bin
c:\atari\2600\roms\burgertime_3.bin
c:\atari\2600\roms\burgertime_4.bin
c:\atari\2600\roms\burgertime_5.bin
c:\atari\2600\roms\burgertime_6.bin
c:\atari\2600\roms\burgertime_7.bin
c:\atari\2600\roms\burgertime_8.bin
The program is written in FreeBASIC, which is a free BASIC compiler that uses a BASIC language which is mostly compatible with QuickBASIC (except FreeBASIC has some additional commands, plus a few of the commands have been modified somewhat from their QuickBASIC counterparts). The source code is included, in case anyone wants to peruse it, modify it, or port it to some other language.
Michael Rideout