<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'need for speed!' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'need for speed!' posted on the 'Qbasic' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Fri, 24 May 2013 21:44:14 -0700</pubDate>
    <lastBuildDate>Fri, 24 May 2013 21:44:14 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>need for speed!</title>
      <link>http://www.programmersheaven.com/mb/advbas/327643/327643/need-for-speed/</link>
      <description>I have a feeling this will be a dificult question.&lt;br /&gt;
my problem is that my pixel setting routine is too slow:&lt;br /&gt;
&lt;br /&gt;
PSET is the original pixel setting routine, but of course, we all know how slow it is.&lt;br /&gt;
then there's GET &amp;amp; PUT, quite fast, but no way to manipulate the sprites well for scrolling, special effects, etc.&lt;br /&gt;
&lt;br /&gt;
then there's the POKEing method, where you POKE a color value into the VRAM (SEG = A000), at an offset that represents the pixel coordinates&lt;br /&gt;
(POKE 320&amp;amp; * Y% + X%)&lt;br /&gt;
this is very fast, (at least two times faster than PSET.)&lt;br /&gt;
and even faster in compilation.&lt;br /&gt;
and is what I have been using so far.&lt;br /&gt;
but... it seems it's STILL too slow, is there a faster way of plotting pixels?&lt;br /&gt;
should I do something different than plotting for drawing large scrolling backgrounds?&lt;br /&gt;
I want to do this without libraries. but ASM in the code is ok with me.&lt;br /&gt;
I've been trying to figure out the assembly equivelent to this code.&lt;br /&gt;
it seems easy, but I don't have TASM or NASM, so DEBUG:A is what I got.&lt;br /&gt;
and MOV [A000]:AX, BX doesn't work in debug, (what some one suggested to me).&lt;br /&gt;
I'm sorry for the long post, but if anyone can help me, then I would appreciate it greatly&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/advbas/327643/327643/need-for-speed/</guid>
      <pubDate>Thu, 26 Jan 2006 14:56:01 -0700</pubDate>
      <category>Qbasic</category>
    </item>
    <item>
      <title>Re: need for speed!</title>
      <link>http://www.programmersheaven.com/mb/advbas/327643/331156/re-need-for-speed/#331156</link>
      <description>try&lt;br /&gt;
MOV &amp;#91;A000+AX&amp;#93;, BX&lt;br /&gt;
I would use some REP STOSB or something similar.&lt;br /&gt;
REP prefixed instructions are really fast.&lt;br /&gt;
&lt;br /&gt;
This code sets up for the rep movsb and executes it.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
MOV CX, 10 ;how many bytes to be copied
MOV AX, yourSegment ;wherever you want to move from
MOV BX, yourAddress
MOV ES, AX
MOV DI, BX
MOV AX, 0A000h
MOV BX, 0           ;wherever you want to move to
MOV DS, AX
MOV SI, BX
REP MOVSB
&lt;/pre&gt;&lt;br /&gt;
This is 25 byte compiled, but the REP MOVSB is only 2...&lt;br /&gt;
This takes CX clock cycles so it's fast as hell.&lt;br /&gt;
&lt;br /&gt;
I downloaded this program some years ago.&lt;br /&gt;
The memcopy func is almost as mine above.&lt;br /&gt;
Check it out:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
' Bmpload Version 2 By Doug Barry (PD Computers)
'  This is the fastest BMP Loader I have ever seen, and I wrote it !!!!
'  God it's fast, anyway it uses assembler to copy a variable to the another
'  part of the memory, here I have used it to put the image data into the
'  bit of the Physical ram that overlaps the video memory, hence loading
'  the picture in one vertical blank space (one 50Hz cycle)
'
' Thanks load to Dan Holmes for finding out the memory copying routine, and
'  Andrew Griffin/Jon Sutton for info on the BMP structure.
'  Also to the guy/gal that posted ShowBMP9.bas on the net and to the
'  guy/gal that wrote CPLASMA.BAS for the "OUT" command for palette setting.

' Enjoy, even though it's uncommented it should be easy to understand,
'  being only 65, yes count 'em 65 lines of code (WOW!!!!!!!!).

' My E-Mail is pdcomputers@iname.com
' or s3dougla@doreen.rainhammark.kent.sch.uk if this don't work.
' i will try to reply and help with any of your problems.

DECLARE SUB SetPALETTE (Slot%, R%, G%, B%)
DECLARE SUB memcopy (fromseg%, fromoffset%, toseg%, tooffset%, bytes%)
DIM SHARED Buffer(319, 199) AS STRING * 1
DIM SHARED Pointer AS STRING * 1
DIM SHARED ImageDataSegment(200) AS STRING * 320
DEFINT A-Z
FileName$ = LCASE$(LTRIM$(RTRIM$(COMMAND$)))
'FileName$ = "Test.Bmp"
OPEN FileName$ FOR BINARY AS #1
IF LOF(1) &amp;lt; 2 THEN PRINT "File does not exist": KILL FileName$: SYSTEM
GET #1, 54, Pointer
SCREEN 13
FOR Slot% = 0 TO 255
 GET #1, , Pointer
 B% = INT(ASC(Pointer) / 4)
 GET #1, , Pointer
 G% = INT(ASC(Pointer) / 4)
 GET #1, , Pointer
 R% = INT(ASC(Pointer) / 4)
 SetPALETTE Slot%, R%, B%, G%
 GET #1, , Pointer
NEXT Slot%
FOR Y = 199 TO 0 STEP -1
  GET #1, , ImageDataSegment(Y)
NEXT
CLOSE
memcopy VARSEG(ImageDataSegment(0)), VARPTR(ImageDataSegment(0)), &amp;amp;HA000, 0, &amp;amp;HFA00
SYSTEM

SUB memcopy (fromseg%, fromoffset%, toseg%, tooffset%, bytes%)
  asm$ = ""
  asm$ = asm$ + CHR$(85)
  asm$ = asm$ + CHR$(137) + CHR$(229)
  asm$ = asm$ + CHR$(30)
  asm$ = asm$ + CHR$(139) + CHR$(70) + CHR$(10)
  asm$ = asm$ + CHR$(142) + CHR$(192)
  asm$ = asm$ + CHR$(139) + CHR$(70) + CHR$(14)
  asm$ = asm$ + CHR$(142) + CHR$(216)
  asm$ = asm$ + CHR$(139) + CHR$(118) + CHR$(8)
  asm$ = asm$ + CHR$(139) + CHR$(126) + CHR$(12)
  asm$ = asm$ + CHR$(139) + CHR$(78) + CHR$(6)
  asm$ = asm$ + CHR$(243)
  asm$ = asm$ + CHR$(164)
  asm$ = asm$ + CHR$(31)
  asm$ = asm$ + CHR$(93)
  asm$ = asm$ + CHR$(203)
  WAIT &amp;amp;H3DA, 8
  DEF SEG = VARSEG(asm$)
    CALL Absolute(BYVAL fromseg%, BYVAL fromoffset%, BYVAL toseg%, BYVAL tooffset%, BYVAL bytes%, SADD(asm$))
  DEF SEG
END SUB

SUB SetPALETTE (Slot, R, G, B)
  OUT &amp;amp;H3C8, Slot
  OUT &amp;amp;H3C9, R
  OUT &amp;amp;H3C9, B
  OUT &amp;amp;H3C9, G
END SUB
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I don't know what you want to do, if you give me the basic code I can convert it to (f)asm&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/advbas/327643/331156/re-need-for-speed/#331156</guid>
      <pubDate>Sat, 04 Mar 2006 13:27:49 -0700</pubDate>
      <category>Qbasic</category>
    </item>
    <item>
      <title>Re: need for speed!</title>
      <link>http://www.programmersheaven.com/mb/advbas/327643/335488/re-need-for-speed/#335488</link>
      <description>hi , &lt;br /&gt;
have you tried to use assembly language ?&lt;br /&gt;
it is very fast . &lt;br /&gt;
contact me to have the dma-straight-to-screen-kill-ya-momma-with-an-axe&lt;br /&gt;
pixel routine (it is 48 microprocessor clock cycles) &lt;br /&gt;
hoping you know how to include assembly in qbasic.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/advbas/327643/335488/re-need-for-speed/#335488</guid>
      <pubDate>Tue, 25 Apr 2006 09:34:51 -0700</pubDate>
      <category>Qbasic</category>
    </item>
  </channel>
</rss>