Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Poke to plot pixels in SCREEN 7.
#1
Is there a good way to plot pixels using the POKE commmand in QB's mode 7?
Reply
#2
screen 7 is 16-color ega, and it isnt chained, like 13h. you have to use OUT ports to change the plane and peek each pixel so that you only change one bit when you poke it. I think you'd be better off either using qb's PSET or GET/PUT.
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
#3
Yup, it is DAMN SLOW (try it for yourself)

Code:
DEFINT A-Z
DECLARE SUB pix12 (vertical%, horizontal%, c%)
DIM SHARED bitfield(7) AS INTEGER
   bitfield(0) = 128: bitfield(1) = 64: bitfield(2) = 32
   bitfield(3) = 16: bitfield(4) = 8: bitfield(5) = 4
   bitfield(6) = 2: bitfield(7) = 1

SUB pix12 (vertical%, horizontal%, c%)
   IF (vertical% < 0) OR (horizontal% < 0) THEN EXIT SUB
   IF (vertical% > 199) OR (horizontal% > 319) THEN EXIT SUB
   DEF SEG = &HA000: OUT &H3CE, 4: OUT &H3C4, 2
   P& = vertical%: P& = P& * 40 + horizontal% \ 8
   bit% = bitfield(horizontal% AND 7): bitmask% = 255 - bit%
   OUT &H3CF, 0: OUT &H3C5, 1: B% = PEEK(P&) AND bitmask%
   IF (c% AND 1) <> 0 THEN B% = B% OR bit%
   POKE P&, B%
   OUT &H3CF, 1: OUT &H3C5, 2: B% = PEEK(P&) AND bitmask%
   IF (c% AND 2) <> 0 THEN B% = B% OR bit%
   POKE P&, B%
   OUT &H3CF, 2: OUT &H3C5, 4: B% = PEEK(P&) AND bitmask%
   IF (c% AND 4) <> 0 THEN B% = B% OR bit%
   POKE P&, B%
   OUT &H3CF, 3: OUT &H3C5, 8: B% = PEEK(P&) AND bitmask%
   IF (c% AND 8) <> 0 THEN B% = B% OR bit%
   POKE P&, B%
END SUB

To change page add (&H200 * page%) to the value located in the DEF SEG.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#4
Of course its slow. Until you limit yourself to one plane whis is one color. But who would do that? LOL

PSET is the way!!!

RockMan: Why are you using screen 7? Most of use has migrated to 13h. ;*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#5
my guess is paging and libphobia. (and dont mention only using one plane for speed unless you want to magically summon wizardlife!)
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
#6
well, if he wanted paging in 13h, he could just use Plasma's SetVideoSeg. And I'd bet it would be faster too!!!
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#7
yeah, but he's making a fighting game and storing all the graphics in near memory. (nut) Tongue
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
#8
"640 kb ought to be enough for anybody" :*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)