05-19-2003, 01:26 PM
Sorry for the double posting I got messed up by the quote system...
When I started working on the SVGA modes, I had to solve a issue, which I actually solved.
It's about the adapted Pset for SVGA 24/32 bits modes. When you try to fill in a screen by a double x,y loop, there is an overflow on the poke after a given number of pixels.
(The following pieces of codes are more pseudo-code than real QB code).
1) The prog which did not work:
2) The prog that works:
In the two progs, SwitchBank is:
First Question : Toonski, can you tell me how you came to this 57k figure ? Can you give the details of your rational ?
Second Question : the prog which does not work on my machine seems to work on other configurations. WHY ? Is that related to the VESA 2 standard, that allows direct linear pixel addressing ?
When I started working on the SVGA modes, I had to solve a issue, which I actually solved.
It's about the adapted Pset for SVGA 24/32 bits modes. When you try to fill in a screen by a double x,y loop, there is an overflow on the poke after a given number of pixels.
(The following pieces of codes are more pseudo-code than real QB code).
1) The prog which did not work:
Code:
Offset& = (ScreenWidth * y% + x%) * Bpp
SwitchBank
Offset& = Offset& + 0 : POKE Offset& , Blue%
Offset& = Offset& + 1 : POKE Offset& , Green%
Offset& = Offset& + 1 : POKE Offset& , Red%
2) The prog that works:
Code:
Offset& = (ScreenWidth * y% + x%) * Bpp
Bank& = INT(Offset& / 65536)
Offset& = Offset& - Bank& * 65536
SwitchBank
POKE Offset& , Blue%
Offset& = Offset& + 1
Bank& = INT(Offset& / 65536)
Offset& = Offset& - Bank& * 65536
SwitchBank
POKE Offset& , Green%
Offset& = Offset& + 1
Bank& = INT(Offset& / 65536)
Offset& = Offset& - Bank& * 65536
SwitchBank
POKE Offset& , Red%
In the two progs, SwitchBank is:
Code:
SUB SwitchBank
IF Bank& <> CurBank& THEN
CurBank& = Bank&
Regs.ax = &H4F05
Regs.bx = 0
Regs.dx = Bank&
CALL INTERRUPT(&H10, Regs, Regs)
END IF
END SUB
First Question : Toonski, can you tell me how you came to this 57k figure ? Can you give the details of your rational ?
Quote:yeah, your bank size was too 1 byte big, but in your former code it still would've only come out to a little less than 57k. funky.
Second Question : the prog which does not work on my machine seems to work on other configurations. WHY ? Is that related to the VESA 2 standard, that allows direct linear pixel addressing ?
hink Global, Make Symp' All ! ®