Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Classic implementation of 'modern' tech  (Read 2407 times)

sentient06

  • 8 MB
  • **
  • Posts: 11
Classic implementation of 'modern' tech
« on: September 14, 2024, 11:37:54 AM »

Hello, I'm new to the forum, although I've been reading stuff from here for quite some time in silence. I just didn't have much to comment on.

But now, I'm considering a few projects to get my hands dirty developing for classic Mac OS, but there are a few hurdles.

For example, I need SHA-1 implementation, and ZLIB. I also need to use regular expressions, and to learn how to traverse directories, create, hide, show and delete files, which, I assume, are part of the toolbox.

I don't want to reinvent the wheel and go on a quest to develop a ZLIB library, which sounds overkill. I assume someone already did these things. Does anyone know about implementations of things like that, or where to find it, or which keywords could help me locating implementations like that on the web?

So, that's basically me surveying the options and trying to figure out how much of a learning curve and how much extra work I will have to deal with.

Thanks!
Logged

sentient06

  • 8 MB
  • **
  • Posts: 11
Re: Classic implementation of 'modern' tech
« Reply #1 on: December 02, 2024, 07:36:30 AM »

I don't see a lot on enthusiasm here, but I'm going to post some updates here anyway.

So I started reading a bunch of books for Macintosh programming and using CodeWarrior. One of the books was the 1996's PowerPC Programmer's Toolkit by Tom Thompson. But I couldn't find the corresponding CD-ROM that came with it and I was getting pretty annoyed with the whole typing, especially when it came to Resource icons in hexadecimals.

So, first, I got those gigantic cd catalogues available on the Macintosh Garden and found the source codes from the CD in a random server somewhere that happened to be in the catalogue.

Second, I was missing the multiple cursor feature from modern IDEs, so I took Retro68 for a spin. And lo! It is a very cool thing! I setup QEMU running Mac OS 9.2.2 and managed to get a bunch of scripts in place to automate my work. So now I can code on macOS 15, run a script on command line and have it compiled, packaged into a CD image and mounted on QEMU immediately.

Retro68 is said to have some hurdles (like not supporting font resources), but so far it's been much easier to use that than CodeWarrior. So I plan on developing the bulk of my project using Retro68 and leave the odd parts to CodeWarrior, if I need to do that at any point.

I've laid out the basics of my scripts on Emaculation, if anyone is interested. And I'm putting all the boilerplate madness that deals with the Toolbox in a project that compiles into a library. Feel free to use it. It's very small atm, it has 2 functions dealing with files: one just gives some information about a filepath and the other is an old implementation to get a "choose folder" kind of window, which is fittinly called `StandardGetFolder`. I'm amazed that this kind of selection was not built into the Toolbox by default! Anyway, it works, after a full week trying to figure out what the resources for that damn window looked like.

