Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Programming the GS

392 views
Skip to first unread message

Drew

unread,
Sep 6, 2009, 4:53:28 AM9/6/09
to
Hi,

I was hoping to get some advice. I have always just been a user of the
GS, but am now thinking that i might want to start doing some
programming on it (I have very little experience apart form some basic
stuff i did years ago) and wondered what's the best language to start
with (Gsoft? Complete Pascal?) was? As well as any must have books or
websites (have seen the VirtualGS site) to help get me started?

Thanks :)
Drew

limtc

unread,
Sep 6, 2009, 6:10:38 AM9/6/09
to
One of the possible resource:

http://virtualgs.larwe.com

I used it to teach my son Apple IIGS programming.

Drew

unread,
Sep 6, 2009, 7:40:39 AM9/6/09
to

Hi,

I was checking your site earlier today :). I am tempted to buy the
GSOFT Basic kit from Syndicomm so i have all the manuals etc, at $30
for download seems a good starting point. I can then move on to Pascal
afterwards.

Drew

Polymorph

unread,
Sep 7, 2009, 7:22:30 AM9/7/09
to

My message was originally posted through the A2Central news server,
but never made it here, so I've copied my original reply:

Funnily enough, your question almost sounds like a lead-in to my
presentation at Mt. Keira Fest (Oz KFest).

My presentation is here for all to read:
http://www.slideshare.net/Polymorph/apple-iigs-programming-k-fest

My recommendation for newcomers to IIgs programming is Complete Pascal
due to it having a large number of features and an uncomplicated
development environment.

If you wish to take my advice and start with Complete Pascal, I
suggest you:
1) grab a copy of CP from my site here: http://apple2.sytes.net/TML_Pascal/index.html
2) while you are at my site, grab the TML Pascal Reference manual too
(TML Pascal became Complete Pascal).
3) while still at my site (!), grab some of my previous projects as
they come with source code to give you some ideas on how things fit
together
4) visit Thye Cheans virtual IIgs which has loads of source code
demo's for you to paruse. From your original post, you've already seen
this, so thats a good start.
5) If your Pascal is rusty, there are a number of Pascal tutorial
style sites on the net that you can use to get rid of the rust. One
such site can be found here: http://www.taoyue.com/tutorials/pascal/contents.html
6) Get yourself copies of the 3 Toolbox references, and the GS/OS
reference (Syndicomm sells these still).
7) Check out things like Marinetti (TCP/IP stack) which now supports
Complete Pascal (I submitted the interface files for it). GTE will
also be supported once the user toolset work is completed. I have also
written libraries for joystick use, and code for using MidiSynth
music. These libraries may give you an idea for a new project...
8) Have fun, and don't forget that there are people on these forums
(me included!) who will gladly offer you assistance if you get stuck
or have questions.

Hope this helps!

Cheers,
Mike

--

Mike Stephens
Central Coast, Australia

Find my Apple II projects online at:
http://apple2.sytes.net/

Drew

unread,
Sep 7, 2009, 10:01:02 AM9/7/09
to

Excellent thanks Mike :). I have downloaded the Complete pascal and
have also ordered Gsoft Basic to have a play with that. I did some
pascal at Uni, but very very very rusty lol. Looks like I will be
playing with Pascal tonight :-). I have also ordered the Toolbox
reference books from Amazon as there seems to be still some original
(used) copies around....and got carried away and order a few other
books that were available for GS as well :-)

Drew

Oracle

unread,
Sep 22, 2009, 5:52:09 AM9/22/09
to
On 7 Set, 13:22, Polymorph <polymorp...@hotmail.com> wrote:
>
> If you wish to take my advice and start with CompletePascal, I
> suggest you:

Hi Mike,
there is an alternative resource editor (I've many trouble with the
Complete Pascal one's)?

Do you know where I can find a TML Source Library II?

Thank you.

Mauro

Polymorph

unread,
Sep 22, 2009, 6:47:47 PM9/22/09
to

Hi Mauro,

There are alternatives. I too have found bugs in CP's resource editor.

Some things to try:
1) Funnily enough, I have found some of the "broken" parts of CP's
resource editor work fine in the earlier TML Pascal II. I guess some
bugs were introduced into CP (as well as some being fixed). You can
get the older TML Pascal II disks from my web site here -
http://apple2.sytes.net/TML_Pascal/index.html
2) Foundation resource editor - http://www.whatisthe2gs.apple2.org.za/foundation-v1-02.html
3) Genesys resource editor - http://www.whatisthe2gs.apple2.org.za/genesys
4) Design Master resource editor - http://www.whatisthe2gs.apple2.org.za/design-master-v2-0
(Commercial)
5) Rez resource editor (Commercial?)

Unfortunately, I have no experience using either Foundation or
Genesys, and very little experience using Design Master. I generally
use Rez these days (it came with the Opus ][ distro). I believe that
all of these resource editors (apart from Rez which is text based) are
either incomplete or buggy for various reasons - Design Master and
Genesys were developed prior to System 6 being released I believe, and
Foundation was never fully completed to cover all resource types.

So, if you can get by with TML Pascal's resource editor you're
probably going to find it easiest, as you are already familiar with
how it *should* work.

Sadly resource editing is one area of IIgs development that never
really got the "all-singing-all-dancing, bells-and-whistles"
application. :-(

Good luck, and let us know how you get on.

Cheers,
Mike

Polymorph

unread,
Sep 22, 2009, 6:49:55 PM9/22/09
to
On Sep 23, 8:47 am, Polymorph <polymorp...@hotmail.com> wrote:
> On Sep 22, 7:52 pm, Oracle <oraclemas...@inwind.it> wrote:
>
>
>
>
>
> > On 7 Set, 13:22, Polymorph <polymorp...@hotmail.com> wrote:
>
> > > If you wish to take my advice and start with CompletePascal, I
> > > suggest you:
>
> > Hi Mike,
> > there is an alternative resource editor (I've many trouble with the
> > Complete Pascal one's)?
>
> > Do you know where I can find a TML Source Library II?
>
> > Thank you.
>
> > Mauro

As for the TML Source Library II, I have never found it and I would
also like to get my hands on a copy if anyone has it?

Cheers,
Mike

Jeff Blakeney

unread,
Sep 23, 2009, 1:14:32 PM9/23/09
to Polymorph
To: Polymorph

Polymorph wrote:
> There are alternatives. I too have found bugs in CP's resource editor.
>
> Some things to try:
> 1) Funnily enough, I have found some of the "broken" parts of CP's
> resource editor work fine in the earlier TML Pascal II. I guess some
> bugs were introduced into CP (as well as some being fixed). You can
> get the older TML Pascal II disks from my web site here -
> http://apple2.sytes.net/TML_Pascal/index.html
> 2) Foundation resource editor - http://www.whatisthe2gs.apple2.org.za/foundation-v1-02.html
> 3) Genesys resource editor - http://www.whatisthe2gs.apple2.org.za/genesys
> 4) Design Master resource editor - http://www.whatisthe2gs.apple2.org.za/design-master-v2-0
> (Commercial)
> 5) Rez resource editor (Commercial?)
>
> Unfortunately, I have no experience using either Foundation or
> Genesys, and very little experience using Design Master. I generally
> use Rez these days (it came with the Opus ][ distro). I believe that
> all of these resource editors (apart from Rez which is text based) are
> either incomplete or buggy for various reasons - Design Master and
> Genesys were developed prior to System 6 being released I believe, and
> Foundation was never fully completed to cover all resource types.
>
> So, if you can get by with TML Pascal's resource editor you're
> probably going to find it easiest, as you are already familiar with
> how it *should* work.

Never used Pascal on my IIgs so I can't comment on the Complete Pascal
or TML Pascal II resource editors.

Foundation was a great idea but never really got anywhere. They did it
so that each resource type could have its own editor written as a plug
in but the extra plug ins were never written so it is pretty basic at
present. This was a freeware or open source type project if I remember
correctly.

I always liked Genesys. It may not have everything but it has most of
the common things that you need. It can save the data into the resource
fork of a file. This is what I usually did and then used the Orca
shell's COPY command to copy just the resource fork to my compiled
executable file before testing it. This was usually done using a batch
file called Make to run MacGen (I write in Orca/M usually), compile and
copy the resource fork. Another nice thing about Genesys is that it can
also export the resource data to source code format so you can have it
output a Rez file which you can then edit and/or add newer resource
types that Genesys doesn't support directly and compile that file to get
your resource file. By the way, this was a commercial product and I
don't thing it has been properly reclassified yet.

Design Master I've only started up once or twice since getting Opus ][
but it is pretty limited too. This was a separate commercial product
from the ByteWorks.

I don't think I've ever used Rez directly. I certainly haven't typed
any Rez source code. When dealing with visual elements I prefer to deal
with them visually. This is also a commercial product but is included
with pretty much any Orca product.

> Sadly resource editing is one area of IIgs development that never
> really got the "all-singing-all-dancing, bells-and-whistles"
> application. :-(

Too true.

Renaud Malaval

unread,
Jul 7, 2022, 6:22:10 AM7/7/22
to
Thank you very much, Jeff.
35 years after, this is not simple !

I used Orca/M at this times. Now, I'm fan off the cross development. I buyer "Golden Gate" and Opus ][.
I'm using gsplus.exe, on my PC windows 10 (Orca/C, Orca/M, Orca/rez).

This is there my little ;) problem. How to build a simple text .rez file ?

