Jump to content
IGNORED

RXB - Rich Extended Basic


Bones-69

Recommended Posts

 

Am I correct in assuming this will all be transparent to the program and that ANY pre-existing TI Extended BASIC program will work in it?

Yea unless you have something goofy like VPEEK for a string or symbol or VDP Stack, those will all be in RAM on the SAMS.

There is no logical reason to use VDP for Strings and symbols or stack when we can use the SAMS RAM which is much faster and more of it.

Also I will remove all the VDP pointers and temporary buffers for XB, except for of course Device Buffers at top of VDP RAM.

So yea all XB and BASIC programs will work in SAMS RXB just fine, well except they will run faster.

VDP is much slower than RAM by anyones standards.

 

Now any Assembly Language CALL LINK program will be a little faster to as the normal LINK used VDP to store variables and strings.

Thus if you have a Assembly Language program that needs the old access to VDP you can not use SAMS RXB as the locations have changed from VDP to RAM.

 

I can think of a few Lower 8K Assembly programs that did this like XBDETECTIVE for example that read string variables from VDP which will not work as SAMS RXB have them in SAMS RAM.

 

I do not think people understand how many times per subprogram Extended Basic used VDP and how it really slows down XB.

Edited by RXB
Link to comment
Share on other sites

  • 2 weeks later...

Yea unless you have something goofy like VPEEK for a string or symbol or VDP Stack, those will all be in RAM on the SAMS.

There is no logical reason to use VDP for Strings and symbols or stack when we can use the SAMS RAM which is much faster and more of it.

Also I will remove all the VDP pointers and temporary buffers for XB, except for of course Device Buffers at top of VDP RAM.

So yea all XB and BASIC programs will work in SAMS RXB just fine, well except they will run faster.

VDP is much slower than RAM by anyones standards.

 

Now any Assembly Language CALL LINK program will be a little faster to as the normal LINK used VDP to store variables and strings.

Thus if you have a Assembly Language program that needs the old access to VDP you can not use SAMS RXB as the locations have changed from VDP to RAM.

 

I can think of a few Lower 8K Assembly programs that did this like XBDETECTIVE for example that read string variables from VDP which will not work as SAMS RXB have them in SAMS RAM.

 

I do not think people understand how many times per subprogram Extended Basic used VDP and how it really slows down XB.

 

I know very little about GPL Rich. How hard is it to call assembler routines and return to GPL?

 

​BF

Link to comment
Share on other sites

 

I know very little about GPL Rich. How hard is it to call assembler routines and return to GPL?

 

​BF

GPL has a routine built in call XML that only takes 2 bytes, one byte is the XML command in GPL the other byte is a one byte preset branch table in the TI OS.

 

If you look at the source of RXB hit has more XML subroutines then normals XB does.

 

The problem with Assembly is it is a MEMORY HOG and has to be in RAM, this presents a real issue as the TI does no have ANY CONSOLE RAM.

 

Look at the XB2 module, it is totally useless in a Console with no memory expansion.

Link to comment
Share on other sites

In the assembly side, you have to put an address table at a fixed address (see table below, from GPL manual).


Like this

>6010 Sub1 address

>6012 Sub2 address

etc.


Sub1:

do something

LWPI >83E0

RT


Then in GPL, to call Sub2:

XML >71 (7 = table at >6010, 1 = 2nd routine)


Here's the table

2 = >2000

7 = >6010

8 = >6030

9 = >7000

F = >8300

  • Like 2
Link to comment
Share on other sites

 

In the assembly side, you have to put an address table at a fixed address (see table below, from GPL manual).
Like this
>6010 Sub1 address
>6012 Sub2 address
etc.
Sub1:
do something
LWPI >83E0
RT
Then in GPL, to call Sub2:
XML >71 (7 = table at >6010, 1 = 2nd routine)
Here's the table
2 = >2000
7 = >6010
8 = >6030
9 = >7000
F = >8300

 

Yep exactly how GPL in XB uses the ROMs for the XB Cartridge.

Also how XB called routines in Lower 8K too.

 

In RXB I use XML >F0 for my GPL routine CALL EXECUTE(ADDRESS)

 

It puts the ADDRESS in FAC and executes a BLWP @>8300 and FAC has the Workspace.

Much faster then CALL LINK as it does no checking of values or does it mess with the VDP STACK like CALL LINK does.

Edited by RXB
Link to comment
Share on other sites

 

Hi Rich,

I one of 'those guys' that does not know a lick of assembly language, and I don't have the time or inclination to try learning it either. It's simply, "not my bag". Now while I have done a few things in Extended BASIC, I like you wish it was faster, but it's not an environment I want to actually RUN my programs in. For me (personally) compiling the completed program is, "where it's at". To that end I'm REALLY, REALLY looking forward to Fest West this year... but I don't want to give anything away.

 

So, what was it?

  • Like 1
Link to comment
Share on other sites

This is the new RXB SAMS version RAM Memory Map.

                                     RXB SAMS MEMORY MAP


**************************************        ************************************
* Lower 8K Assembly Support 4K banks *        * Extended BAsic ROM Banks 4K each *
**************************************        ************************************
* >2000 - >2FFF banks 16 - 224 (832K)*        * >6000 - >6FFF      bank 0        *
**************************************        ************************************
* >3000 = >3FFF banks 16 = 224 (832K)*        * >7000 - >7FFF      bank 1        *
**************************************        ************************************
                                              * >7000 - >7FFF      bank 2        *
                                              ************************************
**************************************    
* Temporay 4K buffer for transfer    *
**************************************
* 225 bank number 4K for temp use    *
**************************************



*************************************************************************************************
* XB Programs   * Strings       * Numerics      * Copy of VDP   * Copy of VDP   * Copy of VDP   *
* Line Numbers  * Temp Strings  * Symbol Table  * Graphics mode * Text mode     * Bit Map mode  *
*               *               * STACK         *               *               *               *
*    24K        *    24K        *     24K       *     16K       *     16K       *     16K       *
*************************************************************************************************
* >A000 - >AFFF * >A000 - >AFFF * >A000 - >AFFF * >A000 - >AFFF * >A000 - >AFFF * >A000 - >AFFF *
* bank 226      * bank 232      * bank 238      * bank 244      * bank 248      * bank 252      *
*************************************************************************************************
* >B000 - >BFFF * >B000 - >BFFF * >B000 - >BFFF * >B000 - >BFFF * >B000 - >BFFF * >B000 - >BFFF *
* bank 227      * bank 233      * bank 239      * bank 245      * bank 249      * bank 253      *
*************************************************************************************************
* >C000 - >CFFF * >C000 - >CFFF * >C000 - >CFFF * >C000 - >CFFF * >C000 - >CFFF * >C000 - >CFFF *
* bank 228      * bank 234      * bank 240      * bank 246      * bank 250      * bank 254      *
*************************************************************************************************
* >D000 - >DFFF * >D000 - >DFFF * >D000 - >DFFF * >D000 - >DFFF * >D000 - >DFFF * >D000 - >DFFF *
* bank 229      * bank 235      * bank 241      * bank 247      * bank 251      * bank 255      *
*************************************************************************************************
* >E000 - >EFFF * >E000 - >EFFF * >E000 - >EFFF *
* bank 230      * bank 236      * bank 242      *
*************************************************
* >F000 - >FFFF * >F000 - >FFFF * >F000 - >FFFF *
* bank 231      * bank 237      * bank 243      *
*************************************************

Use of banks for VDP copy allow for switching Graphics modes entire VDP memory each time.
Any file opened must only be used from that VDP mode used as even buffers are copied.

This set up is similar to Myark XB 2 except unlike Myark XB 2 it is not all assembly,
but does offer 24K of program space, 24K of string space and double stack size for RXB
SAMS using 128 bytes of stack space. This is double the space and not in slow VDP.
Edited by RXB
  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

Hi well the Extended Basic ROMs are coming along but if you have a chance PLEASE take a look and make comments on if you see something you can suggest.

 

