Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: AngelFish on September 26, 2010, 04:47:43 pm

Title: Tilemapping
Post by: AngelFish on September 26, 2010, 04:47:43 pm
I'm trying to start a new project and I was looking through Eeems' tutorial on program flow*. I understand the RLE part, but running the code verbatim in my calc doesn't appear to work. Here's the code I have programmed:

Quote
ClrDraw
DiagnosticsOff
[0515]->GDB1
[FFFFFFFFFFFFFFFF0000000000000000]->Pic1

0->N
0->I

While I>=96
{GBD+N}->A
N+1->N
A^16->B
A/16->A

For(F,0,B)
A->{L1+I}
I+1->I
End

End

For(X,0,11)
For(Y,0,7)
{Y*12+X+L1}->A
Pt-On(X*8,Y*8,A*8+Pic1)
End
End
Dispgraph
While getkey?9
End

If I understand the routine correctly, it should display a series of sprite columns. As it is, the whole screen is covered in the black sprites without any gaps for the blank sprites. Does anyone have an idea of what might be wrong with it?


*http://ourl.ca/4317 (http://ourl.ca/4317)
Title: Re: Tilemapping
Post by: calc84maniac on September 26, 2010, 04:49:42 pm
I'm trying to start a new project and I was looking through Eeems' tutorial on program flow*. I understand the RLE part, but running the code verbatim in my calc doesn't appear to work. Here's the code I have programmed:

Quote
0->I

While I>=96
This looks problematic ^^
Title: Re: Tilemapping
Post by: Deep Toaster on September 26, 2010, 04:52:43 pm
Yeah, I assume you meant I<=96. Also, you never reset N to 0 :P But what calc84maniac said was probably why it doesn't work. Basically, the first 96 bytes of L1 are still 0, so they all display the first sprite, which is black.
Title: Re: Tilemapping
Post by: AngelFish on September 26, 2010, 04:58:45 pm
Oops ;D

Flipping that around changes the output, but now the screen has a bunch of random sprites on it.

Apparently after the compressed data stops, it reads the next byte in the ram. Hm, I always wondered what the data looked like in the memory.
Title: Re: Tilemapping
Post by: DJ Omnimaga on September 26, 2010, 05:06:06 pm
Yeah that's the cool thing with Axe (that z80 assembly has, too): you can read and write stuff to RAM however you want. Just be very careful where you store stuff, to not overwrite parts of the RAM used to store the contrast or other system settings and even overwrite the content of your RAM programs. Also backup often!
Title: Re: Tilemapping
Post by: AngelFish on September 26, 2010, 05:14:14 pm
I've been archiving a lot lately rather than backing up, ever since I noticed that erasing the OS doesn't clear the archives. Backing up to a computer is too difficult for me to do regularly.
Title: Re: Tilemapping
Post by: Deep Toaster on September 26, 2010, 05:15:53 pm
I've been archiving a lot lately rather than backing up, ever since I noticed that erasing the OS doesn't clear the archives. Backing up to a computer is too difficult for me to do regularly.

Erasing the OS? O.o Why would you do that?

EDIT: Also, well, archive space isn't 100% secure either. It's just as safe as the operating system. Meaning if you somehow corrupt your OS, there's a fair chance you corrupted your archived vars too.
Title: Re: Tilemapping
Post by: AngelFish on September 26, 2010, 05:19:32 pm
I blame TI-Connect :P
It erased my OS every time I transferred files between my calc and my computer. I fixed the problem only a little while ago.
Title: Re: Tilemapping
Post by: Deep Toaster on September 26, 2010, 05:21:04 pm
O.o That's a weird bug. How'd it happen? Despite TI-Connect being buggy, it should at least leave your OS in place.
Title: Re: Tilemapping
Post by: DJ Omnimaga on September 26, 2010, 05:29:28 pm
Wow, this is the first time I ever see that happen. That's rather extreme. What did you do to fix it?
Title: Re: Tilemapping
Post by: AngelFish on September 26, 2010, 05:30:00 pm
It had something to do with my firewall blocking the connection between TI-connect and the calculator. Whenever I would transfer files, it would interrupt the communication and when I disconnected the calculator out of frustration, I wouldn't have an OS the next time I booted. Since the computer doesn't deal with data on peripherals unless I tell it to, I'm fairly sure it wasn't the one to erase my OS. It was kind of annoying the first time it happened because I was trying to transfer a very large and useful BASIC math program that I had spent three months writing. Needless to say, I never tried to rebuild it.

I fixed the problem by playing around in the system settings for a few hours days and learning to keep a backup OS on hand.

EDIT: Looking back, it does sound a lot more like my firewall than TI-Connect.
Title: Re: Tilemapping
Post by: meishe91 on September 26, 2010, 05:32:08 pm
Well that sounds more like a issue with your firewall instead of TI-Connect.
Title: Re: Tilemapping
Post by: DJ Omnimaga on September 26, 2010, 05:38:47 pm
I see. That sucks. On top of that resending an OS takes like 10-20 minutes x.x
Title: Re: Tilemapping
Post by: AngelFish on September 26, 2010, 05:43:14 pm
I never had to wait that long to transfer. It can usually be done in 6-7 for me. That said, I've been known to underestimate times before.
Title: Re: Tilemapping
Post by: Deep Toaster on September 26, 2010, 05:49:12 pm
Definitely your firewall's fault :P I have that problem too at home. It would block programs from sending. Thankfully, I almost never send applications, so I've never needed to take out the cable.

But if it gives you the screen that says "Install operating system now" or something like that, you should be able to simply press ON to cancel, press another key to turn off the calc, and turn it back on. See if that works next time it happens.

And about the firewall, could you maybe tweak it to allow TI-Connect to do anything it needs to do?
Title: Re: Tilemapping
Post by: DJ Omnimaga on September 26, 2010, 06:01:53 pm
I never had to wait that long to transfer. It can usually be done in 6-7 for me. That said, I've been known to underestimate times before.
Nice, maybe it was because I was using a serial link cable to send them.
Title: Re: Tilemapping
Post by: Deep Toaster on September 26, 2010, 06:03:04 pm
That still seems pretty long ... good thing I've never had to transfer an OS before. It takes about ten minutes between two calcs, though.