Author Topic: Enlarging sprites?  (Read 27988 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Enlarging sprites?
« Reply #60 on: June 15, 2010, 05:36:05 pm »
Aaah ok I see. Thanks for the info. Could it be modified to work backwards, though? It would be more user-friendly if someone ever decided to use it.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Enlarging sprites?
« Reply #61 on: June 15, 2010, 06:30:19 pm »
That looks like a neat routine.  Nice job calc84! :D

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Enlarging sprites?
« Reply #62 on: June 15, 2010, 07:04:51 pm »
Zooming the whole screen will be too slow? Who said?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Enlarging sprites?
« Reply #63 on: June 15, 2010, 07:10:35 pm »
Wow, could you explain in details how you managed to achieve such speed? I totally don't understand any of your code x.x

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Enlarging sprites?
« Reply #64 on: June 15, 2010, 07:16:58 pm »
oh man, i am doing something cool with that right away.


Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Enlarging sprites?
« Reply #65 on: June 15, 2010, 07:49:02 pm »
This is a little weird to explain. This zooms by shifting the screen in parts to each edge. For vertical zooming, it's as simple as copying data from L₆+12 to L₆ and copying from L₆+755 to L₆+767 (reversed) multiple times, each time with a different copy size. Horizontal zooming was a bit tougher and takes up most of the variables and calculations. I multiply a certain number of bytes on the left side of the screen by 2 and divide bytes on the right side by 2, making sure to carry pixels that would be bumped off from byte to byte.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Enlarging sprites?
« Reply #66 on: June 15, 2010, 08:16:16 pm »
ugh that sounds too confusing. I don't think I'Ll ever be able to understand stuff to such low level. Maybe the vertical part, but not the horizontal one. I guess I'll have to stay away from zooming stuff. What I don't understand at all the most is how you say you work with stuff on edges of the screen, zooming it out, but don't talk about the middle of the screen. Doesn't the middle of the screen need to be zoomed out too?

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Enlarging sprites?
« Reply #67 on: June 15, 2010, 08:24:44 pm »
What I mean is that everything is moved towards the edges of the screen. The distance from the middle in either the vertical or horizontal direction determines how far it will be moved towards either the vertical or horizontal edge closest to it. The middle pixels will move towards the edges by only one pixel, whereas pixels halfway between an edge and the middle will be moved all the way to the edge.
« Last Edit: June 15, 2010, 08:25:35 pm by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Enlarging sprites?
« Reply #68 on: June 15, 2010, 08:32:46 pm »
Yeah but I still don't get how do you move the stuff this fast outside of the screen and how you manage to extend the lenght between each pixels to make them bigger

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Enlarging sprites?
« Reply #69 on: June 15, 2010, 08:35:30 pm »
And we don't want to leave grayscale programs stranded, though they'll take a decently sized speed hit: 4 seconds for black and white vs 12 seconds for grayscale. It takes an extra 4 seconds to shift the back buffer and another 4 to update the screen using DispGraphrr 128 times throughout the process. On 15MHz calculators, this routine should take about 8 seconds.

EDIT: Uploaded a new GIF and source, as I realized I was copying the pictures to the wrong buffers so the grays were reversed.
« Last Edit: June 15, 2010, 09:18:31 pm by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Enlarging sprites?
« Reply #70 on: June 15, 2010, 08:37:15 pm »
wow I'll never be able to reach your level in Axe skills. x.x

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Enlarging sprites?
« Reply #71 on: June 15, 2010, 08:53:52 pm »
Yeah, the hardest parts about this routine were the horizontal zooming and indicating which pixel rows/columns to shift outwards from, and in what order. The horizontal zooming is quite math-based, and took a lot of pacing around my room and thinking to produce and finally get right.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Enlarging sprites?
« Reply #72 on: June 15, 2010, 09:00:31 pm »
indicating which pixel rows/columns to shift outwards from
yeah my issue was really understanding how you did that. I guess that clarifies things a bit, altough I am still wondering how do you shift parts of the screen. Do you just do like Conj(PTR+1,PTR,size of the part of the screen you want to shift) then update the lines of pixels that were left intact in the process? I'm not too sure how to explain my question better
« Last Edit: June 15, 2010, 09:01:54 pm by DJ Omnimaga »

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Enlarging sprites?
« Reply #73 on: June 15, 2010, 09:11:06 pm »
Well the thing about shifting pixels outwards horizontally is that, whereas a vertictical shift of one pixel is 12 bytes, a horizontal shift of one pixel is only one bit. Shifting data by one bit cannot be done using conj().
« Last Edit: June 15, 2010, 09:11:28 pm by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Enlarging sprites?
« Reply #74 on: June 15, 2010, 09:27:38 pm »
Could you maybe post a frame by frame (except maybe if it's repeating the same code 64 times, just post two or three frames) chronology of what each lines of code do in terms of updating the screen buffer? I am sorry but I absolutely get no clue what you are saying. Is there any tutorial somewhere on how to understand such stuff (not tutorials on the actual zooming, but understanding the tutorials about them)?