| Click here to select a new forum. |
| Getting started with application development for System 6/7 |
Posted by: petteri on 2020-07-26 04:45:15 I have a little coding challenge in my mind. The requirements are that it should have some input and output for the text - could be proper UI components or just plain terminal like text screen. I should also read some data from resource fork (text for example) and its target environment should be System 6 or 7.
I have some programming experience and now I'm looking for a toolchain to get this done. I have SE/30, IIcx/ci and Beige G3 available in addition of new laptop running Catalina OS X. Any recommendations for the tools? Also some simple skeleton application would be pretty helpful.
|
Posted by: cheesestraws on 2020-07-26 05:13:50 Depends, to an extent, whether you want to develop on your modern machine and cross-compile, or use an IDE on your old macs (or on an emulator, which is what I tend to do).
In the first case, you could try Retro68, at https://github.com/autc04/Retro68 This is a gcc-based toolchain for building 68k classic Mac applications. I've not tried this myself yet, but I hear other people speaking highly of it. Per the readme: "Why? Because there is no decent C++17 Compiler targeting Apple's System 6."
In the second case, I personally use CodeWarrior or THINK Pascal, depending on whether I'm writing C or Pascal primarily. I'm actually quite fond of classic Mac IDEs, but this may be an eccentricity.
It is worth noting in your case that most development tools come with a kind of pseudo-terminal for basic standard text I/O.
|
Posted by: Crutch on 2020-07-26 05:49:43 Yeah, personal preference but I would do that in THINK C on the SE/30. Why? Because if you’re going to go retro, actually go really retro! And THINK C is great and simple and quick. CodeWarrior is excellent for PPC code generation but is a bit more cumbersome to use and works better on a newer machine (though is perfectly fine on my SE/30 with a 50MHz accelerator). THINK Pascal is a beautiful product built on the fantastically amazing Mac Pascal GUI, but Pascal is too annoying to use for me these days, even though I grew up on it.
If you want to build a text interface, you don’t really need a sample app or to worry about doing all that crazy Mac initialization, event loop, WaitNextEvent, FindWindow stuff. Just #include <studio.h> and printf(...) til you’re blue in the face. It will Just Work. And you can still call GetResource() or whatever you need to access a resource file.
(And if you do like Pascal, @cheesestraws is right as usual, you can use THINK Pascal’s built-in terminal functions too. WriteLn(...) etc.)
If you do want to build a Mac-like app, on the other hand, THINK C comes with a nice demo (Bullseye.c) to get you started, which implements a couple menus and a standard Mac window. And several of us here can help if you have questions.
Have fun! What’s your coding challenge?
|
Posted by: cheesestraws on 2020-07-26 05:58:56
Yeah, personal preference but I would do that in THINK C on the SE/30 Yeah, THINK C is another good option. I don't use it myself, because I find it annoying, but that's personal taste rather than any reflection on the quality of the software itself.
|
Posted by: Andy on 2020-07-26 11:08:54 I've been teaching myself Mac programming on a Classic II and in Mini vMac for the past few months and having a blast with it. Both THINK C and THINK Pascal are great and pretty easy to use. THINK Pascal's built in text and graphics windows make for very easy experimenting with QuickDraw and the like without having to learn how to initialize the toolbox and create windows. But it's also easy to turn your experiments into real applications once you start getting the hang of things
For tutorials and reference, there's a great collection of scanned books at https://vintageapple.org/macprogramming/ . I'd recommend Macintosh C Programming Primer 1992 or Macintosh Pascal Programming Primer. There's also a great overview with examples of Pascal here https://wiki.xxiivv.com/site/pascal.html and the author has a lot more examples here https://git.sr.ht/~rabbits/macintosh_cookbook/tree/master/examples
One thing to note is that the syntax for Think C 5.0 changed to be closer to more modern C. The 1992 book is good, but code from older books will need to be adjusted. Have fun!
|
Posted by: Dog Cow on 2020-07-26 11:12:29
I have some programming experience and now I'm looking for a toolchain to get this done. Which languages do you know? Which one are you most experienced with?
|
Posted by: rplacd on 2020-07-26 12:28:26
[SIZE=1.4rem]In the second case, I personally use CodeWarrior or THINK Pascal, depending on whether I'm writing C or Pascal primarily. I'm actually quite fond of classic Mac IDEs, but this may be an eccentricity. [/SIZE] I'm also a fan of classic IDEs as well – because they bundle frameworks (like PowerPlant etc.) that make writing apps considerably more simpler. Plain Toolbox C/Pascal gets unwieldy for a modern programmer pretty quickly.
|
Posted by: ZaneKaminski on 2020-07-26 12:33:04 For the record, CodeWarrior 6 works quite well on my unaccelerated SE/30, and I recently used it to develop the control panel for my ROM disk. My impression is that CodeWarrior is basically a THINK C clone but the compiler is a bit more modern. Only issue was that I had to hook up a SCSI CD-ROM drive (which I do not normally use) to install CW6 from a burned CD. THINK C is smaller and will be easier to install if you are using a Floppy Emu or similar, although the CodeWarrior 6 CD includes something like 30 1.44MB floppy images to install the software from floppy disk.
|
Posted by: Crutch on 2020-07-26 12:41:37 Does CodeWarrior allow embedded asm{...} blocks in C? My recollection was that it doesn’t, which was another reason I have preferred THINK C except when trying to generate PPC code, but I could be wrong.
|
Posted by: ZaneKaminski on 2020-07-26 13:13:09
Does CodeWarrior allow embedded asm{...} blocks in C? Yes, I believe so, but you have to break it up into its own function like so:
asm void foo() { ... }
|
Posted by: petteri on 2020-07-26 14:48:14
Which languages do you know? Which one are you most experienced with? Java, Scala, Python, JavaScript mostly but also some C, Go and whatever required. Done programming for money last 16 years.
Have fun! What’s your coding challenge? Building a CTF challenge for a hacking event actually. The idea is to hand over a disk image and see how people proceed with that one. There will be a hidden flag somewhere. Might require some disassembler or not, haven't decided that yet. And I should not write the walk through here, those guys are pretty darn good with OSINT.
|
Posted by: cheesestraws on 2020-07-26 19:32:50
Yes, I believe so, but you have to break it up into its own function like so: IIRC you can get it not to emit prologues/epilogues for those, though, so you can use them for things like custom headers on code resources, which is quite handy.
We are getting a bit over-the-top for the OP's actual request, though 🙂
|
Posted by: Mu0n on 2020-07-26 20:52:06 Another vote for THINK C. If you get that, make sure you get the searchable database for standard Mac functions, an absolute time saver (I think it's just called THINK Reference), as well as Popfunc, so you can add a leftmost corner pop-up menu to your window editing a source file, allowing you to go directly to any function from a pull-down menu, if you're a barbarian like me and write too many functions in an individual source file sometimes (I'm trying to break the habit)
If you do target System 6 and less, check out some code examples I did here:
https://mu0n.github.io/ForayInto68k/index.html
|
Posted by: cheesestraws on 2020-07-26 21:11:50
If you do target System 6 and less, check out some code examples I did here: Oooh, these look nice.
it's just called THINK Reference Yeah, THINK Reference is really handy if you are developing on vintage hardware.
|
Posted by: petteri on 2020-07-27 02:44:13 After some reading I decided to go with Think Pascal on Beige G3 route. I did a tiny bit Pascal in school (mid 1990s I think) but that was for MS DOS environment. I just hope it will work on OS 9.2 without troubles.
|
Posted by: cheesestraws on 2020-07-27 18:09:49
Think Pascal THINK Pascal has one of the best debuggers I have ever used. Its editor, not so much. But its debugger—I wish I had something as good as that for the modern tools I use at work.
|
Posted by: petteri on 2020-07-27 23:06:27 I am reading through Macintosh Pascal Programming Primer and Inside Macintosh: Imaging With QuickDraw now. I think I have some kind of idea how to put my challenge together. Too bad I cannot share it here before the event in 2021 February is over 🙂
|
Posted by: cheesestraws on 2020-07-27 23:24:27 I am not brilliant at this, but if you want any input or would like to discuss in private where Google cannot see, you are very welcome to DM me
|
Posted by: Crutch on 2020-07-27 23:39:58 likewise.
|
| 1 > |