[Close window]
MSX - The I.N.E.R.T.I.A. Howto |
How to install sdcc compiler, additional tools and files, I.N.E.R.T.I.A. source code, and how to compile it. Instructions are for Windows, but similar steps could be done on Linux machines. Please also note that I need some feedback from you to know if suggested steps effectively work! Thanks in advance.
sdcc/bin
directory the free GNU utility named split, version
for Windows. SDCC builds a binary image of 64KB, and our 16KB ROM lies in
the 2nd quarter of the image. So we'll split file in four chunks and retrieve
the second one, naming it "inertia.rom".
I found a Windows version of GNU split searching on Google for "UnxUtils";
you can download the binaries from
http://sourceforge.net/projects/unxutils.
Note: any file utility allowing to "cut" a binary file could be used there; a good alternative
may be the (more general) dd file manipulation utility, which requires a bit of commandline
options: input and output file name, block size, offset... both dd and split
are available in the UnxUtils package.
crt0.o as a header to the linked executable file. You'll have to replace
standard lib/z80/crt0.o with one explicitly designed to work as an
MSX ROM header. Original author of this file is the Japanese MSX user Boukichi,
I just added at bottom the standard initrleblock routine, I think
it's needed for sdcc to handle correctly static strings and arrays of strings.
Warning: crt0.o contains the hardcoded value of 0x4000 as
starting address for the ROM. If you want to build for instance ROMS starting
at 0x8000, you'll need to change that hardcoded value accordingly.
[Download here crt0.o, object file to build a 16KB ROM at 0x4000]
[Download here crt0msx.s, source file to build a 16KB ROM at 0x4000]
sdcc
directory, you may use it too. Just remember to change the full
sdcc/bin pathname according to your installing path.
To check a correct startup file, you could type sdcc
on command line (you should see the help screen for options).
[Download here sdcc-msx.bat file].
sdcc main directory and simply unpack the source
tree from zip file. Your sdcc tree should now be something like this:

[Download here ZIP file with sources]
sdcc, go into sdcc/msx/inertia directory, and try compiling. You may also
want to have a look inside make.bat, to see what options
were passed to the compiler and how the final ROM image was obtained.
make buildall to build and
link all files (a lot of warnings are generated,
as my code contains some Z80 machine code).make main to compile only main.c file and
build inertia.rom; main.c has no Z80 machine code, no warnings
should arise this time.make clean command is also available.
It deletes all intermediate files and inertia.rom (so be careful).
make xxxxxx option displays
the usage screen.
Hope you enjoy and build without too much pain. Please drop me a line to confirm that everything works as expected, thanks in advance.
Andrea