256x256x256 Mode Q 256x256x256 Mode Q KenshinHimura (Programmer) (OP) 31 Mar 04 16:02 Does ne1 know how to get this in qbasic? RE: 256x256x256 Mode Q Barok (MIS) 1 Apr 04 01:12 no, i don't know. it's not possible in pure qb (i think) without some asm. (why'd you want 256x256x256 anyways?) RE: 256x256x256 Mode Q SJZero (TechnicalUser) 5 Apr 04 20:30 I've looked at the specs for ModeQ, and I'm almost positive I can get this running. Please give me a few days, and I will try to get some sample code running. Looks like it should run fast. :) RE: 256x256x256 Mode Q SJZero (TechnicalUser) 5 Apr 04 22:27 Yep, I think I have it. I just need to test it on another machine, and if that works, I'll post the code here for you to see. It's quite simple, since mode Q is a chained mode. RE: 256x256x256 Mode Q SJZero (TechnicalUser) 5 Apr 04 23:02 'SJ Zeros PureQB ModeQ graphics routines'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-ZDECLARE SUB setModeQ ()setModeQWHILE INKEY$ = "" c = INT(RND(1) * 255)FOR a = 0 TO 255 FOR b = 0 TO 255 putd a, b, c NEXT bNEXT aWENDdeinitSUB deinit ()CLSSCREEN 13: SCREEN 0: WIDTH 80ENDEND SUBSTATIC SUB putd (x, y, colr)POKE (x * 256&) + y, colrEND SUBDEFSNG A-ZSUB setModeQ ()DEF SEG = &HA000'begin with standard 320x200x256 modeSCREEN 13'to reprogram the CRT controller,'remove write protect from the registersOUT &H3D4, &H11: OUT &H3D5, INP(&H3D5) AND &H7FOUT &H3D4, &H0: OUT &H3D5, &H5F 'Hor. TotalOUT &H3D4, &H1: OUT &H3D5, &H3F 'Hor. Display enable endOUT &H3D4, &H2: OUT &H3D5, &H40 'blank startOUT &H3D4, &H3: OUT &H3D5, &H82 'blank endOUT &H3D4, &H4: OUT &H3D5, &H4E 'retrace startOUT &H3D4, &H5: OUT &H3D5, &H9A 'retrace endOUT &H3D4, &H6: OUT &H3D5, &H23 'vertical totalOUT &H3D4, &H7: OUT &H3D5, &HB2 'overflow registerOUT &H3D4, &H8: OUT &H3D5, &H0 'preset row scanOUT &H3D4, &H9: OUT &H3D5, &H61 'max scan line/char heightOUT &H3D4, &H10: OUT &H3D5, &HA 'vertical retrace startOUT &H3D4, &H11: OUT &H3D5, &HAC 'vertical retrace endOUT &H3D4, &H12: OUT &H3D5, &HFF 'vertical display enable endOUT &H3D4, &H13: OUT &H3D5, &H20 'offset/logical widthOUT &H3D4, &H14: OUT &H3D5, &H40 'underlinde locationOUT &H3D4, &H15: OUT &H3D5, &H7 'vertical blank startOUT &H3D4, &H16: OUT &H3D5, &H17 'vertical blank endOUT &H3D4, &H17: OUT &H3D5, &HA3 'mode controlOUT &H3C4, &H1: OUT &H3C5, &H1 'clock mode registerOUT &H3C4, &H4: OUT &H3C5, &HE 'memory mode registerOUT &H3CE, &H5: OUT &H3CF, &H40 'mode registerOUT &H3CE, &H6: OUT &H3CF, &H5 'misc. registerOUT &H3C0, &H10 + 32: OUT &H3C1, &H41 'mode control'reprotect the registersOUT &H3D4, &H11: OUT &H3D5, INP(&H3D5) OR &H80END SUB RE: 256x256x256 Mode Q KenshinHimura (Programmer) (OP) 7 Apr 04 00:22 You see I'm going to be writing an NES emulator and I heard this is the best Mode for one. Well, I searched everywhere trying to find specs on Mode Q and only found one place (that didn't explain it well). Thx SJZero, but I sort of wanted to write the whole routine and things myself and just get the info on how to initialize it here after all I don't just wanna rip your routine (since I truly want to understand the whole thing and if I take some1 elses code I wouldn't learn). Could you tell me where you find the info on it since I could barely find any. Thx RE: 256x256x256 Mode Q SJZero (TechnicalUser) 7 Apr 04 09:01 Unfortnately, the only thing I could find on modeQ myself was a poorly documented pascal program, which I based the init code on. Take what you see above, by all means. It's in the public domain for everyone to use now. :)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 Barok (MIS) 7 Apr 04 23:13 wow. really sj, you should write a tutorial on setting new screen modes (modex, etc. etc.) and how memory works. make it well and it could be a winner.