640x480 + 256 colors without Palette???

Is it possible to have a resolution of 640x480 (like in SCREEN 12) with 265 colors (SCREEN 13) without using PALETTE???

Do I really must use PEEK and POKE? And if there is no other solution, how can I use it?

If you know the solution, please send me an example.




Comments

  • start qb this way: QB /L




    ----------------------------

    '$INCLUDE: 'QB.BI'


    DIM SHARED regs AS RegType


    SUB setmode (mode)


    regs.ax = &H4F02

    regs.bx = mode

    Interrupt &H10, regs, regs


    END SUB

    ----------------------------


    now you can set any VESA ( SVGA ) mode .. try this:


    setmode &H105


    it will set 1024x768 with 256 colors


    here's a table of SVGA modes:


    GRAPHICS TEXT


    15-bit 7-bit Resolution Colors 15-bit 7-bit Columns Rows

    mode mode mode mode

    number number number number

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    100h - 640x400 256 108h - 80 60

    101h - 640x480 256

    109h - 132 25

    102h 6Ah 800x600 16 10Ah - 132 43

    103h - 800x600 256 10Bh - 132 50

    10Ch - 132 60

    104h - 1024x768 16

    105h - 1024x768 256


    106h - 1280x1024 16

    107h - 1280x1024 256



    VESA Super VGA Standard VS911022-8


    10Dh - 320x200 32K (1:5:5:5)

    10Eh - 320x200 64K (5:6:5)

    10Fh - 320x200 16.8M (8:8:8)

    110h - 640x480 32K (1:5:5:5)

    111h - 640x480 64K (5:6:5)

    112h - 640x480 16.8M (8:8:8)

    113h - 800x600 32K (1:5:5:5)

    114h - 800x600 64K (5:6:5)

    115h - 800x600 16.8M (8:8:8)

    116h - 1024x768 32K (1:5:5:5)

    117h - 1024x768 64K (5:6:5)

    118h - 1024x768 16.8M (8:8:8)

    119h - 1280x1024 32K (1:5:5:5)

    11Ah - 1280x1024 64K (5:6:5)

    11Bh - 1280x1024 16.8M (8:8:8)


  • sorry, the lines were too long..


    test modes are only these:


    108h 80x60

    109h 132x25

    10Ah 132x43

    10Bh 132x50

    10Ch 132x60




  • This is really very interesting.

    Only one question:

    How can i draw in e.g. 256 Colors when I've set the screen to &H101 ??


    I tried:

    LINE (0,0)-(100,100),231,BF


    But that doesn't work really...

    How can I do it??


  • : This is really very interesting.

    : Only one question:

    : How can i draw in e.g. 256 Colors when I've set the screen to &H101 ??


    : I tried:

    : LINE (0,0)-(100,100),231,BF


    : But that doesn't work really...

    : How can I do it??




    This should poke in a 256 colour pixel in any resolution:


    offset& = y * xRes& + x

    newBank = offset& / &h10000

    offset& = offset& - &h10000 * newBank


    if bank newBank then

    bank = newBank

    regs.ax = &h4f05

    regs.bx = 0

    regs.dx = gran * bank

    call interrupt(&h10, regs, regs)

    end if


    def seg = &ha000

    poke offset&, colour




    where:

    y = y position

    x = x position

    xRes& = number of pixels across the screen (640&)

    bank = current bank

    gran = the granularity of your screen. Try either 16 or 1 in place of this number. This number can also be found using the setSVGA mode interrupt, but it's very long and i'm tired of typing. If you need more help with it post another message, or mail me.


    This should work. Make sure you open QB with the /L switch and that you set up a regester type. Look in the help files under call interrupt or call interruptx for the type, it will look something like this:


    type regType

    ax as integer

    bx as integer

    cx as integer

    ...

    end type


    dim shared regs as regtype







  • this is too slow.. because he's switching banks all the time

    using interrupts.. interrupts stop the current cpu

    work to call the interrupt..


    you have to make a table of the points position

    you are going to draw.. and switch bank the less

    possible..




    other way.. is using 32bit mode.. but not in quickbasic.. ;)


  • I don't know of any faster way to do it: The bank is only switched when you absolutely have to, and I don't think you can make a table of points because the whole reason for bank switching is because you can't access all of the video memory at one time. If you have, however coded something using a points table, i'd be glad if you'd explain it to me.


  • : I don't know of any faster way to do it: The bank is only switched when you absolutely have to, and I don't think you can make a table of points because the whole reason for bank switching is because you can't access all of the video memory at one time. If you have, however coded something using a points table, i'd be glad if you'd explain it to me.


    You can use the assembly command INT to access

    the video memory... but it's a lot

    of work explaining that... (Thousands of books

    about ASM exist... Go get them..)


    I do not know why you are not using Palette

    (good as it is)....








Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories