IO subprogram PAGE I3 ------------------------------------------------------------- Format CALL IO(type,address[,...]) CALL IO(type,bits,cru-base,variable,variable [,...]) CALL IO(type,length,vdp-address[,...]) Description The IO subprogram allows access to and control of any chip in the console or perpherial cards. The type refers to different access methods like playing sound from GROM or VDP memory automatically. The type can also specify reading or writting directly to a Control Registar Unit (CRU) address. Thereby allowing direct chip control, or direct chip bypass if the user wishes. The IO subprogram is a Graphics Programming Language (GPL) command. So the function is exactly like GPL despite being run from the XB enviorment. As most of XB is written in GPL the user gains greater GPL like control. After all the Operating System is written in GPL for a good reason. *Note these docs are from GPL Manuals or Docs mostly. type address specifications ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ 0 ---------- GROM sound list address. 1 ---------- VDP sound list address. 2 ---------- CRU input. 3 ---------- CRU output. 4 ---------- VDP address of Cassette write list. 5 ---------- VDP address of Cassette read list. 6 ---------- VDP address of Cassette verify list. The length specifies the number of bytes. The length can be from -32768 to 32767 depending on the amount of VDP memory that is availiable. Of course a value of -32768 is HEX >8000 and 32767 is HEX >7FFF and VDP normally in a TI is only 16384 or HEX >4000 of VDP. So be careful or lock-up will result. The cru-base is the CRU address divided by 2 in decimal form as the command automatically doubles the value input. The cru -base ranges from 0 to 8191 or HEX >0000 to >1FFF with a EVEN address for 8 bits or more being scanned. That means that a value of 8191 will lock-up the system as it is looking for a bit in 8192 that does not exist. The variable can input or output values ranging from 0 to 255 as that is equivilent to a single byte value. As there are two variables 16 bits can be represented in the two 8 bit variables. If CRU input reads less then 8 bits, the unusd bits in the byte are reset to zero. If CRU input reads less then 16 but more then 8 bits, the unused bits in the word will be reset to zero. The bits range from 1 to 16 for input or output. IO PAGE I4 ------------------------------------------------------------- AUTO-SOUND INSTRUCTION GROM/GRAM/VDP Format CALL IO(type,address[,...]) Control of the Sound Generator Chip (SGC) in the system console is through a pre-defined table in GROM/GRAM or VDP memory. Sound output is controlled by the table and the VDP Interrupt Service Routine (ISR). A control byte at the end of the table can cause control to loop back up in the table to continue, or end sound output. The format of the table is the same regardless of where it resides. The table consists of a series of blocks, each of which contains a series of bytes which are directly output to the SGC. Since the VDP generates 60 interupts per second, the interupt count is expressed in units of one-sixtieth of a second. When the IO command is called, upon the next occurring VDP interupt, the first block of bytes is output to the SGC. The interpreter (Operating System) waits the requested number of interrupts (for example, if interupt counts are 1, every interrupt causes the next block to be output). Remember that interpretation of XB continues normally while the SGC control is enabled. The sound control can be terminated by using an interrupt count of 0 in the last block of the table. Alternatively, a primitive looping control is provided by using a block whose first byte is 0, and the next 2 bytes indicate an address in the same memory space of the next sound block to use. (That means one block points to another block only in the same type of memory). If the first byte is hex FF or decimal 255, the next two bytes indicate an address in the other memory space. (That means one block points to another block but in another type of memory.) These allow switching sound lists from GROM/GRAM to VDP or VDP to GRAM/GROM. By making this the beginning of the entire table, the sound sequence can be made to repeat indefinitely. The type 0 indicates sound lists in GROM or GRAM and type 1 indicates sound lists in VDP. Executing a sound list while table-driven sound control is already in progress (from a previous sound list) causes the old sound control to be totally supplanted by the new sound instruction. (That means any sound chip command will over- ride old sound chip commands). The SGC has 3 tone (square wave) generators - 0, 1, and 2 all of which can be working simultaneously or in combination. The frequency (pitch) and attenuation (volume) of each generator can be independently controlled. In addition, there is a noise generator which can output white or periodic noise. For more information on controlling the SGC, see the TSM9919 SGC specification. IO PAGE I5 ------------------------------------------------------------- ATTENUATION CONTROL (for generators 0, 1, 2 or 3) One byte must be trasmitted to the SGC: Binary 1-REG#-1-Attenuation REG# = registar number (0,1,2,3) Attenuation = Attenuation/2 (e.g. A=0000 0 db = highest volume; A=1000 16 db = medium volume; A=1111 30 db = off. ) EXAMPLE: 1 10 1 0000 : turn on gen. #2 highest volume. 1 01 1 0100 : turn on gen. #1 mediam high volume. 1 11 1 1111 | turn off gen. #3 (noise generator). FREQUENCY CONTROL (for generators 0, 1, 2) ----------------- Two bytes must be transmitted to the SGC for a given registar and to compute the number of counts from the frequency F use: N = 111860 / F Binary 1-REG#-N(1s 4 bits)-00-N(ms 6 bits) Note that N must be split up into its least significant 4 bits and most significant 6 bits (10 bits total). The lowest frequency possible is 110 Hz and the highest is 55938 Hz. NOISE CONTROL | ------------- | One byte must be transmitted to the SGC: Binary 1-1-1-0-0-T-S T = 0 for white noise, 1 for periodic noise; S = Shift rate (0,1,2,3) = frequency center of noise. S=3=frequency dependent on the frequency of tone generator #3. IO PAGE I6 ------------------------------------------------------------- Programs Line 100 clears screen. | >100 CALL CLEAR ! Chimes Line 110 to ... | >110 DATA 5,159,191,223,255,2 | 27,1,9,142,1,164,2,197,1,144 | ,182,211,6,3,145,183,212,5,3 | ,146,184,213,4 | >120 DATA 5,167,4,147,176,214 | ,5,3,148,177,215,6,3,149,178 | ,216,7 | >130 DATA 5,202,2,150,179,208 | ,6,3,151,180,209,5,3,152,181 | ,210,4 | >140 DATA 5,133,3,144,182,211 | ,5,3,145,183,212,6,3,146,184 | ,213,7 | >150 DATA 5,164,2,147,176,214 | ,6,3,148,177,215,5,3,149,178 | ,216,4 Line 160 ends sound list. | >160 DATA 5,197,1,150,179,208 | ,5,3,151,180,209,6,3,152,181 | ,210,7,3,159,191,223,0 Line 170 reads list and saves | >170 READ B :: S$=S$&CHR$(B):: bytes into a string S$ | IF B THEN 170 Line 180 L is the length of S$| >180 L=LEN(S$):: CALL MOVES(1, and moves the sting into RAM | L,S$,8192):: CALL MOVE(3,L,81 so move can move it to VDP for| 92,8192):: CALL IO(1,8192) the IO command. | >190 PRINT "TYPE:": :"CALL IO( Prints out suggestion. | 1,8192)" The above program used the lower 8K as a temporary buffer area. So you must have a 32K expansion to run it. IO PAGE I7 ------------------------------------------------------------- Programs Line 100 clears the screen. | >100 CALL CLEAR ! CRASH Line 110 to ... | >110 DATA 2,228,242,5 | >120 DATA 2,228,240,18 | >130 DATA 2,228,241,16 | >140 DATA 2,228,242,14 | >150 DATA 2,228,243,12 | >160 DATA 2,228,244,10 | >170 DATA 2,229,245,9 | >180 DATA 2,229,246,8 | >190 DATA 2,229,247,7 | >200 DATA 2,229,248,6 | >210 DATA 2,229,249,5 | >220 DATA 2,230,250,4 | >230 DATA 2,230,251,3 | >240 DATA 2,230,252,2 | >250 DATA 2,230,253,1 | >260 DATA 2,230,254,1 Line 270 ends sound list. | >270 DATA 1,255,0,0 Line 280 AD is VDP address to | >280 FOR AD=4096 TO 4160 STE start with and ends with. | P 4 Line 290 reads list. | >290 READ V1,V2,V3,V4 Line 300 moves them into VDP. | >300 CALL POKEV(AD,V1,V2,V3, | V4) Line 310 continues AD loop. | >310 NEXT AD Line 320 executes sound list. | >320 CALL IO(1,4096) Line 330 prints out suggestion| >330 PRINT "CRASH": :"TYPE:" on how to test IO. | :"CALL IO(1,4096)" All data values must coverted to Binary in order so see what is going on. You now have all the data that I have as to this phase of IO types 0 and 1. See Editor Assembler Manual also for more data on sound lists and sound chip. IO PAGE I8 ------------------------------------------------------------- CRU ACCESS INSTRUCTION Format CALL IO(type,bits,cru-base,variable,variable [,...]) The IO types 2 and 3 can be used to control a variety of input-output devices including Speech, or CRU. IO always must be the CRU address divided by 2 as any value above 8192 will be out of range. The cru-base must be divided by 2 as the 9901 chip ignores the least significant bits of the base registar it uses. See Editor Assembler Manual page 61. The CRU data to be written should be right justified in the byte or word. The least significant bit will output to or input from the CRU address specified by the CRU base address. Subsquent bits will come from or go to sequentially higher CRU addresses. If the CRU input reads less than 8 bits, the unused bits in the byte are reset to zero. If the CRU input reads less then 16 bits but more than 8 bits, the unused bits in the full two 8 bit bytes will be reset to zero. Programs Line 100 explains program. | >100 ! TURNS OFF/ON/OFF EACH | CARD FROM >1000 TO >1F00 BUT | WILL LOCKUP WITH CERTAIN | CARDS. Line 110 cru address from | >110 FOR CRU=2048 TO 3968 STE >1000 to >1F00 | P 128 Line 120 turn off card, turn | >120 CALL IO(3,8,CRU,0,3,8,CR on card, delay for 2 seconds, | U,255)::FOR A=1 TO 200::NEXT turn off card. | A::CALL IO(3,8,CRU,0) Line 140 loop till done. | >140 NEXT CRU Line 100 display what it does | >100 DISPLAY AT(1,1)ERASE ALL for you. | :"THIS PROGRAM CHECKS FOR | UNUSUAL KEYS BEING PRESSED | , EVEN IF MORE THEN FOUR KEY | ARE BEING PRESSED AT ONCE" Line 110 scans CRU at >0006 | >110 CALL IO(2,16,3,A,B):: IF and reports keys pressed. | A=18 AND B=255 THEN 110 ELS | E CALL HPUT(24,3,RPT$(" ",30 | ),24,24,STR$(A)&" "&STR$(B)) Line 120 more reports. | >120 IF A=146 THEN CALL HPUT( | 24,3,"FUNCTION KEY")ELSE IF | B=191 THEN CALL HPUT(24,3,"C | ONTROL KEY")ELSE IF B=223 TH | EN CALL HPUT(24,3,"SHIFT KEY | ") Line 130 still more reports. | >130 IF B=251 THEN CALL HPUT( | 24,3,"ENTER KEY")ELSE IF B=2 | 53 THEN CALL HPUT(24,3,"SPAC | E BAR")ELSE IF B=254 THEN CA | LL HPUT(24,3,"PLUS/EQUAL KEY | ") Line start over scan of keys. | >140 GOTO 110 IO PAGE I9 ------------------------------------------------------------- Programs Line 100 clears screen. | >100 CALL CLEAR Line 110 explains program. | >110 CALL HPUT(4,7,"This is a | demo of the",6,7,"CALL IO(3 | ,8,2176,B)",8,7,"3 = TYPE(CR | U output)",10,7,"8 = NUMBER | OF BITS",12,7,"2176=address/ | 2") Line 120 turn off card, show | >120 CALL IO(3,8,2176,0):: FO the present byte value being | R B=0 TO 255 :: CALL HPUT(14 sent. | ,7,"B=byte (value "&STR$(B)& | ")") Line 130 diplay block to get | >130 CALL HPUT(18,5,"******** attention. | ******************",19,5,"WA | TCH THE DRIVE LIGHTS",20,5," | **************************") Line 140 send byte to card and| >140 CALL IO(3,8,2176,B):: NE when done with loop, clear for| XT B :: CALL HCHAR(14,24,32, starting over program. | 7):: GOTO 110 Options Some CRU address are used by the Operating System or XB and any attempt to redefine them will create problems. Also some of the address areas will return incorrect values as they have changed since IO has accessed them. These problems will never become completly apparent at first, so take care. Additionally some cards have the same problem, if the card has a program that has a interupt or CRU links turned on as you access it, a complete lock up will result as a fight for control ensues. So with that happy thought, a alternate way is to use EXECUTE or LINK instead. IO PAGE I10 ------------------------------------------------------------- CASSETTE INPUT/OUTPUT/VERIFY INSTUCTION Format CALL IO(type,length,vdp-address[,...]) The three different cassette I/O instuctions use the same format. The write and read instructions physically perform Input/Output to the cassette. The verify instuction will read a tape and compare it, byte by byte, against what is in the specified vdp area. All will report an I/O error if one is detected. No prompts are present with these three formats. These three types control the cassette directly so no prompt will tell the user to turn on or off the cassette record/play buttons. The programmer must inform the user with his own prompt. Programs Presently I have no cassette to write programs with. AUDIO GATE ---------- CRU bit 24 is the audio gate which allows data being read to be heard. If the bit is set to 1, the data being read is heard, and if the bit is set to 0, the data is not heard. Setting the bit to a 0 or 1 is done with an IO instuction, or a Assembly instruction. MOTOR CONTROL ------------- There are two CRU bits (22 and 23) used to control cassettes 1 and 2, respectively. When there is no Cassette IO being done, both motors remain on. When Cassette IO is specified, the DSR (Device Service Routine) will control the data being read. If there are two motor units connected, the data will be read simultaneously, or you may have the option of reading data from one motor unit and playing the recorded voice from another motor unit through the TV (Monitor) speaker. *NOTE: Compatibility with or without 32K or other devices is not a concern as IO needs no RAM to work with. Therefore from just a console all IO comands will work fine. If you only have a Cassette and RXB you can quickly load/save/verify without menus, or just make up your own. ISROFF subprogram PAGE I11 ------------------------------------------------------------- Format CALL ISROFF(numeric-variable) Description The Interupt Service Routine (ISR) is a routine that executes during timed intervals. The operating system of the TI is set up for these. Mouse or Screen dumps or Hot Key programs bring to mind the common uses of a ISR hook. The ISROFF routine in RXB does as it suggests and turns the ISR hook off. But the numeric-variable is used to store the address of where this ISR hook came from. Of course ISRON is the opposite and will turn it back on. Extreme care must be used when turning on or off the ISR. A PEEK at hex >83C4 (decimal -31804 and -31805) will be 0 when there is no ISR. Otherwise any other value will mean that a ISR is being used. Programs This line checks ISR hook. | >100 CALL ISROFF(J) This shows if ISR is in use. | >110 IF J THEN PRINT "ISROFF" This line loads another file. | >120 CALL LOAD("DSK1.HOT") This starts another ISR. | >130 CALL LINK("START") This line checks ISR hook. | >140 CALL ISROFF(K) This shows if ISR is in use. | >150 IF K THEN PRINT "ISROFF" This turns first ISR back on. | >160 CALL ISRON(J) This turns second ISR back on.| >170 CALL ISRON(K) The program continues... Options See AMS example RXB programs and Editor Assembler manual. ISRON subprogram PAGE I12 ------------------------------------------------------------- Format CALL ISRON(numeric-variable) Description The Interupt Service Routine (ISR) is a routine that executes during timed intervals. The operating system of the TI is set up for these. Mouse or Screen dumps or Hot Key programs bring to mind the common uses of a ISR hook. The ISRON routine in RXB does as it suggests and turns the ISR hook on. But the numeric-variable is used to load the address of where this ISR hook came from. Of course ISROFF is the opposite and will turn it back off. Extreme care must be used when turning on or off the ISR. A PEEK at hex >83C4 (decimal -31804 and -31805) will be 0 when there is no ISR. Otherwise any other value will mean that a ISR is being used. Programs This line peeks ISR hook. | >100 CALL PEEK(-31804,I,J) This checks if ISR is in use, | >110 IF I+J THEN CALL ISROFF( and if not 0 turn off ISR. | ADDRESS1) This line loads another file. | >120 CALL LOAD("DSK1.HOT") This starts another ISR. | >130 CALL LINK("START") This turns off ISR. | >140 CALL ISROFF(ADDRESS2) This checks if old ISR is ok, | >150 IF I+J THEN CALL ISRON(A if yes turn it on. | DDRESS1) The program continues... Options See AMS example RXB programs and Editor Assembler manual. JOYST subprogram PAGE J1 ------------------------------------------------------------- Format CALL JOYST(key-unit,x-return,y-return[,...]) Description See EXTENDED BASIC MANUAL. Except for adding autorepeat there is no changes. Programs The program on the right will | >100 CALL CLEAR illustrate a use of JOYST | >110 CALL SPRITE(#1,33,5,96,1 subprogram. It creates two | 28,#2,42,2,96,128) sprites and then moves them | >120 CALL JOYST(1,X1,Y1,2,X2, around according to the input | Y2) from the joysticks. | >130 CALL MOTION(#1,-Y1,X1,#2 Two players with the same | -Y2,X2) input speed and motion. | >140 GOTO 120 | Options NONE. KEY subprogram PAGE K1 ------------------------------------------------------------- Format CALL KEY(key-unit,return-variable, status-variable[,...]) CALL KEY(string,key-unit,return-variable, status-variable[,...]) CALL KEY(string-variable,key-unit,return- variable,status-variable[,...]) Description See EXTENDED BASIC MANUAL. RXB has added autorepeat features. Strings or string variables can now be added to KEY to lock out any other keys. The strings can be empty or up to 255 in length. The string function stops program execution unlike a normal key routine. Programs This line scans both joysticks| >100 CALL JOYST(1,X,Y,2,XX,YY) This line scans both of the | >110 CALL KEY(1,F,S,2,FF,SS) fire buttons & split keyboard.| | Try this for fun. | >CALL KEY(CHR$(2),0,K,S) (HINT: FCNT 4) | | Add this line to programs. | >100 CALL KEY("YNyn",0,K,S) | Suspendes program until key is| >100 CALL KEY("",0,K,S) pressed. (any key) | | Suspendes program until ENTER | >100 CALL KEY(CHR$(13),0,K,S) is pressed. | | Suspendes program until the | >100 A$="123" key from string A$ is used. | >110 CALL KEY(A$,0,KV,STATUS) | Suspendes program until YES is| >100 CALL KEY("Y",0,K1,S1,"E" typed in. | ,0,K2,S2,"S",0,K3,S3) | Options NONE. LDIAG subprogram PAGE L1 ------------------------------------------------------------- Format CALL LDIAG(row,column,character-code) CALL LDIAG(row,column,character-code, repetition[,...]) Description The LDIAG subprogram places character-code per the number of times specified in repetition at row and column. It will wrap off from one side of the screen and restart on the opposite side. LDIAG moves to the left and down. The row numbers from 1 to 24, column numbers from 1 to 32, character-code numbers from 0 to 32768, and repetition numbers from 0 to 32767. Notice the auto-repeat must have repetition or it gets row confused with repetition. See GCHAR, HCHAR, RDIAG, and VCHAR for more data. Programs The program to the right will | >100 CALL LDIAG(3,5,35,3,9,8, place character-code 35 at row| 42) 3 and column 5, then places | character-code 35 at row 4 and| column 4, then places | character-code 35 at row 5 and| column 3. Then places | character-code 42 at row 9 and| column 8. | Options NONE. LIST command PAGE L2 ------------------------------------------------------------- Format LIST LIST "device name" LIST "device name":line length:line number- line number Description The LIST command is the same as per Extended Basic Manual page 114. The LIST routine has been modified to allow the line length to be output to a device. The line length can only be used if a device is specified. A colon (:) must follow the line lenght. If not included in the LIST command, the line length is set to the default of the specified output device. The line length can range from 1 to 255. If the length specified is outside this range, a Bad Line Number Error is reported. Command This line outputs to a device.| >LIST "PIO":80:100-120 | This a dummy line. | >100 ! TEST OF LIST Another dummy line. | >110 ! TEST OF LIST | Options NONE. LOAD subprogram PAGE L3 ------------------------------------------------------------- Format CALL LOAD("access-name"[,address,byte][,...] [,file-field,...]) CALL LOAD(address,byte[,...]) Description See EXTENDED BASIC MANUAL page 115 for more data. The only change is to allow a CALL LOAD to an address without having to use CALL INIT first. Program This line will load address | >100 CALL LOAD(8192,128) 8192 with 128 Options NONE. MKDIR subprogram PAGE M1 ------------------------------------------------------------- Format CALL MKDIR(pathname,directory-name[,...]) CALL MKDIR(string-varialbe,string-variable [,...]) CALL MKDIR(number,disk-volume-name[,...]) Description The MKDIR subprogram MaKes DIRectorys on hard drives or will name a disk. The pathname determines the device used and the pathname can be up to 255 characters in length. The Myarc HFDC can only support 29 characters pathnames plus the filename of 10, so that would add up to 39 characters total. The pathname must end with a period and the filename may only be 10 characters in length. MKDIR can create up to 24 directorys in 24 different drives in one command. MKDIR can also create directorys then sub-directorys in the same command. Programs This line names disk 1 NONE | >CALL MKDIR("DSK1.","NONE") | This line creates a directory| >CALL MKDIR("WDS1.","TEST") named TEST on hard drive 1. | | This line creates a directory | >100 CALL MKDIR("WDS1.","ONE" on hard drive 1 named ONE | ,"WDS1.ONE.","TWO","WDS1.ONE then creates a sub-directory | .TWO.","THREE") named TWO of directory ONE | then creates a sub-directory | named THREE of directory ONE | of sub-directory TWO | Options See CAT or DIR for number or ASCII access to disk options. MOTION subprogram PAGE M2 ------------------------------------------------------------- Format CALL MOTION(#sprite-number,row-velocity, column-velocity[,...]) CALL MOTION(ALL,row-velocity,column-velocity [,...]) CALL MOTION(STOP[,...]) CALL MOTION(GO[,...]) Description See EXTENDED BASIC MANUAL PAGE 125 for more data. Programs * See EXTENDED BASIC MANUAL. The program to the right will | >100 CALL CLEAR :: X=190 will set up 3 sprites to be on| >110 CALL SPRITE(#1,65,2,9,X, the same vertical plane, and | 20,0,#2,66,2,9,X,30,0,#3,67, MOTION will stop all sprites. | 2,9,X,-20,0) GO turns on sprite motion. | >120 CALL MOTION(GO) This is a delay loop. | >140 FOR D=1 TO 2000::NEXT D STOP turns off sprite motion. | >150 CALL MOTION(STOP) This is a delay loop. | >160 FOR D=1 TO 2000::NEXT D Change #3 motion direction,GO.| >170 CALL MOTION(#3,10,10,GO) This is a delay loop | >180 FOR D=1 TO 2000::NEXT D Continue program. | >190 GOTO 120 | Clear screen and set up the | >100 CALL CLEAR::A(0)=-127 :: variables A(0) and A(1) | A(1)=127 Loop to create sprites. | >110 FOR L=1 TO 28::CALL SPRI | TE(#L,L+65,2,L,L,-L,L) :: | NEXT L Use MOTION ALL to change the | >120 CALL MOTION(ALL,A(RND)*R sprite velocitys. | ND,A(RND)*RND)::GOTO 120 Options While characters 144 to 159 are being used, you can not use sprites. Notice that GO or STOP can be followed by other motion commands i.e. CALL MOTION(STOP,#1,44,-87) is valid. MOVE command PAGE M3 ------------------------------------------------------------- Format MOVE start line-end line,new start line,increment Description The MOVE command is used to move a progra line or block of program lines to another location in the program. The block of lines to be moved is defined by start line number and end line number. If either of these numbers are ommited, the defaults are the first program line and the last program line. However, at least one number and a dash must be entered (both can not be ommited), and there must be at least one valid program line between start line number and end line number. To move one both the start line number and end line number are the same. If any of the above conditions are not met, a Bad Line Number Error will be reported. The new start line number defines the new line number of the first line in the moved segment. When the block is moved it will be moved. If not, a Bad Line Number Error message is reported. This problem can be corrected by using a smaller increment, or by using RES to open up space for the segment. A Bad Line Number Error also results if the renumbering process would result in a line number higher then 32767. Although moving lines within the program does not increase the size of the program, this command does require 4 bytes of the program space for line moved. This memory use is temporary, but it must be available in order to move the block. If sufficient memory is not available a Memory Full Error results and no lines are moved. This problem can ussually be worked around by moving the block a few lines at a time. Before the block of lines is moved any open files are closed and any variables are lost. Commands This line moves lines 100 thru| >MOVE 100-180,1000,5 180 to line 1000, and then | increment by 5. | | This line moves lines 40 thru | >MOVE 40-,120, last line to line 120, and | increment by 10. (Default) | | This line moves line 150 to | >MOVE 150-150,1110 line 1110 | | This line moves first program | >MOVE -800,32220,2 line thru line 800 to line | 32220, and increment by 2. | Options Not to be confused with MOVE or MOVES of memory. MOVE subprogram PAGE M4 ------------------------------------------------------------- Format CALL MOVE(table,bytes,from-address,to-address [,...]) CALL MOVE(table,bytes,from-address,VDP-R0 [,...]) Description The MOVE subprogram moves (copies) from-address to-address the amount of bytes specified using the memory type according to the table. MOVE does not physically move memory but copies memory. MOVE can RIPPLE a byte thru memory by the from-address being one byte less then the to-address. The table below specifies what type of memory is being moved and to what other type of memory. The bytes are any amount, the from-address and to-address range from -32768 to 0 to 32767. Any amount, and type, of memory can be used. MOVE also works on the VDP REGISTERS, which means any number VDP modes of any type of VDP chip residing in place of the 9918 VDP processor could be accessed. Up to 65535 VDP REGISTERS can be filled in one command. MOVE always starts with VDP REGISTER 0 so all values from REGISTER 0 on must always be filled again. This forces 100% accuracy into every VDP REGISTER WRITE. TABLE FROM-TYPE TO-TYPE ~~~~~ ~~~~~~~~~ ~~~~~~~ 1 ------------- VDP ---------- VDP 2 ------------- VDP ---------- RAM 3 ------------- VDP ---------- GRAM 4 ------------- RAM ---------- VDP 5 ------------- RAM ---------- RAM 6 ------------- RAM ---------- GRAM 7 ------------- GRAM ---------- VDP 8 ------------- GRAM ---------- RAM 9 ------------- GRAM ---------- GRAM 10 ------------- VDP ---------- VDP R0 11 ------------- RAM ---------- VDP R0 12 ------------- GRAM ---------- VDP R0 There is a slight grouping of the types of memories that can be moved. Group 1 to 3 are VDP, group 4 to 6 are RAM, , group 7 to 9 are GRAM, and group 10 to 12 are VDP REGISTERS. Note that you may move memory into RAM but not ROM, and that you may move memory into GRAM but not GROM. You can copy or move memory from ROM or GROM. Also note that any devices that use phoney GRAM will not work with MOVE these devices don't use the real GRAM/GROM addressing. See MOVES for more data. MOVE PAGE M5 ------------------------------------------------------------- Programs Line 100 thus uses table 0 VDP| >100 CALL MOVE(1,767,1,0) to VDP. 767 bytes are moved. A| VDP from-address of 1 and a | VDP to-address of 0. Will use | a ripple effect of moving all | screen bytes over one address.| | Line 100 copies entire screen | >100 CALL MOVE(2,768,0,8192) into lower 8K. | Line 110 clears the screen. | >110 CALL CLEAR Line 120 copies entire screen | >120 CALL MOVE(2,768,0,8962) into lower 8K. | Line 130 copies from lower 8K | >130 CALL MOVE(4,768,8192,0,3 to screen, then again. GOTO | ,768,8962,0) :: GOTO 130 makes it an endless loop. | | Line 100 sets up loop. Counts | >100 FOR GA=-32768 TO 32767 from -32768 to 0 to 32767 or | (HEX >8000 to >0000 to >7FFF) | Line 110 move table 7 is from | >110 CALL MOVE(7,8,GA,1024) GRAM/GROM to VDP. 8 bytes to | be moved. GA is counter. 1024 | is decimal address of space | character in VDP pattern table| Line 120 completes loop. | >120 NEXT GA | Options Dependent on Assembly Language programmers and the RXB programs that are developed. MOVE is good for replacing those CALL LOAD loops. It also provides a means to rewrite XB while running XB instead of rewriting MERGE files then loading them. Future devices benefit from MOVE as it can copy or move different types of memory directly from or to them. See MOVES for dealing with string variables instead of direct address. MOVES subprogram PAGE M6 ------------------------------------------------------------- Format CALL MOVES(table,bytes,string-variable,VDP-R0 [,...]) CALL MOVES(table,bytes,from-address,string- varible[,...]) CALL MOVES(table,bytes,string-variable,to- address[,...]) Description The MOVES subprogram moves (copies) from-string to-string the amount of bytes specified using the memory type according to the table.MOVES does not physically move memory but copies it. MOVES can RIPPLE a single byte of thru memory by the from-address being one byte less then the to-address. The table below specifies what type of memory is being moved and to what other type of memory. The bytes are 255 maximum, the from-address or to-address range from -32768 to 0 to 32767. MOVES also works on the VDP REGISTERS which means any number VDP modes of any type of VDP chip residing in place of the 9918 VDP processor. Up to 255 VDP REGISTERS can be filled in one command. MOVES always starts with VDP REGISTER 0 so all values from REGISTER 0 on must always be filled again. This forces 100% accuracy into every VDP REGISTER WRITE. As MOVES mostly works with string-variables please see the the Extended Basic Manual page 41. MOVES will error out with *BAD VALUE IN ###* with-in a program if the string variable length exceeds 255, or if the number of bytes exceeds the length of the string variable your moving from or to. TABLE FROM-TYPE TO-TYPE ~~~~~ ~~~~~~~~~ ~~~~~~~ 0 ------------- VDP ---------- VDP R0 1 ------------- VDP $ ---------- VDP 2 ------------- VDP $ ---------- RAM 3 ------------- VDP $ ---------- GRAM 4 ------------- VDP ---------- VDP $ 5 ------------- RAM ---------- VDP $ 6 ------------- GRAM ---------- VDP $ There is a slight grouping of the types of memories that can be moved. Group 1 to 3 are from VDP, group 4 to 6 are to VDP. Note that you may move memory into RAM but not ROM, and that you may move memory into GRAM but not GROM. You can copy or move memory from ROM or GROM. Also note that any devices that use phoney GRAM will not work with MOVES these devices don't use the real GRAM/GROM addressing. See MOVE for more data. MOVES PAGE M7 ------------------------------------------------------------- Programs Line 100 sets string-variable.| >100 I$=RPT$("I",255) Line 120 thus uses table 1 VDP| >110 CALL MOVES(1,55,I$,0) to VDP. 55 bytes are moved. | Line 120 copies string J$ to | >120 CALL MOVES(2,255,J$,8192 into lower 8K, then string I$ | ,2,255,I$,8492) into lower 8K. | Line 130 copies string I$ to | >130 J$=I$ :: PRINT J$ : : I$ into J$. Eliminates old J$. | Then prints them. | Line 150 copies from lower 8K | >140 CALL MOVES(5,255,8192,J$ to J$, then from lower 8K at | ,5,255,8492,I$) :: PRINT J$: 8492 into I$ thus restoring | : I$ both strings and printing them| thus a way to save stings. | Line 100 sets up loop. Counts | >100 FOR GA=-32768 TO 32767 from -32768 to 0 to 32767 or | (HEX >8000 to >0000 to >7FFF) | Line 110 moves table 6 from | >110 CALL MOVES(6,8,GA,H$) GRAM/GROM to VDP. 8 bytes to | be moved. GA is counter. H$ is| string for storing data found.| Line 120 prints H$ on screen. | >120 PRINT H$ Options Dependent on Assembly Language programmers and the RXB programs that are developed. MOVES is good for replacing those CALL LOAD loops. It also provides a means to rewrite XB while running XB instead of rewriting MERGE files then loading them. Future devices benefit from MOVES as it can copy or move different types of memory directly from or to them. See MOVE for dealing with direct address instead of string variables. NEW command or subprogram PAGE N1 ------------------------------------------------------------- Format NEW CALL NEW Description The NEW command is the same as the EXTENDED BASIC MANUAL page 126. NEW can only be used from edit mode. But now CALL NEW can be called from program mode. As expected all values are reset and all defined characters become undefined. Any open files are closed. Characters 32 to 95 are reset to their standard definitions. The TRACE and BREAK commands are canceled. The program is erased from memory. Command The line to the right will | >NEW reset memory for XB. | Programs The program to the right will | >100 CALL NEW reset memory for XB. | | Options NONE. PEEKG subprogram PAGE P1 ------------------------------------------------------------- Format CALL PEEKG(address,numeric-variable-list[,...]) Description The PEEKG command reads data from GROM into the variable(s) specified. It functions identical to the regular EXTENDED BASIC PEEK command page 143. Except it reads from GROM/GRAM. GROM or GRAM address above 32767 must be converted to a negative number by subtracting 65536 from the desired address. Programs The program to the right will | >100 CALL PEEKG(767,B) read a byte from GROM. | Options NONE. PEEKV subprogram PAGE P2 ------------------------------------------------------------- Format CALL PEEKV(address,numeric-variable-list[,...]) Description The PEEKV command reads data from VDP into the variable(s) specified. It functions identical to the regular EXTENDED BASIC PEEK command page 143. Except it reads from VDP. The VDP address should not exceed 16384 in a TI with a 9918 VDP chip, 9938 or 9958 VDP chips can go the full 32767. VDP addresses above 32767 must be converted to a negative number by subtracting 65536 from the desired address. Also when ever a value is peeked or poked to the screen a screen offset is present. 96 must be subtracted from or added to the value to correct it. Programs The program to the right will | >100 CALL PEEKV(767,B) read a byte from VDP and put | it into variable B. | This line will print it. | >110 PRINT B-96 Options NONE. POKEG subprogram PAGE P3 ------------------------------------------------------------- Format CALL POKEG(address,numeric-variable-list[,...]) Description The POKEG command writes the data in the numeric variable list to GRAM at the specified address. It functions identical to the EXTENDED BASIC command LOAD page 115. Except that it writes to GRAM. GROM or GRAM addresses above 32767 must be converted to a negative number by subtracting 65536 from the desired address. Programs The program to the right will | >100 CALL POKEG(1001,128) write 128 to GRAM address 1001| Options NONE. POKER subprogram PAGE P4 ------------------------------------------------------------- Format CALL POKER(vdp-number,numeric-variable[,...]) CALL POKER(numeric-variable,number[,...]) Description The POKER command writes to vdp register a byte value. Only registers 0 to 7 are valid. The byte value ranges 0 to 255. Programs This sets text mode. | >100 CALL POKER(7,244,1,240) This is a delay loop. | >110 FOR L=1 TO 500 :: NEXT L This sets multi color mode | >120 CALL POKER(1,232) This is a delay loop. | >130 FOR L=1 TO 500 :: NEXT L This sets bit map mode. | >140 CALL POKER(0,2,1,2) This is a delay loop. | >150 FOR L=1 TO 500 :: NEXT L Options POKER works best with POKEV, PEEKV, MOVE, MOVES, and BIAS. POKEV subprogram PAGE P5 ------------------------------------------------------------- Format CALL POKEV(address,numeric-variable-list[,...]) Description The POKEV command writes data to VDP into the address specified. It functions identical to the regular EXTENDED BASIC PEEK command page 143. Except it reads from VDP. The VDP address should not exceed 16384 in a TI with a 9918 VDP chip, 9938 or 9958 VDP chips can go the full 32767. VDP addresses above 32767 must be converted to a negative number by subtracting 65536 from the desired address. Also when ever a value is poked or peeked to the screen a screen offset is present. 96 must be subtracted from or added to the value to correct it. Programs The program to the right will | >100 CALL POKEV(767,65+96) write A at address 767. | Options NONE. PROTECT subprogram PAGE P6 ------------------------------------------------------------- Format CALL PROTECT(pathname,filename,number[,...]) CALL PROTECT(string-variable,string-variable, numeric-variable[,...]) CALL PROTECT(number,filename,number[,...]) Description The PROTECT subprogram protects programs or files. Pathname may be up to 255 characters in length. Pathname must end in a period. The Myarc HFDC can only support a 29 character pathname plus a 10 character filename, so that would add up to 39 characters total. The pathname must end with a period and filenames must only be 10 characters in length. The number may be 0 to 255, any number other then 0 (zero) will protect a file. 0 unprotects. Up to 14 files on 14 different drives may be accessed in one command. File error will be returned if the device is not accessed or the file or program does'nt exist. File error will be ignored when protecting a already protected file or program. File error will be reported if the disk notch is covered. Programs This line unprotects a file | >CALL PROTECT("DSKB.","A-FILE named A-FILENAME on RAMDISK B.| NAME,0) | Line 100 protects a file named| >100 CALL PROTECT(3,"JUNK,255 JUNK on disk drive 3 | ) | Line 100 A$ is drive 2 | >100 A$="DSK2." :: O$="LOAD1" String-variable O$ and N$ are | :: N$="filename" loaded with filenames. | Line 110 protects files. | >110 CALL PROTECT(A$,O$,1,N$, | 1) | Line 110 unprotects file DIET | >110 CALL PROTECT("WDS1.FAT." on hard drive 1 in directory | ,"DIET",0) named FAT | Options See CAT or DIR for number or ASCII access to disk options. QUITOFF subprogram PAGE Q1 ------------------------------------------------------------- Format CALL QUITOFF Description The QUITOFF command disables the QUIT KEY. The QUIT KEY is already disabled upon entering RXB. See QUITON for more data. Programs The program to the right will | >100 CALL QUITOFF turn off the QUIT KEY. | Options NONE. QUITON subprogram PAGE Q2 ------------------------------------------------------------- Format CALL QUITON Description The QUITON command enables the QUIT KEY. The QUIT KEY is already disabled upon entering RXB. QUITON makes the QUIT once again functional. You may need to use this command before running certain programs that use the QUIT key. Programs The program to the right will | >100 CALL QUITON turn on the QUIT KEY. | Options NONE. RDIAG subprogram PAGE R1 ------------------------------------------------------------- Format CALL RDIAG(row,column,character-code) CALL RDIAG(row,column,character-code, repetition[,...]) Description The RDIAG subprogram places character-code per the number of times specified in repetition at row and column. It will wrap off from one side of the screen and restart on the opposite side. RDIAG moves to the right and down. The row numbers from 1 to 24, column numbers from 1 to 32, character-code numbers from 0 to 32768, and repettion numbers from 0 to 32767. Notice the auto-repeat must have repetition or it gets row confused with repetition. See GCHAR, HCHAR, LDIAG, and VCHAR for more data. Programs The program to the right will | >100 CALL RDIAG(3,5,35,3,9,8, place character-code 35 at row| 42) 3 and column 5, then places | character-code 35 at row 4 and| column 6, then places | character-code 35 at row 5 and| column 7. Then places | character-code 42 at row 9 and| column 8. | Options NONE. RENAME subprogram PAGE R2 ------------------------------------------------------------- Format CALL RENAME(pathname,old-filename,new-filename [,...]) CALL RENAME(pathname,old-directory-name,new-di rectory-name[,...]) CALL RENAME(string-variable,string-variable, string-variable[,...]) CALL RENAME(number,old-filename,new-filename [,...]) Description The RENAME subprogram renames directorys or files. Pathname may be up to 255 characters in length. Pathname must end in a period. The Myarc HFDC can only support a 29 character pathname plus a 10 character filename, so that would add up to 39 characters total. The pathname must end with a period and filenames must only be 10 characters in length. RENAME can rename up to 15 files or directorys on 15 different drives all in one command. File error will be returned if the device is not accessed or the file or directory does'nt exist. File error will also be reported if renaming a protected file or directory. File error will be reported if the disk notch is covered. File error is also reported if the new-filename is already being used and is protected. Programs This line renames a file named| >CALL RENAME("DSKC.","A-FILEN A-FILENAME on RAMDISK C to the| AME","NEWNAME-1A") new filename NEWNAME-1A | | Line 100 renames a file named | >100 CALL RENAME(2,"JUNK","JU JUNK to JUNK2 on disk drive 2 | NK2") | Line 100 pathname A$ | >100 A$="DSK.TRASH.":: O$="LO String-variable O$ and N$ are | AD1" :: N$="load1" loaded with filenames. | | Line 110 rename LOAD1 to | >110 CALL RENAME(A$,O$,N$) load1 on disk named TRASH | | Line 110 access disk TRASH and| >120 CALL RENAME(A$,N$,O$,A$, first renames load1 to LOAD1 | O$,N$) and renames LOAD1 to load1 | Options See CAT or DIR for number or ASCII access to disk options. RES command PAGE R3 ------------------------------------------------------------- Format RES (Uses default values) RES initial line,increment RES initial line,increment,start line-end line Description The RES command is the same as per Extended Basic Manual page 155. The RESEQENCE comand is deleted. The abbreviation RES is the only access name. The RES command now allows a portion of the program to be resequenced. This RES DOES NOT REPLACE any undefined line numbers with 32767. Any undefined line numbers in the program are left as is. This makes it easier to fix if a problem is present. RES cannot be used to move lines from one location to another inside a program. If the new line numbers generated by the RES command would result in a line being moved, a Bad Line Number Error is generated. A Bad Line Number Error is also reported if there are no valid program lines between start line and end line. Command Lines 10 to 50 are renumbered.| >RES 20,1,10-50 Line 10 becomes 20, increment | is 1. | | Lines 700-800 are renumbered. | >RES ,5,700-800 Line 700 becomes 100, | incremnt is 5. | | Lines 50-80 are renumbered. | >RES ,,50-80 Line 50 becomes 100, | increment is 10. (Defualt) | | Lines 1000 to last line are | >RES 1000,,750- renumbered. Line 750 becomes | 1000, increment is 10. | | Lines to 400 are renumbered. | >RES ,20,-400 First Line becomes 100 | (Defualt), inecrement is 20. | | Line 40 is renumbered 20. | >RES 20,,40 Options None. RMDIR subprogram PAGE R4 ------------------------------------------------------------- Format CALL RMDIR(pathname,directory-name[,...]) CALL RMDIR(string-varialbe,string-variable [,...]) Description The RMDIR subprogram ReMoves DIRectorys on hard drives. The pathname determines the device used and the pathname can be up to 255 characters in length. The Myarc HFDC can only support 29 characters pathnames plus the filename of 10, so that would add up to 39 characters total. The pathname must end with a period and the directory may only be 10 characters in length. RMDIR can remove up to 24 directorys in 24 different drives in one command. RMDIR can also remove sub-directorys then directorys in the same command. Before any directory may be removed it must be empty of all files, or a error will be reported. Programs This line removes a directory| >CALL RMDIR("WDS1.","TEST") named TEST on hard drive 1. | | This line removes | >100 CALL RMDIR("WDS1.ONE.TWO sub-directory THREE of the | .","THREE","WDS1.ONE.","TWO" sub-directory TWO in main | ,"WDS1.","ONE") direcotry ONE then removes | sub-directory TWO of main | directory ONE then finally | removes directory ONE | Options NONE RMOTION subprogram PAGE R5 ------------------------------------------------------------- Format CALL RMOTION(#sprite-number[,...]) CALL RMOTION(ALL[,...]) Description The RMOTION subprogram reverses the row-velocity and column-velocity as numbers from -127 to 127. This means that RMOTION simply reverses the direction of the sprite specified so it goes in the opposite direction it was going in. This also means RMOTION ignores 0 and -128, so you can use those to bypass RMOTION if you do not want RMOTION to change the sprite. The fastest and slowest sprite speeds are never affected by RMOTION. This feature adds more power to RMOTION. The ALL feature also allows all sprites on the screen to reverse all at once. ALL may also be called as many times as wanted in a single program line. See EXTENDED BASIC MANUAL MOTION PAGE 125, SPRITE PAGE 173, DELSPRITE PAGE 75 for more data. Program RMOTION reverses the row- | >100 CALL RMOTION(#1) velocity and the column- | velocity in sprite-number 1. | | This line reverses the motion | >100 CALL RMOTION(ALL) of all sprites. | | Line 100 sets up a sprite. | >100 CALL SPRITE(#1,33,2,96,1 | 8,99,84) Line 110 waits for a number | >110 IF RND<.8 THEN 110 higher then .8 randomly. | Line 120 reverses the motion | >120 CALL RMOTION(#1) of the sprite. | Continues the program. | >130 GOTO 110 Options While characters 144 to 159 are being used, you can not use sprites. SCSI subprogram PAGE S1 ------------------------------------------------------------- Format CALL SCSI(pathname,string-variable,...]) Description The SCSI subprogram fetches a 44 byte package from the SCSI card and puts it into a string variable. This 44 byte package consists of 8 bytes internal, 8 bytes vendor ID, 16 bytes of product ID, 4 bytes revision value, 32 bit number of sectors, and 32 bit sector size. The pathname must end with a period. Programs This line gets the 44 byte | >CALL SCSI("SCS1.",A$) SCSI packet string from SCS1. | | This line gets the 44 byte | >100 CALL ("SCS1.",X$,"SCS3." SCSI packet string from SCS1, | ,Y$,"SCS4.",Z$) SCS3, and SCS4. | Options NONE SECTOR subprogram PAGE S2 ------------------------------------------------------------- Format CALL SECTOR(pathname,read/write-flag,#sectors, sector-string,[,...]) CALL SECTOR(number,number,number,string [,...]) CALL SECTOR(string-variable,numeric-variable, numeric-variable,string-variable[,....]) Description The SECTOR subprogram reads or writes sectors on disk or hard drives. The pathname determines the device used and the pathname can be up to 255 characters in length. The Myarc HFDC can only support 29 characters pathnames plus the filename of 10, so that would add up to 39 characters total. The pathname must end with a period and the directory may only be 10 characters in length. The read/write-flag may be any number to read sectors and 0 will write sectors. The #sectors ranges from 1 to 32 sectors being read/written at one time. The sector-string is a Hexidecimal string of the sector to read or write. Sector-string may be a "0" or up to "FFFFFFFF" or in other words in decimal form ranges from 0 to 4294967295 sectors. NOTE: The lower 8K for assembly support is used as a buffer for SECTOR so anything in the lower 8K will be corrupted. That means two things. 1. AMS support can store the sectors for duplication. 2. SECTOR is totally incompatable with TI Disk controllers. Sorry not enough VDP memory for this subprogram. Programs This line writes sector 0 to | >CALL SECTOR("DSK1.",0,1,"0") drive 1 from lower 8K. . | | This line reads sector 0 and | >100 CALL SECTOR(2,1,2,"0") 1 from drive 2 to lower 8K. | This line puts the 2 sectors | >110 CALL MOVE(4,512,8192,0) onto the screen from the lower| 8K. (See MOVE for info) | Options Only works when 32K availiable and destorys lower 8K data. SIZE command or subprogram PAGE S3 ------------------------------------------------------------- Format SIZE CALL SIZE Description See EXTENDED BASIC MANUAL PAGE 169 for more data. Command May only be used from command | >SIZE mode. | | Programs May only be used from program | >100 CALL SIZE mode. | | Shows memory used. | >100 CALL SIZE Set up for Assembly support. | >110 CALL INIT Shows memory used including | >120 CALL SIZE Assembly space free. | Set up for AMS switching. | >130 CALL AMSINIT Shows memory used including | >140 CALL SIZE AMS amount of K and RXB banks.| Options Unless you have a 32K installed Assembly support will not work. Also unless a AMS card is installed CALL AMSINIT will not work. SWAPCHAR subprogram PAGE S4 ------------------------------------------------------------- Format CALL SWAPCHAR(character-code,character-code [,...]) Description The SWAPCHAR subprogram switches the first character-code character definition with the second character-code character definition. That means they swap definitions. The characters range from 30 to 159. Programs Line 100 swaps character-code | >100 CALL SWAPCHAR(65,97) 65 with character-code 97. | | Line 100 defines character- | >100 CALL CHAR(128,"F0F0F0F0F code 128 and character-code | 0F0F0F0",159,"0F0F0F0F0F0F0F 159. | 0") Line 110 swaps them, then will| >110 CALL SWAPCHAR(128,159,32 swap space with characer 128 | ,128) Line 120 continues program. | >120 GOTO 110 | Try this one on for weird. | >100 CALL SWAPCHAR(31,32,31,3 | 2) | >110 CALL INVERSE(31) | >120 GOTO 100 Options NONE. SWAPCOLOR subprogram PAGE S5 ------------------------------------------------------------- Format CALL SWAPCOLOR(character-set,character-set [,...]) CALL SWAPCOLOR(#sprite-number,#sprite-number [,...]) Description The SWAPCOLOR subprogram swaps foreground and background colors of the first set with the second set. Or swaps the first sprite-number color with the second sprite-number color. The character-set numbers are given below: set-number character-codes ~~~~~~~~~~ ~~~~~~~~~~~~~~~ 0 ---------- 30 to 31 1 ---------- 32 to 39 2 ---------- 40 to 47 3 ---------- 48 to 55 4 ---------- 56 to 63 5 ---------- 64 to 71 6 ---------- 72 to 79 7 ---------- 80 to 87 8 ---------- 88 to 95 9 ---------- 96 to 103 10 ---------- 104 to 111 11 ---------- 112 to 119 12 ---------- 120 to 127 13 ---------- 128 to 135 14 ---------- 136 to 143 (also sprite table) 15 ---------- 144 to 151 (also sprite table) 16 ---------- 152 to 159 Programs The program to the right will | >100 CALL SWAPCOLOR(15,5) swap foreground and background| colors of set 15 with set 5. | | Line 100 sets up two sprites | >100 CALL SPRITE(#1,65,2,99,9 on screen. | 9,#2,66,16,88,88) Line 110 swaps sprite #1 color| >110 CALL SWAPCOLOR(#1,#2) with sprite #2 color. | Continue program. | >120 GOTO 110 Options NONE. USER subprogram PAGE U1 ------------------------------------------------------------- Format CALL USER(quoted-string) CALL USER(string-variable) Description The USER subprogram overides the normal editor of edit mode of XB and reads a DV80 file into the keyscan routine as if the user was keying it in. That means Batch Processing is creating XB programs from DV80 files, Editting XB programs, MERGING, Saving, and RUNNING XB programs. Also RESequencing, adding lines, or deleting lines, and re-writting lines from the DV80 file. Every line to be input from the DV80 file MUST END WITH A CARRIAGE RETURN! A line of input may be up to 588 characters in length. The editor will error out if the crunch buffer is full, reporting a *Line Too Long* error. (Over 163 tokens) Other errors will be reported but will not stop the proccess of USER continuing to input lines. To find errors in the DV80 file the input lines are shown on screen as they are input into the editor, and errors will be reported. So you must observe the screen for errors to test the DV80 file. USER will stop after reaching the end of the file. But USER can have it's operation suspended CALL POKEV(2242,0) will halt USER and CALL POKEV(2242,9) will resume USER. INPUT and ACCEPT will try to read from USER if it is not turned off. On the other hand DV80 files can go directly into a INPUT or ACCEPT prompts. Turn off USER to be safe though. USER will only report errors upon opening, thus if incorrect device or filename then USER reports * USER ERROR * and just closes the USER file, thus ending operation of USER. Example files are included with RXB to show and explain the use of USER. The batch processing USER subprogram opens a new world to the RXB programmer. Possibilities are almost endless! Programs This line starts USER to use | >CALL USER("DSK1.FILENAME") Batch processing on a file | called FILENAME | | Line 100 is same as above. | >100 CALL USER("DSK1.FILE") but within a program. | | Line 100 variable A$ equals a | >100 A$="DSK.VOLUME.FILE" String-variable path name. | Line 110 starts USER to use | >110 CALL USER(A$) Batch processing on A$ | USER PAGE U2 ------------------------------------------------------------- Programs Save this program as LOAD. | >100 CALL USER("DSK1.BATCH") | Here is an example DV80 file you save with the name BATCH. ! BATCH file for using NEW and CALL FILES and RUN. cr cr CALL XBPGM("DSK1.A-PROGRAM",#) cr The above DV80 file uses cr to mean Carrige Return. And # is for the number of files you wish open. A-PROGRAM is the name of the XB program that needs a certain number of files open. The Missing Link is an example of a program that needs USER. Options To many to list out. See BATCH for demo. VCHAR subprogram PAGE V1 ------------------------------------------------------------- Format CALL VCHAR(row,column,character-code) CALL VCHAR(row,column,character-code, repetition[,...]) Description See EXTENDED BASIC MANUAL page 188 for more data. The only change to VCHAR is the auto-repeat function. Notice the new auto-repeat must have the repetitions used or it gets row confused with repetitions. Programs This line puts character 38 at| >100 CALL VCHAR(1,1,38,99,9,1 row 1 column 1 99 times, then| ,87) puts character code 87 at | row 9 column 1 | | Fills screen with characters. | >100 CALL VCHAR(1,1,32,768,1, | 1,65,768,1,1,97,768,1,1,30,7 | 68) :: GOTO 100 Options NONE. VERSION subprogram PAGE V2 ------------------------------------------------------------- Format CALL VERSION(numeric-variable) Description See EXTENDED BASIC MANUAL PAGE 190 for more data. Also see Programs This line will ask for version| >CALL VERSION(X) and return current to numeric-| variable X. | | Line 100 asks for version num.| >100 CALL VERSION(V) Line 110 checks for version | >110 IF V>240 THEN INPUT "DSK to be larger then 240 and if | NAME":D$ :: INPUT "FILENAME" it is will ask for input to | :F$ :: CALL XBPGM("DSK."&D$& use a new routine CALL XBPGM. | F$) ELSE END Options Will always return current version of RXB. VGET subprogram PAGE V3 ------------------------------------------------------------- Format CALL VGET(row,column,length,string-variable [,...]) Description The VGET subprogram returns into a string-variable from the screen at row and column. Length determines how many characters to put into the string-variable. Row numbers from 1 to 24 and column numbers from 1 to 32. Length may number from 1 to 255. If VGET comes to the edge of the screen then it wraps to the other side. Programs The program to the right will | >100 CALL VGET(5,9,11,E$) put into string-variable E$ | the 11 characters at row 5 and| column 9. | | The program to the right will | >100 CALL VGET(1,3,5,M$,9,3,1 put into string-variable M$ | ,Q$,24,1,32,N$) the 5 characters at row 1 and | column 3, then put into | string-varialbe Q$ the 1 | character at row 9 and column | 3, then put into | string-variable N$ the 32 | characters at row 24 and | column 1. | Options NONE. VPUT subprogram PAGE V4 ------------------------------------------------------------- Format CALL VPUT(row,column,string[,...]) CALL VPUT(row,column,string-variable[,...]) Description The VPUT subprogram puts a string or string-variable onto the screen at row and column. The row numbers from 1 to 24 and column numbers from 1 to 32. If the string or string-variable being put onto screen goes to an edge it wraps to the other side. Unlike the EXTENDED BASIC DISPLAY AT the VPUT subprogram will not scroll the screen. Programs Line 100 puts string "THIS" on| >100 CALL VPUT(10,4,"THIS") the screen at row 10 and | column 4. | | Line 110 sets string-variable | >110 A$="VPUT" A$ equal to string "VPUT" | | Line 120 puts string "is" at | >120 CALL VPUT(11,5,"is",10,6 row 11 and column 5, then puts| ,A$) string-variable A$ at row 10 | and column 6. Options NONE. XB Device Service Routine (DSR) PAGE X1 ------------------------------------------------------------- Format RUN "XB" DELETE "XB" CALL CAT("XB") OLD XB SAVE XB -(Must have a program within -memory to work at all) CALL LOAD("XB") -(CALL INIT must proceed it) Description The XB DSR (Device Service Routine) allows access to the RXB title screen. The access will work only if the DSR is in the GPLDSR or LINK DSR. In other words, a DSR that acknowledges any type of DSR in RAM, ROM, GROM, GRAM, or VDP. Most DSR's only accept DSK or PIO. Others like the SAVE or LIST commands will only work with a program in the memory first. Still others like CALL LOAD("XB") must have the CALL INIT command used first. From EA option 5 you may type XB then enter, or from EA option 3 type XB then enter, then enter again. If the EA option 1 (edit), then 4 (print) type XB. From TI BASIC use OLD XB or DELETE "XB". Keep in mind that if it does not work, the problem is the DSR your using. Almost all DSR's today only acknowledge the ROM or RAM DSR's. As the XB DSR is in GROM/GRAM it seems a bit short sighted on the part of most programmers to use cut down versions of a DSR. Please discourage this as it is a diservice to us all. Programs The program at the right will | >100 CALL EAPGM("XB") turn on the AUTO SELECTOR and | wait 4 second before switching| to the AUTO LOAD. | | This line asks for a string. | >100 INPUT A$ This line uses the string and | >110 DELETE A$ if you type XB then enter will| switch to the RXB. | | This line show lower case can | >call xb be used. | | Options BASIC and EA are also availiable. XBPGM subprogram PAGE X2 ------------------------------------------------------------- Format CALL XBPGM("access-name") CALL XBPGM(string-variable) CALL XBPGM("access-name",file-number) CALL XBPGM(string-variable,numeric-variable) Description The XBPGM subprogram is like RUN in XB. (XB manual page 161) The RUN subprogram can't run strings so special XB loader programs were written and required. Using RUN A$ results in a error report of * syntax error * in normal XB. XBPGM uses quotes like RUN or strings unlike RUN. So XBPGM will run XB or BASIC programs. The file-number or numeric-variable denote the number of files to be open before the XB program is loaded and run. XBPGM first sets the number of files open, uses a NEW and then runs the access string. See FILES for more info. If a CALL XBPGM can't find the program or disk it will close all files, clear all XB memory (Assembly lower 8K unaffected) and leave you in XB command mode. You will know this by the * Ready * and the cursor flashing below. This allows you to try again with either RUN or CALL XBPGM again. If an empty string is used XBPGM defualts to restart the RXB title screen. See XB for more info. Programs The program at the right will | >100 CALL XBPGM("DSK2.HOT") load a XB Program named HOT | from disk drive 2 then run it.| | This line loads string GZ$. | >100 GZ$="DSK.XBGAMES.FROG" This line uses the string path| >110 CALL XBPMG(GZ$) name to search all drives and | RAMDISKS for a disk named | XBGAMES and load a program | named FROG then run that | program. | | Line 100 should be added to | >100 CALL QUITON most RXB program to allow the | >110 CALL XBPGM("DSKR.LOAD") QUIT key to work for aborting | XBPGM loader. | | This line could be used to | >100 CALL XBPGM("DSK1.TML",1) set and run a program named | TML after opening only 1 file.| | Options XBPGM can access any DSR (Device Service Routine) like OLD, or LOAD or RUN can.