'=========================================================================== ' Subject: BACK SWITCHING Date: 03-21-96 (21:23) ' Author: Earl L. Montgomery Code: QB, PDS ' Origin: FidoNet QUIK_BAS Echo Packet: GRAPHICS.ABC '=========================================================================== 'This program demonstrates how to use bank switching so that you 'can poke the entire 720X540X256 screen rather than use the slow 'ROM Bios interrupt SETPIXEL. This code will work with Video '7 graphic chips. If you do not have a video7 graphic chip but 'would like to run this demo. Please give me the name of your 'graphic card/chip and I should be able to furnish you with the 'correct code so it will run on your system. '$INCLUDE: 'qb.bi' DIM inreg AS RegType DIM outreg AS RegType DEFLNG A-Z inreg.ax = &H6F05 'inreg.bx = &H66: flag = 66: '640x400x256 'inreg.bx = &H67: flag = 67: '640x480x256 inreg.bx = &H68: flag = 68: '720x540x256 'inreg.bx = &H69:flag = 69: '800x600x256 CALL interrupt(&H10, inreg, outreg) DEF SEG = &HA000 FOR x = 0 TO 65535 POKE x, 4 NEXT bank1: OUT &H3C4, &HE8 OUT &H3C5, &H10 FOR x = 0 TO 65535 POKE x, 184 NEXT bank2: OUT &H3C4, &HE8 OUT &H3C5, &H20 FOR x = 0 TO 65535 POKE x, 4 NEXT bank3: OUT &H3C4, &HE8 OUT &H3C5, &H30 FOR x = 0 TO 65535 POKE x, 3 NEXT bank4: OUT &H3C4, &HE8 OUT &H3C5, &H40 FOR x = 0 TO 65535 POKE x, 143 NEXT IF flag = 66 OR flag = 67 THEN GOTO bank5notneeded bank5: OUT &H3C4, &HE8 OUT &H3C5, &H50 FOR x = 0 TO 65535 POKE x, 3 NEXT bank5notneeded: SLEEP (100) inreg.ax = &H3 CALL interrupt(&H10, inreg, outreg) CLS : END