Ton of code that looks very sloppy in places and some the jump and branches look like planned by a mad man...example:

 

JUMP JUMP JUMP

--------------------------------------------------------------------

>67F0 ---------------- >6738 ---------------------- >664E

 

JUMP JUMP BRANCH

---------------------------------------------------------------------

>6856 ---------------- >6762 ---------------------- >62CE

 

JUMP JUMP BRANCH

----------------------------------------------------------------------

>68B6 --------------- >6738 ----------------------- >640C

 

JUMP JUMP BRANCH

----------------------------------------------------------------------

>68EC ----------------------------------------------- >64FA

 

BRANCH BRANCH

--------------------------------------------------------------------

>69A4 ----------------------------------------------- >64FA

 

And so on to several others. Why they did not use BRANCH instead of 3 or 4 jumps instead baffles me.

You see a JUMP and not far from it a BRANCH that goes exactly where instead they used JUMP 3 times to get to same place????

 

Anyway here is the lot more XB Source ROM code with comments and again any help would be nice.

 

 

XBROM SOURCE.zip

Link to comment
Share on other sites

 

JUMP JUMP JUMP

--------------------------------------------------------------------

>67F0 ---------------- >6738 ---------------------- >664E

 

It was probably done to save some memory. You can't jump from >67F0 to >664E because it is too far. You can B @>664E but that takes two words, while the JMP iinstruction takes only one word. So jumping to an existing jump that takes you where you want to go makes some sense if you are trying to conserve memory. If I am reading the manual right, it looks like one branch takes 16 clock cycles and two jumps take 20 clock cycles, so there isn't that much of a speed penalty. I do agree that it reminds one of Italian cuisine!

Link to comment
Share on other sites

Yea like this is the only Key SCAN in XB ROMs:

*
* KEY SCAN                        
LN654E BL   @>000E           * KEY SCAN ROUTINE          
LN6552 C    @>6000,@RKEY     * >0002(FCTN 4 BREAK)= RKEY ?>  (>8375 & >8376)             
LN6558 JEQ  LN65D2           * Equal jump           
LN655A JMP  LN6576           * jump
*
*                                                                  
LN6576 MOV  @PGMPTR,@SMTSRT   *# Put PGMPTR into SMTSRT            
LN657C INCT R9                * R9 + 2          
LN657E MOV  @>6466,*R9        * Put >65A6 into Address R9
* Get a XB token & increment Program Pointer (zero VDP / Any value ERAM)             
LN6582 BL   @LN6C74           *           
LN6586 JEQ  LN65C8            * Equal jump          
LN6588 JLT  LN658E            *# Lower Than jump               
LN658A B    @LN6948           * Get Token and check for = or ,
*                       
LN658E MOV  R8,R7             *# Put R8 into R7               
LN6590 INC  @PGMPTR           * PGMPTR + 1         
LN6594 MOVB *R10,R8           * Put ADDRESS MSB R10 into MSB R8          
LN6596 SRL  R7,7                        
LN6598 AI   R7,>FEAC          * Add >FEAC into R7
* PUt >0003 into R0, Return ERROR CODE back to GPL                    
LN659C JGT  LN664E            * Greater Than jump          
LN659E MOV  @>69FC(R7),R7     * >8010+R7 into R7             
LN65A2 JLT  LN64C2            * Lower Than jump          
LN65A4 B    *R7               * RETURN                 
*
* FLIP ADDRESS >65A6 TO SWAP UPPER ROMS *
*
LN65A6 C    @>0288(R5),R13    *# >0288+R5 = R13 ?           
LN65AA C    R0,R8             * R0 = R8 ?          
LN65AC JEQ  LN6542            * Equal jump Turn on Interupts, SCAN Keyboard          
LN65AE MOVB @PRGFLG,R0        *# Put MSB PRGFLG into MSB R0              
LN65B2 JEQ  LN6656            * jump          
LN65B4 S    @>6A80,@EXTRAM    * EXTRAM->0004  >>>>>FIND ANOTHER >0004<<<<<          
LN65BA C    @EXTRAM,@STLN     * EXTRAM = STLN ?          
LN65C0 JHE  LN650E            * Higher Equal jump EXECG          
LN65C2 JMP  LN6656            *# jump
*                    
LN65C4 MOVB R8,R8             * Put MSB R8 into MSB R8 (Set Equal Bit)          
LN65C6 JNE  LN6588            * Not Equal jump          
LN65C8 DECT R9                *# R9 - 2                    
LN65CA JMP  LN65AE            * jump     
*                 
***************************** CONTIN XML ********************************
*
* CONTINUE AFTER A BREAK *
* V@SAVEVP = INIT FOR PROGRAM COMPLETION
* FLAG BYTES FOR CONTROL:
* @PRGFLG = PROGRAM MODE
* @RAMFLG = RANFLAG
*
CONTIN EQU  $
* Substack pointer in R9 
* and actual Basic byte in R8
LN65CC BL   @>1E7A                      
LN65D0 JMP  LN6542           *# Turn on Interupts, SCAN Keyboard
*                    
LN65D2 JMP  LN6644           * jump
*                    
LN65D4 JMP  LN6672           * jump
*                     
LN65D6 MOVB R8,R8            *# :: Double Colon ?                  
LN65D8 JEQ  LN65E6           * Equal jump           
LN65DA CI   R8,VAR0          * R8 = VAR0 ?           
LN65DE JH   LN664E           * Higher jump PUt >0003 into R0, Return ERROR CODE back to GPL          
LN65E0 CI   R8,>8100         * R8 = :: (Double Colon Token) ?           
LN65E4 JL   LN664E           * Lower jump PUt >0003 into R0, Return ERROR CODE back to GPL         
LN65E6 MOV  *R9,R7           *# Put address contents R9 into R7               
LN65E8 JLT  LN64F4           * Less Than jump           
LN65EA DECT R9               * R9 - 2           
LN65EC B    @>0002(R7)       * 2+R7
*
* Quoted $ or LN# or Get Token                   
LN65F0 MOVB R8,R8            *# Put MSB R8 into MSB R8 (Set equal bit)                 
LN65F2 JEQ  LN65E6           * Equal jump           
LN65F4 CI   R8,>C700         *# R8 = (Quoted String) ?               
LN65F8 JL   LN660A           * Lower jump           
LN65FA CI   R8,>C900         * R8 = (Line Number Constant) ?           
LN65FE JEQ  LN662A           * Equal jump           
LN6600 JL   LN6618           * Lower jump
* Get a XB token & increment Program Pointer (zero VDP / Any value ERAM)                      
LN6602 BL   @LN6C74          *#                
LN6606 JEQ  LN65E6           * Equal jump           
LN6608 JMP  LN65F4           * jump
*           
LN660A CI   R8,VAR0          *# R8 = VAR0 ?                  
LN660E JH   LN6602           * Higher jump           
LN6610 CI   R8,>8200         * R8 = :: (Double Colon Token) ?          
LN6614 JL   LN6602           * Lower jump           
LN6616 JMP  LN65E6           * jump 
* Get a XB token & increment Program Pointer (zero VDP / Any value ERAM)                   
LN6618 BL   @LN6C74          *#                  
LN661C SWPB R8                          
LN661E A    R8,@PGMPTR       * Add R8 into PGMPTR           
LN6622 CLR  R8               * Zero out R8
* Get a XB token & increment Program Pointer (zero VDP / Any value ERAM)                         
LN6624 BL   @LN6C74          *#                    
LN6628 JMP  LN65F0           * jump  Quoted $ or LN# or Get Token  
*                    
LN662A INCT @PGMPTR          *# PGMPTR + 2
* Get a XB token & increment Program Pointer (zero VDP / Any value ERAM)              
LN662E JMP  LN6624           * jump
*           
***************************** RTNB XML *********************************
*
* RETURN *
*
RTNB   EQU  $
* Substack pointer in R9 
* and actual Basic byte in R8
LN6630 BL   @>1E7A           *           
LN6634 JMP  LN65E6           * jump 
*                     
LN6636 MOVB @FLAG,R0         * Put MSB FLAG into MSB R0           
LN663A SLA  R0,1             * Same as R0 * 2           
LN663C JLT  LN65D0           * Lower Than jump           
LN663E LI   R0,>0001         *# Put >0001 into R0            
LN6642 JMP  LN6652           * Return ERROR CODE back to GPL 
* 
* FCTN 4 BREAK                   
LN6644 MOVB @FLAG,R0         *# Put MSB FLAG into MSB R0             
LN6648 SLA  R0,1             * Same as R0 * 2           
LN664A JLT  LN6576           * Lower Than jump           
LN664C JMP  LN663E           * jump
*
* SET ERROR CODE >0003                        
LN664E LI   R0,>0003         *# Put 3 into R0 (ERROR CODE)           
LN6652 MOV  R0,@ERRCOD       *# LOAD ERROR CODE Return ERROR CODE back to GPL         
LN6656 MOV  @RTNG,R7         *# Put RTNG into R7 (Assemby Return Variable)           
LN665A B    @LN64B0          * Set substack pointer and Basic byte
*                     
LN665E DECT R9               * R9 - 2           

Link to comment
Share on other sites

OMG never occurred to me this would crop up as a problem:

 

Here is RXB 2015 listing from >6372 to >649A

[0657]               ***********************************************************
[0658]               *            START OF BASIC INTERPETER
[0659]               ***********************************************************
[0660]               * GROM Address >6372 TOPLEV
[0661] 6372 86,A3,71 TOPLEV CLR  V@LODFLG           Initialize temp area
[0662]               * RXB PATCH CODE USER ***********************************
[0663]               *        MOVE 77,V@LODFLG,V@LODFLG+1
[0664]               *        ST   5,@KEYBD          Select full keyboard
[0665]               *        SCAN
[0666]               *        CZ   @KEYBD
[0667]               *        BR   G6388             99/4A Console?
[0668]               *       ST   >01,V@CONFLG      Select 99/4A console
[0669] 6375 BC,4A,A3        ST   V@CONFLG,@FAC       Save CONFLG
       6378 BB
[0670] 6379 35,00,4D        MOVE 77,V@LODFLG,V@LODFLG+1
       637C A3,72,A3
       637F 71
[0671] 6380 BC,A3,BB        ST   @FAC,V@CONFLG       Restore CONFLG
       6383 4A
[0672] 6384 43,88           BR   G6388
[0673] 6386 43,88           BR   G6388
[0674]               *
[0675] 6388 86,74    G6388  CLR  @KEYBD
[0676] 638A BF,A3,8C        DST  NLNADD,V@BUFSRT   Initialize edit-buffer start
       638D 02,E2
[0677] 638F BF,A3,8E        DST  NLNADD,V@BUFEND   Initialize edit-buffer end
       6392 02,E2
[0678] 6394 31,00,02        MOVE 2,G@ATNZZ,@INTRIN Get address of ATNZZ
       6397 38,00,32
[0679] 639A B2,38,1F        AND  >1F,@INTRIN       Throw away the BR opcode
[0680] 639D A3,38,00        DADD >5B,@INTRIN       Address of polynomial constan
       63A0 5B
[0681] 63A1 BE,A3,71        ST   >31,V@LODFLG      indicate try auto-boot
       63A4 31
[0682]               *----------------------------------------------------------
[0683]               * Add the following line for fixing "MEMORY FULL" error
[0684]               * occurring during MERGE execution will leave the file open
[0685]               * to disk DSR bug, 5/19/81
[0686] 63A5 86,A3,9E SZNEW  CLR  V@MRGPAB          Initialize merged temporary
[0687]               *                              for PAB pointer
[0688]               *----------------------------------------------------------
[0689] 63A8 BE,73,88        ST   RSTK,@SUBSTK      Load base of subroutine stack
[0690] 63AB 06,69,17        CALL CHRTA2            Load character table
[0691] 63AE 86,45           CLR  @FLAG             Initialize flag byte
[0692] 63B0 87,46           DCLR @BUFLEV           Initialize crunch buffer leve
[0693] 63B2 06,80,12        CALL CLSALL            Close all open files
.
99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0015 
EDIT-359
[0694] 63B5 86,34           CLR  @DATA             Initialize READ/DATA pointer
[0695] 63B7 BF,6E,09        DST  VRAMVS,@VSPTR     Initialize base of value stac
       63BA 58
[0696] 63BB BD,24,6E        DST  @VSPTR,@STVSPT    Save in permanent base
[0697] 63BE BD,A3,88        DST  @VSPTR,V@SAVEVP
       63C1 6E
[0698] 63C2 06,68,C3        CALL INITPG            Initialize program & s.t.
[0699] 63C5 06,A0,18        CALL INTRND            Initialize random number
[0700] 63C8 8E,A3,71        CZ   V@LODFLG
[0701] 63CB 63,D3           BS   TOPL02            If need auto-boot
[0702]               * RXB PATCH CODE *************
[0703]               *      CLR  V@LODFLG          Won't ever need to do again
[0704] 63CD 43,D0           BR   G63D0
[0705]               * RXB PATCH CODE ******************************************
[0706]                      AORG >03D0
[0707] 63D0 06,64,8E G63D0  CALL AUTOLD            Attempt an auto-boot
[0708]               *     Label TOPL02 is used by auto-boot in detection of err
[0709] 63D3          ERRRDY EQU  $
[0710] 63D3 06,6A,84 TOPL02 CALL G6A84             Say READY
[0711] 63D6 00              BYTE 0               *  returns to TOPL15
[0712] 63D7 06,68,C3 TOPL05 CALL INITPG            Initialize program space
[0713] 63DA 06,68,DC TOPL10 CALL KILSYM            Kill the symbol table
[0714]               * RXB PATCH CODE *************
[0715]               * TOPL15 AND  >F7,@FLAG         If error in UDF execution
[0716] 63DD 05,7D,B1 TOPL15 B    MYSRCH
[0717] 63E0 BE,74,05 G63E0  ST   5,@KEYBD          Select full keyboard
[0718] 63E3 03              SCAN
[0719] 63E4 86,74           CLR  @KEYBD
[0720] 63E6 BE,73,88 TOPL20 ST   RSTK,@SUBSTK      Initialize subroutine stack
[0721] 63E9 BF,20,02 TOPL25 DST  NLNADD,@VARW      Screen addr = lower left corn
       63EC E2
[0722] 63ED 86,80,89        CLR  @RAMFLG           Clear the RAMFLG
[0723] 63F0 86,44           CLR  @PRGFLG           Make sure not in program mode
[0724]               * Check for auto-num mode
[0725] 63F2 DA,45,01        CLOG >01,@FLAG         If auto-num on
[0726] 63F5 64,1E           BS   TOPL35
[0727] 63F7 A1,14,0E        DADD @CURINC,@CURLIN   Generate new line number
[0728] 63FA D2,14,00        CGE  0,@CURLIN         >32767?
[0729] 63FD 64,05           BS   TOPL30
[0730] 63FF B2,45,FE        AND  >FE,@FLAG         If out of range->exit auto-nu
[0731] 6402 05,64,1E        B    TOPL35            Merge in below
[0732]               * Must be a long branch!!
[0733] 6405 D5,30,32 TOPL30 DCEQ @ENLN,@STLN       Line might exist
[0734] 6408 64,12           BS   G6412
[0735] 640A BD,4A,14        DST  @CURLIN,@FAC      Ready for program search
[0736] 640D 0F,7E           XML  SPEED
[0737] 640F 03              BYTE SEETWO          * Search for existence of line
[0738] 6410 65,1D           BS   EDTZ05            COND set = line found
[0739] 6412 0F,83    G6412  XML  SCROLL            Scroll to the next line
[0740] 6414 BD,5E,14        DST  @CURLIN,@ARG2     New line #
[0741] 6417 06,6F,BA        CALL DISO              Display the line number
[0742] 641A 91,20           DINC @VARW             Following by a space
[0743] 641C 44,20           BR   G6420
[0744] 641E 0F,83    TOPL35 XML  SCROLL            Scroll the screen
[0745] 6420 BE,A2,E1 G6420  ST   >9E,V@NLNADD-1    Display the prompt character
       6423 9E
