Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scrolling: it goes too slow. Anything I can do?
#11
Before your loop:

Code:
DEF SEG = &HA000

To plot a pixel:

Code:
POKE y%*320& + x%, colour%

After your loop:

Code:
DEF SEG

Faster in compiled mode, but gives an error on the IDE is this:

Code:
POKE y%*320 + x%, colour%

(odd, but in EXE form integers seem to be unsigned sometimes Tongue)
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#12
Combination of double buffering and direct vid mem access should do it. Excellent. This game just might shape up. Big Grin
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#13
Make a lookup table to avoid the mults and it will go faster:

Code:
SUB Put (bleh...)
   STATIC init%, table&()
  
   IF NOT init% THEN
      DIM table&(199)
      FOR i%=0 TO 199
         table&(i%) = 320&*i%
      NEXT
      init%=-1
   END IF

   DEF SEG=&HA000
   ' Your PUT routine here
   ' ...
   POKE table&(y%) + x%, c%
   ' ...
   DEF SEG
END SUB
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#14
[semi-offtopic]
Wow. Surprised I never thought of doing that. :o (lookup tables) Something like that might speed up Useless Sock even faster than it already is...
[/semi-offtopic]
I'd knock on wood, but my desk is particle board.
Reply
#15
Quote:Okay, I tried that IF thing of yours Nath. It's faster, but still not...fast. My main problem now is that you can kinda see it's being drawn. If I was using SCREEN 7,0,1,0 and PCOPYing, it would be fine. Is that what Double Bufferring does?
Btw all, about the high-speed PUT, sorry - I'm stuck with my own PutSprite routine.


Try SuperPut

It flips and clips and is faster than QB's PUT. Although you use PUT itself. :*). And yeah, transparency is supported.

If you don't want to use Supeput(I don't see why you won't) here's a mini scroller:
http://rel.betterwebber.com/junk.php?id=16

If you don't understand something just PM me. :*)

I would recommend you use SuperPut though. :*)

Here's also a preclipped-pokebased sprite routine:

http://rel.betterwebber.com/junk.php?id=4

Rel.Sprite SUB.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#16
Superput is a library in denial Big Grin

There's actually several tricks to speed up pure qb programming... unrolling loops, etc. But libraries are so much easier and they involve soooo little work in comparison...
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#17
Rel: Ah, haven't I said it enough? I gotta use PutSprite, PJ's own little routine. However! It uses PSET, so I think that if I do two things:
1) Shrink the active screen area to be redrawn (from 30x18 to 12x10).
2) Replace PSET with the faster method.
I think it'll run just dandy.
But for now, I'm celebrating since I learned scrolling. Tongue
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#18
Quote:Superput is a library in denial Big Grin

There's actually several tricks to speed up pure qb programming... unrolling loops, etc. But libraries are so much easier and they involve soooo little work in comparison...

Heh. :*)

Zack: then Rel.Sprite might be of interest to you. It preclips and can handle offseting. It's still straight QB .:*)

Link above. :*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#19
Zack, i high, highly recommend looking at relgfx, and minirpg. VERY useful.

also, i prefer this tut on db myself.

http://faq.qbasicnews.com/?blast=ZipsDou...ngTutorial
Jumping Jahoolipers!
Reply
#20
Back offffff, guys, about all these libs. :wink:
I did what I said I would do, and it works perfectly. Expect enormous maps in Operation Pong. Smile
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)