Jump to content
IGNORED

80 columns with F18A and Extended BASIC


senior_falcon

Recommended Posts

gallery_34177_1071_1829235.gif

Here's a first stab at utilizing the 80 column mode of the F18A with Extended BASIC. The text is a short story by Mark Twain. At one point there is a short pause when the text is being displayed - that is in the program, not the result of a garbage collection. I will post the files tomorrow. They are ready to go, but I realized there are no docs for them.

  • Like 18
Link to comment
Share on other sites

very nice. I can see this getting use..

 

Oh yeah! I can see old text games like Hammurabi being modernized. Heck, I'll probably be dusting off my seldom used programming skills now when I get some time.

 

Besides just displaying text, if I can input numeric and text data while in 80 column mode I'll be a happy camper for sure. Who said dreams don't eventually come true! Thanks Senior_Falcon!

Link to comment
Share on other sites

It always feels good when I can impress someone of your stature, Tursi!

 

I've attached the files that I promised yesterday. Here's how to run the demo program, assuming they are on disk 6:

From the XB command line:

CALL INIT

CALL LOAD("DSK6.80TEST.OBJ")

CALL LINK("T80ON")

OLD DSK6.MYWATCH

RUN

 

The assembly language subroutines are:

CALL LINK("T80ON") turns on the interrupt driven monitor so that the 80 column text mode will be usable. Should be done from immediate mode, not from a program

CALL LINK("T80") Changes graphics mode to the 80 column text mode. The first time you call this it will load character definitions and clear the screen.

CALL LINK("G32") Changes the graphics mode to the 32 column mode

CALL LINK("CLS80") Clears the 80 column screen

CALL LINK("TCOLOR",foreground,background) Changes the color in the T80 mode to the specified foreground and background

CALL LINK("DISPLY",row,col,string or number) Displays a string or number at the specified row and column. If the row is off the bottom of the screen the screen will scroll until the text can be printed. Example:

CALL LINK("DISPLY",25,1,"hello world") will scroll once and then print "hello world" at 1,24

 

 

Link to comment
Share on other sites

It always feels good when I can impress someone of your stature, Tursi!

 

I've attached the files that I promised yesterday. Here's how to run the demo program, assuming they are on disk 6:

From the XB command line:

CALL INIT

CALL LOAD("DSK6.80TEST.OBJ")

CALL LINK("T80ON")

OLD DSK6.MYWATCH

RUN

 

The assembly language subroutines are:

CALL LINK("T80ON") turns on the interrupt driven monitor so that the 80 column text mode will be usable. Should be done from immediate mode, not from a program

CALL LINK("T80") Changes graphics mode to the 80 column text mode. The first time you call this it will load character definitions and clear the screen.

CALL LINK("G32") Changes the graphics mode to the 32 column mode

CALL LINK("CLS80") Clears the 80 column screen

CALL LINK("TCOLOR",foreground,background) Changes the color in the T80 mode to the specified foreground and background

CALL LINK("DISPLY",row,col,string or number) Displays a string or number at the specified row and column. If the row is off the bottom of the screen the screen will scroll until the text can be printed. Example:

CALL LINK("DISPLY",25,1,"hello world") will scroll once and then print "hello world" at 1,24

 

 

Link to comment
Share on other sites

It always feels good when I can impress someone of your stature, Tursi!

 

I've attached the files that I promised yesterday. Here's how to run the demo program, assuming they are on disk 6:

From the XB command line:

CALL INIT

CALL LOAD("DSK6.80TEST.OBJ")

CALL LINK("T80ON")

OLD DSK6.MYWATCH

RUN

 

The assembly language subroutines are:

CALL LINK("T80ON") turns on the interrupt driven monitor so that the 80 column text mode will be usable. Should be done from immediate mode, not from a program

CALL LINK("T80") Changes graphics mode to the 80 column text mode. The first time you call this it will load character definitions and clear the screen.

CALL LINK("G32") Changes the graphics mode to the 32 column mode

CALL LINK("CLS80") Clears the 80 column screen

CALL LINK("TCOLOR",foreground,background) Changes the color in the T80 mode to the specified foreground and background

CALL LINK("DISPLY",row,col,string or number) Displays a string or number at the specified row and column. If the row is off the bottom of the screen the screen will scroll until the text can be printed. Example:

CALL LINK("DISPLY",25,1,"hello world") will scroll once and then print "hello world" at 1,24

CALL LINK("DISPLY",27,1,"HELLO WORLD") will scroll 3 times and then print "HELLO WORLD at 1,24

The T80 and G32 screens are independent of each other and you can make any changes you want to the hidden screen. Then you can display the screen with T80 or G32 as desired.

 

I've done as much as I'm going to on this. The file 80TEST.TXT has the source code for the above, and hopefully enough comments to be understandable. Feel free to add or modify as desired. The major thing needed to make this a useful package is a way to input text and numbers when in the T80 mode.

F18A T80.zip

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

Well the TI Mode you mean the Edit Mode?

Well you could use the RXB command CALL USER(devicepath)

Example: CALL USER('SCS1.VOLUME.FILENAME)

or CALL USER("PHONEY DSR DEVICE")

 

In this video I used RXB CALL USER("RS232") to talk to another TI computer thru the RS232 Cable and control the other computer like in Edit Mode in XB.

 

CALL USER works just like you are typing into XB but it runs from a file or from a source. Thus you could make a DSR in your code and RXB CALL USER could run from that.

Type in your code then run CALL USER("F80 DSR") and it would install and run.

Link to comment
Share on other sites

What's needed is an assembly equivalent for ACCEPT AT or INPUT. Everything works as usual in XB but with the addition of the T80 mode. You can type in programs normally or paste them in using Classic99, which is how the text for the Mark Twain story got loaded. That's way too much typing for me! Anyone interested can try it out by following the steps in post #9.

Link to comment
Share on other sites

I've seen several good reasons for the big box in the last month or so--Dungeons of Asgard, the Don't Mess With Texas Demo, the progress on several WIP compiled/XB256 games, Sometimes99er's recent Demo and Squary too, and Stuart's Experimental LBL Assembler/Disassembler module. There is lots of new stuff out there, and it is all good. This 80-column adaptation for the F18A is really good too, but it is not the only great thing out there. I am happy for each and every new bit of TI software--and I thank EVERY TI programmer for what they've done to help the community! :) :) :) :)

  • Like 5
Link to comment
Share on other sites

What's needed is an assembly equivalent for ACCEPT AT or INPUT. Everything works as usual in XB but with the addition of the T80 mode. You can type in programs normally or paste them in using Classic99, which is how the text for the Mark Twain story got loaded. That's way too much typing for me! Anyone interested can try it out by following the steps in post #9.

 

I wrote this long ago for one of my projects (1995 based on one of the dated comments) and as far as I know it functions as documented. A few V9938 highlight/blink calls are commented out so it should be F18A compatible. The keyscan routine has something weird in place, possibly for the Geneve. Anyway... if someone wants to pursue an ACCEPT AT routine to go with your T80 code, this might be a starting point. The routine would need to be modified to use XB parameters in place of the DATA values/pointers.

 

 

 

**DOSIN_S

* BL @ACCEPTAT

* DATA 1 cursor row (0-23 or 0-25)

* DATA 1 cursor column (0-79)

* DATA 10 Maximum Length (1-80) should NOT exceed last column!

* a NEGATIVE length will cause the existing data in

* the field to not be cleared.

* PLEASE NOTE that invalid characters present in the

* field are not screen out. Use at your own risk!

*

* DATA 0 CAPSFLAG (0=both; <>0 converts to UPPER)

* DATA 0 NUMFLAG (0=all; <>0 accept ONLY numbers)

* DATA ACCEPTED NULL terminated string of accepted characters

* DATA BUFFER Location to put the keyed data

*

* OUT: R0 - length of input (LSB)

*

* DESTROYS: R0,R1,R2,R3

* SAVES: whatever registers it uses.

*-------------------------------------------------------------------------------

DEF ACCEPTAT

DEF ESCAPED

REF VMBW,VMBR,VSBW,VSBR

REF KSKAN

FIRSTROW DATA 0

FIRSTCOL DATA 0

R6HACK DATA 0 HACK to allow R6 keypress return (KSKAN)

FIRSTRC DATA 0

CURRC DATA 0

MAXCOL DATA 79

FIELDWIDTH DATA 0

INSERTFLAG DATA 0

CAPSFLAG DATA 0 0=all chars; 1=caps only

NUMFLAG DATA 0 0=all chars; 1=NUMBERs only

BUFCOUNT DATA 0 total characters in the buffer

MYCHAR DATA 0

LASTKEY DATA 0

ESCAPED DATA 0 0=NORMAL; 1=escaped input

BLINKON DATA 1000

BLINKOFF DATA 0500

ONOROFF DATA 0

COUNT1 DATA 0

LENGTH DATA 0

MYBUF BSS 20

TEXTBUF BSS 80

TEXTEND EQU $

EVEN

SAVER4 DATA 0

SAVER5 DATA 0

SAVER6 DATA 0

SAVER8 DATA 0

SAVER9 DATA 0

SAVER10 DATA 0

SAVER10#2 DATA 0

SAVER11 DATA 0

UNDERLINE DATA >1E1E TEXT '__'

ESCAPEKEY BYTE 27

ENTER BYTE 13

LEFTARROW BYTE >88

RIGHTARROW BYTE >89

ERASE BYTE >87

DELETE BYTE >83

INSERT BYTE >84

F9KEY BYTE >8F

HOMEKEY BYTE >A0 for TI, could use FCTN-UP and

ENDKEY BYTE >A1 FCTN-DOWN?

H20 BYTE >20

EVEN

ACCEPTAT

CLR @ESCAPED

MOVB @H20,@MYCHAR

CLR @INSERTFLAG

CLR @LENGTH

MOV R6,@SAVER6

MOV R8,@SAVER8

MOV R9,@SAVER9

MOV R10,@SAVER10

** MOV *R11,@STOPBL row1

** MOV *R11,@STOPBL+4 row2

MOV *R11+,@FIRSTROW

** MOV *R11,@STOPBL+2 col1

** MOV *R11,@STOPBL+6 col2 (add offset later)

MOV *R11+,@FIRSTCOL

MOV *R11+,@FIELDWIDTH

MOV *R11+,@CAPSFLAG

MOV *R11+,@NUMFLAG

MOV *R11+,R9 holds pointer to the accepted data field

MOV *R11+,R6 pointer to output buffer

MOV R11,@SAVER11 save it AFTER changing the address

LI R1,80

MPY @FIRSTROW,R1

A @FIRSTCOL,R2

MOV R2,@FIRSTRC

MOV @FIELDWIDTH,R0 check width

JGT ERASE1 if positive, clear field

JNE USE1 zero?

B @EXIT Yes, can't do it - exit

USE1 BL @USEFIELD no, must be negative. Now, go fix it!

JMP BLINKR GETKEY2

ERASE1 BL @CLEARFIELD sets cursor, clears buffer, clears the field

BLINKR

**BLINKR A @FIELDWIDTH,@STOPBL+6 **WAS (A)dd 6-14-95

** DEC @STOPBL+6

**ERASE9 BL @NOBLNKRC let's 'hilite' the input area!

**STOPBL DATA 0,0,0,0

ERASE9

GETKEY2

MOV @BLINKON,@COUNT1 set ON time

SETO @ONOROFF set to on

BL @PRINTCURSOR

SCAN ABS @ONOROFF CURSOR ON/OFF?

JEQ COFF0 OFF...

DEC @COUNT1 ON, SO DEC COUNTER

JNE GETKEYPRESS CURSOR STILL ON? YES - CONTINUE SCAN

CLR @ONOROFF NO, RESET TO OFF

MOV @BLINKOFF,@COUNT1 PUT DELAY FOR OFF-TIME INTO COUNTER

BL @PRINTCHAR

JMP GETKEYPRESS SCAN SOME MORE..

COFF0 DEC @COUNT1 DEC COUNTER

JNE GETKEYPRESS CURSOR STILL OFF? YES - CONTINUE W/SCAN

SETO @ONOROFF NO..., RESET BLINK ON

MOV @BLINKON,@COUNT1

BL @PRINTCURSOR

GETKEYPRESS

*GETKEY BLWP @KEYXOP

* JNE SCAN

GETKEY MOV R6,@R6HACK

BL @KSKAN

MOV R6,R1

MOV @R6HACK,R6

ANDI R1,>FF00

CI R1,>FF00

JEQ SCAN

CHECKMORE

* ANDI R1,>7F00

CB R1,@RIGHTARROW >DONE<

JEQ MOVERIGHT

CB R1,@ESCAPEKEY

JEQ ABORTESC

CB R1,@F9KEY

JEQ ABORTESC

CB R1,@LEFTARROW >DONE<

JEQ MOVELEFT

CB R1,@ERASE >DONE<

JEQ ERASE8

CB R1,@DELETE

JEQ DELETECHAR

CB R1,@INSERT >DONE<

JEQ INSERTCHAR

CB R1,@HOMEKEY Home...

JEQ HOMECURSOR

CB R1,@ENDKEY End...

JEQ ENDCURSOR

CB R1,@ENTER

JNE NOACC

B @ACCEPTDATA

NOACC ANDI R1,>7F00

CI R1,>2000 some other control character?

***** JL GETKEY2 yes, go get another key

JL SCAN

B @GETDATA

ABORTESC

CLR R0 CLEAR length register

SETO @ESCAPED

B @ACCEPTEND restore char under cursor, then exit properly

ERASE8 BL @CLEARFIELD

JMP ERASE9

MOVELEFT

CLR @INSERTFLAG

C @FIRSTRC,@CURRC

* C @FIRSTCOL,@CURCOL at left column of field?

JEQ LFTEND yes, exit

BL @PRINTCHAR

DEC R10

DEC @CURRC

* DEC @CURCOL no, decrease column number

** BL @SETCURPOS reset cursor

LFTEND B @GETKEY2 return

MOVERIGHT

CLR @INSERTFLAG

MOV R10,R0 get position in buffer

INC R0

C R0,@FIELDWIDTH equal to width?

* C R0,@LENGTH gotta check LENGTH, not width...

JHE RITEND yes, don't go any more

BL @PRINTCHAR

INC R10

* INC @CURCOL NO, move cursor position RIGHT one

INC @CURRC

RITEND B @GETKEY2 exit

ERASEFIELD

MOV @FIRSTRC,@CURRC

CLR @INSERTFLAG

B @ERASE1 jumps out of loop @ top and clears buffer/field

INSERTCHAR

SETO @INSERTFLAG set flag for INSERT <ON>

B @GETKEY2 return for processing

DELETECHAR

CLR @INSERTFLAG

MOV R10,@SAVER10#2

MOV R10,R1 get pointer

INC R1 adjust it

C R1,@LENGTH same as width?

JNE DELET1 no, must be somewhere before the end

MOVB @H20,@TEXTBUF(R10) yes, put a space at this position

JMP DELRET

DELET1 MOVB @TEXTBUF(R1),@TEXTBUF(R10)

INC R10

INC R1

C R1,@LENGTH

JLE DELET1

MOVB @H20,@TEXTBUF(R1)

DEC @LENGTH

DELRET MOV @FIRSTRC,R0

LI R1,TEXTBUF

MOV @FIELDWIDTH,R2

BLWP @VMBW

MOV @SAVER10#2,R10

B @GETKEY2

HOMECURSOR

BL @PRINTCHAR

MOV @FIRSTRC,@CURRC

CLR R10

B @GETKEY2

ENDCURSOR

BL @PRINTCHAR

MOV @FIELDWIDTH,R0 get maximum width

LI R1,TEXTBUF then get the starting

A @FIELDWIDTH,R1 address plus width

DEC R1 adjust for base 0

CLR R2 clear our comparison register

CURE1 MOVB *R1,R2 move the 'last' byte to R2

DEC R1 point to previous byte

CI R2,>2000 was it a control or space?

JH CURE2 no, stop here. Length is OK

DEC R0 yes, shorten the length

JNE CURE1 if length gets to zero, drop out, else try more

CURE2 C R0,@FIELDWIDTH Is the field full / cursor @ end of field?

JL CURE3 no

DEC R0 yes, can't go past the field!!!

CURE3 MOV R0,R10 set text buffer pointer

A @FIRSTRC,R0 get first RC

* A R1,R0 add,

* DEC R0 then adjust

MOV R0,@CURRC and make it so

B @GETKEY2

******************************

ACCEPTDATA

MOV @FIELDWIDTH,R0 get maximum width

LI R1,TEXTBUF then get the starting

A @FIELDWIDTH,R1 address plus width

DEC R1 adjust for base 0

CLR R2 clear our comparison register

ACCPT1 MOVB *R1,R2 move the 'last' byte to R2

DEC R1 point to previous byte

CI R2,>2000 was it a control or space?

JH MOVEFF no, stop here. Length is OK

DEC R0 yes, shorten the length

JNE ACCPT1 if length gets to zero, drop out, else try more

MOVEFF MOV @FIELDWIDTH,R1 length zero?

LI R2,TEXTBUF no, get beginning of text buffer

MOVEMR MOVB *R2+,*R6+ move a byte

DEC R1 done with entire string?

JNE MOVEMR no, keep moving

ACCEPTEND

MOV R0,@SAVELASTR0 9.5.94... AFTER MANY HOURS.. PRINTCHAR DESTROYS!

BL @PRINTCHAR 8.17.94 - get rid of cursor box!

MOV @SAVELASTR0,R0

B @EXIT

SAVELASTR0 DATA 0

*********************************************

* CHARACTER RETRIEVAL

*

* - handles all characters.

* - checks for INSERT

* - checks character acceptance (if 0, other flags used)

* - checks NUMFLAG

* - checks CAPSFLAG USED IN CHARACTER ACCEPTANCE

*

GETDATA

ABS @NUMFLAG number?

JEQ CHECKCAPS was zero, so we don't care

CI R1,'0'*256 yes, below 0?

JL BADNUM yes, don't allow this character

CI R1,'9'*256 no, above 9?

JLE CHECKCAPS no, allow it to pass

BADNUM B @INVALID BAD, exit this routine

CHECKCAPS

ABS @CAPSFLAG convert to uppercase

JEQ CHECKCHARACC no...

CI R1,'a'*256 Yes, check range

JL CHECKCHARACC lower, exit

CI R1,'z'*256

JH CHECKCHARACC higher, exit

ANDI R1,>5F00 Ah hah! got a small letter; convert to upper

CHECKCHARACC

MOV R9,R0 if zero, no address given. No acceptance field

JEQ VALIDCHAR

CHK2 MOVB *R0+,R2 is this character a NULL (end of field)

JEQ INVALID yes, this char does not match. Go get another key

CB R1,R2 no, does this character match the keypress?

JNE CHK2 no, try another

VALIDCHAR

MOV R1,@MYCHAR

ABS @INSERTFLAG insert ON?

JEQ NOINSERT No (whew, easy to do)

MOV R10,R1 get pointer

INC R1 adjust for base 1

C R1,@FIELDWIDTH are we at the last character of the field?

JEQ NOINSERT yes, so just put it in normally

MOV @FIELDWIDTH,R2 get width

MOV R2,R3 place to move it to

DECT R2 WHY 2???? get rid of one for move

JEQ NOINSERT if width 1, then don't perform this move

DEC R3

INS1 MOVB @TEXTBUF(R2),@TEXTBUF(R3) mov the characters RIGHT

DEC R2 back each out

DEC R3

C R2,R10

JGT INS1

MOVB @TEXTBUF(R2),@TEXTBUF(R3)

MOV @FIRSTRC,R0

LI R1,TEXTBUF

MOV @FIELDWIDTH,R2

BLWP @VMBW

NOINSERT

MOV @CURRC,R0

MOVB @MYCHAR,R1

BLWP @VSBW

INC @CURRC

MOV R10,R0 now to check the position against field width

INC R0 adjust for base 1

C R0,@FIELDWIDTH is it equal to the fieldwidth?

JNE NORM1 no

DEC @CURRC yes, move cursor BACK one

MOVB @MYCHAR,@TEXTBUF(R10) save character, exit WITHOUT updating pointr

MOV @FIELDWIDTH,@LENGTH

JMP INEXIT

NORM1 MOVB @MYCHAR,@TEXTBUF(R10) put it in the buffer

INC R10 update pointer into the buffer

C @LENGTH,@FIELDWIDTH length at max?

JEQ INEXIT yes (possible negative width)

INC @LENGTH no, addd another

INVALID

INEXIT B @GETKEY2

****************************************************

* Time to exit - restore previously saved registers

*

EXIT

MOV @SAVER6,R6

MOV @SAVER8,R8

MOV @SAVER9,R9

MOV @SAVER10,R10

MOV @SAVER11,R11

RT

PRINTCHAR

MOV @CURRC,R0

MOVB @TEXTBUF(R10),R1

BLWP @VSBW

RT

PRINTCURSOR

MOV @CURRC,R0

MOVB @UNDERLINE,R1

BLWP @VSBW

RT

SETFIRST

MOV @FIRSTRC,@CURRC

RT

**************************

* Clear input buffer

*

CLEARBUFFER

CLR R10 pointer into the buffer

LI R0,TEXTBUF

CLEAR2 MOVB @H20,*R0+

CI R0,TEXTEND

JNE CLEAR2

RT

*********************************************

* Clear entire field

*

CLEART DATA 0 return value for r11

CLEARFIELD

MOV R11,@CLEART save R11

BL @CLEARBUFFER clear the buffer w/spaces

BL @SETFIRST set cursor to first position

MOV @CURRC,R0

LI R1,TEXTBUF

MOV @FIELDWIDTH,R2

BLWP @VMBW

MOV @CLEART,R11 restore r11

RT return

USEFIELD

MOV R11,@CLEART

NEG @FIELDWIDTH field was negative, make is positive again

MOV @FIELDWIDTH,@LENGTH set length to maximum

CLR R10 Clear pointer into text

BL @CLEARBUFFER clear buffer (use spaces)

BL @SETFIRST Set cursor positions

MOV @CURRC,R0 read into the text buffer!

LI R1,TEXTBUF

MOV @LENGTH,R2

BLWP @VMBR

MOV @CLEART,R11 and return

RT

END

 

 

  • Like 2
Link to comment
Share on other sites

Open-Mouth-Insert-Foot-Funny-Mouth-Meme-

 

Not really, I've been concentrating and playing on my 'small footprint' system lately. I've not used the P-Box in a while. I'll need disk drive access to use it, so it'll be necessary then. A lot of the stuff I've used lately comes in FR99 format, and is used with Matts 32K. For the recent Mega Demo I used an UberGROM cartridge.

Link to comment
Share on other sites

 

What is KSKAN? Is that a Geneve MDOS routine essentially equivalent to the TI-99/4A console’s SCNKEY (at >000E)?

 

...lee

Not quite. I named the routine "KSKAN" so that I can load either a TI- or Geneve-specific direct keyscan object code during program linkage. Why? I like to split routines and utilities into separate source files, assemble them, and then use REF/DEF to call them. This lets me recycle subroutines across multiple programs. It also keeps main program assembly time to a minimum for larger projects.

 

If I recall correctly, KSKAN returns the key in R6 and returns >FF if no key was pressed. I'd have to look at the source to determine any other particulars such as debounce characteristics.

  • Like 1
Link to comment
Share on other sites

  • 8 months later...

gallery_34177_1071_227819.gif

I've been doing some work with the 80 column mode. The results are in the video above and in the attached zipped folder. RUN "DSK1T80XB" will start it up. The docs are in a PDF. This has only been tested with Classic99. You need to enable the 80 column hack. If this does not work with the F18A then I will need to know a little more in order to modify it so it does.

 

Omega, here is what you have been wishing for! (See your post #10)

 

Forgot to mention that occasionally the XB program starts with a bogus error message. Just RUN it again and it should go the second time.

T80XB.zip

Edited by senior_falcon
  • Like 11
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...