• Re: Programming the GS

    From Renaud Malaval@21:1/5 to All on Thu Jul 7 03:22:09 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fadden@21:1/5 to Renaud Malaval on Thu Jul 7 08:03:49 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Speccie@21:1/5 to All on Fri Jul 8 07:18:58 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Fri Jul 8 08:49:39 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Fri Jul 8 09:23:34 2022
    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 ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven Hirsch@21:1/5 to Renaud Malaval on Fri Jul 8 13:50:37 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Sat Jul 9 00:02:36 2022
    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 !!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Speccie@21:1/5 to All on Sat Jul 9 07:42:38 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Speccie@21:1/5 to All on Sun Jul 10 07:38:08 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fadden@21:1/5 to Renaud Malaval on Sun Jul 10 07:55:02 2022
    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. :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Sun Jul 10 23:02:18 2022
    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 ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Mon Jul 11 05:04:59 2022
    Le lundi 11 juillet 2022 à 08:02:19 UTC+2, Renaud Malaval a écrit :
    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 ?

    Hi, I have found the solution, bad code source ;)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Thu Jul 14 07:31:46 2022
    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 ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Fri Jul 15 13:19:02 2022
    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 !!!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Sat Jul 16 09:50:55 2022
    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 ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Fri Jul 22 00:25:09 2022
    Hello All,

    An another dummy error, the stack LOL !!!

    I have solved my problem :)

    Best Regards,
    Renaud

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Antoine Vignau@21:1/5 to All on Fri Jul 22 03:28:44 2022
    Salut Renaud,

    as-tu reçu le lien ?

    Antoine

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Renaud Malaval@21:1/5 to All on Fri Jul 22 08:00:21 2022
    Le vendredi 22 juillet 2022 à 12:28:45 UTC+2, ntn.v...@gmail.com a écrit :
    Salut Renaud,

    as-tu reçu le lien ?

    Antoine

    Salut Antoine,
    oui merci, je m'inscris

    Renaud

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)