Welcome, Guest | Home | Search | Login | Register
Author SDL 1.2.x for M68k attempt... (Read 118263 times)
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #105 on: March 18, 2025, 04:13

Got Super Mario War working on Linux...had to find the data files for the old 1.8 version I'm building, but, once I had them in the right place, no problems!

Was able to build Breaker and SDL Scavenger for m68k Amiga using the toolchain and SDL 1.2 from the amiga Devilutionx build, by pulling them out of the Docker container.  Are running them in FS-UAE on my Linux box, but will try on my PiStorm accelerated amiga hardware soon.  It is supposed to be equivalent to a 100 mhz 68030, so should run them well.   Won't be able to even try on my other machines because amiga SDL requires a graphics card.

Wasn't able to build Abbaye des Morts, because it requires SDL_image, SDL_mixer, and SDL_ttf.  Not sure if there are amiga m68k binaries of these available, or, if they are, if they'd be compatible with the SDL 1.2 I'm using.  If I were to REALLY get into amiga coding at this point, I'd be thinking about creating ports for them, if I can't find someone else hasn't already done so...but that's not something I relish...doing the classic Mac ports was a LOT of work!

----

But all this dabbling with strange other worlds has yielded benefits for our beloved platform...I've found bugs in the game code, and have tightened and cleaned up their source code.

The next frontier is getting a version of SDL 1.2 that works with Retro68...I can compile Mac versions of several of the games, but not link them, as there is no libSDL.a...  It can't use the CodeWarrior .lib files, but I might be able to convert either the shared lib, or the MPW .o/.lib...so looking into that...

If I can't convert one of our existing builds, I'd be looking at trying to build SDL using Retro68...which would not be easy, and may require a LOT of work...

Remember, despite the name, Retro68 supports ppc and carbon too!

----

Alternately, I can keep trying to build the "stalled" games like Super Mario War, and FreeDroidClassic, using CodeWarrior Dev Studio 9 or 10.  Both those support the needed "language features", and I've had good luck compiling...but not linking...as even those versions of CodeWarrior are missing many "standard" functions that I'd need to work around...so I feel like Retro68 might be more promising...  At the same time, these functions (things like getopt(), or decent directory functions) may ALSO be missing from IT...

Last Edit: March 18, 2025, 04:26 by lauland
Jatoba
256 MB
*****
Posts: 270
System 9 Newcomer!
View Profile
Reply #106 on: March 18, 2025, 08:59

All of that is (as always) very exciting to hear about, @lauland. I'm really looking forward to seeing those games, now with a more polished and robust codebase, coming "back to the Mac"! In particular excited about the findings regarding Super Mario War... With some custom levels (that the player can make and share), and someone else to play with, it's an incredibly fun game, and a GREAT addition to the Mac if it ends up working!

On my part, I still mean to apply all those fixes and upgrades to SDL 1.2 that you shared with me on Hotline, and to the world here in the threads. I'm hoping to make some time for it later this week...

Lately, I got too caught up in various real-life stuff to deal with, and to straighten out, and honestly there are more of these underway. But I think I can manage to assign some time for Mac-y things again soon, at least here and there. So I apologize for the tardiness regarding all that.

As always, I am excitedly looking forward to more!
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #107 on: March 20, 2025, 04:12

Some amazing progress with SDL and Reto68! 

I thought I could use ConvertObj command it comes with (which is used to convert the objects and libs from the Universal Headers from MPW to a format it can use) to convert the .obj (actually ".x") files from our MPW SDL build, but it didn't understand the format.  I'm not really sure why...but because I expected, even if it did work, I'd run into problems with it needing the MPW C lib also, I decided to instead try building SDL itself with Retro68.

Instead of trying to get the Linux style GNU autoconfig/Makefiles to work, which are used for MacOS X, I took the MPW makefile and "translated" it to a standard GNU Makefile.  This wasn't simple, but ended up being a lot easier than I expected.  Luckily I know Makefiles pretty well.

Once I'd done that, I was actually able to build SDL, both for powerpc AND for m68k.  I was borderline shocked it worked...but it only needed a very minor fix due to the use of "\p" for Pascal strings.

With that done, I was able to compile the SDL Scavenger game, completely with Retro68...it builds executables, but NOT Mac Applications, ie the wrong binary format.  I'm still having problems LINKING, amusingly ones that are extremely similar to the kinds of problems I'd seen with CodeWarrior...ie which libs to include for powerpc, and for the m68k...you guessed it...the dummy joystick and audio!  (See my other posts about Retro68 for getting it to produce actual "Applications").

So I think I'm getting pretty close...
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #108 on: March 24, 2025, 03:37

So, as mentioned in my Retro68 thread, I got it working and fully building m68k apps...so I was able to build SDL Scavenger that way...

But, the result doesn't "work".  It sets up a blank menu bar, and then "sticks".  It doesn't crash, and I can switch away to the Finder, but I also can't quit it.

I'm 90% sure this is due to the Reto68 m68k port of SDL that I was able to build (but have no idea if it works).  This isn't entirely a surprise, as it was hard enough getting it working with CodeWarrior for m68k!

