Remember me

Lost Password?

Register now!
Who's Online
31 user(s) are online (1 user(s) are browsing Articles)

Members: 1
Guests: 30

cobale, more...
Support us!
Recent OS4 Files

« 1 2 (3) 4 5 »
OWB installation manual
Posted by orgin on 2008/2/20 9:11:57 (5459 reads)

1. Preparations

1.1. Downloading required packages
OWB archive: Download
libicu: Download
libSDL: Download (Shared object)
XAD 7z module: Download
sobjs.lha: download

1.2. - Fetching the optional fonts:
Copy all #?.ttf files from a windows machine from c:\windows\fonts\ to your Amiga
Or just Download them. (All .exe files)
Also download corefonts.lha Download

2. Installation

2.1. Installing XAD 7z module
For some weird reason the author of the OS4 port of OWB decided to use an archive format that isn't by default supported by the UnArc as distributed through the OS4 install CD. This requires that you download a new XAD module for this archive format so that UnArc can handle it.

- Download the XAD 7z archive from the link above.
- Open the archive with unarc and extract it to ram:
- Open your Ram: drive and double click on "Install" in the xad_7z directory
- Once the install script is done, reboot your machine

2.2 Installing OWB
- Download the OWB archive using the link above.
- Open the archive with unarc and extract it into your desired directory.

2.3 Installing libicu
- Download the libicu archive using the link above.
- Open the archive with unarc and extract the two #?.so files into sobjs:

2.4 installing libSDL
- Go to the libSDL page above and download the shared object version of SDL.
- Open the archive with unarc and extract it into RAM:
- Copy the libSDL-1.2.so file from the SDL-#? directory in RAM: to sobjs:

2.4 installing sobjs.lha
- Download sobjs.lha using the link avove
- Open the archive with unarc and extract it into RAM:
- Copy the #?.so files in ram:SObjs to sobjs:

2.5 Installing fonts (Optional)

Installing the extra fonts isn't strictly necessary but it will make pages look somewhat better than using the fallback font(s).

If you have installed these fonts before you need to remove them from fonts: and fonts:_TrueType before proceeding.

If you downloaded the #?.exe files mentioned in the first chapter:
- Open each of the exe files in unarc and extract all #?.TTF files to fonts:_TrueType


- Open wd97vwr32.exe in unarc and extract "Viewer1.cab" to RAM:
- Open ram:Viewer1.cab in unarc and extract "tahoma.ttf" to fonts:_TrueType

If you copied the fonts from a windows machine, just copy the #?.ttf files to fonts:_TrueType

- Download corefonts.lha.
- Open corefonts.lha in unarc and extract it to RAM:
- Copy all #?.otag and #?.font files from ram:fonts to fonts:
- Reboot your machine and start OWB.

3. Troubleshooting

  5   Article ID : 24
HAM8 Explained
Posted by orgin on 2007/10/18 17:12:19 (13301 reads)

HAM8 is a special graphics mode only available with the Amiga AGA chipset used in the CD32, A1200 and A4000 models. It builds on the HAM6 mode found in the OCS/ECS chipset used models like the A500,A1000,A2000,A600 and A3000.

HAM8 mode is based on a 64 color base palette and then an 8 bit per pixel matrix to generate the image. The colors in the 64 color base palette are all a color out of a 16M color palette (24Bit, 8 bits per RGB).

Each pixel on the screen uses 8 bits and can be of 4 different types:
A pixel that uses the color of one of the 64 base palette colors (that is, all 24 bits of the base color)
A pixel that uses the same color as the previous pixel but with a modified Red component.
A pixel that uses the same color as the previous pixel but with a modified Green component.
A pixel that uses the same color as the previous pixel but with a modified Blue component.

6 bits of each 8 bit pixel defines either which base palette color the pixel should use or the value the red, green or blue component should use.
2 bits of each 8 bit pixel defines what kind of pixel it is (see above).

However, each modifying pixel can only change the upper 6 bits per RGB channel from the previous pixel. This means that a modifying pixel inherits the lower 2 bits per RGB from the previous pixel.

All the above means that each RGB channel can be modified in 64 steps, which means that you can modify a base palette color in 64*64*64 (262144) different ways.

Given a long enough line you can have all 262144 variations of a base colors on that line, on which all pixels in that line inherits the lower 2 bits of each RGB channel from the base color.

Using two lines with two different base palette colors with a different set of lower 2 bits per RGB channel will result in 524288 colors on screen.

Using 64 lines with 64 different base palette colors each with a different set of lower 2 bits per RGB channel will result in 16777216 colors on screen.

The AGA chipset is however not able to display lines long enough to generate all 262144 variations of each base color, nor is it able to display enough lines if you split them up. In conclusion: HAM8 can display pixels using any color out of 16777216 and the number of different colors possible on each image is only limited by the makeup of the base colors, the image pattern itself and the number of available columns and rows. Which makes it quite complicated to calculate exactly how many colors an HAM8 image can have. Stating that HAM8 is a 262144 color image mode is however entirely incorrect.

  4   Article ID : 22
OS4 P96 ScreenModes.doc
Posted by TetiSoft on 2007/9/21 14:40:23 (2059 reads)

$VER: ScreenModes.doc 52.2 (6.6.2007)

How to define Picasso96 screenmodes

The new default method to define the screenmodes to be used by
Picasso96 is to edit the tooltypes of the P96 monitor icons in
Devs:Monitors/. The old method, using Picasso96Mode, does still
work, however, Picasso96Mode will not recognize the modes created
with the new method. Picasso96Mode offers more control of details
but is a bit complicated for the normal user.

Picasso96Mode adds a SETTINGSFILE tooltype to the monitor driver icon which
points to the modes stored in a binary file. The settings file screenmodes
are added before the tooltype screenmodes, the tooltype screenmodes dont
overwrite existing similar modes. So when you want to switch to the new
method completely, dont forget to remove the SETTINGSFILE tooltype.

You should first tell Picasso96 about the supported frequency ranges
of your monitor, then define screenmodes, then save and reboot
(the tooltypes are read during Picasso96 startup only).

Caution, dont store monitor driver backups in Devs:Monitors/.
Most existing monitor driver icons contain the BOARDTYPE tooltype
which overrides the filename and specifies which card driver shall
be used, it would be "random" which driver is found and used first,
so if they conflict the correct driver tooltypes could not be able to
redefine the modes already specified with the wrong tooltypes from
the backup. You can exclude file names on the commandline of the
LoadMonDrvs command call in Startup-Sequence but thats not recommended,
please store your monitor driver backups in SYS:Storage/Monitors/.

If you try to define a screenmode which would be out of the specified
monitor frequency ranges, Picasso96 will reject that screenmode.

If you try to define a screenmode which would be out of the capabilities of
your graphics card, Picasso96 will either try to adjust it (by e.g.
switching to DoubleScan mode or lowering the vertical sync rate if
possible) or reject it (e.g. it will not accept 24bit/32bit modes on old
graphics cards which dont support that).

The monitor driver tooltypes for defining monitor specifications are:

The minimum horizontal sync rate in Hz which is supported by your monitor.
The default value is 31500. The lowest possible value is 15000. Please
check the manual of your monitor for the correct value (its mostly
specified in kHz so you have to multiply it with 1000, 31500 means 31.5

Similar to HSYNCMIN, it specifies the maximum horizontal sync rate in Hz.
The default value is 38000 (38 kHz). The value must be greater than

The minimum vertical sync rate in Hz which is supported by your monitor.
The default value is 60. The lowest possible value is 50. Please
check the manual of your monitor for the correct value.

Similar to VSYNCMIN, it specifies the maximum vertical sync rate in Hz.
The default value is 75. The value must be greater than VSYNCMIN.

The monitor driver tooltype for defining screenmodes is:

With this tooltype you specify at least the width and height in pixels
and the vertical sync frequency in Hz of a screenmode. Example:


This will create a screenmode with a width of 1280 pixels, a height of
1024 pixels and a refresh rate (vertical sync rate) of 60 Hz.

When you are unsure about the widths, heights and frequencies to use,
consult the manual of your monitor, it often contains a list a supported
screenmodes. Of course its possible to create more modes when your monitor
has real multisync capabilities. Some hints:

Typical resolutions and frequencies supported by many monitors are

640x350@85 (37.9kHz)
640x400@85 (37.9kHz)
640x480@60 (31.5kHz)
640x480@72 (37.9kHz)
640x480@75 (37.5kHz)
640x480@85 (43.3kHz)
720x400@85 (37.9kHz)
800x600@56 (35.2kHz)
800x600@60 (37.9kHz)
800x600@72 (48.1kHz)
800x600@75 (46.9kHz)
800x600@85 (53.7kHz)
1024x768@60 (48.4kHz)
1024x768@70 (56.5kHz)
1024x768@75 (60.0kHz)
1024x768@85 (68.7kHz)
1024x768i@43 (35.5kHz)
1152x864@75 (67.5kHz)
1280x960@60 (60.0kHz)
1280x960@85 (85.9kHz)
1280x1024@60 (64.0kHz)
1280x1024@75 (80.0kHz)
1280x1024@85 (91.1kHz)
1600x1200@60 (75.0kHz)
1600x1200@65 (81.3kHz)
1600x1200@70 (87.5kHz)
1600x1200@75 (93.8kHz)
1600x1200@85 (106.3kHz)
1792x1344@60 (83.6kHz)
1792x1344@75 (106.3kHz)
1856x1392@60 (86.3kHz)
1856x1392@75 (112.5kHz)
1920x1440@60 (90.0kHz)
1920x1440@75 (112.5kHz)

With the old style CRT (Cathode Ray Tube) monitors, a higher refresh rate
results in less flicker. A too high refresh rate may however result in lower
display quality when you have a cheap monitor cable (or even a monitor switcher
inbetween the graphics card and the monitor) or you are running near the upper
limit of graphics card or monitor. Most people are happy with about 70 or 75 Hz.

With the new style digital TFT/LCD monitors, a higher refresh rate will not
result in less flicker anymore because the monitor refresh rate differs from
the graphics card refresh rate. Here you should probably follow the
recommendations from your monitor manual, often any refresh rate between 60
and 75 Hz is accepted.

On digital TFT/LCD monitors, you should prefer the exact physical resolution of
your monitor as default screenmode, then one pixel in your graphics card can be
displayed as one pixel on your monitor. Any other resolution will result in
interpolated pixels on your monitor which often causes moiree effects or a
blurry display. Check the monitor manual for the exact physical resolution.
When you want to use lower resolutions on a TFT/LCD, its often a good idea to
use something which can be scaled with an integer number, e.g. when you use
640*480 on a 1280*960 monitor, the monitor can display each graphics card pixel
with exactly four (2*2) of its own pixels. Using higher resolutions only makes
sense for displaying large pictures in fullscreen mode when your picture viewer
is unable to scale down the picture.

Back to the explanation of the MODE tooltype, for interlace mode you can specify
an "i" behind the refresh rate, e.g. 'MODE=1280x1024@60i'. BTW, doublescan mode
is automatically activated when the horizontal frequency of the given mode drops
below HSYNCMIN, but its also possible to activate it with a "d" behind the refresh

By default, each mode will be created in all available color depths.
You can add a list of depths separated by commas to a mode specification
to create a mode with only the specified depths. Example:
MODE=1280x1024x8,16@60 will create the mode with depths of 8bit (256 colors)
and 16bit (65536 colors), but not with 15bit (32768 colors), 24bit or 32bit

Adding "-hsync" to a mode specification changes the horizontal sync polarity
from positive (default) to negative. Adding "-vsync" does the same for the
vertical polarity. This may be useful when you have lots of similar screenmodes
defined or a second computer attached to your monitor and the monitor is unable
to distinguish all modes in his internal settings tables for screen placement
etc, then the opposite polarity may help the monitor to distinguish screenmodes.
Example: MODE=1280x1024x24@75-hsync-vsync

  0   Article ID : 21
X-Arcade joystick review
Posted by jahc on 2007/7/31 10:51:05 (6485 reads)

Back in the year 2000, while browsing the web I somehow came across a site selling extremely expensive arcade joysticks, made from real arcade parts. They were way out of my price range, but they looked cool, and I NEVER forgot them. Anyway, 5 years later after I'd forgotten all about them, (that was a joke, feel free to laugh!). I found out my favourite arcade games (or "spacies" as we call them in New Zealand) were playable under a software arcade machine emulator called MAME! And not only the cheesy space invader games with crap graphics from the 1980's, but also the REAL games, like Street Fighter 2! And X-Men Vs Streetfighter! Whats more, my 1.4 GHz Athlon played them perfect.. full screen, 60fps, no graphical glitches! This was great, so a few days after my discovery, I went out and bought a 6 button control pad. It did the job okay, but then a few months later, I somehow came across the arcade stick reseller again. And as luck would have it, they had a distributor right here in New Zealand. Well.. it was expensive.. but I was in a better financial situation, so I plonked my money down, and I've never looked back.

Introducing.. the X-Arcade Solo Player joystick!
Resized Image

The x-arcade solo player stick sports an 8 direction control stick (which can be set to 4 directions for better playability with classics such as PacMan), with 11 buttons littered on the front and sides. One on each side for pinball style games, the traditional 6 buttons on the top plus another two underneath just in case you need them, and what looks like an easily identifyable Start or Join-in button. (Most arcade machines require you to press Start after inserting your coins). It also weighs an impressive 12 lbs (5.4 kg)

Why are you standing on me?!

The first thing I should mention, is that this joystick is advertised as being virtually indestructible. I dont think its possible to break it. And if you do somehow manage that feat, it has a lifetime warranty. Mine has been going strong for about 2 years now. My younger brother seems to be an expert at wearing out Playstation control pads, but my x-arcade stick still functions perfect.

Resized Image

Wide compatibility..

A neat feature of the X-Arcade line of joysticks is that they're not designed for any specific system, and will connect to virtually all consoles and computers, with the appropriate "adapter". And whats more, one adapter is included free of charge with the purchase. Adapters are currently available for the following systems:
Nintendo Wii, Gamecube, Playstation One/Two/Three, Xbox, Dreamcast, Apple, and computers via USB and PS/2.

The PS/2 adapter is quite special in my opinion. You plug your arcade stick into your computers PS/2 keyboard port, and then the computers keyboard into the X-Arcade stick. Then, the joystick will function by sending "keyboard events" to the computer when its being used, and at the same time you will still be able to use the actual keyboard. But what this means, is that NO SPECIAL DRIVERS are required! You can use this stick with any game that has configurable keyboard controls! I use it on my AmigaOneXE with not only XMAME, but also VICE (Commodore 64 emulation) and SMS Plus (Sega megadrive emulation). Very little configuration is needed with XMAME, because the stick already uses XMAME's default keyboard controls. How cool is that?
(For those of you that are curious, the stick is mapped to the numerical keypad, 8 for up, 4 left, 6 right, 2 down)

Update: I've tried the USB adapter, and it works the exact same way as the PS/2 adapter. It looks like a USB keyboard to your computer, so theres no need to mess around with AmigaInput joystick prefs under OS4.

Lets play doubles!

Whats that you say? You want a 2 player version of this beast? Well good news, guys, there is not only a 2 player version available (with two sets of controls of course), but an even BIGGER 2 player unit named the Tank Stick, which is even heavier, and also more ideal for us 20-30yr olds who need more elbow space when playing side by side. The Tank Stick also has a trackball in the middle which operates like a standard 3 button mouse. This is the next item on my "to-buy" list in case you havent already guessed!

Resized Image

The weak points

If you buy the 1 player joystick and connect it with a PS/2 adapter, you might want to play with or against another person using the keyboard controls. Well, most amiga-gamers will know about the dreaded "keyboard conflict" problem, whereby certain combinations of keys cannot be held down at the same time. So, while playing together your characters may not respond fluidly.
A solution to this problem could be either using the USB adapter, getting a 2 player stick, or just finding keys that wont conflict with each other.

The other problem is that arcade gamers are used to the joystick being stuck rigidly in front of you. So while using the solo player x-arcade stick, you may move the unit around your desk slightly and accidentally, and it may get into angles that make it difficult for you to operate your player properly. Having said that, once you get used to the joystick not being fixed in front of you, this becomes less of a problem. Also, the Tank Stick should help in this regard because its much heavier as well (an extra 8 lbs over the 1 player versions, 20 lbs/9 kg in total). There are 6 rubber feet underneath the solo player stick, but they are not the suction cap kind which are featured heavily on old Amiga joysticks.

In conclusion

This stick feels so great that I prefer it to a real arcade machine now. The AmigaOne will play most games at a silky smooth rate of 60 fps. It's built to last. AND it's compatible with all recent gaming consoles and computers!

Official X-Arcade Site: http://x-arcade.com

Current prices, as of July 2007:
1 Player Joystick $69.95 USD
2 Player Joystick $129.95 USD
Tank Stick $199.95 USD

  0   Article ID : 19
Spots Porting for Dummies 1.6.4
Posted by spotUP on 2007/7/12 23:43:08 (1884 reads)



00) Quick Reference
01) Why should I read this? I can't code!
02) History
03) What to port
04) Getting the SDK up to date
-Misc Linklibs
05) The basics
06) How to configure
-For newlib
-For clib
-For cygnix
-Configuring a link library
-Tricky configures
-A small hint
-Explanation of some GCC flags
07) Common errors that occur when configuring
08) Converting unix path's to Amiga path's
09) Defines
10) Understanding error messages
11) Errors and how to fix them
-Common errors
-Not so commong errors
12) Tips and tricks
13) Creating a Makefile by hand
14) Converting a Windows makefile into an AmigaOS makefile
-Fixing the sources
15) Creating a GUI using Emperor (Alpha!)
16) Compiling SDL/GL apps
17) Help me!
18) Contact me
19) Thanks


For lazy geezers like me, I use these lines a lot and I don't want to
wade through the guide to find them all the time, if you are new to this
guide, just skip this chapter for now.

-mcrt=newlib -Wall -O2 -I/sdk/local/newlib/include/SDL -I/sdk/local/common/include/SDL
-mcrt=newlib -lSDL_gfx -lSDL_net -lSDL_image -lpng -ljpeg -lz -lSDL_mixer -lsmpeg -lm -lvorbisfile -lvorbis -logg -lstdc++ -lSDL_ttf -lfreetype -lz -lsdlmain -lsdl -lauto -lpthread -lm -lunix

g++ -mcrt=newlib -Wall -O2 -Wno-deprecated-declarations -I/sdk/local/newlib/include/allegro -I/sdk/local/newlib/include/ -I/sdk/local/common/include/ -c *.cpp
g++ -mcrt=newlib -Wall -O2 *.o -lalmp3 -laldumb -lalfont -lalfblend -lalagup -lallegro -lpthread -lstdc++ -lauto -lunix -o test
gcc -mcrt=newlib -Wall -O2 -Wno-deprecated-declarations -I/sdk/local/newlib/include/allegro -I/sdk/local/newlib/include/ -I/sdk/local/common/include/ -c *.c
gcc -mcrt=newlib -Wall -O2 *.o -lalmp3 -laldumb -lalfont -lalfblend -lalagup -lallegro -lpthread -lstdc++ -lauto -lunix -o test

g++ -mcrt=newlib -Wall -O2 -I/sdk/local/newlib/include/SDL -I/sdk/local/newlib/include/ -I/sdk/local/common/include/ -c *.cpp

./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/newlib/lib CFLAGS=-mcrt=newlib CPPFLAGS="-mcrt=newlib -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=newlib LIBS="-lauto -lunix" LDFLAGS=-mcrt=newlib

CC=gcc CFLAGS=-mcrt=newlib CPPFLAGS="-mcrt=newlib -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=newlib LIBS="-lauto -lunix" LDFLAGS=-mcrt=newlib ./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/newlib/lib

CLIB2 (type PATH=/SDK/Local/clib2/bin:$PATH from ABC-Shell first!)
./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=clib2 LIBS="-lauto -lunix" LDFLAGS=-mcrt=clib2

CLIB2 OLD (type PATH=/SDK/Local/clib2/bin:$PATH from ABC-Shell first!)
CC=gcc CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=clib2 LIBS="-lauto -lunix" LDFLAGS=-mcrt=clib2 ./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib

LinkLib NEWLIB /common/
./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/newlib/lib --includedir=/SDK/Local/common/include CFLAGS=-mcrt=newlib CPPFLAGS="-mcrt=newlib -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=newlib LIBS=-lauto LDFLAGS=-mcrt=newlib

LinkLib CLIB2 /common/ (type PATH=/SDK/Local/clib2/bin:$PATH from ABC-Shell first!)
./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib --includedir=/SDK/Local/common/include CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=clib2 LIBS=-lauto LDFLAGS=-mcrt=clib2

LinkLib CLIB2 /clib2/ (use this one if you want to make a clib2 only version) (type PATH=/SDK/Local/clib2/bin:$PATH from ABC-Shell first!)
./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib --includedir=/SDK/Local/clib2/include CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=clib2 LIBS=-lauto LDFLAGS=-mcrt=clib2

LinkLib CLIB2 OLD /common/ (type PATH=/SDK/Local/clib2/bin:$PATH from ABC-Shell first!)
CC=gcc CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=clib2 LIBS="-lauto -lunix" LDFLAGS=-mcrt=clib2 ./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib --includedir=/SDK/Local/common/include


Well, the sad fact is that, neither can I! :) I am just a stubborn geezer!
And look at me now... 300+ uploads to http://os4depot.net compiling
multiplatform stuff for AmigaOS 4.0 isn't THAT hard, c'mon! If I can do it,
you can do it too! You'll jump up and down screaming when you managed to
compile your first SDL app, I did! To my defence I have to say that I had
to figure out a lot of the process the hard way! :P


Version 1.6.4

Added a new chapter 'Compiling SDL/GL apps'
Added a new tip to the 'Common errors that can occur when configuring' chapter.

Version 1.6.3

Added a new chapter: 'Converting a Windows makefile into an AmigaOS makefile'

Version 1.6.2

Extended the common error section with a small guide on how to find
out what header is missing.

Version 1.6.1

Misc small changes and additional info 'backported' from the AROS 'port'
of this guide.

Version 1.6.0

Added a guide on how to make GUI's using Emperor.
Added lots of small things that I can't remember.

Version 1.5.3

Added a tip on Fullscreen modes in SDL apps/games. Thanks Lio.
Added some quick references related to Allegro compiling. Woooot? Already? ;)

Version 1.5.2

Corrected some small things related to SDL_Mixer

Version 1.5.1

Added SVN to tips and tricks

Version 1.5

Fixed a typo. I had writen -lpng -lpng, when it should be -lpng -ljpeg.
Thanx to Raziel for the report.

Added a new chapter: History

Added a new chapter: Getting your SDK up to date

Added a new chapter: The basics

Added a new chapter: Configuring linklibs

Added a new chapter: Quick Reference

Added more common errors

Defines section updated

Common errors section updated

Corrections to the configure lines. Thanx HNL!

Corrections to the example makefile. Thanx Booger!

A lot of small changes that I can't remember.

Corrected the cygnix config line.

03) What to port?

Look what additional packages are required for the software you want to port.
You cannot simply port when GUI toolkits like GTK or QT are needed.
Only software which runs under a console can be ported directly.
When you want to port games, look if they use libSDL.
Avoid software which requires OpenGL.


Lots of parts of the SDK have been updated since the last official
release, so install the following libs to get an up to date SDK.
This is especially important for the SDL libs, as the ones included
in the SDK are buggy.


ABC-Shell - Amiga Bourne Compatible Shell

GNU make including parallel compile

Diffutils - file comparison tools
http://www.os4depot.net/share/develop ... utility/diffutils-hnl.lha

m4 - Unix macro processor

GNU core utilities
http://www.os4depot.net/share/develop ... utility/coreutils-bin.lha

Texinfo - GNU documentation system



Free Pascal Compiler

Perl 5.8.5

Lua - powerful embeddable programming language


Boost C++ libraries

Expat C library for parsing XML

GNU termcap library


LibCurl - the multiprotocol file transfer library



libODE - ODE and Opcode


libOpenSSL - OpenSSL: The Open Source toolkit for SSL/TLS




libSDL_ttf and libSDL_net


libXML2 - The XML C parser and toolkit of Gnome



The first thing you do is to check how to build your project.
If there is a file called configure in the root directory of the archive, it means
you'll have to configure it for your platform.

Start ABC-Shell by typing 'sh' in your shell, and configure it. See the next
chapter for a description on how to do that.

After the project is properly configured it's time to roll out the compiler.
Start building your project by typing GMAKE.

However, if there was no file called Configure, look for a file called
Makefile. Edit it to suit AmigaOS 4.0 and build the project with GMAKE.

If everything compiled and linked you are ready to test your port. A very common
problem is that it won't find it's datafiles, and crash. Fix the path's as
described in the path-fixing chapter, and try to run it again.

If you've compiled a link library a 'GMAKE INSTALL' is recommended, as it will
copy all neeeded files to the right places.

OK, you're done now, upload it to os4depot and aminet!


./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/newlib/lib CFLAGS=-mcrt=newlib CPPFLAGS="-mcrt=newlib -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=newlib LIBS="-lauto -lunix" LDFLAGS=-mcrt=newlib

Use the same line if you are going to compile a linklibrary, but if you want to
compile exclusively for newlib or clib2 change /common/ to clib2 or newlib.

If you want to configure for CLIB2, first fix the PATH, start ABC-Shell by
typing 'sh' in Amiga-Shell and then type; PATH=/SDK/Local/clib2/bin:$PATH

./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=clib2 LIBS="-lauto -lunix" LDFLAGS=-mcrt=clib2

Use the same line if you are going to compile a linklibrary, but if you want to
compile exclusively for newlib or clib2 change /common/ to clib2 or newlib.

CFLAGS="-O2 -mcrt=clib2 -I/usr/X11R6.3/include/ -I/usr/include" LDFLAGS="-L/usr/X11R6.3/lib -laos4util -L/usr/lib -lunix -lnet -lamiga -lm -lauto" CPPFLAGS="-O2 -I/usr/X11R6.3/include -I/usr/local/include -I/usr/include" LIBS="-L/usr/X11R6.3/lib -laos4util -L/usr/local/lib -L/usr/lib -lunix -lnet -lm -lamiga -lauto" ./configure

When configuring a linklib we need an extra option, --includedir=
this is to specify where to install the header files. Use /common/ if you are
going to compile the linklib for both clib2 and newlib. Change it to /newlib/ or /clib2/ if you
are going to compile for just one of them. It's recommended to make versions for both when
possible. Here's the example configure lines;

NEWLIB with headers in .../common/include/ (Use this if you intend to compile for both newlib and clib2.)
./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/newlib/lib --includedir=/SDK/Local/common/include CFLAGS=-mcrt=newlib CPPFLAGS="-mcrt=newlib -DMINIGL" CXXFLAGS=-mcrt=newlib LIBS=-lauto LDFLAGS=-mcrt=newlib

NEWLIB with headers in .../newlib/include/ (Use this if you intend to compile for newlib only.)
./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/newlib/lib --includedir=/SDK/Local/newlib/include CFLAGS=-mcrt=newlib CPPFLAGS="-mcrt=newlib -DMINIGL" CXXFLAGS=-mcrt=newlib LIBS=-lauto LDFLAGS=-mcrt=newlib

CLIB2 with headers in .../common/include/ (Use this if you intend to compile for both clib2 and newlib.)
./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib --includedir=/SDK/Local/common/include CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL" CXXFLAGS=-mcrt=clib2 LIBS=-lauto LDFLAGS=-mcrt=clib2

CLIB2 with headers in .../clib2/include/ (Use this if you intend to compile for clib2 only.)
./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib --includedir=/SDK/Local/clib2/include CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL" CXXFLAGS=-mcrt=clib2 LIBS=-lauto LDFLAGS=-mcrt=clib2

Some configure scripts just don't want to do what you want them to, here's some real world examples,
from when I have had to tweak a configure script by issuing some flags;

Xmoto configured without Automake (notice the amigaos path fix: --srcdir=/Scene/Coding/xmoto-0.2.4);
./configure --disable-dependency-tracking --srcdir=/Scene/Coding/xmoto-0.2.4 --datadir=/PROGDIR/ --bindir=/SDK/Local/C --prefix=/PROGDIR/ CFLAGS=-mcrt=clib2 CXXFLAGS="-mcrt=clib2 -DMINIGL" LIBS="-mcrt=clib2 -lGL -lGLU -llua -lode -lSDL_gfx -lSDL_net -lSDL_image -lpng -ljpeg -lz -lSDL_mixer -lsmpeg -lm -lvorbisfile -lvorbis -logg -lstdc++ -lSDL_ttf -lfreetype -lz -lsdlmain -lsdl -lauto -lpthread -lm -lunix" --with-sdl-prefix=/sdk/local/clib2
And some manual changes to the Xmoto Makefile;
remove: $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) ... from LINK

./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL -DLIBXML_DOTTED_VERSION=2.6.26 -DLIBXML_TEST_VERSION=20626 -DLIBXML_VERSION=20626 -DLIBXML_VERSION_STRING=20626" CXXFLAGS=-mcrt=clib2 LIBS=-lunix LDFLAGS=-mcrt=clib2

GNGEO: Notice the UNIX path fix at the end (pkgdatadir=/PROGDIR/data)
./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=clib2 LIBS="-lauto -lunix" LDFLAGS=-mcrt=clib2 pkgdatadir=/PROGDIR/data

It makes sense to write the configure statement to a text file.
This way we can easily re-run it like this 'sh mybuildscript.sh'

But before we re-run the script we have to do 'gmake distclean' or 'rm -f config.cache' (the unix way)
or simply 'delete config.cache' (the Amiga way) in order to reset the configuration process.

This enables Linux semantics for paths. Linux applications often use absolute paths to their data files.
But an absolute Linux path like /usr/local/app means for AmigaOS to go one level up, then go into the usr directory.


Prefixes all paths with /PROGDIR. Together with the -lunix option this allows to use Linux paths during compiling and
AmigaOS paths when running the exe.


It's a VERY good idea to ALWAYS add this argument to your configure line;
It cures a LOT of configure related problems.

I get errors like this;
configure: warning: CFLAGS=-mcrt=newlib: invalid host type

The configure script is probably old, don't worry, we can still use it,
but we have to issue the commands a little bit differently. Here's how;

CC=gcc CFLAGS=-mcrt=newlib CPPFLAGS="-mcrt=newlib -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=newlib LIBS="-lauto -lunix" LDFLAGS=-mcrt=newlib ./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/newlib/lib

CC=gcc CFLAGS=-mcrt=clib2 CPPFLAGS="-mcrt=clib2 -DMINIGL -D__USE_INLINE__" CXXFLAGS=-mcrt=clib2 LIBS="-lauto -lunix" LDFLAGS=-mcrt=clib2 ./configure --disable-dependency-tracking --bindir=/SDK/Local/C --prefix=/SDK/Local --libdir=/SDK/Local/clib2/lib

I get errors like this;
configure: error: C compiler cannot create executables

AmigaOS doesn't support the -pipe and -s flags.
Remove the -pipe and -s flags from the configure script. (The file called 'Configure').

I get errors like this;
checking for IMG_Load in -lSDL_image... no

We are linking with static libraries, and we need to be tell exactly what
to link in. Locate this line in the configure script;

LIBS="-lSDL_image $LIBS"

SDL_image depends on some more libraries to function correctly,
add them like this;

LIBS="-lSDL_image -lpng -ljpeg -lz $LIBS"

I get errors like this;
checking for Mix_OpenAudio in -lSDL_mixer... no

We are linking with static libraries, and we need to tell exactly what
to link in. Locate this line in the configure script;

LIBS="-lSDL_mixer $LIBS"

SDL_mixer depends on some more libraries to function correctly,
add them like this;

LIBS="-lSDL_mixer -lsmpeg -lm -lvorbisfile -lvorbis -logg -lstdc++ $LIBS"

The same thing also often happens when configure is searching for
SDL_ttf, and you know why by now. We need to specify some more libs that
SDL_ttf depends on. It needs -lfreetype and -lz. I will leave the
rest to you as an excersize.

If you have added the needed dependencies to the configure script, and
it still doesn't work it can be due missing files in the SDK.
freetype-config and smpeg-config are missing in the archives available
on http://www.os4depot.net. I compiled my libs by myself to get the
missing files, but hopefully the authors of the AmigaOS 4.0 versions
will notice and fix these issues.

Another common problem are wrong paths in the .la files found in
SDK:Local/newlib/lib or SDK:Local/clib2/lib.
Check your .la files to see if they are configured correctly, locate
the following lines;

# Directory that this library needs to be installed in:

This one is set up correctly, notice libdir='/SDK/Local...'
if it's set to '/USR/Local...' it's wrong.

If it still doesn't work, and you are sure that you have the library
installed, try to remove the whole section where it checks
for the failing library in the configure file.
This is not recommended, but if there is no other way...

Now you should be ready to build your project. When porting unix apps
always type GMAKE. MAKE is for Amiga projects only.


How do I convert UNIX paths into AmigaDOS paths?

Exchange getenv("HOME"); to "/PROGDIR/"

org: strcpy(path, getenv("HOME"));
new: strcpy(path, "/PROGDIR/");

org: strcpy(home,getenv("HOME"));
new: strcpy(home,"/PROGDIR/");

old: sprintf(rc_dir, "%s/.gngeo/romrc.d", getenv("HOME"));
new: sprintf(rc_dir, "%sgngeo/romrc.d", "/PROGDIR/");

Notice that I removed "/." in the last example.

Paths to datadirs are often set during the configure process by issuing
-DDATADIR= if this is the case set it to -DDATADIR=/PROGDIR/
It's also common that the datadir are set in the makefiles locate DATADIR=
and change it to DATADIR=/PROGDIR/


Defines are often set in config.h, if something is configured wrongly, you can
often change it here by using #DEFINE and #UNDEF.

A define example that considers all AmigaOS flavours;

#ifdef __AMIGA__
blah blah blah
blah blah blah

A define example that only considers AmigaOS 4.0;

#ifdef __amigaos4__
blah blah blah
blah blah blah

A define example, that considers BeOS and AmigaOS 4.0;

#if !defined(__BEOS__) && !defined(__amigaos4__)

An example of a more complex #ifdef

#ifdef GP2X
char *gngeo_dir="save/";
#elif defined __amiga__
char *gngeo_dir="/PROGDIR/save/";
char *gngeo_dir=get_gngeo_dir();


No return statement in function returning non-void

What does it really mean?
There is no return in a function that needs a return.

Control reaches end of non-void function

What does it really mean?
it is reaching the end of a function that needs a return, but there is no return.

May be used uninitialized in this function

What does it really mean?
The variable is not initialized.

Warning: implicit declaration of function 'blah blah'

What does it really mean?
You need to include a header.



If you can't find the answer here, it's usually a good idea to
google the error message, for example, enter
warning: implicit declaration of function 'strlen' and in many
cases the sollution will be there for you.

In general, when you get an error of this type;

warning: implicit declaration of function 'strlen'
warning: incompatible implicit declaration of built-in function 'strlen'

It means that the sources are missing an include. To find out which include
it wants, open a shell and CD to SDK: then do;
"grep -R strlen *" in this case you will get a LOT of output, so having KingCon
installed is a good idea. 99% of the info printed is irrelevant, what you are
looking for is a header that includes the function the source wants.
Includes are stored in SDK:Local/Newlib/Include, SDK:Local/Common/Include,
SDK:Local/Clib2/Include, SDK:newlib/Include/ and SDK:Clib2/Include.
So only check the hits found in those directories.
For the lazy bunch, i've included the most common ones here;

warning: incompatible implicit declaration of built-in function 'exit'
warning: incompatible implicit declaration of built-in function 'abort'
solution: #include <stdlib.h>

warning: implicit declaration of function 'strlen'
warning: incompatible implicit declaration of built-in function 'strlen'
solution: #include <string.h>

warning: implicit declaration of function 'memcpy'
warning: incompatible implicit declaration of built-in function 'memcpy'
solution: #include <string.h>

error: memory.h: No such file or directory
solution: #include <string.h>

error: malloc.h: No such file or directory
solution: #include <stdlib.h>

warning: incompatible implicit declaration of built-in function 'printf'
solution: #include <stdio.h>

warning: implicit declaration of function 'srandom'
warning: implicit declaration of function 'random'

We don't have random() and srandom() in neither clib2 or newlib.
You "could" use rand() and srand() instead they are not totally compatible,
but it should work.

One way to do it is to manually edit the sources and replac srandom and random
with srand and rand. Another way to do it is to; #define srandom srand in the

warning: implicit declaration of function 'MyRemove'
solution: #define MyRemove Remove

error: 'sqrtl' was not declared in this scope
solution: #define sqrtl sqrt

Fullscreen modes doesn't work in your newly ported SDL game?
solution: try replacing SDL_HWSURFACE with SDL_SWSURFACE.

error: conversion from 'float' to non-scalar type 'fix' requested
solution: #include <math.h>


I will put sollutions to not so common errors here, that I've
managed to solve. Partly as a reminder to myself, but also as
it might be handy for you.

error: array bound forbidden after parenthesized type-id

solution: The guilty line looks something like this;
frames = new(BITMAP*)[number_of_frames];
remove the paranteses, so that it looks something like this;
frames = new BITMAP*[number_of_frames];


How do I search for text strings using GREP?
From ABC-Shell type;
grep -R "I am looking for this" *

How do I make a DIFF file with my changes?
From ABC-Shell type;
diff originalfile.cpp mychangedfile.cpp >./originalfile.patch

My executeable is crashing, how do I debug it?
You can use Snoopy to find out what your application tries to do.
It's VERY common that the app doesn't find a file that it needs.
Check the section about fixing UNIX path's to fix it.

In the Grim Reaper, click generate stack trace under the Stack Trace tab.
Now you'll see a lot of numbers and things.

Now use addr2line to find out where in the source the crash occured.

Here's an example;
addr2line -e xmoto.exe 0x39c48

How do I use Python?
Assign python: to your python dir, and then add it to your path from
abc-shell: PATH=$PATH:/python

How do I redirect GCC warnings and errors to a text file?
gmake 2>/ram/warnings.txt

How do I make a tar.gz archive out of my source dir?
tar czvf myarchive.tar.gz mysources/

How do I fetch a source when all I have is an URL like this one? svn://svn.72dpiarmy.com/smw
install Subversion aka SVN and type this in shell;
svn checkout svn://svn.72dpiarmy.com/smw

How do I redirect GCC warnings and errors to a text file?
gmake 2>warnings.txt


this makefile could be used if the build system is a mess and you want to
simplify it a bit, alter it to fit your needs.
Usually you only need to modify an existing makefile, and add -mcrt=newlib or
-mcrt=clib2, add these include paths;
-I/sdk/local/newlib/include/SDL -I/sdk/local/common/include/SDL
and add some linklibraries.

Here's an explanation of what the flags does.

