Jump to content
IGNORED

Character 31 redefinition under XB256


Recommended Posts

Sure, yeah, you can be a very naughty boy and redefine stuff like XB's cursor character (that's 30, though) if you like, by writing data straight to VDP. 

 

That being said, you of course can't VWRITE the hex string you'd feed to CALL CHAR.  You have to VWRITE the appropriate binary data.  Which will likely itself contain unprintable characters, which you cannot type in BASIC (but could read from a file, or insert into a BASIC program with a hex editor, or just obtain from a series of CHR$ calls). 

 

So for example, this will make your cursor a hash sign:

 

CALL LINK("VWRITE",1009,"((|(|((")

 

Pointless!  But...uh...neat, I guess? 

 

As I say though, that was 30, and 31 is thus

 

CALL LINK("VWRITE",1017,"((|(|((")

 

Or whatever other data you want to use.  "((|(|((" is just a 7/8ths of a character pattern which is all printable characters, treated as ASCII.  Hence my using that. 

 

  • Like 1
Link to comment
Share on other sites

Following up on what pixelpedant wrote, the following program defines char 32 as a box, reads the data you just wrote (the character pattern for 32 is at 1024), writes it to the pattern for char 31 to 1016, then clears the pattern for space:


10 CALL CHAR(32,"FF818181818181FF"):: CALL LINK("VREAD",1024,8,A$):: CALL LINK("VWRITE",1016,A$):: CALL CHAR(32,"0")
20 GOTO 20

If you used a different character such as 129 then you wouldn't necessarily have to redefine it.

Another way would be like this:


10 FOR I=1 TO 8 :: READ N :: A$=A$&CHR$(N):: NEXT I :: CALL LINK("VWRITE",1016,A$)
20 GOTO 20
30 DATA 255,129,129,129,129,129,129,255

Both these methods are cumbersome for redefining characters. RXB and XB 2.9 G.E.M. are able to use CALL CHAR to define characters from 30 to 159, so either of these might be an option.

If you intend to compile your program, you can use XB 2.9 G.E.M. or RXB for testing. When you compile there is no error checking so the problem goes away.

  • Like 2
  • Thanks 2
Link to comment
Share on other sites

18 hours ago, pixelpedant said:

That being said, you of course can't VWRITE the hex string you'd feed to CALL CHAR.  You have to VWRITE the appropriate binary data.  Which will likely itself contain unprintable characters, which you cannot type in BASIC (but could read from a file, or insert into a BASIC program with a hex editor, or just obtain from a series of CHR$ calls). 

Currently in testing for the next TiCodEd release is a "function" BIN$("hex") which will substitute the hex-string with the binary "octect-string" when tokenizing, so only for static hex-strings:

A$=BIN$("A0002AB5")
for i=1 to 4
  print val(seg$(a$,i,1)
next i

Very much designed for the use of CALL VWRITE. We had this discussion recently on a Saturday-Call and it seems to work... But be careful when editing on the TI.

 

  • Like 1
Link to comment
Share on other sites

Just for the fun of it did this in RXB:

10 CALL CHAR(32,"FF818181818181FF") :: CALL MOVES("V$",8,1024,A$,"$V",8,A$,1016) :: CALL CHAR(32,"0")
20 GOTO 20

And:

10 FOR I=1 TO 8 :: READ N :: A$=A$&CHR$(N) :: NEXT I :: CALL MOVES("$V",8,A$,1016)
20 GOTO 20
30 DATA 255,129,129,129,129,129,129,255

And I thought of another way to accomplish same thing:

10 CALL CHAR(32,"FF818181818181FF") :: CALL SWAPCHAR(32,31)
20 GOTO 20

Sorry just so many ways to attack same problem.

  • Like 1
  • Confused 1
Link to comment
Share on other sites

14 hours ago, apersson850 said:

By using the user interrupt, it's possible to make a cursor that inverts the character it's on top of.

Can't think of why you would need the interrupt to do that.

Couldn't the code that waits for a key and flashes the cursor do that inside its own loop?

(Of course now I have to make one :) ) 

Link to comment
Share on other sites

I'm pretty sure apersson was talking about the cursor used in XB. To change that you'd either have to modify the cartridge, or use an interrupt routine to do the job. I thought about doing this for XB 2.9 G.E.M., but it seemed like more trouble than it was worth.

If you are writing your own editor, then of course no interrupt routine would be required.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

3 hours ago, senior_falcon said:

I'm pretty sure apersson was talking about the cursor used in XB. To change that you'd either have to modify the cartridge, or use an interrupt routine to do the job. I thought about doing this for XB 2.9 G.E.M., but it seemed like more trouble than it was worth.

If you are writing your own editor, then of course no interrupt routine would be required.

You can change the Cursor in XB in 2.9 and RXB.

In case you want to see the GPL routine that switches CURSOR with what ever character it is over:

*----------------------------------------------------------
* Auto-repeat function is added for 99/4A, in PSCANS line
* READ00 to READZ2+1 are changed to following code
*----------------------------------------------------------
READ00 CLR  @PAD             Counter for auto-repeat fucti
*
* To get out of insert mode, we usually return here.
*
READ01 CLR  @ARG8             Indicate normal operation mod
       ST   CURSOR,@PAD1      Use PAD1 for CURSOR/CHARACTER
* Idicate one character and alternate current character
* position between normal and cursor.
READZ1 EX   @PAD1,V*ARG5      By alternating between the
*                              normal character and the
*                              cursor, we make the cursor
       CLR  @TIMER             blink
G6AAE  CALL DUSER             USER from EDIT mode
       BS   READZ2            Found one!!!!
G6AB3  INC  @PAD             Increment the auto-repeat cou
       CEQ  >FF,@RKEY         It is an old key
       BS   G6AC5
       CHE  >FE,@PAD         Hold old key for a while
       BR   G6AC5
       SUB  30,@PAD          Control repeat rate
       B    READZ5
G6AC5  CH   >10,@TIMER        Time next character switch
       BR   G6AAE
       BR   READZ1            Restart character blink cycle

 

  • Like 1
Link to comment
Share on other sites

Yes, I was talking about the cursor in TI Extended BASIC. And I was not talking about changing the shape of the cursor from what it is (a block) to something else (an underline), but to change it to the inverse video of the character it's covering.

I've done that once. The purpose was to show if you were in insert of overwrite mode when editing a text, by having a different cursor behavior.

  • Like 2
  • Thanks 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...