[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2008-06-01T12:16:48-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/topic/2643 2008-06-01T12:16:48-05:00 2008-06-01T12:16:48-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17253#p17253 <![CDATA[Help... screen 13 virtual memory and a few library questions]]>
----------------------------------1:

Code:

DIM MyScreen(199) as String * 320
MyPset;

Code:

Sub Dot(X%,Y%,Z%)ax& = x%ay& = y%Def Seg = Varseg(MyScreen(0))Offset& = VarPtr(MyScreen(0)) + ax& + ay& * 320&   'Be carefull With Overflow Error!Poke Offset&, Z%def segEnd SubFunction Pixel%(X%,Y%)ax& = x%ay& = y%'Returns The Pxiel ValueDef Seg = Varseg(MyScreen(0))Offset& = VarPtr(MyScreen(0)) + ax& + ay& * 320&   'Be carefull With Overflow Error!k%=Peek(Offset&)def segPixel = k%End Function
THESE 2 ROUTINNES ARE FASTER THEN USING MID$(MyScreen(Y%),X%+1,1)




For Drawing;

Code:

add& = 0For y% = 0 to 199For x% = 0 to 319def seg = &HA000p% = Pixel(x%,y%)add& = add& + 1poke add&, p%nextnextdef seg
You must use assembly for faster paste.


Now;

Code:

Dim SHared Virmem(9) as String * 10  'we have 100 bytes ! 10-10-10...VirMem(0) = "TOLGAARCOK"'Now Lets Use The Function Abovek% = Pixel(0,5)   'Note That it means 1,6!!!Print K%Dot 0,5,66Print VirMem(0)
The Result is 65 which is ASC(A) and after Dot Command;
TOLGABRCOK

I hope you get it... The Fixed String Storage Are Is your own home :D



-----------------------------------------------2:
use a file! Just use a file for storing some temp data, it can be used as a memeory too, but be carefull, you must access lots of time to there so not nice for hdd.

Statistics: Posted by Yazar — Sun Jun 01, 2008 12:16 pm


]]>
2008-04-10T20:01:57-05:00 2008-04-10T20:01:57-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17061#p17061 <![CDATA[Help... screen 13 virtual memory and a few library questions]]>
The screen buffer can hold the entire screen using BSAVE, but GET and PUT fall a little short of fullscreen in 13.

Ted

Statistics: Posted by burger2227 — Thu Apr 10, 2008 8:01 pm


]]>
2008-04-10T18:37:59-05:00 2008-04-10T18:37:59-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17060#p17060 <![CDATA[Help... screen 13 virtual memory and a few library questions]]> Statistics: Posted by LightBulb — Thu Apr 10, 2008 6:37 pm


]]>
2008-04-06T20:41:33-05:00 2008-04-06T20:41:33-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17014#p17014 <![CDATA[Thanks!]]> Statistics: Posted by LightBulb — Sun Apr 06, 2008 8:41 pm


]]>
2008-04-03T14:07:43-05:00 2008-04-03T14:07:43-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=16974#p16974 <![CDATA[Help... screen 13 virtual memory and a few library questions]]> (pset) POKE y * 320 + x, colour
(point) colour = PEEK(x* 320 + x)

You can optimize this by making a LUT with 200 integers which mulitplies with 320. Then you don't have to multiply, but you can simply use y as the index for the array.

It is the fastest if you use a pointer that starts at zero, but ends at 64000(=320*200, so at the right bottom of the screen). So every time you increase this pointer by one, the pixel that will be affected by that poke, is one to the right. And every 320 times the pointer moves to the beginning of the next row of pixels.
(Something I found out by looking at a heavily optimized rotozoomer is that can be a normal integer, but it will work only when compiled then. It is very weird: compiled the integers dont give an overflow error, so you can always try to replace long integers by normal integers before compiling, this speeds everything up A LOT. I used this much by making optimized demo effects and it is really great)

Back to the point
When you want to get rid of flicker, you have to make a screen buffer. That is just a large array with 32002 integers, that you set def seg to:
DEF SEG = VARSEG(array(0))
Then you poke to it, and then you can PUT at the screen.
Almost forgot: you got to dimension the array. There are two ways:
1. Use GET (0, 0) - (319, 199), array(0)
2. Dimension them by hand:
array(0) = 320(this can be another value too, but only smaller, but this is only if you want a smaller screen buffer. If you do this, I have to mention that the pointer moves to the next row every (x + 1) steps) * 8
array(1) = 199(again this can be smaller if you want a smaller screen buffer)

I hope you understood. This is pretty much all I know about screen buffers, pointers, peek and poke, memory in QB and optimizations.

Statistics: Posted by Codemss — Thu Apr 03, 2008 2:07 pm


]]>
2008-04-02T22:58:43-05:00 2008-04-02T22:58:43-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=16956#p16956 <![CDATA[Help... screen 13 virtual memory and a few library questions]]>
I understand the basics of making a screen 13 virtual memory page, such as PSETing to it and POINTing to it. put when the "virtual flip" happens, I don't understand how it works. Also, is there a way to PUT and GET from the virutal page?
I assume you are talking about the video memory pages that you can manipulate with the SCREEN and PCOPY statements?? This wouldn't be virtual memory... Maybe you are referring to something else... Screen 13 only has 1 video memory page...
For screen modes that allow multiple pages, I think the VGA hardware is instructed somehow to switch what part of memory it uses for the screen?? I'm not sure. The BIOS Int 0x10 functions allow video memory pages, but how exactly it works, I don't know.

Here is some code that demonstrates video memory pages:

Code:

DEFINT A-Zz = &H1000SCREEN 0, , 1, 1CLSCOLOR 15, 1PRINT "A"SCREEN 0, , 0, 0CLSCOLOR 7, 0PRINT "a"DEF SEG = &HB800PRINT HEX$(PEEK(0)), HEX$(PEEK(1))PRINT HEX$(PEEK(z)), HEX$(PEEK(z + 1))
As you can see, the "A" in page 1 is at b800:1000, while the "a" in page 0 is at b800:0000.

To get or put to a specific page, just make it the active page.
But screen 13 only has one page... Are you using some library to emulate multiple pages for it? If so, could you please state what library, and someone with experience with it can help you....
Is the .BI file nesessary?
I don't use QB 4.5, but if it's like anything else, the include file (like a .h file in C) is just a file that gets copied into your source at compile time.
#include <whatever.h>
is the same as copying the contents of the file into your code at that spot. include files contain declarations of functions, etc, that your code will use. I'm not sure, but I imagine they are necessary (either in an included header file, or in your code itself). I imagine there would be link time problems without them?
Regards,
Michael

Statistics: Posted by Michael Calkins — Wed Apr 02, 2008 10:58 pm


]]>
2008-04-02T20:15:02-05:00 2008-04-02T20:15:02-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=16953#p16953 <![CDATA[Help... screen 13 virtual memory and a few library questions]]>
I understand the basics of making a screen 13 virtual memory page, such as PSETing to it and POINTing to it. put when the "virtual flip" happens, I don't understand how it works. Also, is there a way to PUT and GET from the virutal page?

Involving Libraries...
Is the .BI file nesessary? I've seen turtorials that say to do it, and others that don't even mention it.

in the "Set Paths" option in quick basic, rather than typing in /L (your lib here) in MS-DOS, can you just type in the file path to your library there?

How do you type in multiple flie names in zones in the "Set Paths" option?

Thanks!

Statistics: Posted by LightBulb — Wed Apr 02, 2008 8:15 pm


]]>