CC - the name of the C compiler executeable
CXX - the name of the C++ compiler executeable
RM - the name of the delete command
STRIP - the name of the strip command (used to remove debug data from exe files)
CFLAGS - tells the compiler where to find the includes and what clib to use etc.
specify -mcrt=newlib or -mcrt=clib2 here.
LDFLAGS - tells the compiler what link libraries to include etc.
specify -mcrt=newlib or -mcrt=clib2 here too, aswell as the other needed
linklibs depending on what you are compiling.
OBJS - The compiler (GCC/G++) compiles object files (#?.o) from your .C or .CPP
files that are later linked together to become an exe file.
Specify the object file names here.
OUTPUT - The name of the final exe file.


CC = gcc -mcrt=newlib
CXX = g++ -mcrt=newlib
RM = rm
STRIP = strip
CFLAGS = -mcrt=newlib -Wall -O2 -I/sdk/local/newlib/include/SDL -I/sdk/local/common/include/SDL
LDFLAGS = -mcrt=newlib -lSDL_gfx -lSDL_net -lSDL_image -lpng -ljpeg -lz -lSDL_mixer -lsmpeg -lm -lvorbisfile -lvorbis -logg -lstdc++ -lSDL_ttf -lfreetype -lz -lsdlmain -lsdl -lauto -lpthread -lm -lunix
OBJS = a.o b.o c.o
OUTPUT = test.exe

all: $(OBJS)

main.o: main.cpp main.h
$(CXX) $(CFLAGS) -c main.cpp



When compiling an Allegro game for example, it often comes with a makefile for Windows, and obviously
no makefile for AmigaOS. That's where you come in.

I'll guide you through it step by step. The game used in the example is called Pikzels.
Download it here, if you like; http://www.allegro.cc/files/depot/505/PikselzFinal.zip, extract it and
load pikselzfinal/source/makefile.win into your favourite editor.

You'll notice that it uses Windows line breaks, every other line is blank, which makes it harder to
overview. If you are using CED you can fix that by marking everything and selecting 'Strip CR marked'
in the Cut/Paste menu. No you should have a nicer layout to work with.

The first thing we notice are these two lines;

CPP = g++.exe
CC = gcc.exe

We have to get rid of the Windows extensions and tell GCC to use Newlib, like this;

CPP = g++ -mcrt=newlib
CC = gcc -mcrt=newlib

Good, now GCC will be found. On to the next two lines;

WINDRES = windres.exe
RES = ../Obj/ErkleLnD_private.res

I am not sure what windres does, I guess it's related to the windows build environment.
We don't need it anyway. Remove those lines completely.

On to the next line;
OBJ = ../Obj/Main.o ../Obj/erkMap.o ../Obj/erkTile.o ../Obj/erkTileType.o ../Obj/erkBmpGen.o ../Obj/erkUnit.o ../Obj/erkTTHive.o ../Obj/erkTTTrainer.o ../Obj/erkCommand.o ../Obj/erkCmdGo.o ../Obj/erkCmdClear.o ../Obj/erkCmdTrainer.o ../Obj/erkCmdHive.o ../Obj/erkTTThorns.o ../Obj/erkCmdThorns.o ../Obj/erkAI.o $(RES)

Notice the $(RES) thingie at the end? It tries to fetch the parameters from the
"RES = ../Obj/ErkleLnD_private.res" line that we removed. Not good. Remove $(RES) from that
line, and also from the other lines where it occurs, in this case, it only occurs on Line 6 and 7.

Those two lines shall look like this now;
OBJ = ../Obj/Main.o ../Obj/erkMap.o ../Obj/erkTile.o ../Obj/erkTileType.o ../Obj/erkBmpGen.o ../Obj/erkUnit.o ../Obj/erkTTHive.o ../Obj/erkTTTrainer.o ../Obj/erkCommand.o ../Obj/erkCmdGo.o ../Obj/erkCmdClear.o ../Obj/erkCmdTrainer.o ../Obj/erkCmdHive.o ../Obj/erkTTThorns.o ../Obj/erkCmdThorns.o ../Obj/erkAI.o
LINKOBJ = ../Obj/Main.o ../Obj/erkMap.o ../Obj/erkTile.o ../Obj/erkTileType.o ../Obj/erkBmpGen.o ../Obj/erkUnit.o ../Obj/erkTTHive.o ../Obj/erkTTTrainer.o ../Obj/erkCommand.o ../Obj/erkCmdGo.o ../Obj/erkCmdClear.o ../Obj/erkCmdTrainer.o ../Obj/erkCmdHive.o ../Obj/erkTTThorns.o ../Obj/erkCmdThorns.o ../Obj/erkAI.o

On to the next line;
LIBS = -L"lib" -lalleg -mwindows -lalleg

This is where the libs to be used are specified. We don't need some of it. -mwindows has to go. -L"lib" too.
I am a bit lazy, so I usually copy/paste my line from this guide, that has all allegro libs in it. The ones
that aren't needed won't get used anyway. So make it look like this;
LIBS = -mcrt=newlib -lalmp3 -laldumb -lalfont -lalfblend -lalagup -lallegro -lpthread -lstdc++ -lauto -lunix

As I said, most of these aren't used by this game, but it doesn't matter. As GCC will just ignore them.
Notice the -mcrt=newlib part, don't forget it, as it tells GCC to use Newlib when linking.

On to the next two lines;
INCS = -I"include" -I"../include"
CXXINCS = -I"lib/gcc-lib/mingw32/3.3.1/include" -I"include/c++/3.3.1/backward" -I"include/c++/3.3.1/mingw32" -I"include/c++/3.3.1" -I"include" -I"H:/Common/Include" -I"H:/Libs/Lua/include" -I"../include"

These lines tell GCC where to look for the needed includes that we specified on the LIBS line.
The includes on the INCS = line are project specific, these are the includes for the game. We need those.
The ones on the next line are windows specific. We don't need those.

This is an allegro project, so we type the paths to our allegro includes, and add the game specific
includes at the end;

INCS = -I/sdk/local/newlib/include/allegro -I/sdk/local/newlib/include/ -I/sdk/local/common/include/ -I"include" -I"../include"
CXXINCS = -I/sdk/local/newlib/include/allegro -I/sdk/local/newlib/include/ -I/sdk/local/common/include/ -I"include" -I"../include"

I usually put the inclued path's on both those lines, just to make sure they get used.

On to the next line;
BIN = ../ErkleLnD.exe

Change the windows path to an AmigaOS path like this;
BIN = ErkleLnD.exe

Do the same for these lines;
all: all-before ../ErkleLnD.exe all-after
$(CPP) $(LINKOBJ) -o "ErkleLnD.exe" $(LIBS)

make them look like this;
(Line 16) all: all-before ErkleLnD.exe all-after
(Line 23) $(CPP) $(LINKOBJ) -o ErkleLnD.exe $(LIBS)

OK, the flags seems to look fine now. At this stage i usually search the makefile for RES to make sure
I haven't missed any occurances of it. Do that now. At the end of the makefile you'll find two lines
that looks like this;

../Obj/ErkleLnD_private.res: ErkleLnD_private.rc
$(WINDRES) -i ErkleLnD_private.rc --input-format=rc -o ../Obj/ErkleLnD_private.res -O coff

They only deal with that WINDRES thing, remove them completely. Now save it as 'makefile.aos4'.

I tidied up the makefile a bit (I lined up the = chars, to make it more readable) but you should
now have a makefile that looks something like this;

# Project: ErkleLnD
# Makefile created by Dev-C++

CPP = g++ -mcrt=newlib
CC = gcc -mcrt=newlib
OBJ = ../Obj/Main.o ../Obj/erkMap.o ../Obj/erkTile.o ../Obj/erkTileType.o ../Obj/erkBmpGen.o ../Obj/erkUnit.o ../Obj/erkTTHive.o ../Obj/erkTTTrainer.o ../Obj/erkCommand.o ../Obj/erkCmdGo.o ../Obj/erkCmdClear.o ../Obj/erkCmdTrainer.o ../Obj/erkCmdHive.o ../Obj/erkTTThorns.o ../Obj/erkCmdThorns.o ../Obj/erkAI.o
LINKOBJ = ../Obj/Main.o ../Obj/erkMap.o ../Obj/erkTile.o ../Obj/erkTileType.o ../Obj/erkBmpGen.o ../Obj/erkUnit.o ../Obj/erkTTHive.o ../Obj/erkTTTrainer.o ../Obj/erkCommand.o ../Obj/erkCmdGo.o ../Obj/erkCmdClear.o ../Obj/erkCmdTrainer.o ../Obj/erkCmdHive.o ../Obj/erkTTThorns.o ../Obj/erkCmdThorns.o ../Obj/erkAI.o
LIBS = -mcrt=newlib -lalmp3 -laldumb -lalfont -lalfblend -lalagup -lallegro -lpthread -lstdc++ -lauto -lunix
INCS = -I/sdk/local/newlib/include/allegro -I/sdk/local/newlib/include/ -I/sdk/local/common/include/ -I"include" -I"../include"
CXXINCS = -I/sdk/local/newlib/include/allegro -I/sdk/local/newlib/include/ -I/sdk/local/common/include/ -I"include" -I"../include"
BIN = /ErkleLnD.exe
CXXFLAGS = $(CXXINCS) -DALLEGRO_GUESS_INTTYPES_OK -fexpensive-optimizations -O3
CFLAGS = $(INCS) -DALLEGRO_GUESS_INTTYPES_OK -fexpensive-optimizations -O3
RM = rm -f

.PHONY: all all-before all-after clean clean-custom

all: all-before ErkleLnD.exe all-after

clean: clean-custom
${RM} $(OBJ) $(BIN)

$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o ErkleLnD.exe $(LIBS)

../Obj/Main.o: Main.cpp ../include/erkTypes.h ../include/erkMap.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h ../include/erkBmpGen.h
$(CPP) -c Main.cpp -o ../Obj/Main.o $(CXXFLAGS)

../Obj/erkMap.o: erkMap.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkMap.cpp -o ../Obj/erkMap.o $(CXXFLAGS)

../Obj/erkTile.o: erkTile.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkTile.cpp -o ../Obj/erkTile.o $(CXXFLAGS)

../Obj/erkTileType.o: erkTileType.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h ../include/erkBmpGen.h
$(CPP) -c erkTileType.cpp -o ../Obj/erkTileType.o $(CXXFLAGS)

../Obj/erkBmpGen.o: erkBmpGen.cpp ../include/erkBmpGen.h ../include/erkTypes.h
$(CPP) -c erkBmpGen.cpp -o ../Obj/erkBmpGen.o $(CXXFLAGS)

../Obj/erkUnit.o: erkUnit.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkUnit.cpp -o ../Obj/erkUnit.o $(CXXFLAGS)

../Obj/erkTTHive.o: erkTTHive.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkTTHive.cpp -o ../Obj/erkTTHive.o $(CXXFLAGS)

../Obj/erkTTTrainer.o: erkTTTrainer.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkTTTrainer.cpp -o ../Obj/erkTTTrainer.o $(CXXFLAGS)

../Obj/erkCommand.o: erkCommand.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkCommand.cpp -o ../Obj/erkCommand.o $(CXXFLAGS)

../Obj/erkCmdGo.o: erkCmdGo.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkCmdGo.cpp -o ../Obj/erkCmdGo.o $(CXXFLAGS)

../Obj/erkCmdClear.o: erkCmdClear.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkCmdClear.cpp -o ../Obj/erkCmdClear.o $(CXXFLAGS)

../Obj/erkCmdTrainer.o: erkCmdTrainer.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkCmdTrainer.cpp -o ../Obj/erkCmdTrainer.o $(CXXFLAGS)

../Obj/erkCmdHive.o: erkCmdHive.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkCmdHive.cpp -o ../Obj/erkCmdHive.o $(CXXFLAGS)

../Obj/erkTTThorns.o: erkTTThorns.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkTTThorns.cpp -o ../Obj/erkTTThorns.o $(CXXFLAGS)

../Obj/erkCmdThorns.o: erkCmdThorns.cpp ../include/erkMap.h ../include/erkTypes.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h
$(CPP) -c erkCmdThorns.cpp -o ../Obj/erkCmdThorns.o $(CXXFLAGS)

../Obj/erkAI.o: erkAI.cpp ../include/erkTypes.h ../include/erkMap.h ../include/erkUnit.h ../include/erkCommand.h ../include/erkTile.h ../include/erkTTHive.h ../include/erkTTTrainer.h ../include/erkTTThorns.h ../include/erkBmpGen.h
$(CPP) -c erkAI.cpp -o ../Obj/erkAI.o $(CXXFLAGS)

It's now time to try to build the game. Unfortunately this game needed some work on the actual sources,
so it didn't compile and link, bummer! :) But now you know how to convert a windows makefile into an
Amiga makefile. Try it on some other Allegro/SDL game/tool. When you know what you are doing, this whole
process of converting the makefile will only take a minute or so. It's not as timeconsuming as it looks
in this tutorial.

If you still want to build the game, this is how i solved it.

I googled for the error that I got. (error: '::main' must return 'int')
and I found this page;
http://www.linuxforums.org/forum/linu ... main-must-return-int.html

One of the replies suggests this;
Don't write 'void main' write 'int main'.

Great! I edited line 29 in main.cpp, and changed void main() to int main() this helped,
and now I only had a simple error left,

error: winalleg.h: No such file or directory

This game is obviously written with Windows in mind, and it tries to include the windows
specific Allegro header winalleg.h, remove this from all the .cpp files where you find
it. They already include allegro.h, so you don' need to add that.

Once this is done, the game will compile and link! Yeah! Copy the exe ErkleLnD.exe
into the pikselzfinal/ dir and try it.

Bummer. It crashed when launched. It also killed my mouse. And Snoopy didn't give me any
useful info, and as it killed my mouse I can't get any stacktrace to use with addr2line,
sorry, my knowledge ends here. I am off to compile another one, you? ;)


