Jump to content
IGNORED

GPL Development


Davvel

Recommended Posts

Before the syntax discussion gets out of control, here's a table listing all of the differences between xga99 and RYTE DATA, RAG, or TI Image Tool, respectively:

.

xga99   RYTE    RAG     TI IMG TOOL
-----------------------------------
AORG                    --
--      OFFS            --
TITLE   TITL    IDT     TITL

HTEXT   HTEX    HTEX    PRINTH
VTEXT   VTEX    VTEX    PRINTV
HCHAR   HCHA    HCHA    PRINTH FOR
VCHAR   VCHA    VCHA    PRINTV FOR
HMOVE   HSTR    HSTR
BIAS    SCRO
I/O             IO
COL+            ICOL    RIGHT
ROW+            IROW    DOWN
FEND                    END
MOVE                    MOVE BYTES

:1010           &1010
G@                      GROM@
V@                      VDP@
#               R@      VREG

.

This table is partially from memory, though, so I might have gotten the attribution to RYTE DATA and RAG mixed up for some entries. Note that most changes are in the FMT sublanguage.

 

If you want to use either language variant just include "-s rag" or "-s mizapf" in the xga99 call, i.e., the G.bat file. For this tutorial just pick your favorite variant and stick to it. :)

  • Like 3
Link to comment
Share on other sites

Before the syntax discussion gets out of control, here's a table listing all of the differences between xga99 and RYTE DATA, RAG, or TI Image Tool, respectively:

.

xga99   RYTE    RAG     TI IMG TOOL
-----------------------------------
AORG                    --
--      OFFS            --
TITLE   TITL    IDT     TITL

HTEXT   HTEX    HTEX    PRINTH
VTEXT   VTEX    VTEX    PRINTV
HCHAR   HCHA    HCHA    PRINTH FOR
VCHAR   VCHA    VCHA    PRINTV FOR
HMOVE   HSTR    HSTR
BIAS    SCRO
I/O             IO
COL+            ICOL    RIGHT
ROW+            IROW    DOWN
FEND                    END
MOVE                    MOVE BYTES

:1010           &1010
G@                      GROM@
V@                      VDP@
#               R@      VREG

.

This table is partially from memory, though, so I might have gotten the attribution to RYTE DATA and RAG mixed up for some entries. Note that most changes are in the FMT sublanguage.

 

If you want to use either language variant just include "-s rag" or "-s mizapf" in the xga99 call, i.e., the G.bat file. For this tutorial just pick your favorite variant and stick to it. :)

RYTE DATA has a IO command also but it is not in your list?

RYTE DATA has a ROW+ and COL+ commands also, but not on your list?

RYTE DATA has a FEND command, but not on your list?

RYTE DATA has a MOVE command, but not on your list?

RYTE DATA has G@, V@ and # again, but not on your list?

 

RXB source code uses all these using the RYTE DATA assembler.

 

How come this list is so incomplete?

Link to comment
Share on other sites

Before the syntax discussion gets out of control, here's a table listing all of the differences between xga99 and RYTE DATA, RAG, or TI Image Tool, respectively:

.

xga99   RYTE    RAG     TI IMG TOOL
-----------------------------------
AORG                    --
--      OFFS            --
TITLE   TITL    IDT     TITL

HTEXT   HTEX    HTEX    PRINTH
VTEXT   VTEX    VTEX    PRINTV
HCHAR   HCHA    HCHA    PRINTH FOR
VCHAR   VCHA    VCHA    PRINTV FOR
HMOVE   HSTR    HSTR
BIAS    SCRO
I/O             IO
COL+            ICOL    RIGHT
ROW+            IROW    DOWN
FEND                    END
MOVE                    MOVE BYTES

:1010           &1010
G@                      GROM@
V@                      VDP@
#               R@      VREG

.

This table is partially from memory, though, so I might have gotten the attribution to RYTE DATA and RAG mixed up for some entries. Note that most changes are in the FMT sublanguage.

 

If you want to use either language variant just include "-s rag" or "-s mizapf" in the xga99 call, i.e., the G.bat file. For this tutorial just pick your favorite variant and stick to it. :)

Thanks. Much appreciated.

  • Like 1
Link to comment
Share on other sites

RalphB, Please note that your XGA99 compiler works great and we appreciate all the work you put into it for no personal gain. Keep up the great work. Hopefully this thread will help us pull the same rope and deliver a great game/app using GPL and place it in an UBERGROM.

 

 

I am not sure if you agree with me but would you consider to have a more clear error or ignore the error altogether when one has a comment starting with an asterisk and you have one or more spaces in front of the asterisk.

 

Example:

 

* Test <gives error>

* Test <No Error>

 

Error Returned could be "Comments should be left justified in source code" or just ignore and move to next line.

 

 

Thanks. David

Link to comment
Share on other sites

If you want to use either language variant just include "-s rag" or "-s mizapf" in the xga99 call, i.e., the G.bat file. For this tutorial just pick your favorite variant and stick to it. :)

 

Cool, I turned into an option value. :)

 

Alternatively, you could try to abbreviate TIImageTool. I did not find a suitable short form yet which does not sound ... weird.

  • Like 1
Link to comment
Share on other sites

I am not sure if you agree with me but would you consider to have a more clear error or ignore the error altogether when one has a comment starting with an asterisk and you have one or more spaces in front of the asterisk.

 

David, I'm totally open to suggestions for improvement. I'm also sure that there may some bugs along the way ... In general, most of these should probably be posted to the xdt99 thread, to keep this tutorial focused on GPL.

 

As for the comment issue, I guess what you're really saying is that line comments should be relaxed so that they can start in any column. I'll make a note of it for possible future "modern extensions", such as those in xas99.

  • Like 1
Link to comment
Share on other sites

 

David, I'm totally open to suggestions for improvement. I'm also sure that there may some bugs along the way ... In general, most of these should probably be posted to the xdt99 thread, to keep this tutorial focused on GPL.

 

As for the comment issue, I guess what you're really saying is that line comments should be relaxed so that they can start in any column. I'll make a note of it for possible future "modern extensions", such as those in xas99.

Thanks. I shall post in your thread when I have a suggestion.

Link to comment
Share on other sites

Program 4 will focus on how to read data from GROM space and place on screen using Move.

 

Special focus on the quirks that may not hit you immediately such as how to fetch data from an indexed position and why small caps are not displayed.

 

Will not attach files for this program, one can easily copy and paste and build this using the instructions provided.

 

* Prog4
* davvel - 20/01/2016
* Displaying Strings of Text directly on Screen using Move
* GPL makes it super easy even if we do not use FMT sub interpreter
* -----------------------------------------------------------------------------------------------------

GROM >6000 Header stored in 6000-6030
AORG >30 Program starts at 6030

KeyBuf EQU >8375 SCAN keyboard buffer.
KeyTyp EQU >8374 SCAN keyboard type.
KeyRep EQU >83C8 SCAN enable repeats.
Offset EQU >8300 8300-8301 (2 byte address in CPU PAD RAM)

 

Pattern Byte 65,66,67,>44,>45,>46 Mixing Decimal and Binary
Text 'XYZmno123' Placing some bytes of text. Keep in mind that all these bytes are inside the GROM/GRAM, Read only source data

* main program *
start ALL 32 Clear Screen
BACK 0


DCLR @Offset Clear Offset
DST 12,@Offset Fill Offset variable in PAD Memory with 12.

* Please note that the offset value used as an Index to the Pattern data is a requirement which one may not understand immediately
* One cannot use a simple value in the parenthesis to offset by that value.
* Example: move 3,g@pattern(12),v@>0040 will not mean offset by 12 bytes from Pattern but offset by the value in PAD Memory at position 12.


* Note how easy it is to pull data from the Data area of our GROM and place anywhere we want, in this case on screen.

 

MOVE 6,G@Pattern,V@>0000 Move 6 bytes of data starting from GROM address labelled Pattern to VDP address 0.
MOVE >F,G@Pattern,V@>0020 Move 15 bytes of data to the second line (Address 32).

* Please note that (mno) are not displayed because by default we do not have Small Caps defined in the character pattern table.

MOVE 3,G@Pattern(@Offset),V@>0040 Move 3 bytes from Pattern offset by 12 bytes to the third line on screen.


ST >03,@KeyTyp
CLR @KeyRep
loop SCAN

BR LOOP

done EXIT Exit gracefully back to TI splash screen

END Required for compiler to know end of source code

Link to comment
Share on other sites

I am attaching a Zip file with Programs 1 to 5.

 

Please note that comments are progressively being removed from newer versions to avoid clutter.

 

New programs will contain comments only on the new stuff introduced.

 

Program 5 covers how one can load the Lower Case characters in the pattern table.

 

It also shows the speed of GPL when it comes to pulling data from GROM and place it in VDP RAM. I have moved the block of memory around in full speed (no delays) so that one can assess possibilities.

 

Prog5G.zip

 

Have Fun and please <follow and comment> :)

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

In this post I will try to place all that I have learnt in GPL during the last 2 weeks in one commented program which could be converted into some sort of 2D game.

 

The demo I am attaching covers :

 

1. VDP registers - How to configure which memory location to put your various data sets.

2. VDP Status byte - Reading it from a shadow copy.

3. Sprite Definition - Moving GROM data to the memory location we prepared in 1.

4. Sprite Collision (Sprite to Sprite) - Reading the VDP status byte

5. Importing Magellan Screen, Character, Sprite and Colour maps.

6. Key trapping

7. Converting between Sprite X and Y to Screen X, Y (32*24)

8. Animating a sprite

 

To Move left and right press 'A' and 'S'

To Move up and down press 'P' and 'L'

To exit press '='

 

From the little I have learnt I will be ready to assist.

 

prog6G.zip

 

post-44331-0-00909800-1454270942_thumb.png

Edited by Davvel
  • Like 4
Link to comment
Share on other sites

I was trying to work with CGT and CH using XGA99 and I think that these two instructions are somewhat swapped. The manual I am reading from (See link below) states that Compare High would mean that 255 is greater than 48 but "Compare Greater Than" would consider 255 to be -1 and thus not greater than 48.

 

http://www.unige.ch/medecine/nouspikel/ti99/gpl.htm#CH

 

Compare High

Syntax:

[label] CH source,destination [comment]

Use:

Sets cnd bit if source is logically greater than destination.

Status byte: cnd modified

Opcode: >C4 to >C7

Example:       ST    >45,@>8300       CH    >FF,@>8300               cnd=1       CH    >03,@>8300               cnd=0

Compare Greater Than

Syntax:

[label] CGT source,destination [comment]

Use:

Sets cnd bit if source is arithmetically greater than destination.

Status byte: cnd modified.

Opcode: >CC to >CF

Example:       ST    >45,@>8300       CGT   >FF,@>8300          cnd=0 (>FF is -1)       CGT   >65,@>8300          cnd=1

Can anyone please confirm if this is the case ?

Edited by Davvel
Link to comment
Share on other sites

I think it works as designed. Take a look at this program:

.

* GROM >6000
* AORG >0030

START ALL 32

      ST 2,@>8300 ; 2
      ST 254,@>8301 ; 254 OR -2

L1    CH @>8300,@>8301  ; 254 > 2
      BR L2
      DST 'H ',V@66

L2    CH @>8301,@>8300  ; 2 !> 254
      BR L3
      DST 'HR',V@68

L3    CGT @>8300,@>8301 ; -2 !> 2
      BR L4
      DST 'G ',V@70

L4    CGT @>8301,@>8300 ; 2 > -2
      BR L5
      DST 'GR',V@72

L5    ST '*',V@74
      B $

      END

.

The output is

.

H       GR*

which I think is correct.

 

Maybe your confusion is about the order of comparison, i.e., GS and GD? Certainly that's where my confusion usually is, but the GPL manual gives an example on page 4-7:

.

LAB1   CH   @A,@B       COMPARE (B) TO (A)
                        AND IF (B) IS LOGICALLY
                        HIGHER THAN (A) SET THE
                        CONDITION BIT
Link to comment
Share on other sites

 

I think it works as designed. Take a look at this program:

.

* GROM >6000
* AORG >0030

START ALL 32

      ST 2,@>8300 ; 2
      ST 254,@>8301 ; 254 OR -2

L1    CH @>8300,@>8301  ; 254 > 2
      BR L2
      DST 'H ',V@66

L2    CH @>8301,@>8300  ; 2 !> 254
      BR L3
      DST 'HR',V@68

L3    CGT @>8300,@>8301 ; -2 !> 2
      BR L4
      DST 'G ',V@70

L4    CGT @>8301,@>8300 ; 2 > -2
      BR L5
      DST 'GR',V@72

L5    ST '*',V@74
      B $

      END

.

The output is

.

H       GR*

which I think is correct.

 

Maybe your confusion is about the order of comparison, i.e., GS and GD? Certainly that's where my confusion usually is, but the GPL manual gives an example on page 4-7:

.

LAB1   CH   @A,@B       COMPARE (B) TO (A)
                        AND IF (B) IS LOGICALLY
                        HIGHER THAN (A) SET THE
                        CONDITION BIT

Thanks, that makes sense. So what you are saying is that the examples given in the source I indicated are not compatible with XGA99

 

http://www.unige.ch/...ti99/gpl.htm#CH

Link to comment
Share on other sites

Thierry is, in fact, correct—as is your example, @ralphb. Thierry has source and destination operands in left-to-right order, whereas the default for XGA99 has it the other way round.

 

Wow! I got that wrong! Unless Thierry explains somewhere why he changed the order of comparison from what the GPL manual states, he did get it wrong. I seem to remember reading somewhere in his documentation that he did do something like that. I will look.

 

...lee

Edited by Lee Stewart
Link to comment
Share on other sites

Thierry is, in fact, correctas is your example, @ralphb. Thierry has source and destination operands in left-to-right order, whereas the default for XGA99 has it the other way round.

 

Wow! I got that wrong! Unless Thierry explains somewhere why he changed the order of comparison from what the GPL manual states, he did get it wrong. I seem to remember reading somewhere in his documentation that he did do something like that. I will look.

 

...lee

If Thierry got it wrong then it's also wrong in manual that I posted, since it is based on Thierry's text.

 

I could use a collaborator!

Link to comment
Share on other sites

If Thierry got it wrong then it's also wrong in manual that I posted, since it is based on Thierry's text.

 

I would need to verify this, of course; but, I would expect that Thierry's GPL Assembler is aligned with his explanation and that he actually changed the comparison description to not have it “backwards” as R. A. Green noted in his description of his RAG GPL Assembler. If it happens that this is so, it would be useful to explain it.

I could use a collaborator!

 

I will try to be useful in this regard. :)

 

...lee

Link to comment
Share on other sites

I would need to verify this, of course; but, I would expect that Thierry's GPL Assembler is aligned with his explanation and that he actually changed the comparison description to not have it “backwards” as R. A. Green noted in his description of his RAG GPL Assembler. If it happens that this is so, it would be useful to explain it.

 

Maybe it would be a good idea to base the manual on either the original TI GPL Manual or the RAG GPL Assembler, as the latter seems to be most widely used.

 

I could use a collaborator!

 

I'll certainly help out, but right now I'm too swamped in order to do any significant TI work other than a quick AtariAge reply here and there. :(

Link to comment
Share on other sites

If the RAG manual is a better starting point I'm happy to look at producing it as a nice linked and tidy PDF. Do we have the text files?

 

I don't know whether this is the latest version, but it is all here: ftp://whtech.com/programming/GPL

 

The GPL Manual is on gplman.dsk in TI Writer 4.0 format, which, I suppose, could be output to CLIP in Classic99 to get something to work on without the TI-Witer-formatting marks.

 

...lee

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...