[TI ASM] Typing Strings
Moderator: MaxCoderz Staff
- Shadow Phoenix
- Calc Guru
- Posts: 835
- Joined: Mon 03 Jan, 2005 7:54 pm
- Location: out there. seriosly.
[TI ASM] Typing Strings
After some thought I have decided to use a displaying story parts likeit was done in FF. So do I just use _putS and halt is between to achieve typing effect?
Life is getting better.
- Shadow Phoenix
- Calc Guru
- Posts: 835
- Joined: Mon 03 Jan, 2005 7:54 pm
- Location: out there. seriosly.
Basically, you print out the string one character at a time, but it doesn't need to make your code much longer. You would have the text in a string somewhere, and you would make a loop to print out a character and advance the string pointer, delaying after each, until you got to a null character. You will also need to manually update the horizontal (and vertical, possibly) cursor positions, of course.so you mean I would have to provide each separate letter for the typing effect?
IIRC, _vputc does not update pencol, which is a problem since small letters have variable widths (i.e. "w" is much wider than "i"). It may be easier to 'walk' the string you want to display, and copy each letter to a new 1-character zero-terminated string, and display that (since _vputs does update pencol). You can HALT between characters.
No, a null-terminated string would suffice. Something like the following would work:
My mistake: there is no _VPutC defined in "ti83plus.inc." Hey, it seemed logical You are going to have to resort to _VPutMap if you want small characters. And add the stuff that sic and jbshaler mentioned.
Code: Select all
;Display a NTS @ (curRow,curCol)
;Inputs:
; hl - pointer to NTS
; (curRow) - cursor row
; (curCol) - cursor column
; Any other _PutC flags
;Outputs:
; LCD - text drawn
;Destroys:
; af b hl
typeText:
ei ;make sure interrupts are enabled
ld a,(hl)
typeTextLoop:
push hl
B_CALL(_PutC)
pop hl
call typeTextDelay
inc hl
ld a,(hl)
or a
jr nz,typeTextLoop
ret
typeTextDelay:
push bc ;Save bc from destruction
ld b,?? ;Enter desired delay
typeTextDelayLoop:
halt
djnz typeTextDelayLoop
pop bc
ret
"If SOURCE is outlawed, only outlaws will have SOURCE."
-
- Extreme Poster
- Posts: 479
- Joined: Fri 17 Dec, 2004 11:09 pm
- Contact:
_PutC updates curRow/curCol:
Interesting... I never knew that. However, PutMap does not affect the coordinates:
And this code has no other explanation other than that VPutMap does update penCol/penRow (taken directly off the SDK):sdk83pguide wrote:PutC
Description: Displays a character and advance the cursor
Outputs:
Others: curRow, curCol Updated
Code: Select all
VPutSN:
push af
push de
push ix
..10:
ld a,(hl)
inc hl
B_CALL VPutMap
jr c,PP11
djnz ..10
PP11:
pop ix
pop de
pop af
ret
sdk83pguide wrote:PutMap
Description: Displays a character in the large font without affecting the cursor position
"If SOURCE is outlawed, only outlaws will have SOURCE."