PUBLISHED IN LIMA NEWSLETTER FEBRUARY 1988. SOFTWARE DESCRIBED HERE IS IN THE LIMA UG LIBRARY. ED. NOTE: The following article describes a SOFTWARE EMULATION OF  SUPER EXTENDED BASIC (v120) using the regular extended basic module. It was sent to us by the author Art Byers, and was first published in the Jan. 88 issue of CALL SOUNDS, the newsletter of the Central Westchester user group. The entire collection of sub programs is in the public domain and can be downloaded from Delphi. - - - - - - - - - - - - - - - - - - - - The BIT BUCKET #7, CALL SOUNDS, 1/1/88 by Art Byers, Sysop Delphi TINET At the November '87 meeting of the Central Westchester 99'ers, Bob Cataldo gave us a very fine demonstration of the new module Super Extended Basic. I own three regular Extended BAsic modules and am not about to spend for a 4th, even tho it does have many nice features. Besides practically every "advanced " feature has been kicking around the 99/4A community for years, either as an assembly routine or as a CALLed SUB program in TI Extended Basic. I do not know if it was Barry Traver or Jim Peterson who first published the GOTO(n), GOSUB(n), RESTORE(n), and RUNPROG("device.filename") [alternate RUNPROG(F$)]. Thanks to BOTH!!!!! The Smart Programer and the Genial Traveler have also published PEEKVdp and POKEVdp sub programs. A fine "CLOCK" Subprogram for Lo Memory was published by the Smart Programmer, and Barry's GT recently published a one line program that enables you to circumvent the auto LOAD boot of XB - but that too has been around for years! Furthermore, in many many years of programming in TI XB, I have never really had the need to use GOSUB(n), RESTORE(n) or GOTO(n) and considered those subprograms interesting but not vital. The RUNPROG(F$) -IS- a very important feature. The end result is that at the January meeting of the CW 99'ers, a disk was given out that will enable members to have a high degree of compatability with the new Super Extended Basic, using only their regular XB Module. In addition, any member of this club that finds a SUPER XB Module program that will not run using the merge SUB programs on this disk can brink me a copy and I will rewrite it so as they CAN use it. Obviously, I cannot afford to buy the QUALITY SOFT "Draw 'n Plot" disk for all the club. If they want more complete compatability, they will have to buy that for themselves. I am still searching for the proper CALL LOADs and CALL PEEKs that will enable me to duplicate a few subprograms in the Super XB Module. The subprograms not included below because of this are: SUB CLKOFF, SUB ALOCK, SUB CTRL, SUB FCTN,SUB SCROFF, and SUB SCRON Here is the documentation for the disk, plus a printout of most of the CALL SUB programs: *************************************** .IF DSK3.C5 SUPERXB*V1 - Documentation. This disk contains a series of TI Extended Basic CALL SUBprograms that attempt to make the TI Extended Basic module mostly compatable with the new Super Extended Basic Module. The New Super Extended Basic module will load QUALITYSOFT's Draw 'n Plot routines into low memory. To obtain this to use with the TI XB module, you must buy them from Quality Soft and preload them into lo memory. Complete documentation and instructions come with the purchase. The PEEKVdp ram and POKEVdp ram routines are built into the new Super XB module. The only way you can use these CALLs with the regular XB module is to preload assembly language routines, such as those that appeared in the SMART PROGRAMMER or those available by subscribing to the GENIAL TRAVELER. These routines will reside in Lo-memory and be accessed by CALL LINKs. You may have to rewrite the SUB PEEKV and SUB POKEV subprogrtrams to conform with the requirements of those assembly programs. Also, they will cannot be used if "Draw 'n Plot" is in lo-memory, as they will over-write those sub programs. Similarly, the clock programs are in the Super XB module. To simulate this, you will have to preload an assembly language clock routine such as the one tat appeared in the August 1984 Issue of the Smart programmer. Again, if the Draw on Plot subprograms are in low memory, these will over write them and probably cause lockup. What is obvious from the above is that you cannot be 100% compatable with a program written for the new Super XB maodule if it makes use of all the above calls in the same program. However, most programs do not use all these subprograms. In addition, the SUB programs provided are all very useful and can be used in your own regular XB programs. The SUB programs are provided in MERGE form, consecutively numbered. MERGE in only those you need for the program you wish to run or ar planning to write. See the TI Extended Basic reference Guide for the proper way to use CALL SUB programs. This disk contains the following CALLs which are 100% compatable with the CALLs built into the new Super XB module: CALL ALL(numeric expression) This call fills the screen with the character of the ASCII number in the perenthesis. ie: CALL ALL(32) fills the screen with blanks, just like CALL CLEAR. CALL ALL(36) fills the screen with dollar signs -$-. CALL BEEP sounds a beep tone. CALL BYE is the same as the immediate command BYE except that it is used in a program. CALL CHIMES sounds a single chime. Although it is possible to duplicate the chimes provided in the ditor Assembler Manual, I have chosen to use a chime from one of Jim Peterson's Tips from the TIGERCUB. Jim is the undisputed KING of XB CALL SUB programs, and this was included as a tribute to him. You can buy over 300 usefull CALL subs in merge form on his three Nuts and Bolts disks - and get a real education on how to program in XB. CALL CLOCK will only work if you have the clock routine preloaded into Low memory. CALL COLORS(foreground,background). This call sets the foreground and background colors for all Character sets except set 0. Therefore it does not set the border colors. These can be done by the standard CALL SCREEN(). By setting the background color to TRANSPARENT -1- in CALL COLORS, the color called by CALL SCREEN() will become the background color. CALL GOSPRT starts all sprites moving after they have been stopped with CALL STSPRT. WARNING: only ONE of the following can be used in any program as the last line of the CALL SUB XXXX(n) absolutely MUST be the last line of the program. Therefore, they all use the same line numbers, ending in 32767, and will overwrite each other: GOSUB(n), GOTO(n), RESTORE(n), RUNPROG("device,filename"). CALL GOSUB(n) allows you to use a variable with GOSUB. However, remember when you RESequence line numbers, (n) will NOT be resequenced. Also remember that a call to a non existing line number will crash your program. CALL GOTO(n) same as above but is a GOTO instead of a GOSUB. CALLL RESTORE(n) allows the sue of a variable instead of a fixed line number with the same cautions as in GOSUB(n). CALL RUNPROG("device.filename") circumvents TI XB's disallowance of RUN "DSK1."A$" or RUN A$ where A$ might be ___ "DSK3.MYPROGRAM" CALL HONK sounds a warning honk. CALL KEYS("keylist",numeric variable) allows validation of the keys listed by either a predefined string (A$) or listed in between the quotes ie:"1234ABC" and returns a numberic variable. If the key A was pressed the variable would be 5 as A is the fith in the sequence shown. If a key other than those defined is pressed, a honk is sounded and the program awaits a correct key press. IMPORTANT: CALL HONK must be MERGED along with SUB KEYS(). I consider this to be among the most usefull of all the subprograms on this disk. CALL NEW is the same as the immediate command NEW but can be used in a program. CALL PEEKV(vdp address, value list) and CALL POKEV(vdp address, value list) are explained above. CALL QUITOFF disables the quit key, FCTN= CALL QUITON enables the quit key, FCTN= CALL STSPRT stops all sprite motion. To restart use CALL GOSPRT. **************************************** SUB PROGRAMS and documentation written and donated to the public domain by ART BYERS. SYSOP TINET special interest group on DELPHI. 12/16/87. **************************************** 30000 SUB ALL(N) 30001 CALL VCHAR(1,1,N,768):: SUBEND 30002 SUB BEEP 30003 CALL SOUND(220,880,1):: SUBEND 30004 SUB BYE 30005 CALL LOAD(-31962,32):: SUBEND 30006 SUB CHIMES 30007 FOR N=0 TO 25 STEP 5 :: CALL SOUND(-999,1047,N,784,N,659,N):: NEXT N :: FOR N=26 TO 30 :: CALL SOUND(-999,1047,N,784,N,659,N):: NEXT N :: SUBEND 30008 SUB COLORS(F,B) 30009 FOR N=1 TO 14 :: CALL COLOR(N,F,B):: NEXT N :: SUBEND 30010 SUB GOSPRT 30011 CALL LOAD(-31806,0):: SUBEND 30012 SUB HONK 30013 CALL SOUND(220,220,1):: SUBEND 30014 SUB KEYS(A$,P) 30015 CALL KEY(0,K,S):: IF S=0 THEN 30015 30016 P=POS(A$,CHR$(K),1):: IF P>0 THEN 30017 ELSE CALL HONK :: GOTO 30015 30017 SUBEND 30018 SUB NEW 30019 CALL LOAD(-31952,255,231, 255,231):: SUBEND 30020 SUB QUITOFF 30021 CALL LOAD(-31806,16):: SUBEND 30022 SUB QUITON 30023 CALL LOAD(-31806,0):: SUBEND 30024 SUB STSPRT 30025 CALL LOAD(-31806,64):: SUBEND 30026 SUB CLOCK 30027 CALL CLEAR :: CALL LINK("CLOCK") 30028 DISPLAY AT(12,1):"TIME?000000" :: ACCEPT AT(12,6)SIZE(-6)BEEP VALIDATE(DIG IT):TIME$ :: CALL LINK("SETCLK",TIME$):: SUBEND 32762 SUB GOSUB(N) 32763 CALL PEEK(-31952,[,]):: CALL PEEK([*256+]-65534,[,]) 32764 DEF L1(N)=INT(N/256) 32765 DEF L2(N)=N-256*(INT(N/256)) 32766 N=1000*N :: CALL LOAD([*256+]-65534,L1(N),L2(N)) 32767 GOSUB 12345 :: SUBEND 32762 SUB GOTO(N) 32763 CALL PEEK(-31952,[,]):: CALL PEEK([*256+]-65534,[,]) 32764 DEF L1(N)=INT(N/256) 32765 DEF L2(N)=N-256*(INT(N/256)) 32766 N=1000*N :: CALL LOAD([*256+]-65534,L1(N),L2(N)) 32767 GOTO 12345 :: SUBEND 32762 SUB RESTORE(N) 32763 CALL PEEK(-31952,[,]):: CALL PEEK([*256+]-65534,[,]) 32764 DEF L1(N)=INT(N/256) 32765 DEF L2(N)=N-256*(INT(N/256)) 32766 N=1000*N :: CALL LOAD([*256+]-65534,L1(N),L2(N)) 32767 RESTORE 12345 :: SUBEND 32762 SUB RUNPROG(FN$) 32763 REM THANKS TO BARRY TRAVER 32764 DISPLAY AT(24,1)ERASE ALL:" Loading ";FN$ 32765 CALL PEEK(-31952,[,]):: CALL PEEK([*256+]-65534,[,]):: @=[*256+]-65534 :: D$=FN$ :: CALL LOAD(@,LEN(D$)) 32766 FOR [=1 TO LEN(D$):: CALL LOAD(@+[,ASC(SEG$(D$,[,1))):: NEXT [ :: CALL LOAD(@+[,0) 32767 RUN "DSK1.FILENAME" :: SUBEND ***************************************