DICE C Compiler for the Amiga

So on my last adventure through some disk corruption on my Amiga, the natural thing to do is find some kind of MD5 checksum program to then compare signatures of files being copies to ensure that they are being copied correctly.

While there were several great C compilers for the Amiga when it was a viable platform, the one left standing today is GCC.  Which is fine and all, but it is rather large, and unwieldy.  And won’t run on a computer with 2MB of RAM (In the off chance that I want to run it on the 600).  But that is when I found out that the source code (dice.com has moved!)  to old DICE compiler is available!  DICE, was originally a public domain compiler then turned commercial then finally turned freeware.  For its time it was thought as a highly capable compiler as reviewed here. Also of note is that is was written by  Matt Dillon, who later went on to DragonFLY BSD fame.

So I thought I’d try something completely different.

So after extracting the 3.15 binary distribution (which also included cross compiling from linux/i386), and following the install notes I tried to build a md5 program that I had found into an AmigaDOS binary.  And it didn’t work.  It turns out that it is missing include files related to AmigaDOS.  And I was further unable to build DICE C from within DICE C.

So after a lot of searching, I came across this, a cut down “Mini DICE” that was bundled with Amiga Shopper, meaning it has the following limitations:

  • Only small library modules are included.
  • No Bitfields
  • No floating point
  • No pragmas
  • No register variables/arguments
  • The maximun executable program size is 40K
  • Each source file can only have up to 4 procedures
MiniDice

MiniDice

Wow that is.. limiting.  But it does have several of the needed include files, and a nice setup program to get going.  At first I tried doing a full-sale overlay of the ‘3.15 binary’ version but I broke something to do with REXX and how DICE links.  So instead I just overlaid the core compiler, namely dcc, dc1, dccp, das, dlink, dmake, fdtolib & fdtopragma.

I was then finally able to compile md5.  I went ahead and started to build some of the source, and so far using a combination of dmake & vmake I was able to rebuild das, dcc, dlink, dc1 and dccp.  I went ahead and created backups of my somewhat improved dice, and dice with source code.  Some programs build fine from the command line, others you need to invoke the visual build tool.

So how is the environment?  I tried to build Dungeon (dung27s.zip) for the heck of it, but the visual makefile tool couldn’t handle a project with 33 files.  I suppose I could have made a library and gone through with some linking hell but that seemed like work.  Instead I just typed in all the C files from the command line, and compiled it that way.  Taking care of a warning and a few errors and I actually got a binary!

Dungeon on the Amiga

Dungeon on the Amiga

Even better, it runs!

Some fun with my “new” Amiga 600

Compact Flash in Amiga 600

Compact Flash in Amiga 600

So after getting this Amiga 600, I did get some games on diskette, but using any computer in 2013 without a hard disk is just unimaginable.  So a Compact Flash card & IDE adapter I had ordered had finally arrived!  Thankfully it was sold as an “Amiga formatted” Flash disk, being already partitioned as that can be a major ordeal through emulation on OS X.

Of the few disks I do have, I don’t have a full copy of the OS so I don’t have the “install” disk with the partitioning tool, so I kind of had to improvise.. So like I said, I got lucky as the Flash disk had been partitioned on an Amiga before it was sent to me.  Sadly the Amiga emulator FS-UAE doesn’t seem to honor the “IDE0” controller settings and won’t mount the flash directly.  So on a whim, I dd’d the Compact Flash and worked with that.

dd if=/dev/disk1 of=compactflash.hdf bs=512

dd if=compactflash.hdf of=/dev/disk1 bs=512

Surprisingly this worked pretty well.  I was able to format the disk image, and install the OS from disk images. Slapping the whole thing into the Amiga and it booted up, and all was well!  Or so it seemed.  I then wanted to play Frontier: Elite II, of which I was able to locate a copy of the “shareware” version, and use DMS to convert the ADF to a DMS file which I could then extract onto a physical disk on the Amiga.  So everything was going fine, but then today disaster struck.  It seems the floppy drive has either gone bad, or the disk I was using went bad.  Either way it is very maddening.

Frontier Box

Frontier Box

So the natural solution is either to replace the floppy drive, and try to score some decent floppy disks, and repeat the procedure.  The better solution, of course is to just run the game from the Compact Flash.  The good thing is that Frontier doesn’t have any disk based copy protection, instead it relies on some in game reading from the manual, and the shareware & various pirate versions have removed the checks.

After re-dding the image onto the flash I ran it, and it immediately crashed.  Even worse, I copied the game into the RAM disk, and it wouldn’t launch as the file was corrupted.  Clearly something was wrong or corrupting with the ROM version.  Now there is some conflicting information on Wikipedia regarding this, as 37.299 ROMS don’t include PCMCIA drivers, nor any IDE support.  37.300 has support for IDE & PCMCIA but Wikipedia lists it as only support disks up to 40MB.  I’m using a 128MB flash card, so at first I had figured this was the source of my problems regarding disk corruption.  Wiki lists another version 2 ROM, 37.350 which can apparently support disks & filesystems up to 4GB.  Of course there is also Kickstart v3.0 & 3.1 which run on the 68000’s.

After googling around it seems that 37.300 can work fine, and the ROM version, along with the version 2.1 of AmigaDOS should be enough to get this working.  That is when I found out about the MaxTransfer and Mask in HDToolBox.  Apparently the default values don’t work so well with things like PCMCIA disks, and Compact Flash drives.  Setting the MaxTransfer to 0x0FE00 and the Mask to 0x0FFFFFC did the trick!

HDToolBox in action

HDToolBox in action

Of course I found out the hard way that you have to press enter after entering the values, otherwise it won’t save your changes.

Wow what a convoluted process! But mass storage on the Amiga has always been a trying process even at the best of times.  Oh and here is it in action!

Next I’ll try to tackle WHDLoad, although I don’t think 2MB of ram will be enough.

So while I’m on this Amiga kick

Screen Shot 2013-01-05 at 9.29.43 PMI came across this great site, commodore.me, which includes PDF’s of Amiga Format magazine!

And on the same kick, now that Frontier Dangerous got its funding, I ordered a copy of the awesome Elite II: Frontier. And there is another site, amr.abime.net which includes just about every review of the game, along with some page scans! I do look forward to being able to play this game again.. It just isn’t the same with analog sticks, or the PC version.

And speaking of a Commodore overload, they are still doing the “World of Commodore” shows, here is the last from 2012..

It would be cool to go to this in 2013, I would assume it will be held in Toronto, again by the TPUG?

Something interesting happened on the way to Verona

We somehow managed to find an Amiga 600 for sale!

It is stock, 1mb if ram with a 37.300 ROM but it does have workbench disks. With all being well ill be able to rig this thing out!

Pictures and more to follow as I’m on a train to the airport.

Just got back from the UK, and check it out!

Euro amiga 600

On my way out of Italy, it was kind of funny as the security checkpoint people immediately recognized the Amiga 600, pulled it out of the line, and started to wave it around, so that others could come by to check it out, then they put it through the x-ray machine and took pictures.. Sadly I couldn’t take pictures.  But it was slightly amusing.  I guess you had to be there.

Also check this out, I think this game is Amiga 500 / AmigaDOS 1.2 only .. But it crashes with the good old fashioned Guru Meditation…

Now if only I had a serial port I could use this method of transferring ADF files..

More improvements to the Commodore Amiga emulator, Janus

As I had mentioned earlier there is this great HTML5/Javascript Amiga emulator Janus.

And now, it supports loading a bunch of games & demos from the page!  Making this the easiest way to enjoy the best of the early 1990’s on Chrome.

Project-X

Project-X

The available games are:

  • Agony – Psygnosis 1992
  • Alien Breed -Team 17 1991
  • Alien Breed Tower Assault – Team 17 1994
  • Another World - Delphine – U.S. Gold 1991
  • Blood Money - DMA Design 1989
  • Body Blows Galactic  - Team 17 1993
  • Dyna Blaster  - Ubi Soft 1992
  • Lotus Turbo Challenge 2 - Gremlin 1991
  • Pinball Dreams - DICE 1992
  • Prince of Persia  - Domark 1991
  • Project-X – Special Edition 93  - Team 17 1993
  • Rick Dangerous  –  Firebird 1989
  • Shadow of the Beast II  -  Reflections 1990
  • Superfrog  -  Team 17 1993
  • Turrican II – The Final Fight   - Rainbow Arts 1991
  • Wings of Death  – Thalion 1990

And you can enjoy it here.

AmiDevCpp

Antoni sent me a link to this project, AmiDevCpp. It is a nice little wrapped up IDE for cross compiling applications for the following platforms:

  • AmigaOS (m68k)
  • AmigaOS4 (PPC)
  • MorphOS(PPC)
  • AROS (i386, ppc and x86_64).

Naturally it doesn’t work correctly on Wine.. .Oh well, but for you Windows users out there that haven’t installed Cygwin this is an easy way to cross build stuff for the ancient Amiga platform.

Apparently he was able to rebulid the infamous aclock using this cross compiler…

More fun with Janus!

Frontier Elite, on Janus

Frontier Elite, on Janus

So, I came across this great page, Frontierverse, which has download links for all the versions of Frontier Elite which were released out as shareware.  So what is cool, is that using the AROS Kickstart replacement ROM, it’ll boot up and work!

Just be sure to increase the default amount of chip memory, as it seems the AROS Kickstart ROM consumes more RAM than the Commodore ROM.  But heck the AROS ROM is opensource, and free!

Pretty cool, and more interesting than say the normal, yippie a view of the AROS cat..

 

AROS Kickstart ROM

AROS Kickstart ROM

Again very cool stuff!

And lastly, I slapped together a disk that’ll boot up aclock, although it works only with a Kickstart 2 or higher ROM.. 1.3 kinda freaks out, and I didn’t feel the need to go all over the top on this one.  Booting the aclock disk with the Aros ROM though loads up, but the clock doesn’t tick..

On OS X, I’ve been using the FS-UAE emulator to some degree of success, I’ve found it a tad cumbersome for swapping floppy disks, and I’ve had a major issue where making updates on an ADF that while they all look like the changes are reflected, going to the filesystem proved otherwise.  So I wound up having to make DMS disk images, and running some ancient MS-DOS program to convert DMS to ADF‘s.  Naturally the compression programs were in turn.. compressed.  So with enough fooling around with various archivers I found here, I was finally able to get where I needed to be.

At the same time, looking at how the AROS kickstart replacement ROM is quite capable, it may be time to revisit AROS, and I would imagine it has become far more capable than that last time I had looked at it.

Janus Amiga Emulator

Janus + Kickstart 2 ROM

Janus + Kickstart 2 ROM

I’ve been looking for a good Amiga emulator as of late, something that I can mount a physical device (say a CF card), format it and install AmigaDOS, AmiTCP and a few other things, and get it to work on a physical Amiga.

Anyways I did a cursory google search to see what the state of Amiga emulation is, and I came across this very cool emulator, Janus that is written in java script.

You read that right, derived from UAE, Janus is a javascript Commodore Amiga Emulator.

So I loaded it up using Chrome, selected a dumped ROM, and lo I got the boot animation!  Shuffling around I got a disk image for an old game, and it worked!

Although I’ve seen some glitches in the graphics, and the audio is experimental but hey it is in java script!

Really amazing stuff for sure.

Be sure to check it out in a HTML5 compliant browser here.

NeXTSTEP audio & mod files…

Well I’ve been looking for a way to get some audio out of Quake for NeXTSTEP… and it’s incredibly complicated. I found some ‘smallish’ program for the m68k black hardware that is a MOD player, modPlayer 2.5 which also included source!

However, for me I can’t run it as the monitor to my cube is busted… But I was able to compile it to verify the source ‘works’. I then built it on my white box (P4 2.4Ghz 1GB of ram, and a real soundblaster 16!) and, after removing the reference to the decrunch routine it produced.. noise, and lots of it. But I did feel like I was getting *somewhere*.

I figure the main reason it’s exploding is that the m68k port uses the same CPU as the Amiga for these MOD files, so no doubt there is some bit flipping needed to go from big endian to little endian, but I know *nothing* about the MOD format.. So after a quick google search on basic mod players, I found qmod, a module player written in Quick Basic!!

So I looked around for a copy of Quick Basic 4.5, and tried to build the program, and it was all crash & burn.

At work we have a copy of PDS, the Professional Development System, also known as Basic 7.1 .. This thing is still useful, it will target OS/2 so you can write these massive programs (and run them under Windows 2000). So I figured I could use that to get the thing to build.. And I ran into the same errors about overflows, and all kinds of crap.

So the next thing to try was a copy of Visual Basic 1.0 for DOS that I got from ebay a while back.. I made images of the disks, which was fun, installed the thing to get.. the exact same errors. But I have to say VB for DOS was cool in that the output window can be in a windows (although text one) and you can trace and see at the same time… If only this was on store shelves in 1992!!!!

Anyways after looking at the command line options for VB for dos, I spotted this…

/Ah Enable huge dynamic arrays

I was surprised! So it would seem the answer was in the compiler, not the nice interface.. I just has ‘assumed’ that the interface would provide all the options.. Not so.

So I re-extracted the qmod source as I’d hopelessly altered it, then ‘fixed’ the one line that prevented compilation…

DEF SEG = VARSEG(mixarea(0))

I just removed that line, and ran the compiler & linker.. and it runs!

C:\TEMP>bc /Ah /O qmod.bas

Microsoft (R) Visual Basic (TM) for MS-DOS (R)
Compiler – Professional Edition Version 1.00
Copyright (C) 1982-1992 Microsoft Corporation. All rights reserved.

Object Filename [qmod.obj]:

Source Listing [nul.lst]:

42555 Bytes Available
33278 Bytes Free

0 Warning Error(s)
0 Severe Error(s)

C:\TEMP>link qmod.obj

Microsoft (R) Segmented Executable Linker Version 5.31.009 Jul 13 1992
Copyright (C) Microsoft Corp 1984-1992. All rights reserved.

Run File [qmod.exe]:
List File [nul.map]:
Libraries [.lib];
Definitions File [nul.def]:

C:\TEMP>

Now this program does require a sound blaster card, and it also requires the blaster environment variable set properly… So for Virtual PC it’s simply

SET BLASTER=A220 I5 D1 H5 T4

Then run qmod and the supplied mod file, and away it goes!

Qmod under Virtual PC

Qmod under Virtual PC

And I have to say it’s really cool to listen to this thing work, only using peek/poke (ok it’s inp/out in the new syntax…) but it’s playing the soundblaster, and it sounds GREAT.

So going back to PDS & Quick Basic 4.5 they all support the /Ah flag.. So it’ll build on any of them.

So for those who aren’t inclined to play compiler games, here is a pre-built version of Qmod, and it includes a mod file.

Now for those of you who don’t have Virtual PC, or not running on Windows, the program will run on DOSBox as well!

I just found I had to tweak the cpu config a little to make it run.. This is my CPU block in the configuration file.

[cpu]
#core=auto
core=simple
#cputype=auto
cputype=486_slow
cycles=auto
cycleup=500
cycledown=500

Now when you launch DOSBox, it’ll pick some low cpu cycle number and stay there when you launch qmod.. And it’s too low so it’ll sound horrible. So hitting CTRL+F12 will increase the cycles. Set it to 25000, and it’ll run fine. If you set it too high, CTRL+F11 will bring it down. DOSBox already sets the blaster environment variable for you, so it should ‘just work’.

From there I’d recommend sites like Amiga Music Preservation, or Mod Archive. Qmod can play quite a few of the files with the MOD extension, but not all.. But it’s a great small example program.

As luck would have it, my whitebox is having some weird boot issue, so I can’t go any further on this… But I figure I’d share this much with the world…