Amiga C Engine (ACE) is, as you can imagine, a game engine written in C for the Commodore Amiga. There are a few interesting games developed in ACE; ami-invaders, AMIner, Impsbru, OpenFire, Goblin Villages, CastleHack and Squared. There is a GitHub repository where you can clone or download the source and there you will find an introductory documentation. The documentation is incomplete but just enough to give an idea about how to start. The good news is that the project is active being the last commit four weeks old when I'm writing this,

After downloading the source or cloning the repo  you can build the library using VBCC or GCC. The second one is the option I tried and it worked perfectly on my Linux cross compiling environment. Anyway, after seeing Aminer repository y followed their approach for my tests and used the source as a dependency, meaning this that I added all the source and header files to my Codeblocks project. In other words, I'm not using the compiled library.

When I had everything ready I started to build examples and read their source. I'm still learning, reading and trying things but I will explain what I did just to show an image in a screen because I think there is some information missing regarding how to generate bitmaps. What I wanted to try was quite simple, starting from a working example I would replace the initial image by one generated by me

ACE recommends custom formats for bitmaps an palettes. To obtain them there are two utilities palette_conv and bitmap_conv which are created when make is executed to build the project. The problem was that I couldn't create the bitmap correctly. The error was "ERR: Unexpected color: 34, 51, 51 @0,0", meaning that the first color (pixel 0,0) in the source image does not match a color in the palette file.  After digging around, I found that the palette created by palette_conv was different to the original one exported by The Gimp.

In the first column you can see the first palette exported by Gimp. After converting it to plt and converting it back to gpl the result is different as can be seen in the second column.

GIMP Palette
Name: Palette
Columns: 0
#
44 52 48
47 54 50
49 55 46
56 56 48
61 57 46
70 60 45
74 63 43
80 63 44
83 65 41
86 66 38
92 67 40
97 70 37
106 72 36
110 75 33
115 74 34
122 77 32
128 79 29
137 81 27
142 84 23
149 85 26
153 88 22
160 88 25
164 91 20
170 91 23
176 94 18
186 97 15
199 101 11
212 106 11
222 109 5
235 113 2
244 114 0
241 117 0
GIMP Palette
Name: palette exported
Columns: 4
#
 34  51  51 Index 0
 34  51  51 Index 1
 51  51  34 Index 2
 51  51  51 Index 3
 51  51  34 Index 4
 68  51  34 Index 5
 68  51  34 Index 6
 85  51  34 Index 7
 85  68  34 Index 8
 85  68  34 Index 9
 85  68  34 Index 10
102  68  34 Index 11
102  68  34 Index 12
102  68  34 Index 13
119  68  34 Index 14
119  68  34 Index 15
136  68  17 Index 16
136  85  17 Index 17
136  85  17 Index 18
153  85  17 Index 19
153  85  17 Index 20
170  85  17 Index 21
170  85  17 Index 22
170  85  17 Index 23
187  85  17 Index 24
187 102   0 Index 25
204 102   0 Index 26
221 102   0 Index 27
221 102   0 Index 28
238 119   0 Index 29
255 119   0 Index 30
255 119   0 Index 31

 

Apparently, it transforms the colors (I guess this is because the target machine is an ECS one) so, the workaround is to open the image again in Gimp and apply the "new" palette.  The steps are the following:

1, Create the image.

2. Set the image mode to indexed using 32 colors.

3. Export image's palette as gpl.

4. Convert the gpt file to plt using palette_conv

palette_conv palette.gpl palette.plt

5. Convert the .plt to .gpl again (the color values will be different)

palette_conv  palette.plt palette2.gpl

6. Import the palette to Gimp

7. Assign the palette to the image.

8. Export the image as png

9. Convert the png to bm using bitmap_conv

bitmap_conv palette.plt logo_deuteros.png 

After doing this, I could use the generated bitmap to create an screen showing a logo.

Add comment


Security code
Refresh

We use cookies to improve our website and your experience when using it. Cookies used for the essential operation of the site have already been set. To find out more about the cookies we use and how to delete them, see our privacy policy.

I accept cookies from this site.

EU Cookie Directive Module Information