ACagliano wrote:
Does the bcall PutS wrap text? Do any of them?
I don't believe so, but you're better off just checking the Systems Routines reference PDF.
Ok. Cool. I've hit one snag...I need a chemical formula input routine. I tried to write one myself, but started confusing myself. Any help or advice I could get would be great. What I wrote so far is below


Code:
ReceiveEquation:
    bcall(_ClrLCDFull)
    ld  a,0
    ld  (penCol),a
    ld  (penRow),a
    ld  de,saferam1+1
    ld  a,0
    ld  (saferam1),a
    ld  a,0
getKloop:
    bcall(_getCSC)
    jr  z,getKloop
    cp  $01
    jr  z,switchnumeric
    cp  $04
    jr  z,switchalpha
    cp  $02
    jr  z,backspace
    cp  $09
    jr  z,done


switchnumeric:
    bit 0,(TextInputFlag)
    jr  z,getKloop
    ld  hl,NumericCharMap
    ld  a,(penRow)
    add a,3
    ld  (penRow),a
    res 0,(TextInputFlag)
    jr  getKloop

switchalphaup:
    bit 0,(TextInputFlag)
    jr  nz,getKloop
    ld  hl,AlphaCharMap
    ld  a,(penRow)
    sub 3
    ld  (penRow),a
    set 0,(TextInputFlag)
    jr  getKloop

backspace:
    ld  a,(saferam1)
    cp  0
    jr  z,getKloop
    dec a
    ld  (saferam1),a
    dec de
    ld  a,(penCol)
    sub 5
    ld  (penCol),a
    jr  getKloop

done:
       
AlphaUpCharMap:
    .db 0,0,0,0,0,0,0,0,0,0
    .db "WRMH"
AlphaLowCharMap:

NumericCharMap:


Edit: Oh, and another snag...I realized that with rref, you can't do an rref unless your matrix has one more column than row, correct? So, before actually doing the rref, I can compare the number of columns to the number of rows, and if the matrix is not eligible for rref, then we go to guess and test, where the user has to begin trying coefficients and the calc tells you when you have it right.
Definitely agreed on the Edit part of that port. Can you be more specific about what sort of advice I can offer on the first part? Is it just incomplete, or also broken in some way? Always always use xor a instead ld a,0 when possible, and there's no point continually clearing a when it is already zero. Also, always use or a instead of cp 0 when possible.
Well, for one, as you pointed out, it is epically unoptimized. Other than that, it is just incomplete...as in I got a start, then realized I have no a clue what to do in order for the input routine to act as I want (I would like it to act similar to the input routine used in the Balancer Flash App). I actually messaged the author of said app and obtained permission to use the routine. He sent me the relevant source code files, but the comments are in another language and I am having difficulty deciphering them, as well as the code itself.

Edit: Also, I'm curious...when you push a GUIR Window element, then a GUIR Wrapped Text element, if the text string exceeds the capacity of the window, will the GUI system automatically put up the vertical scroll bar and allow you to scroll up and down, or must I do that myself?

Edit2: When you create a TI-Basic Program and run it with bcall(_ParseInput), must you put a Return in the program where you want it to go back to the parent program?

PS: Sorry about 20 thousand edits. I just would rather not double post Wink
Quote:
Edit: Also, I'm curious...when you push a GUIR Window element, then a GUIR Wrapped Text element, if the text string exceeds the capacity of the window, will the GUI system automatically put up the vertical scroll bar and allow you to scroll up and down, or must I do that myself?
It will make it scroll up and down. It will not add a scrollbar. That's my own omission, but it would be a pain to add.

Quote:
When you create a TI-Basic Program and run it with bcall(_ParseInput), must you put a Return in the program where you want it to go back to the parent program?
No, as long as the program just ends. Same as a regular TI-BASIC program.
To question 1, but how would you then scroll up and down, without a scrollbar?

To question 2, what if you have several exit points, where you need to return from. You'd need the "Return" in there, but will it be handled as you intend?
Bump^^ and, here's some TI-Basic code for the rref. Is there a better way to get all integers, rather than the loop?


Code:

dim( [A] )
If Ans( 2 ) =/ Ans( 1 ) + 1:Goto 0
rref( [A] )
dim( [A] )
Ans( 2 )->A
Matr>list( [A] , A , L1 )
For( B , 1 , 5000)     "Is there another way to do this little part?"
B (L1) -> L2
If int( sum (L2)) = sum (L2):Goto 1
End
Lbl 0
0->A
Return
Lbl 1
L2 -> L1
1->A
Return


When returning to the z80 program, I first look at the value in the RealObj A. If it is 0, I move to guess and test. If it is 1, I output L1 as the coefficients.

Please recommend any optimizations you feel are necessary.

According to CalcSys, the following is true about this program:


Code:

VAT data:
Type: Program
Name: RREF
VAT Loc: $F922
Data Loc: $9ED5
Size: 0074

.db $74 , $00 , $B5 , $5C
.db $00 , $11 , $04 , $41
.db $3F , $CE , $72 , $10
.db $32 , $11 , $6F , $72    ;16
.db $10 , $31 , $11 , $70
.db $31 , $3E , $D7 , $30
.db $3F , $BB , $2E , $5C
.db $00 , $11 , $04 , $5C   ;32
.db $00 , $3F , $B5 , $5C
.db $00 , $11 , $3F , $72
.db $10 , $32 , $11 , $04
.db $41 , $3F , $BB , $39   ;48
.db $5C , $00 , $2B , $41
.db $2B , $5D , $00 , $11
.db $3F , $D3 , $42 , $2B
.db $31 , $2B , $35 , $30  ;64
.db $30 , $30 , $11 , $3F
.db $42 , $10 , $5D , $00
.db $11 , $04
ACagliano wrote:
To question 1, but how would you then scroll up and down, without a scrollbar?
You put the text-editing cursor inside the box and move up and down. Smile It scroll with the cursor.

Quote:
To question 2, what if you have several exit points, where you need to return from. You'd need the "Return" in there, but will it be handled as you intend?
It still works just like a normal TI-BASIC program. Razz
KermMartian wrote:
ACagliano wrote:
To question 1, but how would you then scroll up and down, without a scrollbar?
You put the text-editing cursor inside the box and move up and down. Smile It scroll with the cursor.
I'm referring to GUIRWrappedText, not GUIRTextMultiline.
Ahhh. No, that does not scroll. If it overflows, it just gets cropped.
Ok, fair enough.

Bump on the topic of the input routine...
Quote:

Well, for one, as you pointed out, it is epically unoptimized. Other than that, it is just incomplete...as in I got a start, then realized I have no a clue what to do in order for the input routine to act as I want (I would like it to act similar to the input routine used in the Balancer Flash App). I actually messaged the author of said app and obtained permission to use the routine. He sent me the relevant source code files, but the comments are in another language and I am having difficulty deciphering them, as well as the code itself.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement