[TI ASM-LIB] Possible xLib problems

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
Merthsoft -

[TI ASM-LIB] Possible xLib problems

Post by Merthsoft - »

I encountered a problem with xLib while using my 84+SE, and I will try to explain it the best I can:
I was working on an RPG, and I decided that instead of the picture position for the blank tile being 4 (First row, fourth column) that it should be zero, the previous character position, so I just change the pic file a bit, then when running my game (after changing the matrix) it would start out looking right, but whenever I pushed a button, so the loop too it back to drawing thew tile map, instead of blank tiles, it was garbage. So I then tried to make it a grass tile instead of blank, and it still happened.
I then rewrote the whole enginge, using a new map, and the pic file in the position it was first (with the blank tile being 4), then with the blank tile 0, and the blank tile grass, it worked... almost. At the point where the screen would scroll, if you went to the bottom, the calculator would shut off, but not crash, or anyhting like that. But if you went too far up the lcd buffer would flood blue, and I had to remove the battereys in order to make it go away.
I then dleted all of that, and put everything back on my calc (just not the RPG), but havn't tried to do anyhitng... Has anyone else encountered this problem (it only did this in maps bigger then 8x12, and only after changing around my pic file...)
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Hhhmmm... its been a while since i looked at xLIB. This was in pure basic (you werent making MOS compatible?) right?

You have to be careful when you access matrix elements, if you try to go out of bounds strange things can happen ... i cant remember if i added any error checking or not.

As for sprite pics, you have to change the pic then call the 'setupsprites' function.

Sorry i can be more helpful, perhaps if you posted some code?

*Note i will move this to Programming Help.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
merthsoft
Extreme Poster
Posts: 496
Joined: Tue 21 Dec, 2004 6:49 am
Location: WI

Post by merthsoft »

I wasn't doing anything with Mirage, and I changed the pic, then ran the program whose seconf line was:
{1:Asm(prgmXLIB
So the sprites were setup, and sometimes I wouldn't be going out of the bounds of the matrix.
The code could ce something as simple as this:

Code: Select all

{1:Asm(prgmXLIB
{2:Asm(prgmXLIB
DelVar ADelVar BDelVar D Delvar E
While 1
{4,D,E,16,16:Asm(prgmXLIB
(1,B,A,B+7,A+7:Asm(prgmCODEX      //clears a box where the char will be
Real(20,0,24,48,8,8,A,B    //Omnicalc's sprite routine
Repeat K
Getkey -> K
End
A+8(K=26)-8(K=24 -> A   // Horiz movement
B+8(K=32)-8(K=25 -> B   // Vert moverment
End
At this point, if you have a blank tile as zero, and your matrix has zeros in it, it would cause a weird looking tile map. If you then add some stuff to scroll the screen, it would work until you get too far to the edge, in which case the lcd would die or flood, one of the two. This would easily be solved if I added some collision detection routines, but before, instead of messing up, I would just get a domain error, or something.
I erased xLib, and the other program, and will put it back on in a couple weeks (when I'm back home).
Shaun
Post Reply