Thursday, May 20, 2010

OpenSSL 1.0.0 for 68000 / 68020-60 / Colfire 5475

I have just finished building OpenSSL for all 3 targets. Of little use to most people. This is not an RPM as the malloc issue is basically killing me in trying to construct one.

Here is OpenSSL:

http://www.radix.net/~atari/mint/openssl-1.0.0-mint-020-60.tar.bz2
http://www.radix.net/~atari/mint/openssl-1.0.0-mint-m5475.tar.bz2
http://www.radix.net/~atari/mint/openssl-1.0.0-mint.tar.bz2

Each archive is stand alone, so, install one, or install them all. Just make sure the last one installed is the platform for which you wish the ssl binary to run on. 68000 and 68020-60 versions pass all tests. Currently unable to test the Coldifre version. Built natively on my Falcon with GCC 4.4.3.

I am going to work on OpenSSH 5.5p1 next.
My Development Environment......

Well, the first thing to say is that it is not very organized at all.

With Vincent Rivière's cygwin port of the latest GCC releases, I am now doing a lot of building on a laptop with cygwin, that is also running AranyM. For instance, all ScummVM releases are built there just for the fact that it takes forever to build a complete ScummVM on my Falcon.

I have also been making use of my PS3 for development as well. Have YellowDog Linux 6.1 setup, and built a previous versions of Vincent's GCC port on it. Not sure how much longer this will last since Sony has decided to remove this functionality from updates to the system firmware, but since I rarely use the thing, I won't really run into a problem unless some BluRay movie wants an update. Currently I am bringing the tools on it up to date with the latest GCC release. And, I'm using Linux here cause I have so far not been real happy with any modern Linux on my x86 system. I might try getting Ubuntu gong at some point on an x86....

Otherwise, we have my Falcon. It has a CT60 (first release) with the latest generation 68060, clocked at 72 Mhz cause I still have not installed the CTCM. It also has the nice feature of a non working parallel port, at least for flashing the CT60. Its got a 20 Mhz bus, thanks to Mark Duckworth. Actually, I was able to get a hold of 2 68060s, sold one to him, and delivered it personally, and he updated my CT60s flash at that time (when I finally learned the || port was bad) besides wiring the machine for 20 Mhz bus. The CT60 has 512 megs of ram. I have an Ethernec plugged into the cartridge port for net access. For drives, I have a Startech IDE -> SATA adapter connected thru a 44 pin to 40 pin adapter (plugged in backwards) with a 160 GB Drive and a Pioneer DVDRW. This system is using an eiffel for keyboard / mouse. It is also connected, at any given time, to either an MT32, Casio, or Kawaii keyboard. CTPCI should be arriving shortly for it, actually 2 of them. I also have a second CT60, but only the one Falcon.

A coming attraction, hopefully, is a Coldfire development board. I have two of these boards, one is installed in a case and ready to go. Also have a Radeon Card (7000) and a PCI USB card to use with it, but, currently, both can not be connected due to how the PCI slots are laid out on the board. Need to spend some cash and get something to move the slots. The only media this board takes is a Compact Flash card, which I have. I currently do not have a keyboard / mouse, as I either need an eiffel for it, or to test the USB board. So far, I have been able to boot this system with EMUTOS build by Didier using the Radeon card. Have not had the chance yet to try using the USB card.....

I do have other Atari systems, but none of them are really seeing much use at the moment. The main ones I have are a stock 1040 STf (1.4 TOS), 520 ST with 2.5 Megs (1.0 / 1.4 switchable), 1040 STe with AdSpeed STe and 4 Megs (1.6 TOS), and 2 Mega STes, one with a PAK 030. The first 3 systems were all purchased new in the late 80s / early 90s!

Wednesday, May 19, 2010

ScummVM for Atari... Its woes and future (hopefully)

The woes with ScummVM....

ScummVM is an amazing piece of software, and also is extremely complicated. That fact that it currently runs on high end Atari machines is amazing. I believe, currently the Atari/FreeMiNT platform is the lowest end platform supported. There use to be an AmigaOS port for 68k, but I believe that is no longer the case.

Anyway, the port is still without it's numerous problems. I guess I am here to try to list those. Can they be fixed? Hopefully, the problem is getting the amount of dedicated time to do this work.