(Please, please, please, if you do code for classic Macintosh, and it's open-source, dump the resource code into the codebase! Especially because git destroys the resource fork, so committing a resource file to git is just pointless. For anyone who doesn't know how to do that, use DeRez on Macintosh Programmer's Workshop to do it. There's a command you run on MPW that yields the whole code for the resource. People didn't do that in the 80s, nor the 90s, and now to find these things online it's a massive pain in the backside when it's not dowright impossible. Rant over.)

My libs are here:

https://github.com/sentient06/MacintoshLibs

They are geared towards my own projects, so the "make install" command only makes sense in my own environment. Be sure to change to whatever your needs are.
Logged

Greystash

  • 256 MB
  • *****
  • Posts: 265
  • Tinkerer
    • Mac-Classic.com
Re: Classic implementation of 'modern' tech
« Reply #2 on: December 02, 2024, 08:01:31 PM »

Thanks for sharing, that's really helpful! I've been meaning to build a few projects in C/C++ so your examples are very much appreciated!
Logged

sentient06

  • 8 MB
  • **
  • Posts: 11
Re: Classic implementation of 'modern' tech
« Reply #3 on: December 04, 2024, 02:57:25 AM »

Thanks for sharing, that's really helpful! I've been meaning to build a few projects in C/C++ so your examples are very much appreciated!

Hey, no worries. I figured we need more developers. It's really cool to see modern tech making its way into Mac OS 9, so if we can keep some material available and well documented, it should naturally attract some people.

I've made a small tutorial for Retro68 as well:

https://mediocreprogramming.blogspot.com/2024/11/using-retro68-on-mac.html

It might have a few gaps, but the bulk of the drama is there.

I also created gists for all the scripts used on compilation, they were linked in the repo.

It's slow work, but it should accrue with time.  ;D
Logged

rvense

  • 128 MB
  • ****
  • Posts: 161
  • Lombard & son
Re: Classic implementation of 'modern' tech
« Reply #4 on: December 04, 2024, 03:47:41 AM »

Always cool to see new dev projects! I've used Codewarrior a bit. The developer experience is *incredibly* primitive, it's a miracle that any software was shipped at all if you ask me.
Logged

Knezzen

  • Staff Member
  • 1024 MB
  • ******
  • Posts: 1327
  • Pro Tools Addict!
    • Macintosh Garden
Re: Classic implementation of 'modern' tech
« Reply #5 on: December 04, 2024, 05:03:34 AM »

Always cool to see new dev projects! I've used Codewarrior a bit. The developer experience is *incredibly* primitive, it's a miracle that any software was shipped at all if you ask me.

CW is quite fiddly to use. It's easy to break current projects as well. It's always easier to deem stuff as horrible when looking back and I think it's the same thing regardless of whatever field you're in (music, video, graphics etc). The tools are always cruder when looking in the rear view mirror.

CodeWarrior is better than what came before it at least. It's evolution ;)
Logged
Pro Tools addict and staff member at Mac OS 9 Lives!, System 7 Today and Macintosh Garden.

sentient06

  • 8 MB
  • **
  • Posts: 11
Re: Classic implementation of 'modern' tech
« Reply #6 on: December 05, 2024, 07:19:25 AM »

Always cool to see new dev projects! I've used Codewarrior a bit. The developer experience is *incredibly* primitive, it's a miracle that any software was shipped at all if you ask me.

I mean.. it's a product of its time. It wasn't too bad. I guess developers today are a bit spoiled in terms of editors and IDEs as these evolved a lot in the past 20 years or so. And I don't mean it as an insult, I'm talking about myself here. I tried CodeWarrior but I got into the Retro68 because I really wanted a modern interface.

CW is quite fiddly to use. It's easy to break current projects as well. It's always easier to deem stuff as horrible when looking back and I think it's the same thing regardless of whatever field you're in (music, video, graphics etc). The tools are always cruder when looking in the rear view mirror.

CodeWarrior is better than what came before it at least. It's evolution ;)

Exactly! Also, remember it was the age of C++98 and C99. The fact C++ even made it into classic Mac OS is quite a lucky thing. Before C++98 it wasn't standardised, and ANSI-C as the chief C-family language. So I suppose the IDEs were evolving along with these languages.

CodeWarrior has that feature that takes us to the Toolbox and std libraries prototypes of the functions, which is pretty neat for its time. It was a good template for future IDEs, in my opinion.
Logged

laulandn

  • 16 MB
  • ***
  • Posts: 29
  • Mew Nember
Re: Classic implementation of 'modern' tech
« Reply #7 on: March 17, 2025, 07:50:05 PM »

Yes, anyone expecting a "modern" development IDE experience for MacOS9 is doomed to be sorely disappointed...hate to hear what they'd think of Think/Symantec...or MPW...

A buddy and I have been working on modernizing SDL for classic MacOS and made some great progress.  I've been looking for open source games using SDL 1.2, and creating mac ports of them...we've been primarily using CodeWarrior Pro 6, because I'm very interested in the m68k architecture.  (That's the last version that supports m68k).

But...some games use either (more) modern C/C++ language features, or "standard" functions (at least for Linux or Windows) that CodeWarrior doesn't include, at least the older versions.  I've had some luck with the very last versions of CodeWarrior for MacOS, but even then, there's a lot missing.  So have been looking more and more into using Retro68...

https://macintoshgarden.org/forum/the-platinum-builds-efforts-mac-os-ports

I'm currently looking into building SDL 1.2 using Retro68, but, as expected, that isn't possible "out of the box".  I'm going to try converting the .o files for our MPW build to the ELF format that Retro68 uses, but don't suspect that will work, since it will be expecting the MPW C lib (since SDL itself was built with it).  It also isn't possible to use the standard SDL command line build because GNU autoconf (of course) doesn't expect Retro68, and the Makefiles aren't set up for classic MacOS.

So, THAT will require not only getting the configure/Makefile working (or, if I find relevant CMakefiles, adapting them), but also dealing with getting SDL 1.2 building with gcc for classic MacOS, so quite a bit of work...we'll have to see how far I get.

Several of the games also require "SDL add ons", such as SDL_mixer, SDL_image, and SDL_ttf (which, in turn have dependencies on other libs like zlib, freetype, libpng, ogg vorbis, etc.)  I've ported all these to classic MacOS using CodeWarrior, but will be needing them for Retro68 soon too...so it sounds like at least some of our interests may converge...

Your scripts look pretty awesome, and I'm definitely going to give them a try!  I've been using Retro68 with MVM, Basilisk and SheepShaver...but qemu will be just as good, or even better, for ppc.
Logged

IIO

  • Staff Member
  • 4096 MB
  • *******
  • Posts: 4717
  • just a number
Re: Classic implementation of 'modern' tech
« Reply #8 on: March 22, 2025, 07:49:59 AM »

i believe it should technically be no problem to create your own GUI kits in codewarrior which use GL2 for example so that you can move stuff around with normalized coordinate values and transparency, i am just not sure about making custom windows and boxes.
Logged
insert arbitrary signature here
Pages: [1]   Go Up

Recent Topics