Author Topic: Tilemapping  (Read 7566 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Tilemapping
« 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
« Last Edit: September 26, 2010, 04:52:28 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Tilemapping
« Reply #1 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 ^^
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Tilemapping
« Reply #2 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.
« Last Edit: September 26, 2010, 04:57:37 pm by Deep Thought »




Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tilemapping
« Reply #3 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.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemapping
« Reply #4 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!
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tilemapping
« Reply #5 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.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Tilemapping
« Reply #6 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.
« Last Edit: September 26, 2010, 05:16:51 pm by Deep Thought »




Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tilemapping
« Reply #7 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.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Tilemapping
« Reply #8 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.




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemapping
« Reply #9 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?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tilemapping
« Reply #10 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.
« Last Edit: September 26, 2010, 05:35:01 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Tilemapping
« Reply #11 on: September 26, 2010, 05:32:08 pm »
Well that sounds more like a issue with your firewall instead of TI-Connect.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemapping
« Reply #12 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
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tilemapping
« Reply #13 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.
« Last Edit: September 26, 2010, 05:44:02 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Tilemapping
« Reply #14 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?