English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   support.Other (http://eab.abime.net/forumdisplay.php?f=74)
-   -   WarpOS Programming Help? (http://eab.abime.net/showthread.php?t=80019)

esc 18 October 2015 16:24

WarpOS Programming Help?
 
Hi guys,

I'd like to try porting some stuff to Amiga/WarpOS. Initially I'd like to port DosBox. I write code in linux but have never written anything for Amiga. I've looked around and there seem to be several potential solutions to building a proper dev environment to undertake this. What do you recommend? Here's what I've found:

1 - StormC 4
2 - vbcc (only for c not c++ so not a solution unless I'm wrong)
3 - Cross compile from within macos or linux

As far as StormC 4, I'd gladly purchase it now but can't find anyone currently selling it with it in stock, and furthermore, I'm in Iraq and it take a very long time to ship things here. I wish I could purchase an ISO like I basically did with AmigaOS 4.1 FE Classic. Unfortunately it doesn't look like that's an option.

As for vbcc, that only seems to work with c code, not c++. Since I want to port the already existing dosbox package instead of doing a rewrite this is not a solution either.

Cross compiling on OSX or linux seems complicated. If I were to set up a dev environment do to this, what all would I need? Please be explicit because I can't find decent documentation :)

I'm happy to spend money on getting something like this set up - for development packages and such. Any help is much appreciated!

phx 18 October 2015 22:40

Quote:

Originally Posted by esc (Post 1046176)
1 - StormC 4
2 - vbcc (only for c not c++ so not a solution unless I'm wrong)

Those two have been the only real WarpOS C compilers, following the WarpOS-ABI (a modified PowerOpen-ABI).

Quote:

3 - Cross compile from within macos or linux
I remember there have been free gcc (2.95.x and egcs) compiler ports for WarpOS, using the V.4-ABI, doing WarpOS system-calls through stub functions, which temporarily created a PowerOpen-ABI stack frame. Not the optimal solution, but worked to some degree.

Quote:

As far as StormC 4, I'd gladly purchase it now but can't find anyone currently selling it with it in stock
It can still be ordered from "Alinea Computer", for 50 Euros:
https://www.alinea-computer.de/produ...product=stormc

Quote:

As for vbcc, that only seems to work with c code, not c++. Since I want to port the already existing dosbox package instead of doing a rewrite this is not a solution either.
Just switch to an initial project in C. :)


Quote:

Cross compiling on OSX or linux seems complicated. If I were to set up a dev environment do to this, what all would I need? Please be explicit because I can't find decent documentation :)
Building a PowerPC cross compiler with gcc is not that difficult, when you stick to the common V.4-ABI. But then you have to find matching linker libraries, which can do the above-mentioned stack frame translation.

You could reuse libraries and headers from old WarpUp-gcc releases, but I don't know where they are gone. There's nothing on Aminet.

esc 18 October 2015 22:46

Thanks for that reply! That was very informative. So I think StormC is the way to go, in this case. I'll just have to find a way to get the CD to me in Iraq :)

Locutus 19 October 2015 06:58

I guess the easiest might actually be to get the CD delivered to a friend in Europe and then they can send you a image of it.

esc 19 October 2015 09:38

Actually not a bad idea. Anyone interested in helping out?

thomas 19 October 2015 15:07

Writing a program for WarpOS is not a trivial task. You have to strongly optimize the code to avoid context switches. Each call to an OS function implies two context switches (PPC to 68k and back).

For example if you call a series of graphics routines like this:

Code:

SetAPen (rp,2);
Move (rp,50,100);
Draw (rp,50,50);
Draw (rp,200,50);
SetAPen (rp,1);
Draw (rp,200,100);
Draw (rp,50,100);

then you can watch it drawing lines one by one. You'll have to move this into a 68k subroutine which does all calls at once.

GUI programming in WarpOS is a no-go and I suppose that you will have a lot of work optimizing gfx and sound output, keyboard and mouse input and disk access of DosBox.

In a 68k environment you can only benefit from the PPC if you have long-running functions for which you can collect all input data, then call it to do its function and only return back with the result.

All interaction between 68k and PPC only slows down the program.

Locutus 20 October 2015 09:37

I dont know if you noticed, but Skolman just reposted a old gcc 2.95.3 toolchain for WarpOS on Aminet. Crusty, but maybe workable.

And indeed, keep Thomas' comment in mind, WarpOS/PowerUP is in hindsight a bit terrible.

esc 20 October 2015 10:11

Yeah grabbed gcc from aminet. It's undocumented to having trouble using it. Also it can only do c and I need to do c++ but it's a start :)

Didn't realize it would be so tough to write code for warpos. But I'm undeterred! This could be a long term labor of love and I'm fine with that :)

Cowcat 21 October 2015 10:37

Hi !

I would recomend vbcc: Besides having no trouble to configure, to my opinion the output asm code is better than the old GCC (for ppc). Did tried GCC some time ago and it was a nightmare to use some advanced applications because outdated includes, specially those refering calling system functions with a lot of parameters.
Using vbcc you only need to use #pragma amiga-align #pragma default-align whenever amiga system includes are needed. See coders-general and take a look at quake2-workshop thread of how I changed gcc c quake2 code to work with vbcc (for 68k & wos). I should update/fix that sources by the way......mmm


All times are GMT +2. The time now is 15:43.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.

Page generated in 0.04328 seconds with 11 queries