[0746] 6424 06,6A,76        CALL G6A76             Read in a line
[0747] 6427 06,D0,AF        CALL SAVLIN            Save input line for recall
[0748]               *    Crunch the input line
[0749] 642A 86,22           CLR  @ERRCOD           Assume no-error return
[0750] 642C BF,0A,08        DST  CRNBUF,@RAMPTR    Initialize crunch pointer
       642F 20
[0751] 6430 0F,7F           XML  CRUNCH            CRUNCH the input line
[0752] 6432 00              BYTE 0              *  Normal crunch mode
.
99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0016 
EDIT-359
[0753] 6433 8A,23    TOPL42 CASE @ERRCOD+1
[0754] 6435 44,45           BR   TOPL45            No error detected
[0755] 6437 49,7C           BR   ERRSYN            *SYNTAX ERROR
[0756] 6439 49,90           BR   ERRBLN            *BAD LINE NUMBER
[0757] 643B 49,94           BR   ERRLTL            *LINE TOO LONG
[0758] 643D 49,86           BR   ERRNTL            *NAME TOO LONG
[0759] 643F 49,80           BR   ERRNQS            *UNMATCHED QUOTES
[0760] 6441 49,9A           BR   ERRCIP            *COMMAND ILLEGAL IN PROGRAM
[0761] 6443 49,A4           BR   ERRIVN            *UNRECOGNIZED CHARACTER
[0762] 6445 8F,4A    TOPL45 DCZ  @FAC              Line # present
[0763] 6447 64,62           BS   TOPL55
[0764] 6449 DA,45,01        CLOG >01,@FLAG         Not AUTONUM
[0765] 644C 44,5B           BR   G645B
[0766] 644E D6,75,0D        CEQ  >0D,@RKEY         Must be up or down
[0767] 6451 64,5B           BS   G645B
[0768] 6453 D6,42,01        CEQ  >01,@CHAT         Start EDIT mode
[0769] 6456 44,5B           BR   G645B
[0770] 6458 05,D0,00        B    EDTZZ0
[0771] 645B 06,66,CF G645B  CALL EDITLN            EDIT the line into the progra
[0772] 645E 63,E9           BS   TOPL25            If didn't change the line
[0773] 6460 43,DA           BR   TOPL10
[0774]               *    Jump always
[0775] 6462 D6,42,01 TOPL55 CEQ  >01,@CHAT         If blank line - ignore
[0776] 6465 63,E9           BS   TOPL25
[0777] 6467 D6,A8,20        CEQ  >EB,V@CRNBUF
       646A EB
[0778] 646B 65,C9           BS   SZSIZE
[0779] 646D C6,A8,20        CH   >08,V@CRNBUF      If imperative
       6470 08
[0780]               * GKXB Branch code for new commands DEL, COPY, and MOVE.
[0781] 6471 77,59           BS   NEWCMD            Go here to test for new
[0782]               *                              keywords
[0783] 6473 BF,2C,08        DST  CRNBUF+1,@PGMPTR  Anticipate usage of PGMCHR
       6476 21
[0784] 6477 0F,79           XML  PGMCHR            Prepare CHAT for OLD and SAVE
[0785] 6479 8A,A8,20        CASE V@CRNBUF          Select the keyword
[0786] 647C 43,A5           BR   SZNEW             NEW                 0
[0787] 647E 45,20           BR   SZCONT            CONTINUE            1
[0788] 6480 45,BE           BR   SZLIST            LIST                2
[0789] 6482 45,BA           BR   SZBYE             BYE                 3
[0790] 6484 45,60           BR   SZNUM             NUMBER              4
[0791] 6486 45,B7           BR   SZOLD             OLD                 5
[0792] 6488 46,25           BR   SZRES             RESEQUENCE          6
[0793] 648A 45,AF           BR   SZSAVE            SAVE                7
[0794] 648C 45,C6           BR   SZMERG            MERGE               8
[0795]               *    AUTO-BOOT - attempt a ---->   RUN "DSK1.LOAD"
[0796] 648E 31,00,0B AUTOLD MOVE 11,G@DSCLOD,V@CRNBUF
       6491 A8,20,63
       6494 51
[0797] 6495 BF,2C,08        DST  CRNBUF,@PGMPTR    DSK1.LOAD is in crunch buffer
       6498 20
[0798]               * RXB PATCH CODE *************
[0799]               *      BR   SZRUNL            Go to the RUN "NAME" CODE
[0800] 6499 5A,38           BR   RXBRUN
[0801]               ********************************* RUN *********************

Now same thing of new moving normal address in VDP moved up to 1000, example >0371 becomes >1371 to test changes for compatibility

before I switch to RAM >A000 in SAMS.

[0658]               ***********************************************************
[0659]               *            START OF BASIC INTERPETER
[0660]               ***********************************************************
[0661]               * GROM Address >6372 TOPLEV
[0662] 6372 86,AF,13 TOPLEV CLR  V@LODFLG           Initialize temp area
       6375 71
[0663]               * RXB PATCH CODE USER ***********************************
[0664]               *        MOVE 77,V@LODFLG,V@LODFLG+1
[0665]               *        ST   5,@KEYBD          Select full keyboard
[0666]               *        SCAN
[0667]               *        CZ   @KEYBD
[0668]               *        BR   G6388             99/4A Console?
[0669]               *       ST   >01,V@CONFLG      Select 99/4A console
[0670] 6376 BC,4A,AF        ST   V@CONFLG,@FAC       Save CONFLG
       6379 13,BB
[0671] 637B 35,00,4D        MOVE 77,V@LODFLG,V@LODFLG+1
       637E AF,13,72
       6381 AF,13,71
[0672] 6384 BC,AF,13        ST   @FAC,V@CONFLG       Restore CONFLG
       6387 BB,4A
[0673] 6389 43,8D           BR   G6388
[0674] 638B 43,8D           BR   G6388
[0675]               *
[0676] 638D 86,74    G6388  CLR  @KEYBD
[0677] 638F BF,AF,13        DST  NLNADD,V@BUFSRT   Initialize edit-buffer start
       6392 8C,12,E2
[0678] 6395 BF,AF,13        DST  NLNADD,V@BUFEND   Initialize edit-buffer end
       6398 8E,12,E2
[0679] 639B 31,00,02        MOVE 2,G@ATNZZ,@INTRIN Get address of ATNZZ
       639E 38,00,32
[0680] 63A1 B2,38,1F        AND  >1F,@INTRIN       Throw away the BR opcode
[0681] 63A4 A3,38,00        DADD >5B,@INTRIN       Address of polynomial constan
       63A7 5B
[0682] 63A8 BE,AF,13        ST   >31,V@LODFLG      indicate try auto-boot
       63AB 71,31
[0683]               *----------------------------------------------------------
[0684]               * Add the following line for fixing "MEMORY FULL" error
[0685]               * occurring during MERGE execution will leave the file open
[0686]               * to disk DSR bug, 5/19/81
[0687] 63AD 86,AF,13 SZNEW  CLR  V@MRGPAB          Initialize merged temporary
       63B0 9E
[0688]               *                              for PAB pointer
[0689]               *----------------------------------------------------------
[0690] 63B1 BE,73,88        ST   RSTK,@SUBSTK      Load base of subroutine stack
[0691] 63B4 06,69,2D        CALL CHRTA2            Load character table

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0015 
EDIT-359
[0692] 63B7 86,45           CLR  @FLAG             Initialize flag byte
[0693] 63B9 87,46           DCLR @BUFLEV           Initialize crunch buffer leve
[0694] 63BB 06,80,12        CALL CLSALL            Close all open files
[0695] 63BE 86,34           CLR  @DATA             Initialize READ/DATA pointer
[0696] 63C0 BF,6E,19        DST  VRAMVS,@VSPTR     Initialize base of value stac
       63C3 58
[0697] 63C4 BD,24,6E        DST  @VSPTR,@STVSPT    Save in permanent base
[0698] 63C7 BD,AF,13        DST  @VSPTR,V@SAVEVP
       63CA 88,6E
[0699] 63CC 06,68,D7        CALL INITPG            Initialize program & s.t.
[0700] 63CF 06,A0,18        CALL INTRND            Initialize random number
[0701] 63D2 8E,AF,13        CZ   V@LODFLG
       63D5 71
[0702] 63D6 63,D3           BS   TOPL02            If need auto-boot
[0703]               * RXB PATCH CODE *************
[0704]               *      CLR  V@LODFLG          Won't ever need to do again
[0705] 63D8 43,D0           BR   G63D0
[0706]               * RXB PATCH CODE ******************************************
[0707]                      AORG >03D0
[0708] 63D0 06,64,92 G63D0  CALL AUTOLD            Attempt an auto-boot
[0709]               *     Label TOPL02 is used by auto-boot in detection of err
[0710] 63D3          ERRRDY EQU  $
[0711] 63D3 06,6A,84 TOPL02 CALL G6A84             Say READY
[0712] 63D6 00              BYTE 0               *  returns to TOPL15
[0713] 63D7 06,68,D7 TOPL05 CALL INITPG            Initialize program space
[0714] 63DA 06,68,F0 TOPL10 CALL KILSYM            Kill the symbol table
[0715]               * RXB PATCH CODE *************
[0716]               * TOPL15 AND  >F7,@FLAG         If error in UDF execution
[0717] 63DD 05,7E,05 TOPL15 B    MYSRCH
[0718] 63E0 BE,74,05 G63E0  ST   5,@KEYBD          Select full keyboard
[0719] 63E3 03              SCAN
[0720] 63E4 86,74           CLR  @KEYBD
[0721] 63E6 BE,73,88 TOPL20 ST   RSTK,@SUBSTK      Initialize subroutine stack
[0722] 63E9 BF,20,12 TOPL25 DST  NLNADD,@VARW      Screen addr = lower left corn
       63EC E2
[0723] 63ED 86,80,89        CLR  @RAMFLG           Clear the RAMFLG
[0724] 63F0 86,44           CLR  @PRGFLG           Make sure not in program mode
[0725]               * Check for auto-num mode
[0726] 63F2 DA,45,01        CLOG >01,@FLAG         If auto-num on
[0727] 63F5 64,1E           BS   TOPL35
[0728] 63F7 A1,14,0E        DADD @CURINC,@CURLIN   Generate new line number
[0729] 63FA D2,14,00        CGE  0,@CURLIN         >32767?
[0730] 63FD 64,05           BS   TOPL30
[0731] 63FF B2,45,FE        AND  >FE,@FLAG         If out of range->exit auto-nu
[0732] 6402 05,64,1E        B    TOPL35            Merge in below
[0733]               * Must be a long branch!!
[0734] 6405 D5,30,32 TOPL30 DCEQ @ENLN,@STLN       Line might exist
[0735] 6408 64,12           BS   G6412
[0736] 640A BD,4A,14        DST  @CURLIN,@FAC      Ready for program search
[0737] 640D 0F,7E           XML  SPEED
[0738] 640F 03              BYTE SEETWO          * Search for existence of line
[0739] 6410 65,27           BS   EDTZ05            COND set = line found
[0740] 6412 0F,83    G6412  XML  SCROLL            Scroll to the next line
[0741] 6414 BD,5E,14        DST  @CURLIN,@ARG2     New line #
[0742] 6417 06,6F,D1        CALL DISO              Display the line number
[0743] 641A 91,20           DINC @VARW             Following by a space
[0744] 641C 44,20           BR   G6420
[0745] 641E 0F,83    TOPL35 XML  SCROLL            Scroll the screen
[0746] 6420 BE,AF,12 G6420  ST   >9E,V@NLNADD-1    Display the prompt character
       6423 E1,9E
[0747] 6425 06,6A,76        CALL G6A76             Read in a line
[0748] 6428 06,D0,AF        CALL SAVLIN            Save input line for recall
[0749]               *    Crunch the input line
[0750] 642B 86,22           CLR  @ERRCOD           Assume no-error return

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0016 
EDIT-359
[0751] 642D BF,0A,18        DST  CRNBUF,@RAMPTR    Initialize crunch pointer
       6430 20
[0752] 6431 0F,7F           XML  CRUNCH            CRUNCH the input line
[0753] 6433 00              BYTE 0              *  Normal crunch mode
[0754] 6434 8A,23    TOPL42 CASE @ERRCOD+1
[0755] 6436 44,46           BR   TOPL45            No error detected
[0756] 6438 49,92           BR   ERRSYN            *SYNTAX ERROR
[0757] 643A 49,A6           BR   ERRBLN            *BAD LINE NUMBER
[0758] 643C 49,AA           BR   ERRLTL            *LINE TOO LONG
[0759] 643E 49,9C           BR   ERRNTL            *NAME TOO LONG
[0760] 6440 49,96           BR   ERRNQS            *UNMATCHED QUOTES
[0761] 6442 49,B0           BR   ERRCIP            *COMMAND ILLEGAL IN PROGRAM
[0762] 6444 49,BA           BR   ERRIVN            *UNRECOGNIZED CHARACTER
[0763] 6446 8F,4A    TOPL45 DCZ  @FAC              Line # present
[0764] 6448 64,63           BS   TOPL55
[0765] 644A DA,45,01        CLOG >01,@FLAG         Not AUTONUM
[0766] 644D 44,5C           BR   G645B
[0767] 644F D6,75,0D        CEQ  >0D,@RKEY         Must be up or down
[0768] 6452 64,5C           BS   G645B
[0769] 6454 D6,42,01        CEQ  >01,@CHAT         Start EDIT mode
[0770] 6457 44,5C           BR   G645B
[0771] 6459 05,D0,00        B    EDTZZ0
[0772] 645C 06,66,E2 G645B  CALL EDITLN            EDIT the line into the progra
[0773] 645F 63,E9           BS   TOPL25            If didn't change the line
[0774] 6461 43,DA           BR   TOPL10
[0775]               *    Jump always
[0776] 6463 D6,42,01 TOPL55 CEQ  >01,@CHAT         If blank line - ignore
[0777] 6466 63,E9           BS   TOPL25
[0778] 6468 D6,AF,18        CEQ  >EB,V@CRNBUF
       646B 20,EB
[0779] 646D 65,DB           BS   SZSIZE
[0780] 646F C6,AF,18        CH   >08,V@CRNBUF      If imperative
       6472 20,08
[0781]               * GKXB Branch code for new commands DEL, COPY, and MOVE.
[0782] 6474 77,87           BS   NEWCMD            Go here to test for new
[0783]               *                              keywords
[0784] 6476 BF,2C,18        DST  CRNBUF+1,@PGMPTR  Anticipate usage of PGMCHR
       6479 21
[0785] 647A 0F,79           XML  PGMCHR            Prepare CHAT for OLD and SAVE
[0786] 647C 8A,AF,18        CASE V@CRNBUF          Select the keyword
       647F 20
[0787] 6480 43,AD           BR   SZNEW             NEW                 0
[0788] 6482 45,2A           BR   SZCONT            CONTINUE            1
[0789] 6484 45,D0           BR   SZLIST            LIST                2
[0790] 6486 45,CC           BR   SZBYE             BYE                 3
[0791] 6488 45,72           BR   SZNUM             NUMBER              4
[0792] 648A 45,C9           BR   SZOLD             OLD                 5
[0793] 648C 46,38           BR   SZRES             RESEQUENCE          6
[0794] 648E 45,C1           BR   SZSAVE            SAVE                7
[0795] 6490 45,D8           BR   SZMERG            MERGE               8
[0796]               *    AUTO-BOOT - attempt a ---->   RUN "DSK1.LOAD"
[0797] 6492 31,00,0B AUTOLD MOVE 11,G@DSCLOD,V@CRNBUF
       6495 AF,18,20
       6498 63,51
[0798] 649A BF,2C,18        DST  CRNBUF,@PGMPTR    DSK1.LOAD is in crunch buffer
       649D 20
[0799]               * RXB PATCH CODE *************
[0800]               *      BR   SZRUNL            Go to the RUN "NAME" CODE
[0801] 649E 5A,6E           BR   RXBRUN
[0802]               ********************************* RUN *********************

As you can see each GPL commands using >0371 changed to >1371 now takes up an extra address in GPL?

I had never noticed this before....big problem. Now requires a total rewrite of XB from scratch to make all address work correctly.

  • Like 1
Link to comment
Share on other sites

gallery_34177_1071_31879.gif

Here's an idea for an RXB addition that will take 10 minutes to write and that will give some added graphics capabilities. With RXB you can define graphics characters from 32 to 159 which is 2 character sets more than standard XB. But you still cannot use character sets 160 to 255 and 0 to 29. One way to slip in a few extra characters would be to modify the color table at v0800. The first 15 bytes are the colors for the unusable characters. If you write >11, >22, >33 up to >FF you are setting the colors of the 15 unusable character sets so that 8x8 blocks with any of the 15 possible colors are available to be put on the screen with HCHAR and VCHAR. Of course you cannot have any character definitions but I think the ability to put colored blocks on the screen could be very useful, and it's totally independent of the normal graphics used by XB. This could be part of the code that sets the screen colors which currently sets the first 15 bytes to >00 and the last 15 to >10.

 

What do you think?

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

gallery_34177_1071_31879.gif

Here's an idea for an RXB addition that will take 10 minutes to write and that will give some added graphics capabilities. With RXB you can define graphics characters from 32 to 159 which is 2 character sets more than standard XB. But you still cannot use character sets 160 to 255 and 0 to 29. One way to slip in a few extra characters would be to modify the color table at v0800. The first 15 bytes are the colors for the unusable characters. If you write >11, >22, >33 up to >FF you are setting the colors of the 15 unusable character sets so that 8x8 blocks with any of the 15 possible colors are available to be put on the screen with HCHAR and VCHAR. Of course you cannot have any character definitions but I think the ability to put colored blocks on the screen could be very useful, and it's totally independent of the normal graphics used by XB. This could be part of the code that sets the screen colors which currently sets the first 15 bytes to >00 and the last 15 to >10.

 

What do you think?

I am moving all the Temporary variables that currently block this feature.

Also this would allow 256 character sets and colors, lastly currently you can use the last character set for a sprite and at still use the other characters, this is in the RXB manual.

  • Like 1
Link to comment
Share on other sites

I am moving all the Temporary variables that currently block this feature.

Also this would allow 256 character sets and colors, lastly currently you can use the last character set for a sprite and at still use the other characters, this is in the RXB manual.

Nothing blocks this feature. When the colors are set by XB those 15 character sets are set to >00. Should be a trivial job to change them to be >11 through >FF.

Where would I find the RXB manual? I did not see it in the latest release.

Link to comment
Share on other sites

OMG LOL. Ok to use 15 and 16 character sets RXB allows this, but to add 160 to 255 will require moving some stuff around and I explained this in the Fest West video. (See May 1984 Smart Programmer Page 9)

Also things like Crunch Buffer, VDP Rollout Buffer, Temporary Buffers, pointers, and XB GPL variables are stored in the way to do this, so need to be moved.

Also RXB already allows:

CALL COLOR change of sets 15 & 16

CALL CHAR change of sets 144-151 and 152 to 159

Of course this interferes with Sprite use for characters 144 to 156

 

The RXB manual is always included with each RXB release under RXB Documents.

 

 

 

Edited by RXB
Link to comment
Share on other sites

OMG LOL. Hmmm. OK - when you talk about having to move things around it is obvious that you either haven't read my post, or haven't understood it. I will try one final time. By changing the colors of the 15 unused character sets so each set has the same foreground and background color then it doesn't matter what patterns are used for the characters. You have the ability to put 8x8 blocks of all 15 possible colors on the screen. Not exactly earth shattering graphics, but it could be handy and comes at no cost. (Another way to do it would be to change the limit checks in CALL COLOR so you can modify all 32 character sets.)

 

About the manual: It's right where you said it was. I've been suffering a lot from "male vision" these days.

  • Like 2
Link to comment
Share on other sites

Characters in RXB are loaded by this:

[3731]               ***********************************************************
[3732]               * RXB loader for character sets
[3733] 7D4E BF,4A,04 CHRTBL DST   >0408,@FAC             Start with !
       7D51 08
[3734] 7D52 BF,4E,9C        DST   CHARS,@FAC4            GROM ADDRESS
       7D55 EA
[3735] 7D56 31,00,08        MOVE  8,G@EMPTY,V@>0400      Space Character
       7D59 A4,00,63
       7D5C 64
[3736] 7D5D 86,E0,00 CHRLP  CLR   V@0(@FAC)              Clear pattern
       7D60 4A
[3737] 7D61 33,00,07        MOVE  7,G@0(@FAC4),V@1(@FAC) Get GROM Def
       7D64 E0,01,4A
       7D67 00,00,4E
[3738] 7D6A A3,4A,00        DADD  8,@FAC                 GROM ADDRESS
       7D6D 08
[3739] 7D6E A3,4E,00        DADD  7,@FAC4                VDP ADDRESS
       7D71 07
[3740] 7D72 92,4C           DEC   @FAC2                  Character Count-1
[3741] 7D74 5D,5D           BR    CHRLP                  0?
[3742] 7D76 00              RTN
[3743]               ***********************************************************

And this loads Colors for all sets and Sprite tables:

1429]               ***********************************************************
[1430] 6939 04,04    G6939  BACK 4                 Border color = BLUE
[1431] 693B 86,A8,00        CLR  V@>0800
[1432] 693E 35,00,0E        MOVE 14,V@>0800,V@>0801
       6941 A8,01,A8
       6944 00
[1433] 6945 BE,A8,0F        ST   >F0,V@>080F       WHITE fore/transparent back
       6948 F0
[1434] 6949 35,00,10        MOVE 16,V@>080F,V@>0810
       694C A8,10,A8
       694F 0F
[1435] 6950 06,69,5A        CALL SPRINT
[1436]               * This part might be moved up later, load special character
[1437]               * here. Don't load before hiding all sprites.
[1438] 6953 39,00,06        MOVE 6,G@VDPREG,#1
       6956 01,63,6C
[1439] 6959 00              RTN
[1440]               *
[1441]               ****** Initialization of sprites. Enable 28 sprites. ******
[1442]               *
[1443] 695A 86,A7,80 SPRINT CLR  V@>0780           Clear motion of all sprites
[1444] 695D 35,00,6F        MOVE >6F,V@>0780,V@>0781

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0028 
EDIT-359
       6960 A7,81,A7
       6963 80
[1445]               * Replace the line for speeding up XB. 5/22/81
[1446]               *      ST   28,@MOTION        All in motion
[1447] 6964 86,7A           CLR  @MOTION           All not in motion
[1448] 6966 BE,A3,70        ST   >D0,V@>0370       Sprites 29 to 32 unavailiable
       6969 D0
[1449] 696A BF,A3,00        DST  >C000,V@>0300     Hide the first sprites
       696D C0,00
[1450] 696F 87,A3,02        DCLR V@>0302           Make first sprite transparent
[1451] 6972 35,00,6C        MOVE 108,V@>0300,V@>0304 Ripple for the rest
       6975 A3,04,A3
       6978 00
[1452] 6979 00              RTN
[1453]               *
Link to comment
Share on other sites

Rich, I seem to be having an issue with disk file access with RXB. Here's the wireless weather station control program I'm currently working on, and everything works as it should until the program gets to line 5460 when it attempts to write to an already opened disk file on DSK2 for logging purposes, and I get a file error which makes no sense. Also, whenever I run the program then break out of it and try to run it again, I get an IO error 7 for line 60 when the program attempts to open the log file on DSK2 even though on the initial run that was not an issue, and I have to turn off the computer then back on to run the program. I suspect that this is related to my access to the RS232 via CALL IO somehow. I should also mention that trying to list the program to PIO does not work if it has been run previously.

Would you mind looking at the listing below and giving me your thoughts?

10 REM TI WIRELESS WEATHER STATION
20 REM CONTROL PROGRAM
30 REM BY WALID MAALOULI
40 REM MAY 2017
50 OPEN #1:"DSK2.LOG_DAT",INTERNAL,UPDATE
60 INPUT #1:MAXTEMP,MXTMONTH,MXTDAY,MXTYEAR,MINTEMP,MITMONTH,MITDAY,MITYEAR,TRAIN,RMONTH,RDAY,RYEAR
65 CALL CLEAR::OPTION BASE 1
70 CALL HPUT(1,1,"RESET CUMULATIVE RAINFALL?")::CALL BEEP
80 CALL KEY("YN",0,K,S)::IF K=89 THEN RFLAG=1
100 CALL CLEAR::DIM SLEEPTIME(12),WAKETIME(12)
110 CRU=2464!CRU ADDRESS OF TMS9902 DIVIDED BY 2
120 CALL IO(3,1,2432,1)!ACTIVATE RS232 CARD
130 CALL IO(3,1,CRU+31,1)!RESET TMS9902
200 CALL IO(3,8,CRU,203)!LOAD CONTROL REGISTER WITH 8N1 @ 3MHZ
210 CALL IO(3,1,CRU+13,0)!DESELECT THE INTERVAL REGISTER
220 CALL IO(3,12,CRU,0,39)!LOAD RECEPTION AND EMISSION RATE REGISTERS WITH 9600 BPS
230 FOR I=1 TO 7 :: READ D$(I) :: NEXT I
240 DATA sunday,monday,tuesday,wednesday,thursday,friday,saturday
241 CALL CHAR(31,"FFFFFFFFFFFFFFFF",123,"8080808080808080",124,"0101010101010101")
242 FOR I=1 TO 14::PROGBAR$=PROGBAR$&CHR$(31)::NEXT I
243 FOR I=1 TO 12::READ SLEEPTIME(I),WAKETIME(I)::NEXT I
244 DATA 17,7,17,7,18,6,19,6,20,6,20,5,21,5,21,5,20,6,19,6,19,6,18,7
245 DTMAX=-99::DTMIN=120::MAXSPEED=-1
250 CALL IO(3,1,CRU+16,1)!ACTIVATE RTS
251 REM DRAW THE MAIN SCREEN
252 GOSUB 5000
255 REM  FETCH TIME AND DATE
260 CALL IO(3,8,CRU,67)
270 GOSUB 5190
280 IF FLAG=0 THEN 260
290 CALL IO(2,8,CRU,HOUR)! FETCH THE HOUR
300 GOSUB 5190 :: IF FLAG=0 THEN 260
310 CALL IO(2,8,CRU,MINUTE)! FETCH THE MINUTE
320 GOSUB 5190 :: IF FLAG=0 THEN 260
330 CALL IO(2,8,CRU,DOW)! FETCH DAY OF WEEK
340 GOSUB 5190 :: IF FLAG=0 THEN 260
350 CALL IO(2,8,CRU,DAY)! FETCH DAY
360 GOSUB 5190 :: IF FLAG=0 THEN 260
370 CALL IO(2,8,CRU,MONTH)! FETCH MONTH
380 GOSUB 5190 :: IF FLAG=0 THEN 260
390 CALL IO(2,8,CRU,YEAR) ! FETCH YEAR
400 PROGSTAT=1::GOSUB 5150
401 IF SLEEPFLAG=0 AND (HOUR>=SLEEPTIME(MONTH) OR HOUR<WAKETIME(MONTH)) THEN GOSUB 5360
402 IF SLEEPFLAG=0 THEN 409
403 IF HOUR<SLEETIME(MONTH) AND HOUR>=WAKETIME(MONTH) THEN SLEEPFLAG=0 ELSE GOSUB 5360
409 REM  FETCH TEMPERATURE
410 CALL IO(3,1,CRU+18,0) :: CALL IO(3,8,CRU,84)
420 GOSUB 5190 :: IF FLAG=0 THEN 410
430 GOSUB 5240
440 IF FLAG=0 THEN 410 ELSE TEMP=INT(N*9/5+32)
450 PROGSTAT=2::GOSUB 5150
635 REM  FETCH HUMIDITY
640 CALL IO(3,1,CRU+18,0) :: CALL IO(3,8,CRU,72)
650 GOSUB 5190 :: IF FLAG=0 THEN 640
660 CALL IO(2,8,CRU,HUMIDITY)! RECEIVE HUMIDITY VALUE
670 PROGSTAT=3::GOSUB 5150
675 REM  FETCH PRESSURE
680 CALL IO(3,1,CRU+18,0) :: CALL IO(3,8,CRU,80)
690 GOSUB 5190 :: IF FLAG=0 THEN 680
700 GOSUB 5240 :: IF FLAG=0 THEN 680 ELSE PRESSURE=INT(N/1000)
710 PROGSTAT=4::GOSUB 5150
730 REM  FETCH WIND SPEED
740 CALL IO(3,1,CRU+18,0) :: CALL IO(3,8,CRU,87)
750 GOSUB 5190 :: IF FLAG=0 THEN 740
760 GOSUB 5240 :: IF FLAG=0 THEN 740 ELSE WSPEED=N
770 PROGSTAT=5::GOSUB 5150
780 REM  FETCH WIND DIRECTION
790 CALL IO(3,1,CRU+18,0) :: CALL IO(3,8,CRU,68)
800 GOSUB 5190 :: IF FLAG=0 THEN 790
810 GOSUB 5240 :: IF FLAG=0 THEN 790 ELSE WDIR=N
820 PROGSTAT=6::GOSUB 5150
830 REM  FETCH RAIN FALL
840 CALL IO(3,1,CRU+18,0) :: CALL IO(3,8,CRU,82)
850 GOSUB 5190 :: IF FLAG=0 THEN 840
860 GOSUB 5240 :: IF FLAG=0 THEN 840 ELSE DRAIN=DRAIN+N
870 PROGSTAT=7::GOSUB 5150
880 REM DISPLAY DATA
890 DATE$=D$(DOW)&" "&STR$(MONTH)&"\"&STR$(DAY)&"\"&STR$(YEAR)
900 IF MINUTE<10 THEN MINUTE$="0"&STR$(MINUTE) ELSE MINUTE$=STR$(MINUTE)
910 IF HOUR<10 THEN HOUR$="0"&STR$(HOUR) ELSE HOUR$=STR$(HOUR)
920 TIME$=HOUR$&":"&MINUTE$
930 CALL HPUT(1,7,DATE$,2,7,TIME$)
940 CALL HPUT(4,25,TEMP,4,29,"f")
950 IF HOUR=0 THEN DTMAX=-99::DTMIN=120
960 IF DTMAX<TEMP THEN DTMAX=TEMP::DTMAXHR$=HOUR$::DTMAXMN$=MINUTE$ 
970 IF DTMIN>TEMP THEN DTMIN=TEMP::DTMINHR$=HOUR$::DTMINMN$=MINUTE$
980 CALL HPUT(5,7,DTMAXHR$,5,9,":",5,10,DTMAXMN$,5,25,DTMAX,5,29,"f")
990 CALL HPUT(6,7,DTMINHR$,6,9,":",6,10,DTMINMN$,6,25,DTMIN,6,29,"f")
1000 IF MAXTEMP<TEMP THEN MAXTEMP=TEMP::MXTMONTH=MONTH::MXTDAY=DAY::MXTYEAR=YEAR::GOSUB 5460
1010 IF MINTEMP>TEMP THEN MINTEMP=TEMP::MITMONTH=MONTH::MITDAY=DAY::MITYEAR=YEAR::GOSUB 5460
1020 MXTDATE$=STR$(MXTMONTH)&"\"&STR$(MXTDAY)&"\"&STR$(MXTYEAR)
1030 MITDATE$=STR$(MITMONTH)&"\"&STR$(MITDAY)&"\"&STR$(MITYEAR)
1040 CALL HPUT(7,12,MXTDATE$,7,25,MAXTEMP,7,29,"f")
1050 CALL HPUT(8,12,MITDATE$,8,25,MINTEMP,8,29,"f")
1060 CALL HPUT(10,25,PRESSURE,10,29,"kpa")
1070 CALL HPUT(12,25,HUMIDITY,10,29,"%")
1080 CALL HPUT(14,25,WSPEED,10,29,"mph")
1090 CALL HPUT(15,25,WDIR,10,29,"deg")
1100 IF HOUR=0 THEN MAXSPEED=-1
1110 IF MAXSPEED<WSPEED THEN MAXSPEED=WSPEED::MSHR$=HOUR$::MSMN$=MINUTE$
1120 CALL HPUT(16,7,MSHR$,16,9,":",16,10,MSMN$,16,25,MAXSPEED,16,29,"mph")
1130 IF HOUR=0 THEN DRAIN=N
1140 CALL HPUT(18,25,DRAIN,18,30,"in")
1150 TOTRAIN=TOTRAIN+N
1160 IF RMONTH=0 OR RFLAG=1 OR RYEAR<YEAR THEN RMONTH=MONTH::RDAY=DAY::RYEAR=YEAR::GOSUB 5450::RFLAG=0
1170 RDATE$=STR$(RMONTH)&"\"&STR$(RDAY)&"\"&STR$(RYEAR)
1180 CALL HPUT(19,13,RDATE$,19,25,TOTRAIN,19,30,"in")
1190 CALL KEY(0,K,S)::IF K=145 THEN CLOSE #1::STOP ELSE 255 ! CTRL Q ENDS PROGRAM
4999 REM ** SUBROUTINES **
5000 REM DRAW MAIN SCREEN
5010 CALL SCREEN(2)::CALL COLOR(ALL,4,2,3,16,2,4,16,2,9,16,2,10,16,2,11,16,2,12,16,2)
5015 FOR I=65 TO 90::CALL DUPCHAR(I,I+32)::NEXT I
5020 CALL HPUT(1,1,"DATE:")
5030 CALL HPUT(2,1,"TIME:")
5040 CALL HPUT(4,1,"CURRENT TEMPERATURE   :")
5050 CALL HPUT(5,1,"MAX @                 :")
5055 CALL HPUT(6,1,"MIN @                 :")
5056 CALL HPUT(7,1,"HIGHEST ON            :")
5057 CALL HPUT(8,1,"LOWEST ON             :")
5060 CALL HPUT(10,1,"BAROMETRIC PRESSURE   :")
5070 CALL HPUT(12,1,"HUMIDITY              :")
5080 CALL HPUT(14,1,"WIND SPEED            :")
5090 CALL HPUT(15,1,"WIND DIRECTION        :")
5100 CALL HPUT(16,1,"MAX @                 :")
5110 CALL HPUT(18,1,"RAIN FALL TODAY       :")
5120 CALL HPUT(19,1,"TOTAL SINCE           :")
5130 CALL HPUT(24,1,"UPDATE PROGRESS",23,17,CHR$(123),23,30,CHR$(124))
5140 RETURN
5150 REM PROGRESS BAR ROUTINE
5160 PROG$=SEG$(PROGBAR$,1,PROGSTAT*2)
5170 CALL HPUT(24,17,PROG$)::CALL BEEP
5180 RETURN
5190 REM CHECK FOR INCOMING BYTE ROUTINE
5200 COUNTER=0
5210 CALL IO(2,1,CRU+21,BYTEIN)
5220 IF BYTEIN=0 THEN COUNTER=COUNTER+1 ELSE FLAG=1 :: CALL IO(3,1,CRU+18,0) :: RETURN
5230 IF COUNTER>50 THEN FLAG=0 :: CALL IO(3,1,CRU+18,0) :: RETURN ELSE 5210
5240 REM RECEIVE STRING ROUTINE
5250 CALL IO(2,8,CRU,LENGTH)! FETCH LENGTH OF STRING
5260 CALL IO(3,1,CRU+18,0)! RESET THE RECEIVE BUFFER
5270 FOR I=1 TO LENGTH
5280 GOSUB 5190 :: IF FLAG=0 THEN RETURN
5290 CALL IO(2,8,CRU,D(I))! RECEIVE DATA
5300 CALL IO(3,1,CRU+18,0)!RESET THE RECEIVE BUFFER
5310 NEXT I
5320 N$=""
5330 FOR I=1 TO LENGTH :: N$=N$&CHR$(D(I)) :: NEXT I
5340 N=VAL(N$)
5350 RETURN
5360 REM SET INTERVAL TIMER ROUTINE AND WAIT 30 MINUTES
5370 SLEEPFLAG=1::DELAY=0
5375 CALL IO(3,1,CRU+20,0) ! DISABLE TIMER INTERRUPTS
5380 CALL IO(3,1,CRU+13,1) ! SELECT THE INTERVAL TIMER
5390 CALL IO(3,10,CRU,2,253) ! SET INTERVAL FOR 16.32 MSECS AND START TIMER
5420 CALL IO(2,1,CRU+25,FLAG)
5430 IF FLAG=1 THEN CALL IO(3,1,CRU+25,0)::DELAY=DELAY+1
5440 IF DELAY>=110295 THEN CLKFLAG=1::CALL IO(3,1,CRU+13,0)::RETURN ELSE 5420 ! STOP TIMER
5450 REM UPDATE LOG DISK FILE
5460 PRINT #1:MAXTEMP,MXTMONTH,MXTDAY,MXTYEAR,MINTEMP,MITMONTH,MITDAY,MITYEAR,TRAIN,RMONTH,RDAY,RYEAR
5470 RETURN
Link to comment
Share on other sites

