Hi forums Smile

After <finally> managing to make a spritelike routine, improving it a little bit, and messing around with it, I had an idea for something.

Could interrupts be used to pretty much update the entire screen by loading a bunch of sprites from data stored in RAM somewhere? I like the idea of it, but I don't understand interrupts well enough to know if this is possible or not.

I was thinking it would be something like holding a "sprite type, x, y" for each sprite somewhere in a saferam area, then when the interrupt is called load the data and read through placing each sprite where it should be. Then, CALLs like MoveSprite or MakeSprite would be used to define and place sprites, loading data from registers into memory somewhere to be updated at the next interrupt.

So I have a few questions:

    Is this feasible to do, or would it be too slow/difficult?
    Is there somewhere that I can store sprite data in memory that will stay safe even after the ASM program finishes (like for hybrid BASIC sprites)?
    Would this screw up other features of interrupts? i.e. key input? Or will it/can it not change the system routines?

Thanks for reading and hopefully replying Smile
P.S. If I was to make this it would be on a (most likely) TI84+SE or (possibly) TI84+CE.
I thiinnkkk this is right... but my assembly is quite rusty...
You would have to set aside memory locations for an "array", or just all the sprites' data in a row. It would have to be the size of one sprite's data * the amount of sprites. Once you do this, you can just store all your data next to itself.
As long as you know the data structure you can do
(startingMemoryLocation+bitNumber)*spritenumber

My explaining might be hard to understand, so I'll model it with some letters. SpriteX will model a data chunk for one sprite.
The amount of characters it takes to write Sprite1 is 7. We are storing 3 sprites, so we need 21 characters total
123456Sprite1Sprite2Sprite3abcdefgh<-- the locations are next to each other in memory
We're starting at character 7.
To get a character in a specific sprite, we can do
(7+characterIndex) * spriteNumber.
If I wanted to get the 5th character in the 1st sprite
(7+5) * 1.
123456Sprite1Sprite2Sprite3abcdefgh
^ Character #12
This is how you can structure your data.
KingInfinity wrote:
I thiinnkkk this is right... but my assembly is quite rusty...
You would have to set aside memory locations for an "array", or just all the sprites' data in a row. It would have to be the size of one sprite's data * the amount of sprites. Once you do this, you can just store all your data next to itself.
As long as you know the data structure you can do
(startingMemoryLocation+bitNumber)*spritenumber

My explaining might be hard to understand, so I'll model it with some letters. SpriteX will model a data chunk for one sprite.
The amount of characters it takes to write Sprite1 is 7. We are storing 3 sprites, so we need 21 characters total
123456Sprite1Sprite2Sprite3abcdefgh<-- the locations are next to each other in memory
We're starting at character 7.
To get a character in a specific sprite, we can do
(7+characterIndex) * spriteNumber.
If I wanted to get the 5th character in the 1st sprite
(7+5) * 1.
123456Sprite1Sprite2Sprite3abcdefgh
^ Character #12
This is how you can structure your data.

I have no idea what you are doing in the second part of your post. Are you talking about text sprites?

Also, on a different note, do you know how many clock cycles an interrupt can take without repeating forever?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement