ralphb Posted January 20, 2016 Share Posted January 20, 2016 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. 3 Quote Link to comment Share on other sites More sharing options...
RXB Posted January 20, 2016 Share Posted January 20, 2016 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? Quote Link to comment Share on other sites More sharing options...
Davvel Posted January 20, 2016 Author Share Posted January 20, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
Davvel Posted January 20, 2016 Author Share Posted January 20, 2016 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 Quote Link to comment Share on other sites More sharing options...
ralphb Posted January 20, 2016 Share Posted January 20, 2016 How come this list is so incomplete? Rich, I'm highlighting the differences to xga99 -- so "no entry" means "same as xga99". But if you see some errors please let me know; as I said, this is from memory. Quote Link to comment Share on other sites More sharing options...
+mizapf Posted January 20, 2016 Share Posted January 20, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
ralphb Posted January 20, 2016 Share Posted January 20, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
Davvel Posted January 20, 2016 Author Share Posted January 20, 2016 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. Quote Link to comment Share on other sites More sharing options...
Davvel Posted January 20, 2016 Author Share Posted January 20, 2016 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 @KeyReploop SCAN BR LOOP done EXIT Exit gracefully back to TI splash screen END Required for compiler to know end of source code Quote Link to comment Share on other sites More sharing options...
Davvel Posted January 21, 2016 Author Share Posted January 21, 2016 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> 2 Quote Link to comment Share on other sites More sharing options...
Willsy Posted January 21, 2016 Share Posted January 21, 2016 Cool. Will have a play tonight. Quote Link to comment Share on other sites More sharing options...
Davvel Posted January 31, 2016 Author Share Posted January 31, 2016 (edited) 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 Edited January 31, 2016 by Davvel 4 Quote Link to comment Share on other sites More sharing options...
Davvel Posted February 2, 2016 Author Share Posted February 2, 2016 (edited) 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 February 2, 2016 by Davvel Quote Link to comment Share on other sites More sharing options...
Asmusr Posted February 2, 2016 Share Posted February 2, 2016 This is similar to assembly where JH (Jump High) is unsigned and JGT (Jump Greater Than) is signed. Quote Link to comment Share on other sites More sharing options...
Davvel Posted February 2, 2016 Author Share Posted February 2, 2016 Rasmus, the problem is that XDA99 is threating these instructions in inverse order. CGT is Unsigned and CH is Signed. I kindly ask the developer to check it out or indicate if this is intentional for some reason. Quote Link to comment Share on other sites More sharing options...
ralphb Posted February 3, 2016 Share Posted February 3, 2016 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 Quote Link to comment Share on other sites More sharing options...
Davvel Posted February 3, 2016 Author Share Posted February 3, 2016 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 Quote Link to comment Share on other sites More sharing options...
ralphb Posted February 3, 2016 Share Posted February 3, 2016 No, it means that Thierry got that wrong. Which is hard to believe, so let's wait what the real GPL experts have to say on this matter ... Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 3, 2016 Share Posted February 3, 2016 (edited) 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 February 3, 2016 by Lee Stewart Quote Link to comment Share on other sites More sharing options...
Willsy Posted February 3, 2016 Share Posted February 3, 2016 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! Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 3, 2016 Share Posted February 3, 2016 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 Quote Link to comment Share on other sites More sharing options...
ralphb Posted February 3, 2016 Share Posted February 3, 2016 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. Quote Link to comment Share on other sites More sharing options...
Willsy Posted February 3, 2016 Share Posted February 3, 2016 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? Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 3, 2016 Share Posted February 3, 2016 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 Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted February 3, 2016 Share Posted February 3, 2016 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? Did the TI Writer version of the GPL manual I shared have the same problem with instruction order? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.