[TI ASM] Displaying random text

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

koolmansam375
Extreme Poster
Posts: 479
Joined: Fri 17 Dec, 2004 11:09 pm
Contact:

Post by koolmansam375 »

That_One_Guy wrote:Okay, maybe not. here's the source, maybe one of you folk can fix it?

Code: Select all

...
atk3:
        .db "(throws user",0
        .db "into wall)",0
        jp rnd
;more stuff like this
...
Heres 1 problem (also the 'jp rnd's are just wasting space)
Image

Pongwars shall live!

blog is down atm. :-(
That_One_Guy
New Member
Posts: 65
Joined: Sun 03 Apr, 2005 7:55 pm
Location: The seventh circle of Hell.
Contact:

Post by That_One_Guy »

Ahh, so its just unneccesary? Even without, the program still crashes :puzzled:
Truly great madness cannot be achieved without significant intelligence.

http://www.xanga.com/jakku_kun, rants by me.
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

First of all, there should be no executable code among the strings. It's all a bunch of binary data. It's never going to see or even know of the existance of those jumps. It's not like TI Basic where you put the data in line with the code, like Disp "HELLO". No. In assembly, you give it the address of a text string.

Your code is never moving the text cursor, maybe you should do that.

0 is not a newline character, it is a null terminator that marks the end of a string. If you want to display multi line strings, you will need to write a special routine to handle those.

If you're getting crashes, then what .bat file are you using to compile?
Last edited by Dwedit on Tue 12 Apr, 2005 2:34 am, edited 1 time in total.
You know your hexadecimal output routine is broken when it displays the character 'G'.
That_One_Guy
New Member
Posts: 65
Joined: Sun 03 Apr, 2005 7:55 pm
Location: The seventh circle of Hell.
Contact:

Post by That_One_Guy »

Oh...emm...then if I make them only one-line strings, it'll work? Or how do I put it on the graph screen? Y'know, so i can have more characters per line than the homescreen.
Truly great madness cannot be achieved without significant intelligence.

http://www.xanga.com/jakku_kun, rants by me.
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

bcall(_vputs) is for displaying text in the small font. Use (penrow) for the Y coordinate, and (pencol) for the X coordinate. Since they are in memory next to each other, and pencol is the least significant byte, you can stick a 16 bit number into (pencol), such as $1008 to display at (8,16).

If you want it to display directly to the screen, you don't do anything special.
If you want it to draw the text onto the graph buffer, use set textwrite,(iy+sgrflags).

(edited 1 time in total...)
You know your hexadecimal output routine is broken when it displays the character 'G'.
That_One_Guy
New Member
Posts: 65
Joined: Sun 03 Apr, 2005 7:55 pm
Location: The seventh circle of Hell.
Contact:

Post by That_One_Guy »

So then, to use the small font, use vputs? then could you do: ld (pencol),0 ld (penrow),0 to display it at the top of the screen?
Truly great madness cannot be achieved without significant intelligence.

http://www.xanga.com/jakku_kun, rants by me.
Gambit
Sir Posts-A-Lot
Posts: 252
Joined: Mon 21 Feb, 2005 5:34 am
Location: Laveen, Arizona

Post by Gambit »

Yes, _VPutS is small font, except that you need to use the accumulator to store into an address:

Code: Select all

ld a,0          ;Note: Unoptimized code
ld (penCol),a
ld a,0
ld (penRow),a
"If SOURCE is outlawed, only outlaws will have SOURCE."
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

For 16 bit values, you can use a 16 bit load to store the two values penrow and pencol simultaneously...
ld hl,$0000
ld (pencol),hl
You know your hexadecimal output routine is broken when it displays the character 'G'.
That_One_Guy
New Member
Posts: 65
Joined: Sun 03 Apr, 2005 7:55 pm
Location: The seventh circle of Hell.
Contact:

Post by That_One_Guy »

Aha, thanks for the help. I'm gonna try it out once i get all my stuff back (i recently reformatted me comp). I'll let you know if it doesnt work, or if i have any more questions. Thanks again
Truly great madness cannot be achieved without significant intelligence.

http://www.xanga.com/jakku_kun, rants by me.
Post Reply