Welcome, Guest. Please login or register.

Author Topic: C coding noobie needs help converting a 68k program to PPC/OS 4  (Read 2314 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline DuceTopic starter

  • Off to greener pastures
  • Hero Member
  • *****
  • Join Date: Jul 2009
  • Posts: 1699
    • Show only replies by Duce
    • http://amigabbs.blogspot.com/
C coding noobie needs help converting a 68k program to PPC/OS 4
« on: October 08, 2010, 04:01:16 AM »
I'm a relative noobie coder and need some help, and I'll explain the project I'd like to tackle.

I would like to port an old 68k Amiga BBS program called DLG BB/OS to PPC/OS 4.1.  The source is readily available in C, originally done with SAS/C 6 apparently, but I am not sure where to start as far as what I will need for devtools on my SAM/OS 4, any tips in general in regards to coding C on this gen of "Amiga's" would be just great.

As I said, this is pretty much my first venture into coding in C, so all tips and tricks would be helpful!  Browsing thru the code it seems fairly logical and not terribly confusing, but I don't know a heck of a lot in regards to C on any platform.

DLG BB/OS was a very powerful BBS back in the Commodore days, and a native OS 4 BBS program would be beyond cool.  All the old big names (including DLG, CNet, E!, Zeus, etc) all seem to have some ugly issues when it comes to running them on PPC/OS 4 machines, and emulating the 68k machines via UAE on a SAM is sort of redundant in my eyes.

Thanks a lot, in advance.  The previous author released DLG BB/OS open awhile back, including the source - if anyone wants to paw thru it a bit, send me a PM.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: C coding noobie needs help converting a 68k program to PPC/OS 4
« Reply #1 on: October 08, 2010, 08:32:15 AM »
Your first milestone would be to migrate the code not to OS4, but to gcc. SASC is a great C compiler for Amiga but provides a lot of non-standard functionality, some of which you may need to reimplement. Once you can get the original 68K application code to build properly (and give a working executable) in gcc, then you can look into porting it to OS4.

For the second step, you can opt to keep the code as 3.x compatible as possible, or you can make it more OS4 coding standards compatible. The major difference between the two is mostly down to the way OS library functions are invoked (eg IExec->AllocVec(...) as opposed to AllocVec(...)) and the preferred names for elemental types (int32 as opposed to LONG).
int p; // A
 

Offline woof

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 94
    • Show only replies by woof
    • http://uae.is.free.fr
Re: C coding noobie needs help converting a 68k program to PPC/OS 4
« Reply #2 on: October 08, 2010, 01:38:53 PM »
Hello Karlos

You can still use ULONG if you want

and just adding
#ifdef __amigaos4__
#define __USE_INLINE__
#define __USE_BASETYPE__
#endif

allow you to still call the os3 way the OS library functions like that AllocVec(...)

Alain Thellier
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: C coding noobie needs help converting a 68k program to PPC/OS 4
« Reply #3 on: October 08, 2010, 01:52:11 PM »
Quote from: woof;583578
Hello Karlos

You can still use ULONG if you want

and just adding
#ifdef __amigaos4__
#define __USE_INLINE__
#define __USE_BASETYPE__
#endif

allow you to still call the os3 way the OS library functions like that AllocVec(...)

Alain Thellier


I know; I said he had a choice of which route to take. The alternative is to go for the preferred OS4 coding standards if he didn't care about keeping the code backwards compatible.
int p; // A
 

Offline mousehouse

Re: C coding noobie needs help converting a 68k program to PPC/OS 4
« Reply #4 on: October 15, 2010, 08:57:33 AM »
Just a small update, the author has given permission to release DLG BB/OS as open source code with a small limitation (be sure to read the README)

It can be downloaded from Aminet...
A3000T
 

Offline DuceTopic starter

  • Off to greener pastures
  • Hero Member
  • *****
  • Join Date: Jul 2009
  • Posts: 1699
    • Show only replies by Duce
    • http://amigabbs.blogspot.com/
Re: C coding noobie needs help converting a 68k program to PPC/OS 4
« Reply #5 on: October 15, 2010, 05:29:04 PM »
Very good news, Mousehouse!  Hopefully some more BBS's will go up and perhaps even the code makes its' way onto the new gen machines running Morph and OS 4.  Hopefully we can get some more of this old comms SW onto Aminet, either in sourcecode form or keyfiles released.

DLG was always a spectacular BBS package, but many didn't like it as much as CNet or E! due to the lack of a GUI sysop side.  I remember paying $300 for it new back in the day, back when TelePro Tech still had it.  Jay Miner ran his BBS "The Mission" on DLG back in the day, once of the first BBS's I ever called.