Author |
Message |
|
thebetter1
Advanced Newbie
Joined: 09 Jul 2008 Posts: 86
|
Posted: 03 Nov 2008 07:48:08 pm Post subject: |
|
|
How can I make my text sprite maps have walkable non-blank tiles? If I erase the tile when the character walks on, I will have to put it back when he walks off. If I try to redraw that tile with the regular text method, it will bleed into the tile to the right, so I would have to redraw the entire row. The only other method I can think of is to take a pixel matrix of the tile and save it, then redraw the pixels, which is extremely slow. Anyone know of a faster solution? |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 03 Nov 2008 07:58:40 pm Post subject: |
|
|
A possibility is to use StorePic to save the map and then use RecallPic when a part of it needs to be replaced.
Last edited by Guest on 11 Jul 2010 06:07:24 pm; edited 1 time in total |
|
Back to top |
|
|
Harrierfalcon The Raptor of Calcs
Super Elite (Last Title)
Joined: 25 Oct 2006 Posts: 2535
|
Posted: 03 Nov 2008 08:02:33 pm Post subject: |
|
|
Weregoose wrote: A possibility is to use StorePic to save the map and then use RecallPic when a part of it needs to be replaced.
[post="128444"]<{POST_SNAPBACK}>[/post] Just note that if you do that, that RecallPic recalls a picture in an OR fashion, so make sure you erase the character before you recall the pic.
OR essentially means that white pixels are transparent:
So if you or'ed this:
11110101
10101111
Over this:
00001001
10010000
You would get this:
11111101
10111111
Last edited by Guest on 11 Jul 2010 06:07:58 pm; edited 1 time in total |
|
Back to top |
|
|
Galandros
Active Member
Joined: 29 Aug 2008 Posts: 565
|
Posted: 04 Nov 2008 04:17:52 pm Post subject: |
|
|
Erase the character by text spaces is faster than a complete ClrDraw?
I think yes, but not sure.
But if you have more than a tile or you want to cut bytes use ClrDraw before the recall.
Have fun. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 04 Nov 2008 04:33:40 pm Post subject: |
|
|
Galandros wrote: Erase the character by text spaces is faster than a complete ClrDraw?
I think yes, but not sure.
But if you have more than a tile or you want to cut bytes use ClrDraw before the recall.
Have fun.
[post="128455"]<{POST_SNAPBACK}>[/post] It's irrelevant whether or not it's faster (it is). You have to erase things before you StorePic, so if you clear the whole screen you won't have the screen saved anywhere. Even if you did, it would cause bad flicker every time you moved. |
|
Back to top |
|
|
Harrierfalcon The Raptor of Calcs
Super Elite (Last Title)
Joined: 25 Oct 2006 Posts: 2535
|
Posted: 04 Nov 2008 04:46:11 pm Post subject: |
|
|
DarkerLine wrote: Galandros wrote: Erase the character by text spaces is faster than a complete ClrDraw?
I think yes, but not sure.
But if you have more than a tile or you want to cut bytes use ClrDraw before the recall.
Have fun.
[post="128455"]<{POST_SNAPBACK}>[/post] It's irrelevant whether or not it's faster (it is). You have to erase things before you StorePic, so if you clear the whole screen you won't have the screen saved anywhere. Even if you did, it would cause bad flicker every time you moved.
[post="128456"]<{POST_SNAPBACK}>[/post]
"Bad" is a very gentle term for what I'm thinking...
"Horribly annoying and agonizingly slow" would probably be better. |
|
Back to top |
|
|
thebetter1
Advanced Newbie
Joined: 09 Jul 2008 Posts: 86
|
Posted: 04 Nov 2008 09:53:48 pm Post subject: |
|
|
Okay, the recallpic method does work and is actually fast enough to notice the delay for holding the arrow keys. Now hopefully I can find a way to draw the screen in less than 45 seconds... |
|
Back to top |
|
|
darkstone knight
Advanced Member
Joined: 07 Sep 2008 Posts: 438
|
Posted: 05 Nov 2008 04:15:34 am Post subject: |
|
|
45 seconds?
i can probaly do it in 10 seconds... possibly less |
|
Back to top |
|
|
TI-newb
Member
Joined: 24 Dec 2008 Posts: 158
|
Posted: 10 Mar 2009 08:44:04 pm Post subject: |
|
|
Harrierfalcon wrote: Weregoose wrote: A possibility is to use StorePic to save the map and then use RecallPic when a part of it needs to be replaced.
[post="128444"]<{POST_SNAPBACK}>[/post] Just note that if you do that, that RecallPic recalls a picture in an OR fashion, so make sure you erase the character before you recall the pic.
OR essentially means that white pixels are transparent:
So if you or'ed this:
11110101
10101111
Over this:
00001001
10010000
You would get this:
11111101
10111111
kay, what is this Binary Code for? like.. Pt on? or Pxl on?? xDD, cause this Binary code is for drawing Sprites am i right? so if anyone can tell me, i would love to know.
Last edited by Guest on 11 Jul 2010 06:08:29 pm; edited 1 time in total |
|
Back to top |
|
|
Harrierfalcon The Raptor of Calcs
Super Elite (Last Title)
Joined: 25 Oct 2006 Posts: 2535
|
Posted: 10 Mar 2009 08:51:19 pm Post subject: |
|
|
I was just saying that that's how Pic's are drawn onto the screen when you use RecallPic.
Last edited by Guest on 11 Jul 2010 06:07:09 pm; edited 1 time in total |
|
Back to top |
|
|
simplethinker snjwffl
Active Member
Joined: 25 Jul 2006 Posts: 700
|
Posted: 10 Mar 2009 08:52:51 pm Post subject: |
|
|
The binary is just used to represent the sprite. On the forums it's easier to use 1's and 0's for pixel on/off than making and attaching a picture. |
|
Back to top |
|
|
thebetter1
Advanced Newbie
Joined: 09 Jul 2008 Posts: 86
|
Posted: 08 Apr 2009 10:36:31 pm Post subject: |
|
|
darkstone knight wrote: 45 seconds?
i can probaly do it in 10 seconds... possibly less
10 seconds??? Exactly how are you doing this? Just recently I got it down to 24, and that routine uses over 70 text instructions in each execution of the For loop. |
|
Back to top |
|
|
darkstone knight
Advanced Member
Joined: 07 Sep 2008 Posts: 438
|
|
Back to top |
|
|
simplethinker snjwffl
Active Member
Joined: 25 Jul 2006 Posts: 700
|
Posted: 09 Apr 2009 01:21:34 pm Post subject: |
|
|
thebetter1 wrote: 10 seconds??? Exactly how are you doing this? Just recently I got it down to 24, and that routine uses over 70 text instructions in each execution of the For loop.
What calculator do you have? And could you post the code you're using?
darkstone knight wrote:
I believe the operative word in your previous post was I. Also, on my 84+SE DonutQuest renders a map in ~8 seconds but on my 83+ it takes ~21 seconds, so the calculator in use it kind of important |
|
Back to top |
|
|
TKD_01
Advanced Newbie
Joined: 20 Feb 2009 Posts: 51
|
Posted: 10 Apr 2009 02:46:01 pm Post subject: |
|
|
24 seconds is...not too bad. I'm thinking it could be faster. How complex is this map you're trying to make (like what are you putting on it)?
One other thing:
Storing a picture takes a heck of a lot of memory (767 bytes per picture), so you should be sparing in how many pictures you're storing, or else you could cause an overflow (correct term?) of RAM, which will result in a crash. Just be mindful of that
Last edited by Guest on 10 Apr 2009 02:49:41 pm; edited 1 time in total |
|
Back to top |
|
|
simplethinker snjwffl
Active Member
Joined: 25 Jul 2006 Posts: 700
|
Posted: 10 Apr 2009 02:57:55 pm Post subject: |
|
|
TKD_01 wrote: One other thing:
Storing a picture takes a heck of a lot of memory (767 bytes per picture), so you should be sparing in how many pictures you're storing, or else you could cause an overflow (correct term?) of RAM, which will result in a crash. Just be mindful of that
Unless you use an Asm utility you're limited to 10 pictures anyways (but 767 bytes still is kind of a big chunk of memory). Also, I think in this case there's only one extra picture, which would just be used as a temporary buffer to save the screen and then be deleted. |
|
Back to top |
|
|
TKD_01
Advanced Newbie
Joined: 20 Feb 2009 Posts: 51
|
Posted: 10 Apr 2009 03:33:11 pm Post subject: |
|
|
simplethinker wrote: TKD_01 wrote: One other thing:
Storing a picture takes a heck of a lot of memory (767 bytes per picture), so you should be sparing in how many pictures you're storing, or else you could cause an overflow (correct term?) of RAM, which will result in a crash. Just be mindful of that
Unless you use an Asm utility you're limited to 10 pictures anyways (but 767 bytes still is kind of a big chunk of memory). Also, I think in this case there's only one extra picture, which would just be used as a temporary buffer to save the screen and then be deleted.
Right, right. I was only noting that because when people receive/download a program, many times, they are led to believe that that's how much memory they're using up, so, as long as they have that much RAM free, they're good to go. I know most people with the least bit of sense wouldnt leave <767 bytes of RAM open, but you always have those rare few.
--The only reason I'm commenting on this is because this happened to one of my friends with a program that I created (when I had very little experience), in which I stored 7 pictures (like an idiot), which took up an extra 5k of RAM. When he ran the program, it caused a memory leak, thus rendering his calculator useless. I've felt pretty bad ever since, so that's why I'm cautious about this subject.
@thebetter1: You could (and should) do the picture storing, just remeber that you have to draw the picture one time before storing it into a Pic.
Also, you can actually have all ten pictures active at one time, you just have to be smart about it: unarchive the one you're going to use, and archive the other 9 that you're not using
...where's my EasyButton...
Last edited by Guest on 10 Apr 2009 03:37:10 pm; edited 1 time in total |
|
Back to top |
|
|
simplethinker snjwffl
Active Member
Joined: 25 Jul 2006 Posts: 700
|
Posted: 10 Apr 2009 03:41:00 pm Post subject: |
|
|
Quote: When he ran the program, it caused a memory leak, thus rendering his calculator useless. I've felt pretty bad ever since, so that's why I'm cautious about this subject.
A memory leak is when you jump out of a block of code and skip an End (like an If:Then:End, For, While, etc...). After you quit there shouldn't be a problem. Do you mean he got a memory error? All it takes to fix that is delete/archive some stuff in RAM, or a reset, and if that doesn't work then pull the batteries and put them back in. If that doesn't work then there was something more than not enough RAM going wrong. |
|
Back to top |
|
|
TKD_01
Advanced Newbie
Joined: 20 Feb 2009 Posts: 51
|
Posted: 10 Apr 2009 03:58:59 pm Post subject: |
|
|
simplethinker wrote: Quote: When he ran the program, it caused a memory leak, thus rendering his calculator useless. I've felt pretty bad ever since, so that's why I'm cautious about this subject.
A memory leak is when you jump out of a block of code and skip an End (like an If:Then:End, For, While, etc...). After you quit there shouldn't be a problem. Do you mean he got a memory error? All it takes to fix that is delete/archive some stuff in RAM, or a reset, and if that doesn't work then pull the batteries and put them back in. If that doesn't work then there was something more than not enough RAM going wrong.
Sorry, I used 'memory leak' a bit loosely. What happened was after the the screen turned blank, he pressed the on button, and the screen turned on, but with pixels all over the place. We took the batteries out (yes, all of them), and the exact same thing happened. Each time he turned on his calculator, pixels appeared in random places, and any button he pressed caused a group of random pixels to pop up in different spots on the screen.
Now, I know that there should've been some sort of fail safe on that, but maybe it was because the call was too far out of the RAM that it corrupted OS data? Honestly, I don't know, but I do know that his calculator was done after that event. Albeit, he still has it. So, do you have any suggestions for possibly fixing it? |
|
Back to top |
|
|
darkstone knight
Advanced Member
Joined: 07 Sep 2008 Posts: 438
|
Posted: 10 Apr 2009 04:10:12 pm Post subject: |
|
|
basic can never (well... unless your name is tifreak8x..) crash your calc |
|
Back to top |
|
|
|