This section of the guide is to be considered alpha, it's untested,
and the guide was given to me in a hurry in #amigadev by Ami603.

Open your project and go to the Variables page.
Open the edit window by clicking the 'edit' button.
Add a stringpointer called commandfile. do not add any values to it.

Step by Step:

Go to the request page

Step by step;
page variable, click on edit, select stringpointer, name commandfile, click add.

Return back to the reaction page.

Go to the requester page.
Open the edit window again if it's not opened.
Select errorrequest.
Type "your emulator executable doesn't exists" or something similar as BodyText, and add it.

Select errorrequest again.
Type "The file you selected does not exist" as BodyText, and add it.

Go to the reaction page.
Click twice on your added getfile gadget (on the left).
A text editor will be opened with a function called GetFileX_GadgetUP_evt.

Enter this code between the brackets;

IIntuition->IDoMethod((Object *)gad[GID_Getfile1],GFILE_REQUEST,NULL,win[WID_Window1],NULL,TAG_DONE);

(Assuming your gadget is called GetFile1 and you didn't edit the gadget name).

Close the editor, click twice on the launch button.
Another function will be displayed in the text editor, 'Button1_GadgetUP_Evt'
Enter this code between the brackets;

BPTR executable,file;
STRPTR commandbuffer;
if (!(executable = IDOS->Lock("here_goes_The_emulator_cli_executable_name",ACCESS_READ)))
// First requester below here
if (!(file = IDOS->Lock(commandfile,ACCESS_READ)))
// Second requester below here
else if ((executable)&&(file))
commandbuffer = IUtility->ASPrintf("here_goes_the_emulator_cli_executable_name \"%s\"",commandfile);
if (IDOS->SystemTags(commandbuffer,
SYS_Input, NULL,
SYS_Output, NULL,
SYS_Asynch, TRUE,
IDOS->Printf("Commandline: %s failed\n",commandbuffer);

Now without closing the texteditor go to the requester page again and put your
editor cursor below the "//first requester below here", click twice on the
ErrorRequester1 same for "//Second requester below here",
click twice on ErrorRequester2, close the editor, save all, shell ->make

Try to edit the your_command_cli_executable with the name of your exe in both places
in this function.

You can add a third requester, with your about info inside, add another button and
do the same as before click button twice, select function, go to requesters page
and click twice on it.


First of all, if you are brave enough to try this, and finds an SDL/GL project
that don't throw hundreds of errors at you, this might help you.

Add -DMINIGL to your CFLAGS.
Add -lGL -lGLU to your LDFLAGS. It's important to add them first,
before any other link libs.

Then, there's a bug in the AmigaOS 4.0 version of SDL. It ALWAYS opens a fullscreen
mode, and many apps wants to open a window mode. This is a very common reason as
to why GL apps crashes when compiled for OS4. So, some changes needs to be done to
the code.

Look for SDL_SetVideoMode in the sources, and change it to use fullscreen instead.

Here's an example;

screen = SDL_SetVideoMode( 800, 600,24, SDL_OPENGL | SDL_HWSURFACE );
screen = SDL_SetVideoMode( 800, 600,24, SDL_OPENGL | SDL_HWSURFACE | SDL_FULLSCREEN );

I have reported this bug to Evil Rich, but he haven't answered the mail, so if
you read this Evil oner, consider it a bug report. ;)

I just got a new, yet unreleased game called Bomber Bastards compiled using this method,
keep your eyes focused on amigaweb.net as it will be released on that site exclusively.

17) HELP ME!

I created this document mainly to aid myself from the beginning, but it turned
out to be quite useful in the end, so I decided to clean it up and release it.
I'd love to get help extending this document, if you've spotted an error, want to
clarify a section or add a new section, please join me in my mission! I am sure
it will be appreciated by many! --- And hey! What could happen? os4depot could be
flooded by new files? That wouldn't be so bad would it?


Send a mail to: spot AT triad DOT se
You can also find me and a bunch of other helpful developers in #amigadev on irc.amigaworld.net


This wouldn't be possible without:

and the rest in #amigadev! THANX A LOT GUYS!

  0   Article ID : 18
« 1 2 (3) 4 5 »

Maintain By NovaSmart Technology . Visit NovaSmart XOOPS Module Development Site
Navigate thru topics
Top Articles
Most Active Authors
Most Read Authors
Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project