Not sure what is going wrong, I'm running it in Basilisk where I can't use MacsBug, so can't tell where it is hanging.  It is probably getting stuck VERY close to the start, inside SDL Main.  The first thing SDL does is attempt to redirect stdout and stderr to files.  I'm thinking I need to link with Retro68's console lib because otherwise the standard C handles (maybe) don't exist.

Once I've figured out how to correctly build powerpc apps with Retro68, I'll try SDL Scavenger that way.  If the problem is what I think, in SDL Main, then it'll stick in the same place...but if the problem is with SDL itself, then it is possible it'll work.

----

Since I have also been building the SDL games for Amiga, I took a look in Aminet (which is roughly similar to Macintosh Garden, although much less user friendly) for other SDL apps and games that could potentially be ported to Classic MacOS, and found a whole bunch!

One is a recreation of "Rick Dangerous", which is a quite fun platform game:
https://github.com/fabiensanglard/xrick

It'd be interesting to try building this in CodeWarrior...I haven't tried yet, so don't know if we'd run into "language" issues using CodeWarrior 6 or not.  I can see it requires zlib, which luckily I already have a MacOS port because it was needed for SDL_image and SDL_ttf.  It is "built in" to those two libs, but I can easily break it out as a separate project, if needed.  If "Rick" used either of these, it'd automatically get it linked in, but it doesn't, so I'd break it out as a separate .lib.

There's also a "Mah Jongg" clone called Lopan, that would be an easy port, but I don't think I'll bother since there are TONS of Mah Jongg games for Mac already...so not much point!

I also found "SDLZombies" which is a strange game where you're a penguin and there are zombie penguins, on a huge playfield with an overhead "radar" showing everything.  I'm not even sure how to play it, but it is also something we might port.

There were a bunch of other games and "demos" (which show off particle or 3d effects) that we could also potentially port.  I just downloaded pretty much everything that used SDL, haven't even unarc'd them to see what they all are.

----

So I've been doing a lot work with Retro68, but at some point want to get back to the "stalled" game ports, like Super Mario War and FreeDroidClassic, both which are very fun games.  Using CW DS 9 or 10, allows them to compile, but there are still problems with missing functions, which I may or may not be able to work around.  This is probably worth the effort, because many of those same functions may also be missing (or not fully functional) in Retro68...or not?  A lot of these  are standard on Linux, but not Mac, in general, so it is likely Retro68 won't have decent versions of them too.
Last Edit: March 24, 2025, 03:40 by lauland
lauland
512 MB
*****
Posts: 674
Symtes 7 Mewconer!
View Profile
Reply #109 on: March 29, 2025, 04:24

So, as I mentioned in my other thread, I figured out how to build powerpc apps using Retro68 with Makefiles (as opposed to CMake).  With that solved, I was able to start building several of my SDL game ports successfully.

I used "#ifdef __MWERKS__" for the fixes/changes needed to build these on classic Mac...which obviously is not defined with Retro68, so I'm changing these to something like "#ifdef MACINTOSH"...

Much to my chagrin, the problem in SDL, happening VERY early in startup, was in SDL Main as I'd guessed...but in the code I'd added to support AppleEvents.  This was added so you could drop disk image icons on our color version of the MvM app.  Needless to say, I included a way to disable my code, and will disable it by default in the next "release" we do of SDL.  I'm not sure why it hangs with Retro68, and not CodeWarrior or MPW, but one of the first thing it does is wait for an OpenAppl event, which, for whatever reason, isn't happening with the Retro68 runtime.  (Retro68 is able to build System 6 apps, so its runtime is likely more primitive than the other compilers, and may not send this initial event by default).

So there will be two new Makefiles to build SDL using Retro68, for each processor.  (They are actually radically modified versions of the MPW one).  I'll be including support to build the games using Retro68 in the next releases I do of them also.  (And for building on Amiga and modern Linux, since I did that too).

----

@Jatoba, since it looks like you haven't had time to do a release on MG of our SDL including the fixes you found, I might as well do so, to include the new Makefiles I mentioned above, as well.  (And the teeny tiny fixes needed for Retro68 in the SDL code itself).  I'll update the "add ons" with my latest versions too.  (FYI I haven't tried building any with Retro68, but it only seems logical to try that at some point, as several of the games need them).
Last Edit: March 29, 2025, 04:26 by lauland
Jatoba
256 MB
*****
Posts: 270
System 9 Newcomer!
View Profile
Reply #110 on: March 29, 2025, 10:01

@lauland Yes, that's perfectly fine by me. Again, sorry I couldn't stick around for the most part lately.

Things are slowly finally settling down now for me, so at least I should be able to drop by on Hotline periodically again, starting today or tomorrow. We can perhaps touch base soon!
Pages: 1 ... 6 7 [8]

© 2021 System7Today.com.
The Apple Logo, Macintosh™, Mac OS™, and others property of Apple Computer, Inc.
This site is in no way affiliated with Apple Computer, Inc.