256x256x256 Mode Q
256x256x256 Mode Q
(OP)
Does ne1 know how to get this in qbasic?
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS Contact USThanks. We have received your request and will respond promptly. Come Join Us!Are you a
Computer / IT professional? Join Tek-Tips Forums!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines |
|
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
Register now while it's still free!
Already a member? Close this window and log in.
RE: 256x256x256 Mode Q
RE: 256x256x256 Mode Q
RE: 256x256x256 Mode Q
RE: 256x256x256 Mode Q
'This is just a very simple batch of routines I
'slapped together to show that ModeQ can be done
'in PureQB. To use them, set the video mode using
'setModeQ, put dots on the screen using putd(x,y,colour)
'exit the program at the end using deinit, or you'll
'be stuck in modeQ.
'I left out a PUT compatible statement and text stuff
'but if there's demand I'll release a new one later.
'Trust me when I say, it's an easy piece of code to
'write.
DECLARE SUB deinit ()
DECLARE SUB putd (x%, y%, colr%)
DEFINT A-Z
DECLARE SUB setModeQ ()
setModeQ
WHILE INKEY$ = ""
c = INT(RND(1) * 255)
FOR a = 0 TO 255
FOR b = 0 TO 255
putd a, b, c
NEXT b
NEXT a
WEND
deinit
SUB deinit ()
CLS
SCREEN 13: SCREEN 0: WIDTH 80
END
END SUB
STATIC SUB putd (x, y, colr)
POKE (x * 256&) + y, colr
END SUB
DEFSNG A-Z
SUB setModeQ ()
DEF SEG = &HA000
'begin with standard 320x200x256 mode
SCREEN 13
'to reprogram the CRT controller,
'remove write protect from the registers
OUT &H3D4, &H11: OUT &H3D5, INP(&H3D5) AND &H7F
OUT &H3D4, &H0: OUT &H3D5, &H5F 'Hor. Total
OUT &H3D4, &H1: OUT &H3D5, &H3F 'Hor. Display enable end
OUT &H3D4, &H2: OUT &H3D5, &H40 'blank start
OUT &H3D4, &H3: OUT &H3D5, &H82 'blank end
OUT &H3D4, &H4: OUT &H3D5, &H4E 'retrace start
OUT &H3D4, &H5: OUT &H3D5, &H9A 'retrace end
OUT &H3D4, &H6: OUT &H3D5, &H23 'vertical total
OUT &H3D4, &H7: OUT &H3D5, &HB2 'overflow register
OUT &H3D4, &H8: OUT &H3D5, &H0 'preset row scan
OUT &H3D4, &H9: OUT &H3D5, &H61 'max scan line/char height
OUT &H3D4, &H10: OUT &H3D5, &HA 'vertical retrace start
OUT &H3D4, &H11: OUT &H3D5, &HAC 'vertical retrace end
OUT &H3D4, &H12: OUT &H3D5, &HFF 'vertical display enable end
OUT &H3D4, &H13: OUT &H3D5, &H20 'offset/logical width
OUT &H3D4, &H14: OUT &H3D5, &H40 'underlinde location
OUT &H3D4, &H15: OUT &H3D5, &H7 'vertical blank start
OUT &H3D4, &H16: OUT &H3D5, &H17 'vertical blank end
OUT &H3D4, &H17: OUT &H3D5, &HA3 'mode control
OUT &H3C4, &H1: OUT &H3C5, &H1 'clock mode register
OUT &H3C4, &H4: OUT &H3C5, &HE 'memory mode register
OUT &H3CE, &H5: OUT &H3CF, &H40 'mode register
OUT &H3CE, &H6: OUT &H3CF, &H5 'misc. register
OUT &H3C0, &H10 + 32: OUT &H3C1, &H41 'mode control
'reprotect the registers
OUT &H3D4, &H11: OUT &H3D5, INP(&H3D5) OR &H80
END SUB
RE: 256x256x256 Mode Q
RE: 256x256x256 Mode Q
If you're interested in how to plot a pixel, my putd statement covers it pretty simply: memory location(past 0xa000, which the setModeQ command sets with the DEF SEG, along with setting up the video mode) = x * 256 + y. It's so simple because it's a chained mode, meaning the video memory is set up so you can just write the colour of the pixel in, unlike ModeX, where you have to switch planes around.
RE: 256x256x256 Mode Q