Changes

Jump to: navigation, search

Exomizer

879 bytes added, 02:50, 31 August 2017
/* Links */
== Tutorial ==
=== Installing ''Exomizer '' ===
Firstly, download ''Exomizer'' from the home page; the link is at the bottom of this article.  For Windows: Unzip the ZIP file to a folder of your choice (e.g. <tt>C:\exomizer</tt>). The Windows binaries are located in the <tt>win32\</tt> subfolder. For ease of use, copy the <tt>exomizer.exe</tt> file in this subfolder to the main folder (i.e. <tt>C:\exomizer</tt>).
This tutorial also assumes that ''[[ManageDsk]]'' (a Windows utility for manipulating DSK files) is installed on your PC.
 
For Linux:
 
You need to download the zip, extract it and build it from source. You will gnu C installed.
 
<tt>unzip exomizer202.zip</tt>
<tt>cd exomizer202/src</tt>
<tt>make</tt>
 
When you are done you will have b2membuf, exobasic, exomizer and exoraw in the same directory as the source.
=== Compression ===
Remember the safety offset that was mentioned earlier? The game code starts at &200 and is &7520 bytes long, so the final byte is located at address &200 + &7520 - 1 = &771F. As the safety offset for <tt>BOULDERC.BIN</tt> is 2 bytes, this means that the final byte of this file can be located at any address from &771F + 2 = &7721 or above. This means that the lowest start address that the file can be loaded to is &7721 - &2AD8 + 1 = &4C4A (or 0x4C4A), so enter this value as the start address. The entry point should be left at 0x0000.
The Z80 assembler source code for decompressing files is located in the <tt>rawdecrs\z80\</tt> subfolder, and the file name is <tt>deexo.asm</tt>. The decompression routine is 198 bytes long, and it also requires a buffer of 156 bytes. The buffer is labelled <code>exo_mapbasebits</code>, and it is located immediately after the decompression routine, but you can alter it (by adding the line <code>exo_mapbasebits equ &xxxx</code>) so that it is located anywhere in memory - as long as it doesn't overwrite the compressed file or the decompressed data! Assemble the decompression routine to a suitable address in memory using an assembler of your choice (e.g. ''[[Pasmo]]'' or ''[[WinAPE]]'''s built-in assembler); again, ensure that it doesn't overwrite the compressed file or the decompressed data. The code supplied with ''Exomizer'' may need to be edited to suit the syntax of your assembler.
Now you will need to add some code to load <tt>BOULDERC.BIN</tt> into memory and decompress it. Add the following code before the decompression routine:
<pre>load_file:
ld hl,filename ;HL = file name address
ld de,&c0004c4a ;DE = start address to load file to
ld b,12 ;B = length of file name
call &bc77 ;Open the file header
;DE = start address to load file to
ex de,hl ;Now HL = start address
Finally, run this code, and if you have done everything correctly, you should see the ''Boulder Dash'' title screen!
 
== Bugs ==
 
''Exomizer'' can sometimes fail to decompress files correctly for no apparent reason, causing the CPC to crash. Unfortunately there is no known way to overcome this problem, other than to use a different compressor.
 
[Added 31-August-2017 by ervin] The above claim is questionable. The *only* times I've ever encountered such Exomizer crashes were due to errors on my part (for example, an incorrect data type for an array in C). In my experience, Exomizer itself has never caused any problems.
== Links ==
* [httphttps://hembitbucket.bredband.netorg/magli143/exoexomizer/wiki/Home/ ''Exomizer'' home page] [[Category:CrossDev]]
3,699
edits