I didn't found how to use Rez resource editor (under GoldenGate or Orca shell in simulator).

Could you help me, please ?

Best regard

fadden

unread,
Jul 7, 2022, 11:03:51 AM7/7/22
to
On Thursday, July 7, 2022 at 3:22:10 AM UTC-7, Renaud Malaval wrote:
> This is there my little ;) problem. How to build a simple text .rez file ?
>
> I didn't found how to use Rez resource editor (under GoldenGate or Orca shell in simulator).

The easiest way to get a sample Rez file is to use "DeRez" on something. Also, the Opus ][ CD-ROM has many examples (files ending in ".rez"). They're just text files (vaguely similar to JSON).

To understand the contents, see Appendix E ("Resource Types") and chapter 45 ("Resource Manager") in _Apple IIgs Toolbox Reference, Volume 3_.

IIRC, once upon a time I used Genesys to create the files, and would tweak them by hand if something wasn't supported by the editor.

Speccie

unread,
Jul 8, 2022, 2:19:01 AM7/8/22
to
Renaud,

> IIRC, once upon a time I used Genesys to create the files, and would tweak them by hand if something wasn't supported by the editor.

As Fadden says, if you have Genesys on your system, ask it to disassemble a resource fork, and you will see how a res text file is constructed.

My BrkDown app can also dissemble resource forks into res text files in the same way:

https://speccie.uk/software/brkdown/

You then use any text editor you like on your host machine to edit the text files, and transfer them over to the GS for assembly. If your host machine can be set as an FTP server, then in addition to other methods of doing it, you can use my SAFE2 FTP app to bring the files into the IIgs.

I use BBEdit on the Mac to write my source res files, then transfer them over with SAFE2 for ORCA/M to do its thing:

https://speccie.uk/software/safe2/

Cheers - Ewen

Renaud Malaval

unread,
Jul 8, 2022, 11:49:41 AM7/8/22
to
Hello and Thank Fadden, Speccie,

My problem was by the bad sub file type of my main.rez file LOL !

well my commands:
iix compile main.rez keep=main.rfork

Finish without error but main.rfork have size of 0 byte ...


note:
Genesys crash with system 6.04 but perfect in 6.01

Renaud Malaval

unread,
Jul 8, 2022, 12:23:35 PM7/8/22
to
LOL !

in fact, the generated file is a resource file, I could generate it on orca on GSPlus simulator.

my software is not in desktop mode...
I declare in my main.rez file 2 resources rVersion and rToolStartup.

resource rToolStartup (1)
{
$C000, /* set master SCB to mode320 + fFastPortAware + fUseShadowing */
{
4, $0307, /* Quick Draw II */
6, $0301, /* Event Manager */
8, $0303, /* Sound Manager */
11, $0300, /* Integer Math Toolset */
30, $0100, /* Resource Manager */
100, $0000 /* myTool Toolset */
}
};

but new problem is in my C code source :

long gStartStopAddr;
Word gStartStopRez = refIsResource;
long gStartStopID = TOOL_STARTUP;

TLStartUp(); /* Tool Locator */
pContext->iMasterID = MMStartUp(); /* Memory Manager */
MTStartUp(); /* Miscellaneous Tool */

(long )gStartStopAddr = StartUpTools( (Word)pContext->iMasterID, gStartStopRez, (long )gStartStopID);

at compilation times, I got an error, I didn't understood why ???????

Compiling MyStartTools
635 (long )gStartStopAddr = StartUpTools( (Word)pContext->iMasterID, gStartStopRez,
(long )gStartStopID);
^ l-value required
Compiling MyStopTools
Compiling main

Any idea, svp ?

Steven Hirsch

unread,
Jul 8, 2022, 1:50:45 PM7/8/22
to
On 7/8/22 12:23, Renaud Malaval wrote:

> at compilation times, I got an error, I didn't understood why ???????
>
> Compiling MyStartTools
> 635 (long )gStartStopAddr = StartUpTools( (Word)pContext->iMasterID, gStartStopRez,
> (long )gStartStopID);
> ^ l-value required
> Compiling MyStopTools
> Compiling main

I've never programmed the GS using C, but try casting the right-hand
expression to the declared type of 'gStartStopAddr', e.g.


gStartStopAddr = (long) StartUpTools( (Word)pContext->iMasterID,gStartStopRez,
(long)gStartStopID);

I'm not sure that casting the destination is valid syntax.

Speccie

unread,
Jul 9, 2022, 2:42:41 AM7/9/22
to
Renaud,

> Genesys crash with system 6.04 but perfect in 6.01

Make sure you are using the latest version of Genesys. It was updated last year by Antoine Vignau:

https://github.com/antoinevignau/source/tree/main/genesys/disks

Cheers - Speccie

Renaud Malaval

unread,
Jul 9, 2022, 3:02:37 AM7/9/22
to
Hello and Thank very much Steven, Speccie, all

It working now :)

ok, I will get this new release of Genesys.

Do you know, if coding rules exist ?
ie:
is it a good idea tu use malloc / calloc or is it better to use handle every where ?

Have Fun !!!

Speccie

unread,
Jul 10, 2022, 2:38:10 AM7/10/22
to
Renaud,

> is it a good idea tu use malloc / calloc or is it better to use handle every where ?

I don’t know, as I do not code in C myself. I use the more efficient ORCA/M 65816 assembly language.

Resource files are written in their own res language, so are the same in all the languages.

Cheers - Speccie

fadden

unread,
Jul 10, 2022, 10:55:03 AM7/10/22
to
On Saturday, July 9, 2022 at 12:02:37 AM UTC-7, Renaud Malaval wrote:
> is it a good idea tu use malloc / calloc or is it better to use handle every where ?

General rule: malloc allocates from a heap that is managed by the application. Requesting a handle from the operating system requires making an OS call, which tend to be more expensive. If you just want a few hundred bytes for storage, use malloc; if you need an entire 64KB bank, call the OS.

I don't know what the malloc library actually looks like, so this may be terrible advice. :-)

Renaud Malaval

unread,
Jul 11, 2022, 2:02:19 AM7/11/22
to
Hi,

My soft advance very well :)

But now I got an error in the GSplus Emulator with 8Mo of RAM and GS/OS 6.04 without RAM disk :

"
Finder requires System 6.0.1 or later at least 300K of free memory. ($0401)

You can increase free memory by decreasing your Control
Panel's RAM Disk size, and also by restarting the
Shift key held down to bypass loading inits and desk
accessories.
"

Do you know this error ? Any idea to fix it, please ?

Renaud Malaval

unread,
Jul 11, 2022, 8:05:00 AM7/11/22
to
Hi, I have found the solution, bad code source ;)

Renaud Malaval

unread,
Jul 14, 2022, 10:31:48 AM7/14/22
to
Hello Masters,

My little program is in C with OrcaC and OrcaM.
But I use csubroutine() and creturn() macros
Init of Tools, and usage are perfect in C (GetNextEvent() works perfect)
In my 1st sub routine I call csubroutine() to pass parameters, its fine.

My problem is usage of _GetNextEvent(), the field EventWhat is always equal to 0

GlobalData DATA
; ...
EventRecord anop
EventWhat ds 2
EventMessage ds 4
EventWhen ds 4
EventWhere ds 4
EventModifiers ds 2
; ...
END

CARTE START ; main entry point
using GlobalData
csubroutine (5:aTable),4
; ...

Again PushWord #0
PushWord #$FFFE
PushLong #EventRecord
_GetNextEvent
pla
beq Again ; no event

SuiteAgain lda EventWhat
cmp #3 ; keyDownEvt = 3
bne Follow_A
brl Keys

Follow_A anop
; ...

Keys anop
; ...

creturn 2:FlagPoint ; return the position...
END


Any idea, please ?

Renaud Malaval

unread,
Jul 15, 2022, 4:19:03 PM7/15/22
to
Miracle, I have found !!!

:) :) :)

CARTE START ; main entry point
csubroutine (5:aTable),4 ; masterID, pointer from ZPHandle, pointer from Horsehandle, pointer of MapHandle

phb
phk
plb
using GlobalData

; ........................................

plb
creturn 2:FlagPoint ; return the position...

END

TODAY was a VERY BIG FUN DAY !!!!

Renaud Malaval

unread,
Jul 16, 2022, 12:50:56 PM7/16/22
to
Hello all,

Well now all my function work properly but I don't use "creturn" properly...
plb, restore the origin banc not the good one to access to FlagPoint

> plb
> creturn 2:FlagPoint ; return the position...
>
> END

Perhaps, I have to add a pointer parameter to my aTable parameter of csubroutine...

any idea, please ?

Renaud Malaval

unread,
Jul 22, 2022, 3:25:10 AM7/22/22
to
Hello All,

An another dummy error, the stack LOL !!!

I have solved my problem :)

Best Regards,
Renaud

Antoine Vignau

unread,
Jul 22, 2022, 6:28:45 AM7/22/22
to
Salut Renaud,

as-tu reçu le lien ?

Antoine

Renaud Malaval

unread,
Jul 22, 2022, 11:00:24 AM7/22/22
to
Salut Antoine,
oui merci, je m'inscris

Renaud
0 new messages