Jump to content
Bones-69

RXB - Rich Extended Basic

Recommended Posts

A thing of beauty Lee.

 

I am wondering if you have one free register?

VWROW1 MOVB *R1+,@VDPWD    * write next VRAM byte from RAM
       MOVB *R1+,@VDPWD    * write next VRAM byte from RAM

My experiments showed that replacing the symbolic address with indirect addressing through a register speeds up this kind of loop by 12.9%.

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, TheBF said:

A thing of beauty Lee.

 

I am wondering if you have one free register?

VWROW1 MOVB *R1+,@VDPWD    * write next VRAM byte from RAM
       MOVB *R1+,@VDPWD    * write next VRAM byte from RAM

My experiments showed that replacing the symbolic address with indirect addressing through a register speeds up this kind of loop by 12.9%.

 

Indeed, It sped up the rolls by an average of 12 %. Here is the new code, which, by the way, is the same size as the previous code:

Spoiler
************************************************************
       AORG >6000
       TITL 'RXB ROM3'

UNUSED DATA >0000,>0000,>0000,>0000
       DATA >0000,>0000,>0000,>0000
************************************************************
* XML table number 7 for RXB ROM3 - must have              *
*     it's origin at >6010                                 *
************************************************************
*           0     1     2     3      4      5     6
       DATA RROLL,LROLL,UROLL,DROLL,>0000,>0000,>0000
*            7     8     9     A     B     C     D
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000
*             E     F
       DATA >0000,>0000
************************************************************
* XML table number 8 for RXB ROM3 - must have              *
*     it's origin at >6030                                 *
************************************************************
*            0     1     2     3     4     5     6     7
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000,>0000
*            8     9     A     B     C     D     E     F
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000,>0000

GR0LB  EQU  >83E1          * GPLWS R0 LSB
FAC    EQU  >834A          * RAM line buffer
SAVRTN EQU  >836C          * free space after RAM line buffer
VBUFF  EQU  >03C0          * line buffer in VRAM
VDPRD  EQU  >8800          * VDP Read Data address
VDPWD  EQU  >8C00          * VDP Write Data address

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Write VRAM address
*     Expects address in R0
*
* BL here for writing data
*
VWADDW ORI  R0,>4000       * set to write VRAM data
*
* BL here for reading data
*
VWADD  MOVB @GR0LB,*R15    * write LSB of R0 to VDPWA
       MOVB R0,*R15        * write MSB of R0 to VDPWA
       ANDI R0,>3FFF       * ensure R0 returned intact
       RT

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* The following utilities expect 
*     R0 = VRAM address of row
*     R1 = RAM buffer address
*
* R2 and R10 will be destroyed
* 
* Copy 1 row of 32 bytes from VRAM (R0) to RAM (R1)
*
VRROW  MOV  R11,R10        * save return
       BL   @VWADD         * write out VRAM read address
       LI   R2,32          * read 1 row
       LI   R4,VDPRD       * load VDP Read Data address
VRROW1 MOVB *R4,*R1+       * read next VRAM byte to RAM
       MOVB *R4,*R1+       * read next VRAM byte to RAM
       DECT R2             * dec count by 2
       JNE  VRROW1         * repeat if not done
       B    *R10           * return to caller

* 
* Copy 1 row of 32 bytes from RAM (R1) to VRAM (R0)
*
VWROW  MOV  R11,R10        * save return
       BL   @VWADDW        * write out VRAM write address
       LI   R2,32          * write one row
       LI   R4,VDPWD       * load VDP Write Data address
VWROW1 MOVB *R1+,*R4       * write next VRAM byte from RAM
       MOVB *R1+,*R4       * write next VRAM byte from RAM
       DECT R2             * dec count by 2
       JNE  VWROW1         * repeat if not done
       B    *R10           * return to caller

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* RROLL
*
RROLL  MOV  R11,@SAVRTN    * save return address
       CLR  R0             * set to screen start
       LI   R3,24          * rows to roll
* Write row to RAM buffer
RROLLP LI   R1,FAC+1       * RAM buffer+1 for roll-right positions
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy last column before first in RAM buffer
       MOVB @FAC+32,@FAC   * copy roll-out byte to roll-in position
* Copy rolled row back to screen (R0 still has correct location)
       LI   R1,FAC         * reset RAM buffer pointer
       BL   @VWROW         * copy rolled line          
* Process next row
       AI   R0,32          * next row                   
       DEC  R3             * dec row count
       JNE  RROLLP         * roll next row if not done
       MOV  @SAVRTN,R11    * restore return address
       RT

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* LROLL
*
LROLL  MOV  R11,@SAVRTN    * save return address
       CLR  R0             * set to screen start
       LI   R3,24          * rows to roll
* Write row to RAM buffer
LROLLP LI   R1,FAC         * RAM buffer+1 for roll-left positions
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy first column after last in RAM buffer
       MOVB @FAC,@FAC+32   * copy roll-out byte to roll-in position
* Copy rolled row back to screen (R0 still has correct location)
       LI   R1,FAC+1       * reset RAM buffer pointer
       BL   @VWROW         * copy rolled line 2 bytes at a time
* Process next row
       AI   R0,32          * next row                   
       DEC  R3             * dec row count
       JNE  LROLLP         * roll next row if not done
       MOV  @SAVRTN,R11    * restore return address
       RT

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* UROLL
*
UROLL  MOV  R11,@SAVRTN    * save return address
       CLR  R0             * set to screen start
       LI   R3,23          * rows to roll (all but 1st)
* Write first row to RAM buffer
       LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy RAM buffer to VRAM buffer
       LI   R0,VBUFF       * set VRAM dest to VBUFF
       LI   R1,FAC         * set RAM buffer
       BL   @VWROW         * copy row to VBUFF 2 bytes at a time
* Start copy loop at 2nd row
       LI   R0,32          * point to 2nd row
* Write row to RAM buffer
UROLLP LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy to previous row
       AI   R0,-32         * back up 1 row
       LI   R1,FAC         * reset RAM buffer pointer
       BL   @VWROW         * copy to previous row 2 bytes at a time
* Process next row
       AI   R0,64          * next row
       DEC  R3             * dec row count
       JNE  UROLLP         * roll next row if not done
* Copy saved row to RAM
       LI   R0,VBUFF       * set VRAM source
       LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy saved row to last row
       LI   R0,736         * point to last row
       LI   R1,FAC         * reset RAM buffer pointer
       BL   @VWROW         * copy to last row 2 bytes at a time
       MOV  @SAVRTN,R11    * restore return address
       RT
       
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* DROLL
*
DROLL  MOV  R11,@SAVRTN    * save return address
       LI   R0,736         * set to last row
       LI   R3,23          * rows to roll (all but last)
* Write last row to RAM buffer
       LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy RAM buffer to VRAM buffer
       LI   R0,VBUFF       * set VRAM dest to VBUFF
       LI   R1,FAC         * set RAM buffer
       BL   @VWROW         * copy row to VBUFF 2 bytes at a time
* Start copy loop at 2nd-to-last row
       LI   R0,704         * point to row 22
* Write row to RAM buffer
DROLLP LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy to next row
       AI   R0,32          * down 1 row
       LI   R1,FAC         * reset RAM buffer pointer
       BL   @VWROW         * copy to next row 2 bytes at a time
* Process next row
       AI   R0,-64         * back up 2 rows
       DEC  R3             * dec row count
       JNE  DROLLP         * roll next row if not done
* Copy saved row to RAM
       LI   R0,VBUFF       * set VRAM source
       LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy saved row to first row
       CLR  R0             * point to first row
       LI   R1,FAC         * reset RAM buffer pointer
       BL   @VWROW         * copy to first row 2 bytes at a time
       MOV  @SAVRTN,R11    * restore return address
       RT

       END

 

 

The above code is a full 3 times faster than the last RXB code I tested (post #1236).

 

...lee

  • Like 4

Share this post


Link to post
Share on other sites
On 6/17/2021 at 2:31 AM, Lee Stewart said:

If I worked a little harder, I could probably combine the up/down routines as well as the right/left routines—the pairs are practically identical...

 

TaDa!! Here is 252 bytes of code that is as compact as I can get it, I think. Left/right rolling is combined into a horizontal rolling routine and up/down rolling is combined into a vertical rolling routine. The times are virtually identical to the last program:

Spoiler
************************************************************
       AORG >6000
       TITL 'RXB ROM3'

UNUSED DATA >0000,>0000,>0000,>0000
       DATA >0000,>0000,>0000,>0000
************************************************************
* XML table number 7 for RXB ROM3 - must have              *
*     it's origin at >6010                                 *
************************************************************
*           0     1     2     3      4      5     6
       DATA RROLL,LROLL,UROLL,DROLL,>0000,>0000,>0000
*            7     8     9     A     B     C     D
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000
*             E     F
       DATA >0000,>0000
************************************************************
* XML table number 8 for RXB ROM3 - must have              *
*     it's origin at >6030                                 *
************************************************************
*            0     1     2     3     4     5     6     7
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000,>0000
*            8     9     A     B     C     D     E     F
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000,>0000

GR0LB  EQU  >83E1          * GPLWS R0 LSB
FAC    EQU  >834A          * RAM line buffer
SAVRTN EQU  >836C          * free space after RAM line buffer
VBUFF  EQU  >03C0          * line buffer in VRAM
VDPRD  EQU  >8800          * VDP Read Data address
VDPWD  EQU  >8C00          * VDP Write Data address

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Write VRAM address
*     Expects address in R0
*
* BL here for writing data
*
VWADDW ORI  R0,>4000       * set to write VRAM data
*
* BL here for reading data
*
VWADD  MOVB @GR0LB,*R15    * write LSB of R0 to VDPWA
       MOVB R0,*R15        * write MSB of R0 to VDPWA
       ANDI R0,>3FFF       * ensure R0 returned intact
       RT

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* The following utilities expect 
*     R0 = VRAM address of row
*     R1 = RAM buffer address
*
* R2, R4, R10 will be destroyed
* 
* Copy 1 row of 32 bytes from VRAM (R0) to RAM (R1)
*
VRROW  MOV  R11,R10        * save return
       BL   @VWADD         * write out VRAM read address
       LI   R2,32          * read 1 row
       LI   R4,VDPRD       * load VDP Read Data address
VRROW1 MOVB *R4,*R1+       * read next VRAM byte to RAM
       MOVB *R4,*R1+       * read next VRAM byte to RAM
       DECT R2             * dec count by 2
       JNE  VRROW1         * repeat if not done
       B    *R10           * return to caller

* 
* Copy 1 row of 32 bytes from RAM (R1) to VRAM (R0)
*
VWROW  MOV  R11,R10        * save return
       BL   @VWADDW        * write out VRAM write address
       LI   R2,32          * write one row
       LI   R4,VDPWD       * load VDP Write Data address
VWROW1 MOVB *R1+,*R4       * write next VRAM byte from RAM
       MOVB *R1+,*R4       * write next VRAM byte from RAM
       DECT R2             * dec count by 2
       JNE  VWROW1         * repeat if not done
       B    *R10           * return to caller

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Roll table data...
*
RRLTAB DATA FAC+1,FAC+32,FAC,FAC    * Right
LRLTAB DATA FAC,FAC,FAC+32,FAC+1    * Left
URLTAB DATA 0,32,-32,64,736         * Up
DRLTAB DATA 736,704,32,-64,0        * Down

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* RROLL
*
RROLL  LI   R8,RRLTAB      * set HROLL for right roll
       JMP  HROLL          * on with the rolling
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* LROLL
*
LROLL  LI   R8,LRLTAB      * set HROLL for left roll
* Fall through to HROLL to get on with the rolling

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* HROLL  Horizontal Roll common code
*
HROLL  MOV  R11,@SAVRTN    * save return address
       CLR  R0             * set to screen start
       LI   R3,24          * rows to roll
* Write row to RAM buffer
HROLLP MOV  R8,R5          * reset roll table pointer
       MOV  *R5+,R1        * RAM buffer+1 for roll-right positions
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy rolled-out column to roll-in column in RAM buffer
       MOV  *R5+,R6        * get source of rolled-out column
       MOV  *R5+,R7        * get destination of roll-in column
       MOVB *R6,*R7        * copy roll-out byte to roll-in position
* Copy rolled row back to screen (R0 still has correct location)
       MOV  *R5,R1         * reset RAM buffer pointer
       BL   @VWROW         * copy rolled line          
* Process next row
       AI   R0,32          * next row                   
       DEC  R3             * dec row count
       JNE  HROLLP         * roll next row if not done
       MOV  @SAVRTN,R11    * restore return address
       RT

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* UROLL
*
UROLL  LI   R8,URLTAB      * set VROLL for up roll
       JMP  VROLL          * on with the rolling
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* DROLL
*
DROLL  LI   R8,DRLTAB      * set VROLL for down roll
* Fall through to VROLL to get on with the rolling

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* VROLL  Vertical Roll common code
*
VROLL  MOV  R11,@SAVRTN    * save return address
       MOV  *R8+,R0        * set to roll-out row
       LI   R3,23          * rows to roll (all but 1st)
* Write roll-out row to RAM buffer
       LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy RAM buffer to VRAM buffer
       LI   R0,VBUFF       * set VRAM dest to VBUFF
       LI   R1,FAC         * set RAM buffer
       BL   @VWROW         * copy row to VBUFF 2 bytes at a time
* Start copy loop at next row to scroll
       MOV  *R8+,R0        * point to roll to start scroll
* Write row to RAM buffer
VROLLP LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy to scroll row
       MOV  R8,R5          * reset roll table pointer to 3rd entry
       A    *R5+,R0        * next scroll dest
       LI   R1,FAC         * reset RAM buffer pointer
       BL   @VWROW         * copy to scroll row 2 bytes at a time
* Process next row
       A    *R5+,R0        * next row
       DEC  R3             * dec row count
       JNE  VROLLP         * roll next row if not done
* Copy saved row to RAM
       LI   R0,VBUFF       * set VRAM source
       LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy saved row to roll-in row
       MOV  *R5,R0         * to roll-in row
       LI   R1,FAC         * reset RAM buffer pointer
       BL   @VWROW         * copy to rolled-out row 2 bytes at a time
       MOV  @SAVRTN,R11    * restore return address
       RT
       
       END

 

 

...lee

  • Like 7

Share this post


Link to post
Share on other sites
On 6/17/2021 at 2:10 PM, Lee Stewart said:

 

TaDa!! Here is 252 bytes of code that is as compact as I can get it, I think. Left/right rolling is combined into a horizontal rolling routine and up/down rolling is combined into a vertical rolling routine. The times are virtually identical to the last program:

  Reveal hidden contents

************************************************************
       AORG >6000
       TITL 'RXB ROM3'

UNUSED DATA >0000,>0000,>0000,>0000
       DATA >0000,>0000,>0000,>0000
************************************************************
* XML table number 7 for RXB ROM3 - must have              *
*     it's origin at >6010                                 *
************************************************************
*           0     1     2     3      4      5     6
       DATA RROLL,LROLL,UROLL,DROLL,>0000,>0000,>0000
*            7     8     9     A     B     C     D
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000
*             E     F
       DATA >0000,>0000
************************************************************
* XML table number 8 for RXB ROM3 - must have              *
*     it's origin at >6030                                 *
************************************************************
*            0     1     2     3     4     5     6     7
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000,>0000
*            8     9     A     B     C     D     E     F
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000,>0000

GR0LB  EQU  >83E1          * GPLWS R0 LSB
FAC    EQU  >834A          * RAM line buffer
SAVRTN EQU  >836C          * free space after RAM line buffer
VBUFF  EQU  >03C0          * line buffer in VRAM
VDPRD  EQU  >8800          * VDP Read Data address
VDPWD  EQU  >8C00          * VDP Write Data address

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Write VRAM address
*     Expects address in R0
*
* BL here for writing data
*
VWADDW ORI  R0,>4000       * set to write VRAM data
*
* BL here for reading data
*
VWADD  MOVB @GR0LB,*R15    * write LSB of R0 to VDPWA
       MOVB R0,*R15        * write MSB of R0 to VDPWA
       ANDI R0,>3FFF       * ensure R0 returned intact
       RT

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* The following utilities expect 
*     R0 = VRAM address of row
*     R1 = RAM buffer address
*
* R2, R4, R10 will be destroyed
* 
* Copy 1 row of 32 bytes from VRAM (R0) to RAM (R1)
*
VRROW  MOV  R11,R10        * save return
       BL   @VWADD         * write out VRAM read address
       LI   R2,32          * read 1 row
       LI   R4,VDPRD       * load VDP Read Data address
VRROW1 MOVB *R4,*R1+       * read next VRAM byte to RAM
       MOVB *R4,*R1+       * read next VRAM byte to RAM
       DECT R2             * dec count by 2
       JNE  VRROW1         * repeat if not done
       B    *R10           * return to caller

* 
* Copy 1 row of 32 bytes from RAM (R1) to VRAM (R0)
*
VWROW  MOV  R11,R10        * save return
       BL   @VWADDW        * write out VRAM write address
       LI   R2,32          * write one row
       LI   R4,VDPWD       * load VDP Write Data address
VWROW1 MOVB *R1+,*R4       * write next VRAM byte from RAM
       MOVB *R1+,*R4       * write next VRAM byte from RAM
       DECT R2             * dec count by 2
       JNE  VWROW1         * repeat if not done
       B    *R10           * return to caller

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Roll table data...
*
RRLTAB DATA FAC+1,FAC+32,FAC,FAC    * Right
LRLTAB DATA FAC,FAC,FAC+32,FAC+1    * Left
URLTAB DATA 0,32,-32,64,736         * Up
DRLTAB DATA 736,704,32,-64,0        * Down

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* RROLL
*
RROLL  LI   R8,RRLTAB      * set HROLL for right roll
       JMP  HROLL          * on with the rolling
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* LROLL
*
LROLL  LI   R8,LRLTAB      * set HROLL for left roll
* Fall through to HROLL to get on with the rolling

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* HROLL  Horizontal Roll common code
*
HROLL  MOV  R11,@SAVRTN    * save return address
       CLR  R0             * set to screen start
       LI   R3,24          * rows to roll
* Write row to RAM buffer
HROLLP MOV  R8,R5          * reset roll table pointer
       MOV  *R5+,R1        * RAM buffer+1 for roll-right positions
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy rolled-out column to roll-in column in RAM buffer
       MOV  *R5+,R6        * get source of rolled-out column
       MOV  *R5+,R7        * get destination of roll-in column
       MOVB *R6,*R7        * copy roll-out byte to roll-in position
* Copy rolled row back to screen (R0 still has correct location)
       MOV  *R5,R1         * reset RAM buffer pointer
       BL   @VWROW         * copy rolled line          
* Process next row
       AI   R0,32          * next row                   
       DEC  R3             * dec row count
       JNE  HROLLP         * roll next row if not done
       MOV  @SAVRTN,R11    * restore return address
       RT

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* UROLL
*
UROLL  LI   R8,URLTAB      * set VROLL for up roll
       JMP  VROLL          * on with the rolling
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* DROLL
*
DROLL  LI   R8,DRLTAB      * set VROLL for down roll
* Fall through to VROLL to get on with the rolling

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* VROLL  Vertical Roll common code
*
VROLL  MOV  R11,@SAVRTN    * save return address
       MOV  *R8+,R0        * set to roll-out row
       LI   R3,23          * rows to roll (all but 1st)
* Write roll-out row to RAM buffer
       LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy RAM buffer to VRAM buffer
       LI   R0,VBUFF       * set VRAM dest to VBUFF
       LI   R1,FAC         * set RAM buffer
       BL   @VWROW         * copy row to VBUFF 2 bytes at a time
* Start copy loop at next row to scroll
       MOV  *R8+,R0        * point to roll to start scroll
* Write row to RAM buffer
VROLLP LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy to scroll row
       MOV  R8,R5          * reset roll table pointer to 3rd entry
       A    *R5+,R0        * next scroll dest
       LI   R1,FAC         * reset RAM buffer pointer
       BL   @VWROW         * copy to scroll row 2 bytes at a time
* Process next row
       A    *R5+,R0        * next row
       DEC  R3             * dec row count
       JNE  VROLLP         * roll next row if not done
* Copy saved row to RAM
       LI   R0,VBUFF       * set VRAM source
       LI   R1,FAC         * set RAM buffer
       BL   @VRROW         * copy row to RAM buffer 2 bytes at a time
* Copy saved row to roll-in row
       MOV  *R5,R0         * to roll-in row
       LI   R1,FAC         * reset RAM buffer pointer
       BL   @VWROW         * copy to rolled-out row 2 bytes at a time
       MOV  @SAVRTN,R11    * restore return address
       RT
       
       END

 

 

...lee

This is really great work! Look forward to seeing further collaborative efforts for the TI. Thanks.

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites
10 minutes ago, Lee Stewart said:

 

You either misnamed it or uploaded the wrong fil;e.

 

...lee

 Ok need to fix it:

 

RXB 202E.zip

  • Like 1

Share this post


Link to post
Share on other sites

Ok just finished RXB 2021  new CALL INIT that instead of loading from GROM now loads from ROM3

Loop for 10,000 times results are:

XB             34  minutes 41 seconds

RXB 2021    3  minutes 12 seconds

 

Yea I know pointless values but shows a marked improvement over XB.

 

 

Also RXB 2021 has a new Assembly version of CALL CLEAR instead of the old XB GPL version.

Oddly hardly any improvement?

Spoiler

***********************************************************
       AORG >6000
       TITL 'RXB ROM3'

UNUSED DATA >0000,>0000,>0000,>0000
       DATA >0000,>0000,>0000,>0000
************************************************************
* XML table number 7 for RXB ROM3 - must have              *
*     it's origin at >6010                                 *
************************************************************
*           0     1     2     3      4      5     6
       DATA RROLL,LROLL,UROLL,DROLL,CLEAR,>0000,>0000
*            7     8     9     A     B     C     D
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000
*             E     F
       DATA >0000,>0000
************************************************************
* XML table number 8 for RXB ROM3 - must have              *
*     it's origin at >6030                                 *
************************************************************
*            0     1     2     3     4     5     6     7
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000,>0000
*            8     9     A     B     C     D     E     F
       DATA >0000,>0000,>0000,>0000,>0000,>0000,>0000,>0000

GR0LB  EQU  >83E1       * GPLWS R0 LSB
FAC    EQU  >834A       * RAM line buffer
SAVRTN EQU  >836C       * free space after RAM line buffer
VBUFF  EQU  >03C0       * line buffer in VRAM
VDPRD  EQU  >8800       * VDP Read Data address
VDPWD  EQU  >8C00       * VDP Write Data address

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Write VRAM address
*     Expects address in R0
*
* BL here for writing data
*
VWADDW ORI  R0,>4000    * set to write VRAM data
*
* BL here for reading data
*
VWADD  MOVB @GR0LB,*R15 * write LSB of R0 to VDPWA
       MOVB R0,*R15     * write MSB of R0 to VDPWA
       ANDI R0,>3FFF    * ensure R0 returned intact
       RT

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* The following utilities expect 
*     R0 = VRAM address of row
*     R1 = RAM buffer address
*
* R2 and R10 will be destroyed

* Copy 1 row of 32 bytes from VRAM (R0) to RAM (R1)
*
VRROW  MOV  R11,R10     * save return
       BL   @VWADD      * write out VRAM read address
       LI   R2,32       * read 1 row
VRROW1 MOVB @VDPRD,*R1+ * read next VRAM byte to RAM
       MOVB @VDPRD,*R1+ * read next VRAM byte to RAM
       DECT R2          * dec count by 2
       JNE  VRROW1      * repeat if not done
       B    *R10        * return to caller


* Copy 1 row of 32 bytes from RAM (R1) to VRAM (R0)
*
VWROW  MOV  R11,R10     * save return
       BL   @VWADDW     * write out VRAM write address
       LI   R2,32       * write one row
VWROW1 MOVB *R1+,@VDPWD * write next VRAM byte from RAM
       MOVB *R1+,@VDPWD * write next VRAM byte from RAM
       DECT R2          * dec count by 2
       JNE  VWROW1      * repeat if not done
       B    *R10        * return to caller

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* RROLL
*
RROLL  MOV  R11,R9      * save return address
       CLR  R0          * set to screen start
       LI   R3,24       * rows to roll
* Write row to RAM buffer
RROLLP LI   R1,FAC+1    * RAM buffer+1 for roll-right positions
       BL   @VRROW      * copy row to RAM buffer 2 bytes at a time
* Copy last column before first in RAM buffer
       MOVB @FAC+32,@FAC * copy roll-out byte to roll-in position
* Copy rolled row back to screen (R0 still has correct location)
       LI   R1,FAC      * reset RAM buffer pointer
       BL   @VWROW      * copy rolled line          
* Process next row
       AI   R0,32       * next row                   
       DEC  R3          * dec row count
       JNE  RROLLP      * roll next row if not done
       B    *R9         * return to caller
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* LROLL
*
LROLL  MOV  R11,R9      * save return address
       CLR  R0          * set to screen start
       LI   R3,24       * rows to roll
* Write row to RAM buffer
LROLLP LI   R1,FAC      * RAM buffer+1 for roll-left positions
       BL   @VRROW      * copy row to RAM buffer 2 bytes at a time
* Copy first column after last in RAM buffer
       MOVB @FAC,@FAC+32 * copy roll-out byte to roll-in position
* Copy rolled row back to screen (R0 still has correct location)
       LI   R1,FAC+1    * reset RAM buffer pointer
       BL   @VWROW      * copy rolled line 2 bytes at a time
* Process next row
       AI   R0,32       * next row                   
       DEC  R3          * dec row count
       JNE  LROLLP      * roll next row if not done
       B    *R9         * return to caller
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* UROLL
*
UROLL  MOV  R11,R9      * save return address
       CLR  R0          * set to screen start
       LI   R3,23       * rows to roll (all but 1st)
* Write first row to RAM buffer
       LI   R1,FAC      * set RAM buffer
       BL   @VRROW      * copy row to RAM buffer 2 bytes at a time
* Copy RAM buffer to VRAM buffer
       LI   R0,VBUFF    * set VRAM dest to VBUFF
       LI   R1,FAC      * set RAM buffer
       BL   @VWROW      * copy row to VBUFF 2 bytes at a time
* Start copy loop at 2nd row
       LI   R0,32       * point to 2nd row
* Write row to RAM buffer
UROLLP LI   R1,FAC      * set RAM buffer
       BL   @VRROW      * copy row to RAM buffer 2 bytes at a time
* Copy to previous row
       AI   R0,-32      * back up 1 row
       LI   R1,FAC      * reset RAM buffer pointer
       BL   @VWROW      * copy to previous row 2 bytes at a time
* Process next row
       AI   R0,64       * next row
       DEC  R3          * dec row count
       JNE  UROLLP      * roll next row if not done
* Copy saved row to RAM
       LI   R0,VBUFF    * set VRAM source
       LI   R1,FAC      * set RAM buffer
       BL   @VRROW      * copy row to RAM buffer 2 bytes at a time
* Copy saved row to last row
       LI   R0,736      * point to last row
       LI   R1,FAC      * reset RAM buffer pointer
       BL   @VWROW      * copy to last row 2 bytes at a time
       B    *R9         * return to caller
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* DROLL
*
DROLL  MOV  R11,R9      * save return address
       LI   R0,736      * set to last row
       LI   R3,23       * rows to roll (all but last)
* Write last row to RAM buffer
       LI   R1,FAC      * set RAM buffer
       BL   @VRROW      * copy row to RAM buffer 2 bytes at a time
* Copy RAM buffer to VRAM buffer
       LI   R0,VBUFF    * set VRAM dest to VBUFF
       LI   R1,FAC      * set RAM buffer
       BL   @VWROW      * copy row to VBUFF 2 bytes at a time
* Start copy loop at 2nd-to-last row
       LI   R0,704      * point to row 22
* Write row to RAM buffer
DROLLP LI   R1,FAC      * set RAM buffer
       BL   @VRROW      * copy row to RAM buffer 2 bytes at a time
* Copy to next row
       AI   R0,32       * down 1 row
       LI   R1,FAC      * reset RAM buffer pointer
       BL   @VWROW      * copy to next row 2 bytes at a time
* Process next row
       AI   R0,-64      * back up 2 rows
       DEC  R3          * dec row count
       JNE  DROLLP      * roll next row if not done
* Copy saved row to RAM
       LI   R0,VBUFF    * set VRAM source
       LI   R1,FAC      * set RAM buffer
       BL   @VRROW      * copy row to RAM buffer 2 bytes at a time
* Copy saved row to first row
       CLR  R0          * point to first row
       LI   R1,FAC      * reset RAM buffer pointer
       BL   @VWROW      * copy to first row 2 bytes at a time
       B    *R9         * return to caller
************************************************************
* CALL CLEAR                                               *
************************************************************
* >8080 already loaded *************************************
* Put writing out the VRAM address outside the loop. *******
************************************************************
CLEAR  MOV  R11,R9     * save return address
           LI   R0,0       * set to first screen address
           LI   R3,768     * Screen size
           LI   R1,>8080   * SPACE SPACE
           BL   @VWADDW    * write out VRAM write address
CLRLP  MOVB R1,@VDPWD * write next VRAM byte from R1
           MOVB R1,@VDPWD * write next VRAM byte from R1
           DECT R3         * count by -2
           JNE  CLRLP      * count=0?
           B    *R9        * return to caller
*************************************************************

Which was disappointing and a bummer. 3.1 seconds faster after 10,000 times in loop.

  • Like 1

Share this post


Link to post
Share on other sites
  6 hours ago, Vorticon said:

I just noted that the TAB key does not work in the editor. I think it's important to have that functionality for ease of formatting.

I can add a TAB key to RXB Editor so how many spaces should it jump forward or should it look for something like "::" ?

  Reveal hidden contents

I think the best thing would be tab maybe 24 characters at time so next line in Editor each tab.

XB EXAMPLE:

100 ! This is a test line at line 100 and just to show an example.

 

When you hit tab the screen would like this:

100 ! This is a test line at

@line 100 and just to sh

ow an example.

 

The @ is where the Cursor would move to.

  • Like 1

Share this post


Link to post
Share on other sites

I also thought RXB can add a FIND KEY to Editor in XB.

Like FCTN or CTRL TAB would ask for a search string say like "FIND?:" and you would type in string up to 24 characters.

Then a search of the XB program would find that line and display it.

  • Like 1

Share this post


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

Rich - do you have a manual of the new features and functions?

 

Sorry no will have to add changes and put in addition changes.

 

I am going to add FIND into XB Editor Mode so like RES or NUM or COPY just type in FIND linenumber,string

EXAMPLE:

 

FIND 2070,RK=LF

 

Would start at line number 2070 and look for "RK=LF" in program and show line number with "RK=LF" in that line number.

Error output would be No Program Present, Bad Value, Bad Line Number or Line Not Found in case no match found. 

 

Second EXAMPLE:

 

FIND 1910,STR$

 

Would look for STR$ command starting at line 1910 and display that line if found.

  • Like 1

Share this post


Link to post
Share on other sites

Rich,

 

Just going to throw this out in case it is of interest to you following our Saturday Zoom call.

 

You mentioned something about converting some of the GPL routines in RXB to assembly.  I don't know if you would find any advantage to it or not, but Geneve Advanced Basic is written entirely in assembly.  I mention this as you are free to borrow routines you may want to convert to assembly, etc.  Also, all the math routines are in assembly but part of an XOP call which is basically not much more than load various registers and call the XOP which for the TI, would be like doing a BLWP instruction.  I know Lee converted the floating point routines to be used in Forth on the 4A.  I know he saw speed improvement, but not sure how much.

 

The Geneve supports more ram and has more graphic features due to the 9938, but if you got very industrious, I guess you might even consider rewriting Geneve Advanced Basic to work with the FinalGrom and a SAMS card cutting out the pieces that would not be compatible with a stock TI-99/4A or TI-99/4A with F18A.

 

Just wanted to point out that you might not have to start from scratch, etc. dependent upon where your development interest lies.

 

I had hoped to get Myarc's Advanced Basic for the TI with the 512K card from him, but thus far, he hasn't found any code.  

 

Beery

 

Share this post


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

I know Lee converted the floating point routines to be used in Forth on the 4A.  I know he saw speed improvement, but not sure how much.

 

I am pretty sure those routines that are equivalent to the XMLLNK calls (see the E/A manual) are slower due to 16-bit vs. 8-bit bus. Those equivalent to GPLLNK calls (again, see the E/A manual) are almost certainly faster. I am not sure I ever checked, however.

 

...lee

  • Like 1

Share this post


Link to post
Share on other sites
On 7/13/2021 at 3:37 PM, 9640News said:

The Geneve supports more ram and has more graphic features due to the 9938, but if you got very industrious, I guess you might even consider rewriting Geneve Advanced Basic to work with the FinalGrom and a SAMS card cutting out the pieces that would not be compatible with a stock TI-99/4A or TI-99/4A with F18A.

 

It would be really great to have some of the "automatic" extra memory features of XB-II (same as A-Basic? - do not know myself) incorporated into RXB.

 

I would coordinate an honorarium for this effort...  Thanks.

MikeV.

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.

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...