Further examination of the Fase.bat

Your spectrum game is created using the fase.bat file as we discussed earlier, but the actual batch file calls a number of programs which build each individual section. This entry is a summary of these programs.

So I’m going to drill into the ../lib/bin directory and grab the options from the programs found in it.

There are 10 programs here with no documentation

Time to change that, at least for now.

GenTape.exe

GenTape v0.21, a Tape File Generator by Antonio Villena, 12 May 2014

GenTape [<frequency>] [<channel_type>] <output_file>

[ basic <name> <startline> <input_file>

| hdata <name> <address> <input_file>

| data <input_file>

| pilot <pilot_ts> <pilot_ms>

| pulse <M> <pulse1_ts> <pulse2_ts> .. <pulseM_ts>

| pause <pause_ms>

| pure <zero_ts> <one_ts> <pause_ms> <input_file>

| turbo <pilot_ts> <syn1_ts> <syn2_ts> <zero_ts> <one_ts>

<pilot_ms> <pause_ms> <input_file>

| stop48

| plug-xxx-N <param1> <param2> .. <paramN> ]

<output_file> Target file, between TAP, TZX or WAV file

<name> Up to 10 chars name between single quotes or in hexadecimal

<startline> In decimal, first BASIC line to execute

<address> In hexadecimal, address of the binary block

<input_file> Hexadecimal string or filename as data origin of that block

<zero_ts> <one_ts> <syn1_ts> <syn2_ts> <pilot_ts>

Length of zero/one/syncs/pilot pulses at 3.528MHz clock

<pilot_ms> <pause_ms>

Duration of pilot/pause after block in milliseconds

<M> Number of pulses in the sequence of pulses

<pulseX_ts> Length of X-th pulse in the sequence at 3.528MHz clock

<plug-xxx-N> External generator, must exists xxx.exe and accept N params

stop48 Only TZX. Signal end of tape on 48K machines

WAV options:

<frequency> Sample frequency, 44100 or 48000. Default is 44100

<channel_type> Possible values are: mono (default), stereo or stereoinv

 

GenTmx.exe

GenTmx v1.11, MAP file (Mappy) to TMX (Tiled) by Antonio Villena, 11 Nov 2013

Map2Tmx <map_width> <map_height> <screen_width> <screen_height> <output_tmx>

<map_width> Map width

<map_height> Map height

<screen_width> Screen width

<screen_height> Screen height

<output_tmx> Generated output file

Example: GenTmx 5 4 15 10 map.tmx

 

Png2Rcs.exe

Png2Rcs v1.11. Image to ZX Spectrum RCS screen by AntonioVillena, 11 Nov 2013

Png2Rcs <input_png> <output_rcs> [output_attr]

<input_png> 256×64, 256×128 or 256×192 png file

<output_rcs> ZX spectrum output in RCS format

<output_attr> If specified, attributes here

Example: Png2Rcs loading.png loading.rcs

 

sjasmplus.exe

sjasmplus [options] sourcefile(s)

Option flags as follows:

–help Help information (you see it)

-i<path> or -I<path> or –inc=<path>

Include path

–lst=<filename> Save listing to <filename>

–lstlab Enable label table in listing

–sym=<filename> Save symbols list to <filename>

–exp=<filename> Save exports to <filename> (see EXPORT pseudo-op)

–raw=<filename> Save all output to <filename> ignoring OUTPUT pseudo-ops

Note: use OUTPUT, LUA/ENDLUA and other pseudo-ops to control output

Logging:

–nologo Do not show startup message

–msg=error Show only error messages

–msg=all Show all messages (by default)

–fullpath Show full path to error file

Other:

–reversepop Enable reverse POP order (as in base SjASM version)

–dirbol Enable processing directives from the beginning of line

–dos866 Encode from Windows codepage to DOS 866 (Cyrillic)

 

step1.exe

step2.exe

step3.exe

These 3 provide no DOS documentation or help

 

TmxCompress.exe

TmxCompress v1.12b, Map compressor by Antonio Villena, 18 Nov 2013

TmxCompress <input_tmx> <output_compressed>

<input_tmx> Origin .TMX file

<output_compressed> Generated binary compressed map

 

xm2tritone.exe

xm2tritone converter by Shiru (shiru@mail.ru) 03’11

Usage: xm2tritone filename.xm filename.asm

 

zx7b.exe

ZX7 Backwards compressor v1.0 by Einar Saukas/AntonioVillena, 28 Dec 2013

zx7b <input_file> <output_file>

<input_file> Raw input file

<output_file> Compressed output file

Example: zx7b Cobra.scr Cobra.zx7b

 

 

With that out of the way, kinda, we look at our toolchain build order in our batch file.

*note it’s a little more complex than what is listed below.

Png2Rcs is called first, converting the loading screen from a PNG

zx7b is then called to compress both the screen data and the color attributes.

GenTmx is called to convert a mappy file to a TMX file.

TmxCompress is called to compress the maps

sjasmplus is then called to work some assembler magic for the music player.

Zx7b is called to compress the music player

xm2tritone is another player, I believe for 48k beeper music.

Step1.exe is called, however, this program is not documented, so it must be magical. Looking with my handy hex editor, it looks as if this deals with graphics.

sjasmplus is then called again for the music player, perhaps for a second song

Zx7b is called to compress the music player

sjasmplus is called to work on files engine0.asm, engine1.asm and engine2.asm

step2.exe is called. Again, no documentation, but it appears to deals with binaries of maps, music and graphics.

Zx7b is called to compress block1.bin and block2.bin.

The program is compiled with

zcc +zx -zorg=32772 -O3 -vn main.c -o build\main.bin -lndos

which creates a bin file, almost ready to use but not quite yet.

zx7b build\main.bin build\main.zx7b

is now called, compressing the bin file even smaller.

step3.exe is called an undocumented program

sjasmplus is called to create a loader with the command

sjasmplus asm\loader.asm

 

Finally, the build is created with the series of commands

if exist build\player.zx7b (
lib\bin\gentape game.tap ^
basic 'game' 0 build\loader.bin ^
data build\engine.zx7b ^
data build\player.zx7b
) else (
lib\bin\gentape game.tap ^
basic 'game' 0 build\loader.bin ^
data build\engine.zx7b
)

 

 

Rather boring notes below

when you compile, the following files are altered, meaning they are the output of the build

fase gfx

loader.bin
nulo.bin
main.bin
ndefload.asm
main.zx7b
engine.zx7b
zcc_opt.def
engine2.bin
engine1.bin
engine0.bin
bullet.bin
block2.bin
block1.bin
temp.rcs
loading.rcs
define.h
temp.atr
loading.atr
music.asm
defmap.asm
defload.asm
define.asm
temp.rcs.zx7b
temp.atr.zx7b
player.zx7b
music.zx7b
loading.rcs.z7b
loading.atr.zx7b

fase config

engine2.bin
engine1.bin
engine0.bin
block2.bin
block1.bin
define.h
defload.asm
block2.zx7b
block1.zx7b

as well as

main.zx7b
engine.zx7b
nulo.bin
main.bin
loader.bin
ndefload.asm
zcc_opt.def

 

Advertisements

Author: andydansby

I'm a hobbyist coder working with the ZX Spectrum. Living in New York state near the Syracuse area. I grew up in Virgina. The first computer my parents bought for me was a Timex Sinclair 2068.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s