Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create SIOW app with mpw? #67

Open
petersieg opened this issue Oct 27, 2023 · 6 comments
Open

Create SIOW app with mpw? #67

petersieg opened this issue Oct 27, 2023 · 6 comments

Comments

@petersieg
Copy link

This is more a question.
In original mpw, one can generate a SIOW type program, that basically opens a text window with menue items and the code can use printf and scanf I/O. So simple console type programs/C source can be compiled like that within Mac OS9/mpw.

Can this same behavior archived in mpw as well and if yes, how can that be done?

Many thx,
Peter

@ksherlock
Copy link
Owner

If you want to build an SIOW application that should work. You need to link with {Libraries}/SIOW.o (listed before MacRuntime.o and rez {RIncludes}/SIOW.r

The building and Managing Programs in MPW Chapter 15 goes over it.

Bldg & Mng Progs in MPW 2ed.pdf

@petersieg
Copy link
Author

petersieg commented Oct 28, 2023

Hi. If have tried, but get errors:
Rez -rd SIOW.r -o bin/hello.68k -i ~/mpw/Interfaces/RIncludes -append
/Users/ich/mpw/Interfaces/RIncludes/SIOW.r:909: ### Rez - Can't find the declaration for the resource type 'hmnu' (0x686D6E75).
/Users/ich/mpw/Interfaces/RIncludes/SIOW.r:979: ### Rez - Can't find the declaration for the resource type 'hmnu' (0x686D6E75).
/Users/ich/mpw/Interfaces/RIncludes/SIOW.r:1029: ### Rez - Can't find the declaration for the resource type 'hmnu' (0x686D6E75).
/Users/ich/mpw/Interfaces/RIncludes/SIOW.r:1078: ### Rez - Can't find the declaration for the resource type 'hmnu' (0x686D6E75).
/Users/ich/mpw/Interfaces/RIncludes/SIOW.r:1097: ### Rez - Can't find the declaration for the resource type 'hmnu' (0x686D6E75).
/Users/ich/mpw/Interfaces/RIncludes/SIOW.r:1116: ### Rez - Can't find the declaration for the resource type 'hfdr' (0x68666472).
/Users/ich/mpw/Interfaces/RIncludes/SIOW.r: ### Rez - Since errors occurred, ...

Source and Makefile attached.
(A ppc app is created and can be started, but output goes into a file stdout)

Thx, Peter

test.zip

@ksherlock
Copy link
Owner

Don't use the modern rez, use the MPW version. mpw rez SIOW.r -o bin/hello.68k

@petersieg
Copy link
Author

Hmm. Still doesn't work. No IO Window and file stdout is created.
Test zip attached.

Thx, Peter
test.zip

@ksherlock
Copy link
Owner

It's probably a subtle library link order issue.

I was able to make the 68k version run (in basilisk), based off the SIOW example from an ETO CD.

For 68k, the rez -append flag needs to be first and the library order is

"{CLibraries}"StdCLib.o
"{Libraries}"SIOW.o
"{Libraries}"IntEnv.o
"{Libraries}"MacRuntime.o
"{Libraries}"Interface.o

With those changes it executes correctly. For PPC, they list the library order as:

"{PPCLibraries}"PPCSIOW.o
"{PPCLibraries}"PPCCRuntime.o
"{SharedLibraries}"InterfaceLib
"{SharedLibraries}"StdCLib

SIOWExamples.zip

@petersieg
Copy link
Author

Hi.

I tried your suggestions. hello.68k now opens a "SIOW" window, but no printout visible?
hello.ppc still writes to file stdout and does not open any window.
??
The file hello.make is the one from real mpw running in os9. There all works as expected.
(Window opened an print hello world in it)

Thx, Peter
test.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants