Jump to content

Willsy

Members
  • Content Count

    3,144
  • Joined

  • Last visited

Posts posted by Willsy


  1. Personally I quit on GCC just looking at the installation process and time

    Totally. I have never tried it for exactly that reason.

    And I guess you may even be more comfortable with Forth and Assembly than, say C and Basic ?

     

    Yes I think that's true. Assembly first then Forth. Assembly on the 9900 family is the nicest I've ever used. 68k coming a close second place.
    • Like 1

  2. So in terms of speed versus programming effort it's clear: we should all be using C since that's is very close to assembly language speed but much easier to write the code in C than it is in Forth or assembly.

     

    Hats of to the GCC compiler for the 9900. Seriously impressive.


  3. I just posted the GPL code not the Assembly.

    99 or >63 is the Random number seed.

     

    So are you saying that RAND >63 or 99 decimal is not the seed?

    Are you saying there is no seed number?

    That's not the seed. That's the limit. Learn the difference between a limit and a seed.


  4. This one is based on Tursi's code, but pokes VDP directly. Some other little optimisations:

    VARIABLE cnt
     
    hex
    : asterisk DATA 4 0028 107C 1028 0000 12a dchar ;
    decimal
     
    : test
    1 gmode
    page
    1 magnify
    asterisk
    0 0 0 42 1 sprite
    100 cnt !
    begin
      cnt @ 0> while
      239 0 do i $301 v! loop
      175 0 do i $300 v! loop
      0 239 do i $301 v! -1 +loop
      0 175 do i $300 v! -1 +loop
      -1 cnt +!
    repeat
    bye
    ;
    
    and here's one that removes the need for a variable:

    hex
    : asterisk DATA 4 0028 107C 1028 0000 12a dchar ;
    decimal
     
    : test
        1 gmode
        page
        1 magnify
        asterisk
        0 0 0 42 1 sprite
        100 0 do
          239 0 do i $301 v! loop
          175 0 do i $300 v! loop
          0 239 do i $301 v! -1 +loop
          0 175 do i $300 v! -1 +loop
        loop
        bye 
    ;
    
    Both of them take 29 seconds. So that's 3.6 times slower than assembler and 69 times faster than XB.

     

    Rock on!


  5. Hmm.... it's academic but you might be able to make TF go faster by making it more like the assembly version. I.e use V! To poke VDP memory. I'll have a look this evening and see if it'll be any faster. I was disappointed when I saw 48 seconds, but on the other hand SPRLOC and friends actually update a copy of the sprite attribute list in cpu ram and copy portions of it to VDP so there's a lot going on under the covers.


  6. TF

    Program space (Forth/Assembly), variables: 24K (high RAM)

    Variables: 8K (low RAM)

     

    GPL

    GPL program space (without bank switching): 40K

    Variables: 32K

    Assembly program space (without bank switching): 8K

     

    Not quite. You can freely mix Forth code, variables, buffers, and assembly language in TF in both high and low memory just by changing the variable H.

     

    See H and FFAILM and FFAIHM.

     

    But I'm splitting hairs; I take your point that you do have access to more memory in GPL. :thumbsup:


  7. Yes. I think auto motion would work. I was young and not very experienced. It was my first assembly project on the 4A. I whince at the code: using MPY to multiply by 32. Oh dear!

     

    I always did my assembly code with a pen then tried it out. Rinse and repeat until it worked. Even now I tend to work things out away from the computer!


  8. Here you go, 'yall...

     

    TGWTK.zip

     

    The attached is Win994A disk image, of course you'll need to insert the mini-mem cart into Win994A.

     

    If you rename the file extension from TIDISK to DSK you can open the disk image in TIDIR or Michael's TIImageTool and export into FIAD or any other format.

     

    Here's the manual, just for kicks:

     

     

    .CO PRINT THROUGH THE FORMATTER!!
    .CO CONTINUOUS PAPER RECOMMENDED
    .PA 1
    .FO ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^PAGE %
    .PL 60
    .LS 1
    .LM 5
    .RM 75
    .CE 5
    THE GAME WRITERS TOOLKIT V2.8
    WRITTEN BY MARK WILLS
    © 1991 ABBOTS SOFTWARE

    USERS MANUAL/GUIDE V2.0 (This is NOT a comprehensive manual)

    Congratulations on choosing THE extension to TI BASIC for the
    TI-99/4a.

    If you have any enquiries/problems with The Game Writers Toolkit then
    please write to the Author at the below address:

    Mark Wills (Abbots Software)
    12 "Rosehill",
    Betton Street,
    Belle Vue,
    Shrewsbury,
    Shropshire,
    SY3 7NY.

    A stamped addressed envelope would be appreciated!!


    CONTENTS OF THIS TUTORIAL:
    --------------------------

    Introduction and how to access the extra commands.

    A description of each command, with examples.

    COMMAND PAGE NUMBER
    ------- -----------
    BOX 4
    BYE 4
    CHIMES 5
    CROLL 5
    DOWN 8
    GPHOTO 7
    LCHARS 5
    LEFT 5
    LOWCAS 6
    PPHOTO 8
    [email protected] 6
    QUITOF 7
    QUITON 7
    RIGHT 8
    SETUP 8
    SMLIST 10
    SPRCOL 9
    SPRITE 9
    SPRMOV 10
    SSIZE 9
    UP 5
    WINDOW 8
    WIPE 7
    WHERE 10
    GETKEY

    PAGE 12 - DISCLAIMERS & COPYRIGHT INFORMATION.
    DISTRIBUTION CREDITS AND INFORMATION.

    .CE 2
    INTRODUCTION
    ------------

    The Game Writers Toolkit (hereafter reffered to as TGWTK) represents
    nearly a year of continous development and refinement. All the
    routines included in this utility have been designed to run as
    efficiently and quickly as possible.

    The utility and all is buffers/memory banks etc reside in the RAM of
    the Mini Memory and sits in the background when TI BASIC is in
    operation. It is dormant until a specific Toolkit command is called.
    Only then does control pass over to the Toolkit. When the particular
    Toolkit command has finished, control passes back to the TI BASIC
    program, AFTER the line that called the particular Toolkit command.

    You can run any TI BASIC program with the TGWTK setup and in
    operation, but all CALL COLOR commands will have to be changed to the
    Toolkit version : CALL LINK("COLOR",X,Y,Z) in order to run the program
    with the correct colours assinged to the correct character sets. This
    is because the colour table in VDP RAM has been physically moved to
    the top end of VDP. This of course means that the TI BASIC CALL COLOR
    command is writing to redundant memory locations, so I have provided a
    COLOR command in the Toolkit. The Toolkit version has exactly the
    same syntax as the TI BASIC version, it is thus very easy to edit old
    TI BASIC programs and change all CALL COLORS to the Toolkit version.

    Some of the facilities afforded by TGWTK are outlined here: It allows
    the TI BASIC programmer to access all 32 sprites, in all 4 selectable
    sizes. Full directional screen scrolling is supported. You can scroll
    any part of the screen (or all of it) in any of the four directions.
    Fast manipulation of the colour table is allowed via the Colour Roll
    command which will roll all sixteen colours through the character sets
    with a selectable delay and repeat. The machine can now reset itself
    from INSIDE a TI BASIC program, the FCTN and + key can be disabled
    (and re-enabled) to prevent accidental resetting of the machine. A
    true lower case character set is included and much more...

    .CE 2
    ACCESSING THE NEW COMMANDS
    --------------------------

    Because all the Toolkit commands are written in 100% machine code,
    they are accessed through the CALL LINK("") command. The name of the
    command you wish to use is inserted between the quotes - eg. CALL
    LINK("BYE"). Some commands need specific information before they can
    work, when this is so the information is supplied after the command
    name with a comma seperating them. eg. CALL LINK("CROLL",100,50) note
    the comma between the second quote and the first number.

    Where some commands need numeric or string information, you can
    specify either numeric constants, variables, or expressions, string
    constants or string variables respectively. Arrays or array elements
    either numeric or string cannot be passed. They must be passed to a
    numeric or string variable first.

    CALL LINK("BOX",Y,X,YE,XL,ASCII)
    --------------------------------

    This command allows you to instantly draw a rectangle of any vertical
    and horizontal size, consisting of any ASCII character.

    The operand "Y" is the number of lines down the screen where drawing
    will then start (range 0 - 23).

    The operand "X" is the number of characters across the screen where
    drawing will then start (range 0 - 31).

    The operand "YE" is the number of lines down the screen where drawing
    will end. (range 0 - 23). Note that it MUST be greater than "Y" or a
    crash may occur.

    The operand "XL" is the length of each horizontal line that is drawn.
    (range 1 - 32).

    The operand ASCII is the character code of the character of which you
    want your box to be drawn. (range 32 - 159).

    EXAMPLE:
    --------

    CALL LINK("BOX",4,9,22,7,42)

    The above example would draw a box starting 4 lines down and 9
    characters across, ending on the 22nd line, each horizontal line
    having a length of 7 characters, consisting of asterisks. (character
    code 42).

    CALL LINK("BOX",10,10,10,10,65)

    Would draw a box consisting of A's (character code 65) starting ten
    lines down, ten characters across, each line having a length of ten
    characters.

    CALL LINK("BYE")
    ----------------

    This command when encountered in your program or in direct mode will
    cause the computer to reset itself immediately. You must of course be
    careful when using this command and make sure that all data is saved
    etc before your program resets the machine, or else all data will be
    lost!



    CALL LINK("CHIMES")
    -------------------

    This command plays a chime whenever it is encountered, rather like a
    doorbell. Aknowledgement is made to Texas Instruments Inc. Dallas,
    Texas, who hold the copyright to this routine. The routine is based
    on the routine on page 322 of the Editor Assembler Manual.



    CALL LINK("UP",R)
    -----------------

    CALL LINK("DOWN",R)
    CALL LINK("LEFT",R)
    CALL LINK("RIGHT",R)

    These commands scroll the screen in the directions as stated above.
    The numeric operand "R" tells the toolkit how many times you want the
    screen to be scrolled in that particular direction.

    EXAMPLE:
    --------

    CALL LINK("LEFT",10)

    This would cause the section of the screen covered by the WINDOW
    command to scroll left 10 times. control then returns to the next
    line of your program.

    See the description of the WINDOW command on page ???

    CALL LINK("CROLL",R,D)
    ----------------------

    This command moves all the colours of the sixteen character sets into
    the character set to the left of it numerically speaking. In other
    words, it moves the colours in character set 2 to character set 1, the
    colours in character set 3 to character set 2 and so on.

    The numeric operands R and D tell the command how many times you want
    to repeat the rolling before control passes to the next line, and how
    long a delay you want between each roll. The range for R and D is 1 to
    65535 for both.



    CALL LINK("LCHARS")
    -------------------

    This command is intended to be used when you want to make the normal
    upper case characters slightly larger. It expands upwards all the
    characters from ASCII(32) TO ASCII(95) inclusive. If you want to use
    this command AND have user defined graphics residing in the character
    set between the above two values, then execute LCHARS first, then
    define your graphics, otherwise your graphics characters will be
    expanded also!!



    CALL LINK("LOWCAS")
    -------------------

    This command replaces the "small capitals" in the lower case character
    set with proper lower case characters. Any graphics characters that
    you have stored in ASCII(97) to ASCII(122) prior to this command will
    be overwritten with the new definition data that this command creates.



    CALL LINK("[email protected]",Y,X,D,S$)
    ----------------------------

    This command allows you to print a string of up to 255 characters in
    lenth in any postion on the screen. Like DISPLAY AT in Extended
    Basic.

    The numeric operands Y and X tell the command how many lines to count
    down and how many characters to count across BEFORE it starts to print
    your text. If your text goes over the end of the line that it starts
    on, then it simply reappears on the other side, one line down.

    The numeric operand "D" tells the computer which direction to print
    the string in. You can experiment with this value to get different
    effects but here are four values for you to try: D=1 print to the
    right(like a normal print statement), D=-1 prints the string
    backwards!, D=32 prints the string downwards, D=-32 prints the string
    upwards.

    EXAMPLE:
    --------

    CALL LINK("[email protected]",11,5,1,"HELLO THERE WORLD!")

    This would cause the computer to count 11 lines down, 5 characters
    across and then print the string HELLO THERE WORLD! on the screen.

    CALL LINK("[email protected]",10,10,-32,"HELLO")

    This would cause the computer to print the string HELLO starting at
    10,10 and going upwards!



    CALL LINK("QUITOF")
    -------------------

    This command disables the FCTN and + keys so that you cannot reset the
    computer while typing in a program, or while a program is running,
    unless you type BYE when in edit mode or the machine encounters a CALL
    LINK("BYE") in your program.



    CALL LINK("QUITON")
    -------------------

    This turns the quit keys back on so that it is possible to reset the
    machine from the keyboard.



    CALL LINK("WIPE",D,ASCII)
    -------------------------

    This is a fancy screen clear command!! It fills the screen with the
    character you specify from the top left and bottom right at the same
    time, working in to the middlle of the screen. The operand "D" tells
    the command how long a delay you want between each character being
    printed. (range 1 - 65535). The operand "ASCII" (both operands are
    numeric) tells the command which character you want to fill the screen
    with. (range 32 - 159)



    CALL LINK("GPHOTO",Y,X,YE,XL)
    -----------------------------

    This command called "get photo" actually "takes a photo" of a section
    of screen, the size of which you tell the command, and stores it in
    the RAM of the MiniMemory. All operands are numeric, and the operands
    work in exactly the same way as the operands do in the BOX command.

    EXAMPLE:
    --------



    CALL LINK("GPHOTO",6,4,12,9)

    This causes the computer to count down 6 lines, across 4 characters,
    then store the next 9 characters in each line, up until line 12.
    In other words it copys a 6*9 square box of the screen into the
    MiniMemory.



    CALL LINK("PPHOTO",Y,X,YE,XL
    ----------------------------

    This command, called "put photo" puts the photo back onto the screen,
    that you "got" with the get photo command. Note that you DON'T have
    to put the photo back on to the screen, in the same place that you
    "took" it. This allows you take a photo of a large section of screen
    (or even the whole screen) and move it around very quickly.

    You can also "distort" the image that you "put" back onto the screen
    by changing the operand "XL". If for example the XL in your GPHOTO
    command was 9 and the "XL" in you PPHOTO command was 8, then it would
    cause the photo that it put back on the screen to slant to the left as
    it goes down each screen line. The demo program "PHOTOS" shows this
    feature. It also shows CROLL.



    CALL LINK("SETUP")
    ------------------

    This command must be issued at least once at the begginning of your
    program, or else none of the toolkit commands will function.
    It displays the credits on the screen, establishes the REF/DEF table,
    and relocates the colour table in VDP ram so that all 32 sprites can
    be used. This is why a new version of CALL COLOR is included.


    CALL LINK("WINDOW",Y,X,YE,XL)
    -----------------------------

    This command tells the scroll commands which part of the screen to
    scroll. You only need to issue it once and the scroll commands will
    know the section of screen to be scrolled every time they are called.
    You must of course issue a new WINDOW command if you want to change
    the section of screen to be scrolled.

    The numeric operands Y,X,YE AND XL work in the same way as the BOX
    command.



    SPRITES:
    --------

    A lot of work has been put into this utility to offer an easy to use
    sprite system comparable to that of extended basic, indeed most of the
    sprite commands offered by Extended Basic are implemented in TGWTK and
    those that are not can be gotten around. Much research was put into
    using the interrupt driven sprite routines in ROM but it was found to
    be impossible. TI BASIC was never intended to use it anyway so we
    mustn't grumble too much! An alternative approach is used in TGWTK so
    all is not lost.


    CALL LINK("SPRITE",SN,Y,X,ASCII+96,C)
    -------------------------------------

    All initial sprite information is supplied with this command. In
    order to enable the sprite system, sprite 0 must be somewhere on the
    screen. (0,0 is fine). To disable the sprite system make sprite 0's Y
    location on the screen 208 like this:CALL LINK("SPRITE",0,208,0,0,0)
    This turns off ALL sprites.
    To disable for example sprites 8 to 31 then make sprite 8's Y value
    208 (CALL LINK("SPRITE",8,208,0,0,0) Then you can only use sprites 0
    to 7 unless you change the Y value of sprite 8 to some value other
    than 208.

    The numeric operand "SN" is the sprite you wish to use (range 0 - 31).

    Numeric operand "Y" tells the machine the Y value of the sprite you
    are using.

    Numeric operand "X" tells the machine the X value of the sprite you
    are using.

    All sprites are "tied" to a character in the character set. If you
    place 65+96 for example in the ASCII operand then the sprite will look
    like a capital A, unless the shape of the capital A has been changed
    with CALL CHAR.

    The numeric operand "C" tells the sprite what colour it should be.
    Subtract 1 from the numbers given for colours in the TI manual to get
    the number to use. Eg. The manual says black is 2, so for the sprite
    colour the value to use is 1.



    CALL LINK("SSIZE",S)
    --------------------

    The SSIZE command allows you to change the size of the sprites in
    exactly the same way as the MAGNIFY statement in extended basic. For
    standard single character sprites use a 0 for the value of "S". For
    single character double sized sprites use a value of 1. For 4
    character normal sized sprites use a value of 2. For double sized 4
    character sprites use a value of 3. For a description of sprite sizes
    see the extended basic manual.



    CALL LINK("SPRCOL",SN,C)
    ------------------------

    This command changes the colour of the sprite "SN" to the colour "C".
    No other characteristics of the sprite are changed.
    Subtract one from the colour values given in the TI manuals, to get
    the correct colour value to use.



    CALL LINK("WHERE",SN,Y,X)
    -------------------------

    This command asks the computer for the "Y" and "X" screen locations of
    sprite "SN". At times you will need to know where a particular sprite
    is on the screen, this is what this command does. It puts the Y and X
    values of the sprite whose details you ask for into the variables you
    place in the second and third operands. EG. CALL LINK("WHERE",5,A,B)
    will place the Y location of sprite 5 into numeric variable A and the
    X location into numeric variable B.



    CALL LINK("SMLIST",SN,YM,XM)
    ----------------------------

    This command tells the toolkit Sprite Movement List in the MiniMemory
    the movement details of the sprite "SN". Then whenever a SPRMOV
    command is encountered, the sprite "SN" will move according to the
    details given to the SML. EG. CALL LINK("SMLIST",4,10,-3) means that
    whenever a SPRMOV command is encountered sprite 4 will move down 10
    pixels and left 3 pixels from where it was. CALL
    LINK("SMLIST",2,-4,5) will cause sprite 2 to move up four pixels and
    right 5 pixels everytime a SPRMOV command is encountered.



    CALL LINK("SPRMOV",N,R)
    -----------------------

    This moves all sprites from sprite 0 up to and including sprite "N"
    according to thier details entered into the SML with SMLIST. The
    numeric variable "R" will repeat this R times, then continue execution
    from the next line of your program.


    SEE THE DEMO PROGRAMS FOR MORE INFORMATION ON SPRITES.

    CALL LINK("GETKEY",S$,KU,A)
    ---------------------------

    This command was added at the last minute which is why it is not
    included with the others!

    It works like the POS statement in TI BASIC, whereby it will return
    the position of the key(s) being searched in the string "S$", in the
    variable "A". The numeric operand "KU" tells the computer what key
    unit to use and works in the same way as the keyunits work in CALL KEY
    in TI BASIC.

    EXAMPLE:
    --------

    10 CALL LINK("GETKEY","ESDX",3,A)
    20 PRINT A;
    30 GOTO 10

    The above program would print a 1 on the screen when you pressed "E",
    a 2 when you pressed "S" and so on. If you do not press any keys, or
    the key you press is nnot in the string, then the value returned is 0.

    COPYRIGHT INFORMATION AND DISCLAIMERS:
    --------------------------------------

    The program THE GAME WRITERS TOOLKIT (all versions) is the sole
    copyright of Mark Wills of Abbots Software. No unauthorised
    duplication of this product is allowed in any way without express
    written permission from the author.

    Abbots Software accept no liability for any damages to persons or
    equipment deriving from the use of this software.

    The only authorised duplicator for this software package at the time
    of writing is Mike Goddard, M.G.C.S, "Sarnia", Cemetary Road, Rhos,
    Wrexham, Clwd. LL14 2BY.



    DISTRIBUTION CREDITS AND INFORMATION:
    -------------------------------------
    This program and its associated files and documentation are
    distributed and duplicated by:

    Mike Goddard Computer Support, (MGCS)
    "Sarnia",
    Cemetary Road,
    Rhos,
    Wrexham,
    Clwyd,
    LL14 2BY.

    Thanks are given to MGCS for taking some of the burden off the
    author!!

    Any information you may require about this program can be obtained
    from the above address, or by writing to Abbots Software at this
    address:

    M. Wills,
    Abbots Software,
    12 "Rosehill",
    Betton Street,
    Belle Vue,
    Shrewsbury,
    Shropshire,
    SY3 7NY.

    We hope that The Game Writers Toolkit gives you hours of pleasure and
    helps you to get just that little bit more from your TI!

    Have Fun!

    LOADING THE DEMO PROGRAMS
    -------------------------

    The programs that come with this package demosntrate some of the
    features of TGWTK.

    To load them simply type OLD CS1 if you are using a tape system, and
    follow the onscreen instructions, or type OLD DSKX.ZZZZZZ if you are
    using a disk system where "X" is the disk number and "ZZZZZZ" is the
    filename of the demo program you wish to load.
    RUN them in the normal way for both tape and disk systems.


    LOADING THE GAME WRITERS TOOLKIT OPERATING SYSTEM INTO YOUR OWN
    PROGRAMS:

    If you are using a disk system then make the first line of your
    program:

    CALL LOAD("DSK1.TGWTK/O") and the machine code will be loaded into the
    coreect place.

    Tape owners will have to load the operating system using the LOAD
    option in EASY BUG, then reset the machine and load you BASIC program
    with OLD CS1 in the usual way.

    Write to me if you have any problems, or programs you would like me to
    see, You never know we might release them for sale!!

    €‹€Ñ—˜Ÿ©³½ÇÕÕÕÕÕÕÕÕÕ€‹€†€Õ†’¤ÕÕÕÕÕÕÕÕÕÕÕÕ€†

     

    • Like 3

  9. I think it's slower than TF because a lot of TF words are implemented in machine code.

     

    A good test would be to write something like a screen scrolling routine like the one TF had in GPL and test it. I think it will be quite a bit slower.

     

    Also, compared to Forth, you can't just type something in and test it. You have to assemble it and make a cart image. Laborious and time consuming but a lot easier with cross compilers than the old days!

     

    Finally, for deployment you can't use a simple ROM cart, you need a GROM capable cart.

     

    So on the face of it I don't think there are any good reasons to use it, other than its really cool!

     

    If I was writing TF now I'd actually put a GROM in it to do the cart header and all the initialization before TF starts up (character sets and all that good stuff). Would have saved around 2k of ROM space. There's a lot of code you can squeeze into 2k. :-)

×
×
  • Create New...