One of the biggest problems has been sound. Adlib emulation takes a huge hit on the CPU, and that is using the older included emulation code. The newer code is even harder on the CPU cycles. Now, between SDL 1.2.9 and 1.2.11, there was a great increase in the speed of the sound handling, so Patrice made some extremely useful optimizations. But, I seem to hit up with sound race conditions (or maybe not) in some games, so, unfortunately, all officially released versions of ScummVM are using the older SDL.

Now, for instance, I can run Monkey Island 2 - LeChucks Revenge (DOS) with almost no issue using newer revisions of SDL. The game plays close to original speed if not at 100%. The 1.2.9 revision of SDL has some lags but is pretty good. Now, Indiana Jones and the Fate of Atlantis (DOS CD Talkie) runs just about full speed with new SDL, but will randomly crash anywhere from 5 to 30 minutes, while with SDL 1.2.9, stable, but some lag. I think a sound race condition is introduced because of the efficiency of the newer SDL in these talkie games, since ScummVM is producing both an Adlib music stream and a digital speech stream. This is one problem I have not been able to figure out at all, but I could be wrong in this thought. While GDB has been wonderful in some other troubleshooting, with this crash it is of little use because there is no code to look at to see where the crash occurred. But then, this theory could be wrong from another issue and approach I was taking to fix it....

ScummVM really wants threads to be able to use timers. As far as I know, timers are used in quite a few engines such as Sierra's AGI engine, the SKY engine and some of the more modem Scumm games, as well using any midi music driver. I have never been able to get threads to work with ScummVM (pth), and ScummVM does not like the included vbl timer Patrice did in SDL, and I believe Patrice thought that possibly the code segment was too large. Now, I was able to hack ScummVM, and this patch has never gone into the official source, but was given the OK with additional work, to fire the timers through screen updates. This works well and allows ST Midi music to work (out to an MT32 on my Falcon), along with AGI games (I completed Space Quest I) and some other titles. Although, I still get the wierd crash with Talkie games like Fate of Atlantis, even though one stream of sound is taken out of the picture. This sort of makes me question the whole idea of a possible race condition. GDB is still of no help here. Also, the timer hack works great with the newer revisions of SDL, but causes crashing with 1.2.9, the version I use for releases.

Another problem is memory usage. Memory usage is not a problem at all when used in MiNT, but seems to be a huge problem in TOS and MagiC. I have never been able to run a game in ScummVM in TOS, and do not have MagiC, while others have been able to do this. But they can only run smaller games, and not larger ones. While I have not spent too much time on this issue, I'm guessing there is a problem with how memory is used between ST Ram, and FastRAM. It seems MiNT does not care, while maybe TOS is dumping ScummVM into ST Ram. It has been a while since I messed with this, since I hate having to constantly reboot to test, but it is a problem that I need to get figured out. Besides flags, I tried messing around with redefining how the mallocs worked, which did not get me anywhere.......

Another current problem I have is that binaries compiled with -m68020-60 do not work. So, I have been back to building 68000 versions for a while.

Well, that lists the main deficiencies I know of. Improvements? Well, there is already a midi driver I added into the ScummVM tree that works on my Falcon with hacked timers. I have been toying around with trying to add a midi -> ym driver, although that still needs a lot of thought to figure out if this is really worthwhile. This is more of a way to reduce the load on the CPU. Also, as previously mentioned, trying to make use of the DSP is on my radar as well. I want to see if I can offload some Adlib functionality to it, and possibly MP3 decoding since using compressed sounds files currently is just too heavy of a CPU load.

Anyway, there you have it. The status of ScummVM. Even with the problems, it is still incredible it works on the platform, and I think the majority of the thanks go to Patrice Mandin for his SDL work. Maybe some of this long winded post should be added to the next readme. :)

Tuesday, May 18, 2010

Lets share some links....

Right off the presses

GMP / MPFR / MPC for 68020-60 target. Just extract this files into / on a native system. Built specifically to build a native version of GCC 4.5.0
GMP 4.3.2
MPFR 2.4.2
MPC 0.8.1

Here is some stuff I have built. Just the highlights. You can see everything @ http://www.radix.net/~atari/mint/

Native GCC 4.4.3 for the 68000. Works great.
http://www.radix.net/~atari/mint/new/gcc-4.4.3-1.m68kmint.rpm
http://www.radix.net/~atari/mint/new/gcc-c++-4.4.3-1.m68kmint.rpm

GCC 4.4.3 binaries only compiled for 68020-60. Seem to work fine. I have not done any testing to see if they work better than there 68000 counterparts. Just extract this archive over the existing install from /
http://www.radix.net/~atari/mint/new/gcc-4.4.3-020-binaries.tar.bz2

GCC 4.4.3 binaries only compiled for Coldfire. Totally untested! Just extract this archive over the existing install from /
http://www.radix.net/~atari/mint/new/gcc-4.4.3-v4e-binaries.tar.bz2

OpenSSL 0.9.8l with binaries built for 68000, but libraries built for 68000 / 68020-60 / Coldfire. Coldfire has not been tested. I am currently working on build OpenSSL 1.0.0.
http://www.radix.net/~atari/mint/new/openssl-0.9.8l-2.m68kmint.rpm
http://www.radix.net/~atari/mint/new/openssl-0.9.8l-2.src.rpm
http://www.radix.net/~atari/mint/new/openssl-devel-0.9.8l-2.m68kmint.rpm

Zlib 1.2.3 built just like the above OpenSSL, includes the libraries for all 3 targets.
http://www.radix.net/~atari/mint/new/zlib-1.2.3-1.m68kmint.rpm
http://www.radix.net/~atari/mint/new/zlib-1.2.3-1.src.rpm
http://www.radix.net/~atari/mint/new/zlib-devel-1.2.3-1.m68kmint.rpm

For the brave, http://www.radix.net/~atari/mint/new/ includes some binaries targeted for 68020-60 (Like OpenSSH) that are RPMs, and also has modified rpmrc files to support these. I don't support this, yet, as this is something that needs to be decided on as a group, basically the direction to head as far as how to support multiple targets.

Here is an older revision of LibGMP built for the 68000, and fully tested. Newer revisions for the 68000 have issues.
http://www.radix.net/~atari/mint/gmp-4.2.4-1.m68kmint.rpm
http://www.radix.net/~atari/mint/gmp-4.2.4-1.src.rpm

Lzip
http://www.radix.net/~atari/mint/lzip-1.5-1.m68kmint.rpm
http://www.radix.net/~atari/mint/lzip-1.5-1.src.rpm

Lzo
http://www.radix.net/~atari/mint/lzo-2.03-1.m68kmint.rpm
http://www.radix.net/~atari/mint/lzo-2.03-1.src.rpm

A working version of the MPC lib for 68000, compiled against the older revision of GMP
http://www.radix.net/~atari/mint/mpc-0.8.1-atari.tar.bz2

Subversion, which seems to work well, used heavily in ScummVM development. Many of the prereqs for building it are also present in the same directory.
http://www.radix.net/~atari/mint/subversion-1.5.6-1.m68kmint.rpm
http://www.radix.net/~atari/mint/subversion-1.5.6-1.src.rpm
An Atari blog. Never have really done the blog thing before, but since my work on all sorts of different packages for that Atari/FreeMiNT platform is so disjointed, I decided I needed a place to actually talk about what I am doing and hopefully provide links that might be helpful to someone out there. So, anyway, not too sure how often this will be updated.

At the moment, I am working on OpenSSL 1.0.0. So far, it only needed 1 additional patch besides the existing patches to add support for our platform. I was able to successfully build and fully test a version built for 68000 with GCC 4.4.3. Right now my Falcon is building a 68020-60 version to test. Unsure if this will get packaged as an RPM at this stage because the build keeps getting the dreaded malloc crash.

I'm hoping to start working on building GCC 4.5.0 natively. Have successfully built GMP, MPFR, and MPC for a 68020-60 target. Right now, the 68000 target is not doing too well with testing.

Other pending projects? Well, I just ordered the FireBee yesterday, hoping to get something going with my ColdFire development board soon too, but just have not invested the time in trying. I got a hold of a NEC USB PCI card to try to get keyboard and mouse going on it, besides already having Radeon 7000s on hand in expectation of the CTPCI showing up soon.

And my latest adventure is into the realm of learning to use the 56001 DSP in the Falcon. ScummVM needs a lot of help (It has tons of issues on the platform besides the horsepower it needs) so I am hoping that I can figure out a way to use the DSP to alleviate the load on the CPU. I have always been thinking about trying to make all of the adlib code run from it for adlib emulation. Another possibility is getting MP3 decoding working with ScummVM to have the ability to use compressed sound with the DSP's help. Again, this is an area where I need to find time to invest. Of course, ScummVM has other problems with timers, sound race conditions, and memory needs outside of mint.

Also always messing with other items here and there. Anyway, enough for now. Hopefully I'll get back on here and start posting links to some of my older packages sitting in my webspace with some short descriptions.....