[TI ASM] Typing Strings

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

[TI ASM] Typing Strings

Post by Shadow Phoenix »

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.
Gambit
Sir Posts-A-Lot
Posts: 252
Joined: Mon 21 Feb, 2005 5:34 am
Location: Laveen, Arizona

Post by Gambit »

Did you accidentally press "Post" instead of "Reply"? :)

You would use _PutC/_VPutC instead of _PutS/_VPutS for that typing effect.
"If SOURCE is outlawed, only outlaws will have SOURCE."
User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

Post by Shadow Phoenix »

so you mean I would have to provide each separate letter for the typing effect?
Life is getting better.
jbshaler
Maxcoderz Staff
Posts: 22
Joined: Fri 17 Dec, 2004 8:35 pm
Location: Michigan

Post by jbshaler »

so you mean I would have to provide each separate letter for the typing effect?
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.
sic
Site Admin
Posts: 101
Joined: Wed 15 Dec, 2004 5:58 am
Contact:

Post by sic »

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.
Gambit
Sir Posts-A-Lot
Posts: 252
Joined: Mon 21 Feb, 2005 5:34 am
Location: Laveen, Arizona

Post by Gambit »

No, a null-terminated string would suffice. Something like the following would work:

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
My mistake: there is no _VPutC defined in "ti83plus.inc." :oops: 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.
"If SOURCE is outlawed, only outlaws will have SOURCE."
koolmansam375
Extreme Poster
Posts: 479
Joined: Fri 17 Dec, 2004 11:09 pm
Contact:

Post by koolmansam375 »

sic wrote:IIRC, _vputc does not update pencol, which is a problem since small letters have variable widths (i.e. "w" is much wider than "i").
i think it does update pencol. _vputmap is the one that doesnt
Image

Pongwars shall live!

blog is down atm. :-(
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

_vputmap does update the pencol. it's useful for strings in apps.
Image
sic
Site Admin
Posts: 101
Joined: Wed 15 Dec, 2004 5:58 am
Contact:

Post by sic »

Are you sure? I am almost positive that while _putc does update the coordinates (currow and curcol), _vputmap does not update penrow/pencol.
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Vputmap I know updates pencol i use it a lot, putc notsure.
Image
Gambit
Sir Posts-A-Lot
Posts: 252
Joined: Mon 21 Feb, 2005 5:34 am
Location: Laveen, Arizona

Post by Gambit »

_PutC updates curRow/curCol:
sdk83pguide wrote:PutC
Description: Displays a character and advance the cursor
Outputs:
Others: curRow, curCol Updated
And this code has no other explanation other than that VPutMap does update penCol/penRow (taken directly off the SDK):

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
Interesting... I never knew that. :? However, PutMap does not affect the coordinates:
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."
Spencer
Extreme Poster
Posts: 346
Joined: Mon 17 Jan, 2005 8:56 am
Location: Indiana

Post by Spencer »

True, but given it has to support smaller characters of variable width, it has to autoupdate. VPutMap can write both sizes of character, depending on your flag status.
sic
Site Admin
Posts: 101
Joined: Wed 15 Dec, 2004 5:58 am
Contact:

Post by sic »

Ah. I must have been remembering _putmap. You must understand, it's been a long time since I've used any ROM calls in any of my programs :)
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Why would you ever want to use a romcall, aside from slowing down your calc. :wink:
Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

Why, even I used them before I knew about alternatives (I only had docs from ti.com back then).
Post Reply