Author Topic: Smoothscrolling pictures  (Read 5421 times)

0 Members and 1 Guest are viewing this topic.

Offline Camdenmil

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 121
  • Rating: +4/-0
    • View Profile
Smoothscrolling pictures
« on: October 03, 2011, 05:52:59 pm »
Does anyone have a fast routine to display pictures bigger than the screen? I can't figure out how to draw them starting from any pixel coordinate of the picture.
It is bad luck to be superstitious.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Smoothscrolling pictures
« Reply #1 on: October 03, 2011, 06:05:37 pm »
meh that is actually kind of difficult because the picture and the screen memory is mapped differently........uhm let me try and make up a routine:

uhhhhhhhhhh

Copy(y*h+x,L6,12) will do the first row so..
Code: [Select]
For(e,0,63)
Copy(y+e*h+x,e*12+L6,12)
End
Code: (now i'll try and optimize it) [Select]
y*h->a
0->b
64
while -1->e
copy(a,b+L6,12)
a+h->a
b+12->b
e
end

Try that, I think it might be able to work

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Smoothscrolling pictures
« Reply #2 on: October 03, 2011, 06:12:53 pm »
Couldn't you optimize that to a single copy statement?

Code: [Select]
Copy(Y*12+Pic1,L6,768)
Then again, this only works for pictures that scroll in the Y direction.  The X direction is much harder D:

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Smoothscrolling pictures
« Reply #3 on: October 03, 2011, 08:48:01 pm »
You can store your picture as a bunch of 8x8 sprites, then draw 13x9 of them to the buffer. Like a tilemapper, except without the tile lookup.

Edit:
This reminds me, why doesn't Axe support 8xN sprites yet?
« Last Edit: October 03, 2011, 08:48:41 pm by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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: Smoothscrolling pictures
« Reply #4 on: October 03, 2011, 09:49:01 pm »
Edit:
This reminds me, why doesn't Axe support 8xN sprites yet?
Because even though I've requested it at least twice it's deemed "too useless" for Axe. :P

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Smoothscrolling pictures
« Reply #5 on: October 03, 2011, 09:51:47 pm »
I could imagine 4*4 (or 5*5) being used a lot...

As for the topic of this thread, idk to that as well, I'd go with what either calc84 or squidgetx said :P
Vy'o'us pleorsdti thl'e gjaemue

Offline Camdenmil

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 121
  • Rating: +4/-0
    • View Profile
Re: Smoothscrolling pictures
« Reply #6 on: October 04, 2011, 10:39:44 pm »
You can store your picture as a bunch of 8x8 sprites, then draw 13x9 of them to the buffer. Like a tilemapper, except without the tile lookup.

Edit:
This reminds me, why doesn't Axe support 8xN sprites yet?
Why didn't I think of that :banghead: 8xN sprites would be nice for this though.
It is bad luck to be superstitious.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Smoothscrolling pictures
« Reply #7 on: October 04, 2011, 11:15:25 pm »
You can store your picture as a bunch of 8x8 sprites, then draw 13x9 of them to the buffer. Like a tilemapper, except without the tile lookup.

Edit:
This reminds me, why doesn't Axe support 8xN sprites yet?

For that matter, why doesn't Axe support m*n sprites yet?

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Smoothscrolling pictures
« Reply #8 on: October 04, 2011, 11:42:26 pm »
You can store your picture as a bunch of 8x8 sprites, then draw 13x9 of them to the buffer. Like a tilemapper, except without the tile lookup.

Edit:
This reminds me, why doesn't Axe support 8xN sprites yet?

For that matter, why doesn't Axe support m*n sprites yet?

One step at a time :P
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Smoothscrolling pictures
« Reply #9 on: October 05, 2011, 05:26:21 am »
Yeah, I was thinking of changing the Bitmap() command's code to use a custom, fully clipped routine that would make it more useful.  Currently its used very rarely because the OS's routine is slow, buggy, and just sucks.  I don't mind having a big bulky routine as long as the ease of use makes up the difference.

If either you or Runer or anyone else wants to design a routine, I'd be happy to include it.  It needs:
  • Clipping in all directions
  • Supports aligned and unaligned sprites
  • Sprite dimensions built into data
  • Data itself can be in any format (byte aligned not necessary)
  • Usable on any buffer
  • Extra argument to allow both "Or" or "Xor" drawing methods ("And" would be nice too)

Don't worry about the register/stack juggling for input, I can optimize that myself.

The complexity of this routine is the only thing holding me back right now :P  The reason for the last condition is that I don't want separate routines for each method, this is a command that should be optimized for usefulness, not for size or speed.  If you needed the later, you'd be using 8x8 or smaller anyway.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Smoothscrolling pictures
« Reply #10 on: October 05, 2011, 06:18:27 am »
If you do that, you get >9000 respect. do it.
I'm not a nerd but I pretend: