Jump to content
IGNORED

Extended BASIC G.E.M.


senior_falcon

Recommended Posts

For the past several months I have been working on a cartridge called Extended BASIC G.E.M. (Graphics Enhancement Module) that adds The Missing Link, XB256, and T40XB to Extended BASIC. There is around 11-12K of free space in the 5 groms. A big problem is that these programs total about 18K in length, so some sort of data compression is needed to make everything fit. Dan Bienvenu wrote the Dan2 compression algorithm and PeteE wrote a 9900 assembly code version that decompresses the compressed code. With much input from PeteE I was able to compress assembly source code and then decompress it without error. The compressed code was about 65 to 70% of the original size. With that amount of compression it looked as if everything could be made to fit. It did take some creative rearrangement of the programs; certain routines are shared and there is no need to duplicate them. The 5 XB groms are packed about as full as they can be, with perhaps 100 bytes left unused. I believe this is as much graphics power as can be packed into the 5 XB groms and using the standard XB roms.

                                                                                          

 

When you select an option, the cartridge does CALL INIT, then copies the decompressor from GROM into expansion memory at >A000. Then it copies the compressed code from grom into >B000. From there it is decompressed and sent to low memory.  There are some enhancements to XB. From the manual:

 

The main focus of XB GEM is the three powerful graphics utilities. But beyond that, a number of enhancements have been added to XB. While not nearly as extensive as RXB or XB2.7, these do provide some very useful features, and some are unique to Extended BASIC+. There are no additional CALL subprograms, which may seem limiting, but it does retain compatibility with the more common TI Extended BASIC so that programs developed using XB GEM can be run with standard XB.

A new font is provided that has a slashed zero and true lower case letters with descenders. 

CALL CHAR can now define any of the characters from 30 to 159. A string up to 255 bytes long can be used as the pattern identifier. This lets you define up to 16 characters with a single CALL CHAR.

CALL CHARPAT can now return a character pattern for characters from 30 to 159.

CALL COLOR can now define the color of all the character sets from 0 to 31. Although you cannot change the pattern of the characters from 0 to 29 and 160 to 255, by setting the foreground and background to the same color you can have 8x8 blocks in all 15 colors without sacrificing any of the characters from 30 to 159.

These changes to the limit checks allow XB+ to run TI BASIC programs that use character sets 15 and 16, and usually at a considerable increase in speed.

There are changes to the line editor that make programming easier. You can enter long XB lines with up to 12 lines of code instead of the usual 5. The cursor repeat speed is faster. When editing a program line the cursor appears in the usual place, but you can go left and change the line number. The left/right/up/down keys are used normally. Or you can hold down Ctrl and use the up/down/right/left keys to easily navigate a lengthy program line. If you are on the last line, Ctrl+down goes to the end of the line. If you are on the first line, Ctrl+up goes to the beginning of the line.  

RND uses the fast random number generator from TI BASIC. This is around 5x faster than the random number generator that is standard in XB. There is another very useful modification when using random numbers. Normally, a LOAD program will always produce the same random numbers when it autoruns at XB startup. This has been changed so that now a LOAD program will actually produce random numbers. 

Instead of the * READY * message, XB GEM gives one of the following messages:
* XB+ *
* XB256 *    if XB256 is loaded and active
* TML16 * or * TML2 *    if The Missing Link is loaded and active
* T40XB *    if T40XB is loaded and active

An assembly language disk catalog program is available in XB+, XB256, and T40XB. CALL LINK(“CAT”) will start the program. Press any key to pause or resume the listing.

CALL INIT loads the assembly support routines in the usual memory locations and also clears the interrupt hook at >83C4. After CALL INIT the disk catalog program is no longer available.

When selecting an option from the main menu, you can hold down any key to defeat autoloading of the LOAD program. Usually you would just keep pressing  the key used to make the selection.
 

 

XBGEM.zip

 

(edit 02/23/2022) See below or page 27 for the latest version, XB 2.9 G.E.M. version 20231229

The latest version lets you edit programs using the 40 or 80 column text modes. Also you can save programs in DV80 or .TXT format and load programs saved that way.

(edit 03/19/2022) Latest version fixes a problem that could rarely happen when entering a program.

(edit 07/05/2022) Initialized a byte to avoid a problem at startup when using a real TI99.

(edit 12/28/2023) latest version of XB 2.9 G.E.M. is below

(edit 12/31/2023) latest version of XB 2.9 G.E.M. is below

(edit 01/04/2024) latest version is below, with a bug in the fast HCHAR and VCHAR fixed.

(edit 02/08/2024) latest verson below with fast CHAR and CHARPAT.

XB29GEM240206.zip

 

 

Edited by senior_falcon
  • Like 14
  • Thanks 7
Link to comment
Share on other sites

1 hour ago, Vorticon said:

Nice work! FYI the XB256 docs are under the Isabella folder (the XB compiler).

This is going to make next year's 10 liner contest so much more interesting :)

The folders ISABELLA6, T40XB, and The_Missing_Link_2_0 have the complete packages for the three programs. I just copied the docs for these three to a more accessible location next to the XBGEM files.

 

The end of the TML docs describe how to use CALL LOADs to modify the behavior. The code has been moved around, and so these do not work.

  • Like 3
Link to comment
Share on other sites

RXB 2015 gives .2018717590

                         .2966026045

                         .3546775287

                         .5486298097

Each restart of RXB resulted in the above number even on a debug reset of Classic99 so you never get same number twice.

 

The normal XB Assembly random number always gives the same number every reboot. (Also is super slow too.)

 

Edited by RXB
  • Like 1
Link to comment
Share on other sites

XB G.E.M. uses virtually all the remaining space in the 5 XB groms, so there is no room for turther development other than bug fixes.

However, in developing G.E.M. I learned how to use bank switched cartridge roms. This greatly simplifies the process. Now XB256 can go into one page of cartridge memory and then be quickly copied over to low memory with an XML routine, rather than using GPL to copy the decompressor to high memory, the compressed XB256 code to high memory, then run the compressor to put XB256 into low memory. This is way faster and more versatile, plus revisions get a whole lot easier.

I am now  using XB2.7 as a base, so there are the additional calls provided by XB2.7. Another one that I added was CALL FONT, which gives you a choice of 30 fonts. Even better, you can now change the font and colors of the XB editor. This is shown in the short GIF below.

There is still much to do. I will add the additional CALL LINKs to TML that formerly had to be embedded in the XB program, so now this will be a complete package. I will also include TML GA which can be used to create graphics adventures. The top two thirds of the screen can be used for pictures and the bottom third for text. I will probably include DM1000. This is not very useful for those running in emulation, but could be very useful if you have real iron.

More to come.....

FONTDEMO.gif.ad6186a0b1219d413e1bde4479d3a571.gif
 

Edited by senior_falcon
  • Like 9
Link to comment
Share on other sites

23 hours ago, senior_falcon said:

RXBRND.gif.c4d17e2d27f9814be655084672181ca0.gifRXB 2015E as included with Classic99 gives the same number every time. Maybe you fixed this in a later version?

 

 

 

So you are saying each time you turn on the computer it should have a different RANDOM NUMBER?

Unless you tie into something like a keypress how the hell are you going to do that, we are talking hardware here not just software?

 

I did not know you were attempting something almost impossible for hardware of the TI99/4A to do, let alone with no human input would do this.

Again how would you fix this with out human input or are you going to changed RND to use the clock, but that again would always return the same number?

  • Like 1
Link to comment
Share on other sites

1 hour ago, RXB said:

So you are saying each time you turn on the computer it should have a different RANDOM NUMBER?

Unless you tie into something like a keypress how the hell are you going to do that, we are talking hardware here not just software?

 

I did not know you were attempting something almost impossible for hardware of the TI99/4A to do, let alone with no human input would do this.

Again how would you fix this with out human input or are you going to changed RND to use the clock, but that again would always return the same number?

This is not an attempt. As Yoda said "Do or do not. There is no try."  And so I did, as you can see for yourself in the GIF.

  • Like 3
  • Haha 1
Link to comment
Share on other sites

3 hours ago, RXB said:

So you are saying each time you turn on the computer it should have a different RANDOM NUMBER?

Unless you tie into something like a keypress how the hell are you going to do that, we are talking hardware here not just software?

I know very little about the bowels of BASIC but could you load a new value into >83C0 when RXB starts?

 

For example, when I randomize, I grab the byte at >8379 and a byte at >83D7, put them together and store them at >83C0 to create a new random seed. These values are always changing so I get pretty good variations.

(- FUSE is a function that "fuses" two bytes into an integer

 - SEED is a function that stores an integer to >83C0 )

: RANDOMIZE  ( -- )  8379 C@  83D7 C@ FUSE SEED ;

 

Link to comment
Share on other sites

I'm still new at this stuff, the last cart I bought way back was Super Extended Basic.
So How can I get this Extended Basic 2.7 GEM ?
 
It's not released yet when it does get released I'll be making carts available on arcadeshopper.com or you can likely load it in a finalgrom99

Sent from my LM-G820 using Tapatalk

Link to comment
Share on other sites

2 hours ago, TheBF said:

I know very little about the bowels of BASIC but could you load a new value into >83C0 when RXB starts?

 

For example, when I randomize, I grab the byte at >8379 and a byte at >83D7, put them together and store them at >83C0 to create a new random seed. These values are always changing so I get pretty good variations.

(- FUSE is a function that "fuses" two bytes into an integer

 - SEED is a function that stores an integer to >83C0 )


: RANDOMIZE  ( -- )  8379 C@  83D7 C@ FUSE SEED ;

 

Ok I turn on the TI99/4A and go to XB how is this XB LOAD PROGRAM going to get a new RANDOM NUMBER?

10 PRINT RND

 

Turn off the computer and do it again....did the number change? What changed in the hardware and XB cart to make a new RANDOM NUMBER?

Please explain to me what changed where?

1. Hardware same.

2. XB cart same.

3. Clock same.

4. No matter how much time it takes for you to press 2 for XB it still did not yet know the amount of time it took for you to press 2 XB.

5. Now if RXB looks at the delay before XB started it could get a new random number, but how would it look back in time?

  • Like 1
Link to comment
Share on other sites

1 hour ago, RXB said:

Ok I turn on the TI99/4A and go to XB how is this XB LOAD PROGRAM going to get a new RANDOM NUMBER?

10 PRINT RND

Turn off the computer and do it again....did the number change? What changed in the hardware and XB cart to make a new RANDOM NUMBER?

 

Where did you get the idea that I was turning off the computer? Did you look at the video in post #8? If you had then you would know that I typed "bye" to reset to the master title screen. Fctn= would do the same.

I don't know of any other XB that can do this. As far as I know, they all will generate the same RND when autoloading a LOAD program.

Edited by senior_falcon
Link to comment
Share on other sites

2 hours ago, RXB said:

Ok I turn on the TI99/4A and go to XB how is this XB LOAD PROGRAM going to get a new RANDOM NUMBER?

10 PRINT RND

 

Turn off the computer and do it again....did the number change? What changed in the hardware and XB cart to make a new RANDOM NUMBER?

Please explain to me what changed where?

1. Hardware same.

2. XB cart same.

3. Clock same.

4. No matter how much time it takes for you to press 2 for XB it still did not yet know the amount of time it took for you to press 2 XB.

5. Now if RXB looks at the delay before XB started it could get a new random number, but how would it look back in time?

I get that.

 

What I see in the debugger is that when you select BASIC a number goes into >83C0

My thinking is when RXB starts it could change that seed value based on the couple of values that under spinning under interrupt control.  

For example you grab one value, loop that many times for a random delay then grab one from each location, XOR them together and set a new seed value.  Just a thought.

 

  • Like 1
Link to comment
Share on other sites

Hello Senior_Falcon,

 

Your XB + is great, I especially like the line editing functions, the font and the selection of the XB256, TML and T40 extensions are great!

 

In Classic99 I can start XB+ and it works.

On my TI99/4A systems I can select the XB+ with FG99, then a blue screen appears and nothing else happens.
After a reset and ENTER I see the selection 1 - 6.
Unfortunately, 2 only leads to the blue screen again.
At 3 the screen changes to gray,
At 4 and 5 I see a light green screen
And at 5 I see the light yellow screen.

But nothing else happens!


Even if I press a key to bypass LOAD, the blank screens remain.

 

I tested this on three different systems with two different FG99 modules and it always gives the same result.

 

Have I overlooked something to make XB+ work on real hardware? 

 

Another note: The XB+ shows version 110. XB2.7 shows version 210.

It would be nice if XB+ shows a new version, for example 220, 230 or 310

 

Wolfgang

Link to comment
Share on other sites

Quick question regarding T40: In the documentation, it states that it gives "the Extended BASIC programmer easy access to the 40 column screen mode offered by the F18A video upgrade and other 40 column upgrades."

 

Isn't 40-column text mode actually built into the TI, just not very easily accessed? I'm asking because I have physical TIs without this upgrade and am wondering if a program I create that uses 40-column text mode would work on a stock TI. So if I would create a program in Classic99 that uses Text Mode, would it work on a real machine without an F18A? It's a matter of using CALL XXB in XB 2.7 for the extensions it offers, which I think work without an F18A, or yours which sounds as if an F18A is required. I'm most interested in your CALL LINK("SCROLL") command, in addition to some of the other text editing features you've added. Even if it does require the F18A, I may still go with your extensions since they are more in line with what I'd like to use them for.

  • Like 1
Link to comment
Share on other sites

You are right. The 40 column text mode is built into the standard TI99 and T40XB will work fine on a stock computer. I adapted the manual from T80XB which said "easy access to the 80 column screen mode offered by the F18A video upgrade and other 80 column upgrades."  and didn't catch that error.

I will edit the manual.

  • Like 3
Link to comment
Share on other sites

17 hours ago, senior_falcon said:

Where did you get the idea that I was turning off the computer? Did you look at the video in post #8? If you had then you would know that I typed "bye" to reset to the master title screen. Fctn= would do the same.

I don't know of any other XB that can do this. As far as I know, they all will generate the same RND when autoloading a LOAD program.

Currently no XB does this, but if a BYE is used and goes back to Title Screen and the computer is not turned off I can sample the clock and save it in VDP.

Of course anything like going to REA cart or changing carts than returning to RXB would just give you the same number.

As every other XB cart made does this, RXB does not stand out other then it does have a better faster RND number output then any other XB.

  • Like 1
Link to comment
Share on other sites

14 hours ago, TheBF said:

I get that.

 

What I see in the debugger is that when you select BASIC a number goes into >83C0

My thinking is when RXB starts it could change that seed value based on the couple of values that under spinning under interrupt control.  

For example you grab one value, loop that many times for a random delay then grab one from each location, XOR them together and set a new seed value.  Just a thought.

 

Here is the problem in a nutshell.

Say I change the SEED RANDOM NUMBER and take it times a RND, guess what every single time I turn on the computer it is exactly the same number.

This is what I was attempting to explain, the hardware never changed and the Cart did not so you get exactly the same number every time.

 

Now if you exit RXB and restart RXB I could get a change in that number as long as you never turn off the computer, there are several ways to do this.

 

Honestly Computers can not really generate random numbers, they just appear random to us. Proof is restart the machine, dice do not reset....

  • Like 1
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...