English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 18 October 2015, 16:24   #1
esc
 
Posts: n/a
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!
 
Old 18 October 2015, 22:40   #2
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by esc View Post
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.
phx is offline  
Old 18 October 2015, 22:46   #3
esc
 
Posts: n/a
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
 
Old 19 October 2015, 06:58   #4
Locutus
Registered User
 
Join Date: Jul 2014
Location: Finland
Posts: 1,176
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.
Locutus is offline  
Old 19 October 2015, 09:38   #5
esc
 
Posts: n/a
Actually not a bad idea. Anyone interested in helping out?
 
Old 19 October 2015, 15:07   #6
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
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.
thomas is offline  
Old 20 October 2015, 09:37   #7
Locutus
Registered User
 
Join Date: Jul 2014
Location: Finland
Posts: 1,176
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.
Locutus is offline  
Old 20 October 2015, 10:11   #8
esc
 
Posts: n/a
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
 
Old 21 October 2015, 10:37   #9
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
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
Cowcat is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
DarcNES emulator for WarpOS Leandro Jardim support.Apps 1 02 May 2015 17:41
WarpOS MiniGL blues. Cowcat Coders. General 16 22 February 2014 18:44
LHA v2.11 for WarpOS available on Aminet! keropi Amiga scene 8 16 March 2006 02:29
GCC warpos linking error? JoJo Coders. General 0 21 March 2003 00:09
ppc.library and WarpOS oldpx support.Apps 5 23 August 2002 16:57

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07454 seconds with 13 queries