11-25-2005, 06:01 PM
Quote:LOLThen, like, the QB documentation is wrong. Take your pick.
Then like 100 QB games are bad coded and don't work :roll:
stylin:
Get\Put troubles
|
11-25-2005, 06:01 PM
Quote:LOLThen, like, the QB documentation is wrong. Take your pick.
stylin:
11-25-2005, 06:24 PM
The QBasic documentation describes the general formula in which the PMAP value has to be taken in account. It works in excess guaranteeing (sp?) that the arrays will be big enough. The (x*y+4)/2 formula fails when x*y is odd. For example if you have a 5x5 image it would need 25 bytes + 4 = 29 bytes, but 29 / 2 = 14. If you DIM sprite%(13) you are not reserving the needed amount of memory.
The QB help is a "failsafe" solution providing a decent array size which will work for every videomode, but it's not the most efficient formula, memory-wise. Anyway, following the formula: Code: 4 + INT(((x2 - x1 + 1) * (bits-per-pixel-per-plane) + 7)/8) * planes * ((y2 - y1) + 1) You get: Code: 4 + INT (((319 - 0 + 1) * 8 + 7) / 8) * 1 * (199 - 0 + 1) solving... Code: 4 + INT ((320 * 8 + 7) / 8) * 200 You know, this time we get the same results.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio underBASIC, homegrown musicians [img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
11-25-2005, 06:44 PM
Quote:Nope. The correct number of subscripts is 32263.Do not question me like that again. I don't like it. In that case, you tell me what you need those 524 extra bytes for. Oh well... I said enough... I dont feel like repeating what Nath said.
11-25-2005, 06:49 PM
Quote:The QB help is a "failsafe" solution providing a decent array size which will work for every videomode, but it's not the most efficient formula, memory-wise.I see. My apologies. I guess then it would help if the QB help would be (a little) clearer in its documentation. It's situations like these that I remember why I work in FreeBASIC now. Quote:Do not question me like that again. I don't like it.I didn't question you. Quote:In that case, you tell me what you need those 524 extra bytes for.I would if I could. Seemed rather odd to me, and apparently, QB doesn't even know. :roll:
stylin:
11-25-2005, 08:02 PM
No need to apologise. Now I realise that my "LOL" shouldn't be there. It's me who apologises.
I think that you got the big number 'cause you used 320 and 200 instead of 319 and 199. The formula considers coordinates, not measurements.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio underBASIC, homegrown musicians [img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
11-25-2005, 10:32 PM
Yes, I just noticed that as well. I need to stop posting at 6am - or stay clear of the QB forums.
stylin:
11-26-2005, 12:12 AM
well 32001 works fine, but when it fills, it still flickers... but otehr then that it works
11-26-2005, 03:27 AM
The only way to really stop the flickering, is to use double beffering. You can make it less noticable, by adding a strategic Wait &H3DA,8 though. Have you considered using a library?
11-26-2005, 04:16 AM
Code: WAIT &H3DA, 8
11-26-2005, 07:37 AM
double buffering, well i fixed it, i simply put the PUT statement in rite before the x and y values are changed which un-draws the old img, then in the SUB where it draws it, then it draws it, and it doesnt have to change the background at all, so no more flickering, yay.
anyway, for future reference in case i need it, wat is this double buffering u speak of, i read a tutorial on it, but didnt quite understand, and the Code: WAIT &H3DA, 8 |
« Next Oldest | Next Newest »
|