Currently on another computer so can not test your routine in Classic99, but from the source code I can see 3 problems.

 

1. I would use LINPUT instead of INPUT as if a character value of 44 (Comma) is returned in a variable it will crash the program. (See page 113 XB manual)

 

2. I see the possibility of a CRU conflict when you access the Disk Controller if the IO chip is being used for CRU input/output as the IO Chip has a pending value when you ask for Disk Access CRU.

Suggestion is to reset the CRU Bits to null so this possibility does not crash the program.

Thus you have like a PC IRQ request error as one wants access while being used by a different program but not closed.

 

3. How are you using UPDATE without telling the FILE RECORD NUMBER using REC(#) and specifically using RELATIVE files? (See page 153 XB manual)

 

Hope this helps....

Rich

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

Rich, the program does not ask for any INPUT... Which line are you referring to?

 

Problem solved by turning off the RS232 card prior to disk IO then turning it back on and reinitializing the comm registers. This is likely related to what you stated in #2 :)

 

UPDATE is the default mode and is not restricted to relative files.

XB entry excerpt for the OPEN command: "To be able both to read from and write to a file, specify UPDATE. To just read from a file, specify INPUT. To just write to a file, specify OUTPUT. To only add to a file, specify APPEND. Append mode can only be specified for VARIABLE length records. If you do not specify an open-mode, the default is UPDATE. "
In any case, this is not the final version as I am still tweaking it.
  • 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...