Jump to content
Bones-69

RXB - Rich Extended Basic

Recommended Posts

1 hour ago, oddemann said:

Where is it that you find the speedup?

Hmmm what does that mean?

I have replaced the GPL access to screen and graphics with Assembly routines.

Example RXB 2020 CALL HCHAR

***********************************************************
*                SUBPROGRAM FOR 'HCHAR'
***********************************************************
* CALL HCHAR(row,column,character#,repetition,...)        *
***********************************************************
HCHAR  CALL HVCHR             Get X, Y values character, #
       DCZ  @FAC              If 0 characters
       BS   HCHAR2
HCHAR1 CALL HFMT  * FMT '@PAD' Display horizontal
       DDEC @FAC              Done yet?
       BR   HCHAR1            No, finish it
* RXB PATCH CODE
HCHAR2 CEQ  COMMAZ,@CHAT
       BS   HCHAR
XPTRTN ST   @MNUM,@XPT        Restore X-pointer
LNKRTN XML  SPEED             Must be at
       BYTE SYNCHK        *     a right
       BYTE RPARZ         *      parenthesis
LNKRT2 CALL CHKEND            Check end of statement
       BR   ERRSYN            If not end-of-stmt , error
       CALL RETURN            Return to caller

The above is almost all GPL.

Now this is RXB 2021 GPL:

***********************************************************
*                SUBPROGRAM FOR 'HCHAR'                   *
***********************************************************
* CALL HCHAR(row,column,character#,repetition[,...])      *
***********************************************************
HCHARZ CALL HVCHR             Get X, Y values character#
       DST  >6004,@>6004
HCHAR1 XML  HCHAR             Disply them
       DST  >6000,@>6000
HCHAR2 CEQ  COMMAZ,@CHAT
       BS   HCHARZ
LNKRTN XML  SPEED             Must be at
       BYTE SYNCHK        *     a right
       BYTE RPARZ         *      parenthesis
LNKRT2 CALL CHKEND            Check end of statement
       BR   ERRSYN            If not end-of-stmt , error
       CALL RETURN            Return to caller
***********************************************************

And here is the Assembly in ROM 3 it calls:

*************************************************************
* CALL HCHAR(row,column,character#,repetition)
* R0 VDP ADDRESS = MNUM
* R1 CHARACTER   = PAD 
* R3 COUNTER     - FAC
*
HCHAR  MOV  R11,R9      * save return address
       LI   R8,VDPWD    * put VDPWD in R8 for faster loop
       MOV  @MNUM,R0    * VRAM start address for HCHAR4
       MOV  @PAD,R1     * ASCII char code is in MSB
       AI   R1,>6000    * Add screen offset (96) to char in MSB
       MOV  @FAC,R3     * repetition to R3..
       MOV  R3,R7       * .. and to R4 for manipulation
       LI   R5,768      * get screen end = 768 to a register..
       MOV  R5,R6       * ..and to R6 for screen size
       C    R6,R7       * scrn_size > cnt, i.e., cnt OK?
       JGT  HCHAR1      * yes; jump
       MOV  R6,R7       * no; cnt = scrn_size
HCHAR1 C    R0,R5       * VRAM address outside screen?
       JHE  HCHARX      * error if so..just exit
       S    R0,R5       * bytes to end of screen
HCHAR2 MOV  R7,R3       * put cnt in R3 for HCHAR4
       JGT  HCHAR3      * are we done?
       JMP  HCHARX      * yup; we're outta here!
HCHAR3 S    R5,R7       * no; do we wrap to screen start?
       JLT  HCHAR4      * no
       MOV  R5,R3       * yes, just go to screen end
HCHAR4 BL   @VWADD      * write out VRAM write address
HCHAR5 MOVB R1,*R8      * Write a byte to next VRAM location
       DEC  R3          * decrement count
       JNE  HCHAR5      * Not done, fill another
       CLR  R0          * wrap for next round
       MOV  R6,R5       * scrn_size to bytes-to-end-of-screen
       JMP  HCHAR2      * see if more
HCHARX B    *R9         * return to caller
*************************************************************

As most of the work with VDP Graphics is now Assembly instead of GPL it is faster.

  • Like 6
  • Thanks 1

Share this post


Link to post
Share on other sites

Just finished and tested new Character routine that RESETS CHARACTERS when XB program ends or you change character definitions.

 

Here is the new Character set and Assembly routine to load them:

***********************************************************
*
* RXB Character set 
***********************************************************
CHRLDR MOV  R11,R9    * save return address
       LI   R0,>03F8
       BL   @VWADD    * write out VDP write address
       LI   R1,CHARS  * CHARACTER LIST
       LI   R2,96     * COUNT
       LI   R8,VDPWD  * Register faster then address
CHRLP  MOVB *R1+,*R8  * write next VDP byte from RAM 1
       MOVB *R1+,*R8  * write next VDP byte from RAM 2
       MOVB *R1+,*R8  * write next VDP byte from RAM 3
       MOVB *R1+,*R8  * write next VDP byte from RAM 4
       MOVB *R1+,*R8  * write next VDP byte from RAM 5
       MOVB *R1+,*R8  * write next VDP byte from RAM 6
       MOVB *R1+,*R8  * write next VDP byte from RAM 7
       MOVB *R1+,*R8  * write next VDP byte from RAM 8
       DEC  R2        * COUNT-1
       JNE  CHRLP     * repeat if not done  
       B    *R9       * DONE
***********************************************************
CHARS  BYTE >00,>00,>00,>00,>00,>00,>00,>00    *   31
       BYTE >00,>00,>00,>00,>00,>00,>00,>00    *   32
       BYTE >00,>10,>10,>10,>10,>10,>00,>10    * ! 33
       BYTE >00,>50,>50,>50,>00,>00,>00,>00    * " 34
       BYTE >00,>50,>50,>F8,>50,>F8,>50,>50    * # 35
       BYTE >00,>20,>78,>A0,>70,>28,>F0,>20    * $ 36
       BYTE >00,>C0,>C8,>10,>20,>40,>98,>18    * % 37
       BYTE >00,>40,>A0,>A0,>40,>A8,>90,>68    * & 38
       BYTE >00,>C0,>40,>80,>00,>00,>00,>00    * ' 39
       BYTE >00,>08,>10,>20,>20,>20,>10,>08    * ( 40
       BYTE >00,>10,>08,>04,>04,>04,>08,>10    * ) 41
       BYTE >00,>00,>28,>10,>7C,>10,>28,>00    * * 42  
       BYTE >00,>00,>10,>10,>7C,>10,>10,>00    * + 43
       BYTE >00,>00,>00,>00,>00,>60,>20,>40    * , 44
       BYTE >00,>00,>00,>00,>F8,>00,>00,>00    * - 45
       BYTE >00,>00,>00,>00,>00,>00,>60,>60    * . 46
       BYTE >00,>00,>08,>10,>20,>40,>80,>00    * / 47
       BYTE >00,>70,>88,>98,>A8,>C8,>88,>70    * 0 48
       BYTE >00,>20,>60,>20,>20,>20,>20,>70    * 1 49
       BYTE >00,>70,>88,>08,>30,>40,>80,>F8    * 2 50
       BYTE >00,>70,>88,>08,>30,>08,>88,>70    * 3 51
       BYTE >00,>10,>30,>50,>90,>F8,>10,>10    * 4 52
       BYTE >00,>F0,>80,>80,>F0,>08,>88,>70    * 5 53
       BYTE >00,>70,>80,>80,>F0,>88,>88,>70    * 6 54
       BYTE >00,>F8,>08,>10,>20,>40,>40,>40    * 7 55
       BYTE >00,>70,>88,>88,>70,>88,>88,>70    * 8 56
       BYTE >00,>70,>88,>88,>78,>08,>88,>70    * 9 57
       BYTE >00,>00,>60,>60,>00,>60,>60,>00    * : 58
       BYTE >00,>00,>60,>60,>00,>60,>20,>40    * ; 59
       BYTE >00,>08,>10,>20,>40,>20,>10,>08    * < 60
       BYTE >00,>00,>7C,>00,>00,>7C,>00,>00    * = 61
       BYTE >00,>20,>10,>08,>04,>08,>10,>20    * > 62
       BYTE >00,>70,>88,>10,>20,>20,>00,>20    * ? 63
       BYTE >00,>38,>44,>5C,>54,>5C,>40,>38    * @ 64
       BYTE >00,>70,>88,>88,>F8,>88,>88,>88    * A 65
       BYTE >00,>F0,>48,>48,>70,>48,>48,>F0    * B 66
       BYTE >00,>70,>88,>80,>80,>80,>88,>70    * C 67
       BYTE >00,>F0,>48,>48,>48,>48,>48,>F0    * D 68
       BYTE >00,>F8,>80,>80,>F0,>80,>80,>F8    * E 69
       BYTE >00,>F8,>80,>80,>F0,>80,>80,>80    * F 70
       BYTE >00,>70,>88,>80,>80,>98,>88,>78    * G 71
       BYTE >00,>88,>88,>88,>F8,>88,>88,>88    * H 72
       BYTE >00,>F8,>20,>20,>20,>20,>20,>F8    * I 73
       BYTE >00,>08,>08,>08,>08,>08,>88,>70    * J 74
       BYTE >00,>88,>90,>A0,>C0,>A0,>90,>88    * K 75
       BYTE >00,>80,>80,>80,>80,>80,>80,>F8    * L 76
       BYTE >00,>88,>D8,>A8,>A8,>88,>88,>88    * M 77
       BYTE >00,>88,>88,>C8,>A8,>98,>88,>88    * N 78
       BYTE >00,>70,>88,>88,>88,>88,>88,>70    * O 79
       BYTE >00,>F0,>88,>88,>88,>F0,>80,>80    * P 80
       BYTE >00,>70,>88,>88,>88,>A8,>90,>68    * Q 81
       BYTE >00,>F0,>88,>88,>F0,>A0,>90,>88    * R 82
       BYTE >00,>70,>88,>80,>70,>08,>88,>70    * S 83
       BYTE >00,>F8,>20,>20,>20,>20,>20,>20    * T 84
       BYTE >00,>44,>44,>44,>44,>44,>44,>38    * U 85
       BYTE >00,>44,>44,>44,>28,>28,>10,>10    * V 86
       BYTE >00,>88,>88,>88,>88,>A8,>A8,>50    * W 87
       BYTE >00,>88,>88,>50,>20,>50,>88,>88    * X 88
       BYTE >00,>88,>88,>88,>50,>20,>20,>20    * Y 89
       BYTE >00,>F8,>08,>10,>20,>40,>80,>F8    * Z 90                
       BYTE >00,>78,>40,>40,>40,>40,>40,>78    * [ 91
       BYTE >00,>00,>80,>40,>20,>10,>08,>00    * \ 92
       BYTE >00,>F0,>10,>10,>10,>10,>10,>F0    * ] 93
       BYTE >00,>20,>50,>88,>00,>00,>00,>00    * ^ 94
       BYTE >00,>00,>00,>00,>00,>00,>00,>FF    * _ 95
       BYTE >00,>18,>10,>08,>00,>00,>00,>00    * ` 96
       BYTE >00,>00,>00,>60,>10,>70,>90,>68    * a 97
       BYTE >00,>00,>40,>40,>70,>48,>48,>B0    * b 98
       BYTE >00,>00,>00,>60,>90,>80,>90,>60    * c 99
       BYTE >00,>00,>10,>10,>70,>90,>90,>68    * d 100
       BYTE >00,>00,>00,>60,>90,>E0,>80,>70    * e 101
       BYTE >00,>00,>30,>40,>E0,>40,>40,>40    * f 102
       BYTE >00,>00,>00,>70,>90,>70,>10,>60    * g 103
       BYTE >00,>00,>80,>80,>E0,>90,>90,>90    * h 104
       BYTE >00,>00,>20,>00,>20,>20,>20,>70    * i 105
       BYTE >00,>00,>10,>10,>10,>10,>90,>60    * j 106
       BYTE >00,>00,>80,>90,>A0,>C0,>A0,>90    * k 107
       BYTE >00,>00,>60,>20,>20,>20,>20,>70    * l 108
       BYTE >00,>00,>00,>D0,>A8,>A8,>A8,>A8    * m 109
       BYTE >00,>00,>00,>B0,>48,>48,>48,>48    * n 110
       BYTE >00,>00,>00,>60,>90,>90,>90,>60    * o 111
       BYTE >00,>00,>F0,>48,>48,>70,>40,>40    * p 112
       BYTE >00,>00,>78,>90,>90,>70,>10,>10    * q 113
       BYTE >00,>00,>00,>B0,>C8,>80,>80,>80    * r 114
       BYTE >00,>00,>00,>70,>80,>70,>08,>F0    * s 115
       BYTE >00,>00,>40,>E0,>40,>40,>50,>20    * t 116
       BYTE >00,>00,>00,>90,>90,>90,>90,>68    * u 117
       BYTE >00,>00,>00,>88,>88,>88,>50,>20    * v 118
       BYTE >00,>00,>00,>88,>88,>A8,>A8,>50    * w 119
       BYTE >00,>00,>00,>88,>50,>20,>50,>88    * x 120
       BYTE >00,>00,>00,>48,>48,>38,>08,>70    * y 121
       BYTE >00,>00,>00,>F8,>10,>20,>40,>F8    * z 122
       BYTE >00,>18,>20,>20,>40,>20,>20,>18    * { 123
       BYTE >00,>20,>20,>20,>00,>20,>20,>20    * | 124
       BYTE >00,>C0,>20,>20,>10,>20,>20,>C0    * } 125
       BYTE >00,>00,>00,>40,>A8,>10,>00,>00    * ~ 126
***********************************************************
       END

Speeded it up some using 8 bytes at a time.

Times:

XB 110      = 33 minutes 17 seconds

RXB 2020  = 33 minutes  0 seconds

RXB 2021  = 4 minutes    4 seconds

  • Like 4

Share this post


Link to post
Share on other sites
23 hours ago, dhe said:

Are the files available to be dropped in to Classic99?

Yea why?

 

Share this post


Link to post
Share on other sites

Ok here are results of RXB 2021 CALL SCROLLUP(repetition,string or number or variable)

Program for RXB 2020, Extended Basic 110, and TI Basic:

100 OPEN #1:"CLOCK"
110 INPUT #1:A$,B$,C$
120 FOR X=1 TO 10000
130 PRINT "TEST OF SCROLL"
140 NEXT X
150 INPUT #1:X$,Y$,Z$
160 PRINT A$,X$:B$,Y$:C$,Z$

 

RXB 2021 instead changed line 130 to:

130 CALL SCROLLUP(1,"  "TEST OF SCROLL")

 

So after running test these are the times:

TI Basic     = 22 minutes 16 seconds

XB 110      = 15 minutes   5 seconds

RXB 2020  = 15 minutes   4 seconds

RXB 2021  = 10 minutes   0 seconds

 

Twice as fast as TI Basic and way faster then PRINT in XB or RXB 2020.

Next to test PRINT : : : :    vs           CALL SCROLLUP(5,"")

 

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, dhe said:

Because I would like to do that thing.

Yes RXB 2020 or RXB 2021 can be dropped into Classic99 using CARTRIDGE>USER>OPEN>RXBC.bin

RXB 2020 is presently in Classic99 latest version, but RXB 2021 is not released yet, still working on it.

  • Like 1

Share this post


Link to post
Share on other sites

Ok here are results of RXB 2021 CALL SCROLLUP(repetition,string or number or variable)

Program for RXB 2020, Extended Basic 110, and TI Basic:

100 OPEN #1:"CLOCK"
110 INPUT #1:A$,B$,C$
120 FOR X=1 TO 10000
130 PRINT : : : :
140 NEXT X
150 INPUT #1:X$,Y$,Z$
160 PRINT A$,X$:B$,Y$:C$,Z$

 

RXB 2021 instead changed line 130 to:

130 CALL SCROLLUP(5,"")

 

So after running test these are the times:

TI Basic     = 1 hour    7 minutes     1 seconds

XB 110      = 1 hour  10 minutes   26 seconds

RXB 2020  = 1 hour  10 minutes   29 seconds

RXB 2021  =            32 minutes     9 seconds

 

So PRINT : : : : is 5 prints in XB but in RXB 2021 I used CALL SCROLLUP(5,"")

  • Like 1

Share this post


Link to post
Share on other sites

Nice... double the speed out of the old TI!

What if... There are so many what if... with that!

But the biggest... What if they had this kind of programs THEN. Also, maybe a lot of computing power is lost. And more and more as the computers are getting bigger.

Question... how much more is it possible to get out of the TI. Are you at the limit of the TI's possibility or more speed to be found?

Share this post


Link to post
Share on other sites
58 minutes ago, oddemann said:

Nice... double the speed out of the old TI!

What if... There are so many what if... with that!

But the biggest... What if they had this kind of programs THEN. Also, maybe a lot of computing power is lost. And more and more as the computers are getting bigger.

Question... how much more is it possible to get out of the TI. Are you at the limit of the TI's possibility or more speed to be found?

Well I still use GPL/XB ROMs  to do most of the heavy lifting for variables and strings, but any VDP screen stuff is all going Assembly in ROM3.

Down line I will add more ROMs to RXB so eventually it will be mostly Assembly ROMs.

Share this post


Link to post
Share on other sites

Results of RXB 2021 CALL SCROLLUP(repetition,string or number or variable)

Program for RXB 2020, Extended Basic 110, and TI Basic:

100 OPEN #1:"CLOCK"
110 INPUT #1:A$,B$,C$
120 FOR X=1 TO 10000
130 PRINT X
140 NEXT X
150 INPUT #1:X$,Y$,Z$
160 PRINT A$,X$:B$,Y$:C$,Z$

 

 

RXB 2021 instead changed line 130 to:

130 CALL SCROLLUP(1,X)

 

So after running test these are the times:

TI Basic     = 29 minutes   57 seconds

XB 110      = 16 minutes   35 seconds

RXB 2020  = 16 minutes   34 seconds

RXB 2021  = 11 minutes     3 seconds

 

  • Like 1

Share this post


Link to post
Share on other sites

Another test 

Results of RXB 2021 CALL SCROLLUP(repetition,string or number or variable)

Program for RXB 2020, Extended Basic 110, and TI Basic:

100 OPEN #1:"CLOCK"
110 INPUT #1:A$,B$,C$
120 FOR X=1 TO 10000
130 PRINT "COUNTER:"&STR$(X)
140 NEXT X
150 INPUT #1:X$,Y$,Z$
160 PRINT A$,X$:B$,Y$:C$,Z$

 

RXB 2021 instead changed line 130 to:

130 CALL SCROLLUP(1,"  COUNTER:"&STR$(X))

 

Running test these are the times:

TI Basic     = 40 minutes   11 seconds

XB 110      = 20 minutes   13 seconds

RXB 2020  = 20 minutes   14 seconds

RXB 2021  = 15 minutes     7 seconds

 

SCROLLUP has a issue unlike PRINT in XB in that it uses the entire screen not column 3 to 28 only.

RXB 2021 SCROLLUP, SCROLLDOWN, SCROLLLEFT, and SCROLLRIGHT all use columns like HCHAR or VCHAR 1 to 32

Thus why you see 2 spaces in the line 130 for RXB 2021 vs no spaces in PRINT in TI Basic, XB or RXB 2020 does.

But as you can see the difference in speed is not affected by much.

  • Like 1

Share this post


Link to post
Share on other sites

RXB 2021 will not get a Assembly version of CALL GCHAR or CALL HGET or CALL VGET as just no way to get the Assembly version to be faster then GPL.

No matter how I write it it is at least 34 seconds slower then XB version 110 after 10,000 loops.

The GPL version is just so much smaller and more efficient just like the RXB 2020 Version of HGET and VGET thus Assembly for these is a dead issue.

  • Like 1

Share this post


Link to post
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...