Opry99er Posted January 31, 2018 Share Posted January 31, 2018 The GRAM Kracker manual states that you can store BASIC programs *up to 40k* in the Module space using MSAVE6. According to the docs, MSAVE6 utilizes a feature built in to the BASIC interpreter which allows you to run pure BASIC code from the module space. This is different than having a BASIC program stored on a cartridge and then copying it to the VDP to run. This would allow a giant 40k BASIC program to run from the module space without storing the code in VDP. I could finish up Jedi Gauntlet with 20 levels and have headroom to spare. I would like to know how this is achieved. Since I am sans-Kracker right now, Im trying to find some additional documentation on this feature of the interpreter which is more specific than the GK manual. Thanks! Quote Link to comment Share on other sites More sharing options...
RXB Posted January 31, 2018 Share Posted January 31, 2018 It used the GRAM as a fake storage device. RAMIT and GRAMIT were routines that used the header and GROM 0 to access it. How it works is you set up a header in GRAM: * GROM HEADER *********************************************************** GROM >6000 AORG 0 DATA >AA0F * VALID GROM / VERSION DATA >0100 * (FUTURE EXPANSION) DATA >0000 * POWERUP DATA XBCART * PROGRAMS DATA VEIW40 * DSR *** PUT YOUR FAKE DEVICE HERE (VIEW40) DATA LINK1 * CALL DATA >0000 * INTERUPT DATA >0000 * BASIC CALL ***********VEIW40 DATA EADSR * Viewer 40 Column DATA MV40 STRI 'V40' ******************************* MV40 DST @>8356,@>8358 DSUB @>8354,@>8358 MOVE 10,V@-10(@>8358),@FAC AND >1F,V@-9(@>8358) CH >04,@FAC BS DSREXT CASE @FAC BR VOPEN * OPEN BR VCLOSE * CLOSE BR DSREXT * READ MOVE 880,V@80,V@0 * WRITE MOVE 80,V*FAC2,V@880 SCAN BR DSREXT FREEZE SCAN BR FREEZE BR DSREXT VOPEN MOVE 128,V@>0380,V@-128(@>8370) ST >F0,@FAC MOVE 1,@FAC,#1 ST >F0,@>83D4 ST >20,V@0 MOVE 959,V@0,V@1 DSREXT CALL RETURN VCLOSE SCAN BR VCLOSE MOVE 128,V@-128(@>8370),V@>0380 ST >E0,@>8300 MOVE 1,@>8300,#1 ST >E0,@>83D4 BR DSREXT ************************************************************************************ The above is a similar device I installed into RXB 2001 that allowed you to view DV80 files in on screen and scroll through them. You could do the same thing using TI BASIC SAVE or OLD for storage space up to 40K. At one time RXB had a GRAMIT routine that would save to GROM into the TI Basic space of the GRAM KRACKER or GRAMULATOR. (Of course rending TI Basic useless but RXB runs all TI Basic programs fine so no real loss there.) Quote Link to comment Share on other sites More sharing options...
Opry99er Posted January 31, 2018 Author Share Posted January 31, 2018 Thanks. I guess my question is, does the GK modify the console in some way to allow it to run BASIC code from the module space, or could a large cartridge contain BASIC code and run from the module space without the need for GRAMs? Quote Link to comment Share on other sites More sharing options...
Omega-TI Posted January 31, 2018 Share Posted January 31, 2018 It used the GRAM as a fake storage device. RAMIT and GRAMIT were routines that used the header and GROM 0 to access it. IIRC RAMIT was also used with the old, but now outdated Super Cartridge. Quote Link to comment Share on other sites More sharing options...
+acadiel Posted January 31, 2018 Share Posted January 31, 2018 Well, Klaus did talk a little about this in his thread: http://atariage.com/forums/topic/246757-decoding-basic-source-code-from-cartridge-binaries/ Wasn't there a BASIC support module or some other thing discussed at one time? 2 Quote Link to comment Share on other sites More sharing options...
Opry99er Posted January 31, 2018 Author Share Posted January 31, 2018 Interesting stuff in that thread. Thanks for posting! Im actually pretty jazzed because i am in *Final-Details* mode on acquiring my old GRAM Kracker back after all these years. I am hoping to develop a large TI BASIC program using the GRAM in the module space, or at least developing it in emulation and then testing it on the GK. Details will have to be worked out on how to achieve the transfer, but the prospect of being able to create a pure BASIC cartridge is very intriguing. Very intriguing indeed. If the GK can run BASIC from the cartridge space, we should be able to do it using a cartridge board, no? Unless the GK has some magic trickery up its sleeve, that is. Fun stuff to think about. Quote Link to comment Share on other sites More sharing options...
Opry99er Posted January 31, 2018 Author Share Posted January 31, 2018 I wonder if the FinalGROM will play well with the GK? Quote Link to comment Share on other sites More sharing options...
Tursi Posted January 31, 2018 Share Posted January 31, 2018 IIRC the BASIC interpreter doesn't mind running BASIC programs from GROM, but that doesn't entirely help you because I don't know of any way to create that 40KB BASIC program....? Quote Link to comment Share on other sites More sharing options...
Opry99er Posted January 31, 2018 Author Share Posted January 31, 2018 True. It can be created using the GRAM Kracker, if I am reading the docs correctly. If that is the case, I would imagine it could be emulated in MESS. Or maybe I could convince you to hack something up to allow a 40k listing in Classic99. Honestly, I dont know any other way than to do it on hardware with the GRAM Kracker, save the final module to disk, then transfer the saved module to the PC. Would suck royally, but I think it is possible. Ill be getting my GK back next month and I will do some work. Quote Link to comment Share on other sites More sharing options...
+mizapf Posted January 31, 2018 Share Posted January 31, 2018 (edited) The GK is fully emulated in MAME (including these nasty switches). I don't have the manual right here to test it. [Edit: I say "nasty" because it is virtually impossible to operate that device correctly without looking into the manual... ] Edited January 31, 2018 by mizapf 1 Quote Link to comment Share on other sites More sharing options...
Tursi Posted January 31, 2018 Share Posted January 31, 2018 True. It can be created using the GRAM Kracker, if I am reading the docs correctly. If that is the case, I would imagine it could be emulated in MESS. Or maybe I could convince you to hack something up to allow a 40k listing in Classic99. Honestly, I dont know any other way than to do it on hardware with the GRAM Kracker, save the final module to disk, then transfer the saved module to the PC. Would suck royally, but I think it is possible. Ill be getting my GK back next month and I will do some work. No, the GRAM Kracker can /convert/ it. But you still need a working program to start from. And Classic99 doesn't need to emulate "those nasty switches". How are you going to create that 40k BASIC listing in the first place? Unless I've completely missed something. Quote Link to comment Share on other sites More sharing options...
Opry99er Posted January 31, 2018 Author Share Posted January 31, 2018 I was under the impression that you could write, load, and save BASIC programs to/from the module space with the GK, with the GRAM acting as the storage medium. Perhaps it is I who completely missed something. Quote Link to comment Share on other sites More sharing options...
+mizapf Posted February 1, 2018 Share Posted February 1, 2018 The GK is mainly used to store a cartridge and/or the console GROMs, and to allow for changing the contents. It overrides the console GROMs so you can effectively patch the GROMs. I don't know if there is a way to store a BASIC program in GROM. It would not be impossible, but it requires another tool for that. And then the program is in the GK's GROM space, and I guess you'd like to use it elsewhere. Quote Link to comment Share on other sites More sharing options...
+acadiel Posted February 1, 2018 Share Posted February 1, 2018 The GK is fully emulated in MAME (including these nasty switches). I don't have the manual right here to test it. [Edit: I say "nasty" because it is virtually impossible to operate that device correctly without looking into the manual... ] Yep, remember helping you with it. I have the ROM on my hard drive somewhere. Quote Link to comment Share on other sites More sharing options...
Opry99er Posted February 1, 2018 Author Share Posted February 1, 2018 Im going to re-read the docs again, but if Im not mistaken, the BASIC program resides in the GK module space, and can be loaded, edited, and saved there. So, (and I may be entirely wrong) it should be possible to write a BASIC program, MSAVE6 It to the GK, re-load, edit, etc., all the way up to 40K. Quote Link to comment Share on other sites More sharing options...
Opry99er Posted February 1, 2018 Author Share Posted February 1, 2018 According to the docs, GRAMs 3-7 are set aside for BASIC code. The TI GROMs are 6k in size but reside in 8k boundaries... meaning the additional 2K are basically garbage. You can write over these with your own BASIC code. That gives a total of 40k of space. It does not specify the maximum size of a single program, but I think it is implied. Quote Link to comment Share on other sites More sharing options...
Casey Posted February 1, 2018 Share Posted February 1, 2018 I'm not sure if this is apropos to your project, but Thierry's site mentions that there is a bug in the TI BASIC interpreter related to the RESTORE command used with DATA statements. RESTORE only works if your program is running from VDP RAM and not GRAM/GROM: http://www.unige.ch/medecine/nouspikel/ti99/bugs.htm#Restore Something to keep in mind if you are pursuing this and need to use RESTORE - you may have issues. 2 Quote Link to comment Share on other sites More sharing options...
Opry99er Posted February 1, 2018 Author Share Posted February 1, 2018 10-4. When I began working on Jedi Gauntlet, I made the decision early on to not use restore commands, so Im good there. I remember Bill Sullivan chronicling this bug somewhere with much chagrin. My structure is currently as such that it will work from the module space. I am actually excited to learn the details and try the Jedi demo running pure BASIC code from the cart slot. As everyone knows, Im no genius on CPU and VDP architecture, but the prospect of a 40k BASIC program running from the module space is enough to get me digging into data sheets. Quote Link to comment Share on other sites More sharing options...
Tursi Posted February 1, 2018 Share Posted February 1, 2018 Im going to re-read the docs again, but if Im not mistaken, the BASIC program resides in the GK module space, and can be loaded, edited, and saved there. So, (and I may be entirely wrong) it should be possible to write a BASIC program, MSAVE6 It to the GK, re-load, edit, etc., all the way up to 40K. This is the point that I think is incorrect, I didn't think the BASIC immediate mode could write to the GROM. But Mizapf is right, maybe the GRAM Kracker has a hacked BIOS. It should just work in Classic99, I will see if I can find the Kracker's software. Quote Link to comment Share on other sites More sharing options...
Opry99er Posted February 1, 2018 Author Share Posted February 1, 2018 Very cool. And yea, the GK manual isn't super specific on this point either. I will have the GK back next month, so I will be able to test... for now, I'm formulating my plan based on a potentially flawed understanding of the hardware. Quote Link to comment Share on other sites More sharing options...
Tursi Posted February 1, 2018 Share Posted February 1, 2018 Well, I found the manual. It does say "MSAVE6 loads into GRAM3 so it can use all of the module Gram space for BASIC programs that you write (up to 40K)". But the instructions note: "Once the file is loaded you can go into TI BASIC and load or write a Basic program and then type in CALL MSAVE and follow the instructions on the screen. This routine moves your Basic program out to Gram, sets up a proper line number table in Gram and sets up a header for it on the menu so that it can be directly executed by pressing a key." To me that says it is only a utility to move an existing TI BASIC program, which is by definition restricted to under 16k. But I guess all you can do is try it. Quote Link to comment Share on other sites More sharing options...
Opry99er Posted February 1, 2018 Author Share Posted February 1, 2018 Yes, I'd had that thought too... But I sort of read it as: By "pressing a key" it functions as "RUN BASICGRAMCOPY", almost as if it were an XB autoload program... If that is the case, then you should be able to break out and edit while the program still resides in GRAM, since it has a pre-set-up line number table in GRAM... That was my thought process. Unless, of course, it disables FCTN+4 somehow, but if so--that's undocumented. Additionally, if the "proper line number table in GRAM" is set in stone, one would not be able to edit the module in GRAM... as you suggest. Anyone have a GK on hand? Care to run a test or two for me? Quote Link to comment Share on other sites More sharing options...
RXB Posted February 1, 2018 Share Posted February 1, 2018 (edited) IIRC RAMIT was also used with the old, but now outdated Super Cartridge. I used it with RXB SAMS demo running 46K of Assembly out of SAMS using this so saying outdated is rather funny.\ I did do this demo years ago but no reason a updated version could not be done on SAMS for 32K chunks (8K assembly & 24K XB program) P.S. Originally this was in RXB 5.55 in 1993 up to RXB 2001 Edited February 1, 2018 by RXB 1 Quote Link to comment Share on other sites More sharing options...
RickyDean Posted February 1, 2018 Share Posted February 1, 2018 Yes, I'd had that thought too... But I sort of read it as: By "pressing a key" it functions as "RUN BASICGRAMCOPY", almost as if it were an XB autoload program... If that is the case, then you should be able to break out and edit while the program still resides in GRAM, since it has a pre-set-up line number table in GRAM... That was my thought process. Unless, of course, it disables FCTN+4 somehow, but if so--that's undocumented. Additionally, if the "proper line number table in GRAM" is set in stone, one would not be able to edit the module in GRAM... as you suggest. Anyone have a GK on hand? Care to run a test or two for me? I have a working GK. If it doesn't involve using 5.1/4 inch floppies, I could possibly help this evening and take pictures. Quote Link to comment Share on other sites More sharing options...
Omega-TI Posted February 1, 2018 Share Posted February 1, 2018 I used it with RXB SAMS demo running 46K of Assembly out of SAMS using this so saying outdated is rather funny.\ Hi Rich, I was referring to the Supercart as being out of date, not the program. 1 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.