'=========================================================================== ' Subject: WEIRD COLOR MIXING Date: 09-15-98 (00:10) ' Author: Andrew S. Gibson Code: QB, PDS ' Origin: zapf_dingbat@juno.com Packet: GRAPHICS.ABC '=========================================================================== ' This is what happens when I get weird... Experiments in mixing... !? ' Press escape to stop, You'll need QuickBASIC. It's funny too ! ' Most are mine...You can use them in messages.. 'Email / Zapf_DingBat@JUNO.COM DEFINT A-Z TYPE Regtype AX AS INTEGER BX AS INTEGER CX AS INTEGER DX AS INTEGER BP AS INTEGER SI AS INTEGER DI AS INTEGER Flags AS INTEGER DS AS INTEGER ES AS INTEGER END TYPE DECLARE FUNCTION Monitor% (VSSegment) DECLARE SUB ModeSet (ModeNum) DECLARE SUB STDOUT (MESSAGETEXT$) DECLARE SUB VgaPsycho (PlaneLen&) DIM SHARED Registers AS Regtype RANDOMIZE -TIMER Video = Monitor%(SSeg) SELECT CASE Video CASE IS < 4: STDOUT "Enhanced Graphics Adapter (EGA) is the least required adapter for Psycho." + CHR$(10) + CHR$(13): Ingraphics = 0: GOTO Terminate END SELECT SELECT CASE COMMAND$ CASE IS = "0X0D", "7", "320X200": ModeSet &HD: PlaneLength = 7959: Ingraphics = -1 CASE IS = "0X0E", "8", "640X200": ModeSet &HE: PlaneLength = 15919: Ingraphics = -1 CASE IS = "0X10", "9", "640X350": ModeSet &H10: PlaneLength = 28000: Ingraphics = -1 CASE IS = "0X12", "12", "640X480" IF Video = 4 THEN STDOUT "Video Gate Array adapter (VGA) ABSOLUTELY required for this mode." + CHR$(10) + CHR$(13): Ingraphics = 0: GOTO Terminate ModeSet &H12: VgaPsycho 38400: Ingraphics = -1: GOTO Terminate CASE ELSE STDOUT "Psycho Version 1.0 for EGA and VGA systems." + CHR$(10) + CHR$(10) + CHR$(13) STDOUT "Command line options are:" + CHR$(10) + CHR$(13) STDOUT " 7 or 320X200 (0x0D) - 320x200 Ega 16 color screen mode (Low Resolution)" + CHR$(10) + CHR$(13) STDOUT " 8 or 640X200 (0x0E) - 640x200 Ega 16 color screen mode (Medium Resolution)" + CHR$(10) + CHR$(13) STDOUT " 9 or 640X350 (0x10) - 640x350 Ega 16 color screen mode (High Resolution)" + CHR$(10) + CHR$(13) STDOUT "12 or 640X480 (0x12) - 640x480 Vga 16 color screen mode (Higher Resolution)" + CHR$(10) + CHR$(10) + CHR$(13) STDOUT "Press ESCape to exit Psycho." + CHR$(10) + CHR$(13): Ingraphics = 0: GOTO Terminate END SELECT 'main loop DO DEF SEG = &HA000 FOR ScrnSize = 0 TO PlaneLength OUT &H3C4, 2: OUT &H3C5, 15 OUT &H3C4, 2: OUT &H3C5, 1 'Plane 1: Blue POKE ScrnSize, INT(RND(1) * 255) OUT &H3C4, 2: OUT &H3C5, 2 'Plane 2: Green POKE ScrnSize, INT(RND(1) * 255) OUT &H3C4, 2: OUT &H3C5, 4 'Plane 3: Red POKE ScrnSize, INT(RND(1) * 255) OUT &H3C4, 2: OUT &H3C5, 8 'Plane 4: Color Intensity POKE ScrnSize, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : GOTO Terminate IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize DEF SEG DO Times = INT(RND(1) * 31) LOOP UNTIL Times <> 0 FOR Z = 0 TO Times DO XC = INT(RND(1) * 8) LOOP UNTIL XC <> 0 SELECT CASE XC CASE 1: GOSUB BluePlane CASE 2: GOSUB GreenPlane CASE 3: GOSUB RedPlane CASE 4: GOSUB IntensityMap CASE 5: DO: InvertRand = INT(RND(1) * 4): LOOP UNTIL InvertRand <> 0: GOSUB InvertPlane CASE 6: DO: NullRand = INT(RND(1) * 4): LOOP UNTIL NullRand <> 0: GOSUB NullPlane CASE 7: DO: PlaneOn = INT(RND(1) * 4): LOOP UNTIL PlaneOn <> 0: GOSUB FillPlane CASE 8: DO: XorRand = INT(RND(1) * 4): LOOP UNTIL XorRand <> 0: GOSUB XorPlane END SELECT NEXT Z LOOP Terminate: IF Ingraphics = -1 THEN ModeSet &H3: DO: Ecomment = INT(RND(1) * 66): LOOP UNTIL Ecomment <> 0 SELECT CASE Ecomment CASE 1: STDOUT "Hmmm ... Where did all those colors come from..." + CHR$(10) + CHR$(13) CASE 2: STDOUT "Got a headache now ?" + CHR$(10) + CHR$(13) CASE 3: STDOUT "Concept for a new Internet Conference: alt.EMM386.DIE.DIE.DIE" + CHR$(10) + CHR$(13) CASE 4: STDOUT "Altoids are *the* best mints to use for bad breath !" + CHR$(10) + CHR$(13) CASE 5: STDOUT "C is not a language but an encryption scheme..." + CHR$(10) + CHR$(13) CASE 6: STDOUT "Wow, you have a great case of eye strain !" + CHR$(10) + CHR$(13) CASE 7: STDOUT "One day Pyscho will be faster, I promise !" + CHR$(10) + CHR$(13) CASE 8: STDOUT "Right now, Buddhists are pondering the reason for Psycho's existance ! " + CHR$(10) + CHR$(13) CASE 9: STDOUT "Right now People are doing what you desire to do." + CHR$(10) + CHR$(13) CASE 10: STDOUT "...And You ask yourself, WHY did I download this thing !?..." + CHR$(10) + CHR$(13) CASE 11: STDOUT CHR$(34) + "Go away kid, Ya bother me." + CHR$(34) + " - W.C Fields" + CHR$(10) + CHR$(13) CASE 12: STDOUT CHR$(34) + "... And now for something completely different ..." + CHR$(34) + CHR$(10) + CHR$(13) CASE 13: STDOUT "Oh blast, another comment!" + CHR$(10) + CHR$(13) CASE 14: STDOUT "Right now, Lita Ford is awaiting the resurrection of '80s style Hard Rock." + CHR$(10) + CHR$(13) CASE 15: STDOUT "Right now, America Online is sending free diskettes to computerless people." + CHR$(10) + CHR$(13) CASE 16: STDOUT "Right now a guy named Seth is drinking his own urine, the sicko !" + CHR$(10) + CHR$(13) CASE 17: STDOUT "Hey, I got your DMA controller right here!" + CHR$(10) + CHR$(13) CASE 18: STDOUT CHR$(34) + "Hey!, It's a touchy situation !" + CHR$(34) + " - A. D. Clay" + CHR$(10) + CHR$(13) CASE 19: STDOUT "Bye!" + CHR$(10) + CHR$(13) CASE 20: STDOUT "I hope I don't crash something..." + CHR$(10) + CHR$(13) CASE 21: STDOUT "Are you doored to death ?" + CHR$(10) + CHR$(13) CASE 22: STDOUT "BARNEY: What happened when a person fed a smurf after midnight." + CHR$(10) + CHR$(13) CASE 23: STDOUT "Abort, Retry, Ignore, Plead for mercy?" + CHR$(10) + CHR$(13) CASE 24: STDOUT "Windows a virus with mouse support." + CHR$(10) + CHR$(13) CASE 25: STDOUT "DEJA VU ALert! : You may have read this before in a past life." + CHR$(10) + CHR$(13) CASE 26: STDOUT "Crass isn't it?" + CHR$(10) + CHR$(13) CASE 27: STDOUT CHR$(34) + "Drole!, Very Drole Willma." + CHR$(34) + " - F. Flintstone" + CHR$(10) + CHR$(13) CASE 28: STDOUT CHR$(34) + "Drole!, Very Drole Fred." + CHR$(34) + " - W. Flintstone" + CHR$(10) + CHR$(13) CASE 29: STDOUT "Today is international Spastic day !" + CHR$(10) + CHR$(13) CASE 30: STDOUT "Remember what old Jack Burton says..." + CHR$(10) + CHR$(13) + "No, what does he say ?" + CHR$(10) + CHR$(13) CASE 31 STDOUT "Oh where, oh where could Tao Ge be" + CHR$(10) + CHR$(13) STDOUT "we need a version of Exitilus bug free" + CHR$(10) + CHR$(13) STDOUT "Is Tao a citizen or immigrant nine hundred thousand and three ?" + CHR$(10) + CHR$(13) STDOUT "Oh where, oh where could Tao Ge be" + CHR$(10) + CHR$(13) CASE 32: STDOUT "... That dumb herky wouldn't let me in ..." + CHR$(10) + CHR$(13) CASE 33: STDOUT CHR$(34) + "One step closer and you'll be kissin my shalaly !" + CHR$(34) + " - some Scottish guy" + CHR$(10) + CHR$(13) CASE 34: STDOUT "Star Trek:TNG shows should be retrofitted with subtitles that define ambiguous terms." + CHR$(10) + CHR$(13) CASE 35: STDOUT "New! Vericose Veins from AgeTron, look like the man you always wanted to be, buy some today!" + CHR$(10) + CHR$(13) CASE 36: STDOUT "If anybody steps on my bunyon, I kill 'em !!!!!" + CHR$(10) + CHR$(13) CASE 37: STDOUT "OH NO, its its its.............King Boobus Tuber!" + CHR$(10) + CHR$(13) CASE 38: STDOUT "Have you been gnawing at my Chia Head again ?!?" + CHR$(10) + CHR$(13) CASE 39: STDOUT "Where do weirdos come from ?" + CHR$(10) + CHR$(13) CASE 40: STDOUT "Are you from Earth, too ???" + CHR$(10) + CHR$(13) CASE 41: STDOUT "Virus is outdated. Contact hacker for update (Y/N)?" + CHR$(10) + CHR$(13) CASE 42: STDOUT "Worm holes don't have anything to do with time travel." + CHR$(10) + CHR$(13) CASE 43: STDOUT CHR$(34) + "Daddy, what's " + CHR$(34) + "Real Mode" + CHR$(34) + " mean ?" + CHR$(34) + CHR$(10) + CHR$(13) CASE 44: STDOUT "Elvis Is a Jew, He was a member of the tribe LEVIS.." + CHR$(10) + CHR$(13) CASE 45: STDOUT "I crashed the last of the XT harddrives..." + CHR$(10) + CHR$(13) CASE 46: STDOUT "Seize Harddrive and use as an anchor !" + CHR$(10) + CHR$(13) CASE 47: STDOUT "NORTON: Patron saint of strangely named utilities." + CHR$(10) + CHR$(13) CASE 48: STDOUT "Care for some Crispy UART chips ?" + CHR$(10) + CHR$(13) CASE 49: STDOUT "Dead ants are the only ants I like :)" + CHR$(10) + CHR$(13) CASE 50: STDOUT "UNIX: Programmers without testes." + CHR$(10) + CHR$(13) CASE 51: STDOUT "They have made an HD that can hold my data |8*;" + CHR$(10) + CHR$(13) CASE 52: STDOUT CHR$(34) + "Like WOW ! Man !" + CHR$(34) + " - Shaggy (Scooby Doo)" + CHR$(10) + CHR$(13) CASE 53: STDOUT "ANSI Still LIVES !" + CHR$(10) + CHR$(13) CASE 54: STDOUT "WOW..." + CHR$(10) + CHR$(13) CASE 55: STDOUT "Can Monitors make Sparks ? ... Let's Find out !" + CHR$(10) + CHR$(13) CASE 56: STDOUT "Gorrest Fump, The antithesis of Forrest Gump !" + CHR$(10) + CHR$(13) CASE 57: STDOUT "Stupid comment count: number fifty-seven." + CHR$(10) + CHR$(13) CASE 58: STDOUT "Love may be blind, but LUST has 20/20 vision..." + CHR$(10) + CHR$(13) CASE 59: STDOUT "The IBM AT ate Apple computes for breakfast." + CHR$(10) + CHR$(13) CASE 60: STDOUT "Different names for Microsoft: Microslop, Macroslop, Macrosoft, Vaporsoft..." + CHR$(10) + CHR$(13) CASE 61: STDOUT "I have a huge mouth." + CHR$(10) + CHR$(13) CASE 62: STDOUT "Kilroy was here." + CHR$(10) + CHR$(13) CASE 63: STDOUT "Max Korn" + CHR$(10) + CHR$(13) CASE 64: STDOUT "Null was never here." + CHR$(10) + CHR$(13) CASE 65: STDOUT "Political Correctness, A STUPID self contradicting concept !" + CHR$(10) + CHR$(13) CASE 66: STDOUT "Some space for your thoughts:" + CHR$(10) + CHR$(13) + CHR$(10) + CHR$(13) + CHR$(10) + CHR$(13) + CHR$(10) + CHR$(13) CASE 67: STDOUT "This Sucks Ass! Man !!" + CHR$(10) + CHR$(13) CASE 68: STDOUT "AWW !! Sons-of-Bitches !!!" + CHR$(10) + CHR$(13) CASE 69: STDOUT "What's so civil about War anyway ?" + CHR$(10) + CHR$(13) CASE 70: STDOUT "OH MY GOD ! THEY KILLED KENNY !" + CHR$(10) + CHR$(13) END SELECT END IF END BluePlane: DEF SEG = &HA000 FOR ScrnSize = 0 TO PlaneLength OUT &H3C4, 2: OUT &H3C5, 1 'Plane 1: Blue POKE ScrnSize, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : GOTO Terminate IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize DEF SEG RETURN GreenPlane: DEF SEG = &HA000 FOR ScrnSize = 0 TO PlaneLength OUT &H3C4, 2: OUT &H3C5, 2 'Plane 2: Green POKE ScrnSize, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : GOTO Terminate IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize DEF SEG RETURN RedPlane: DEF SEG = &HA000 FOR ScrnSize = 0 TO PlaneLength OUT &H3C4, 2: OUT &H3C5, 4 'Plane 3: Red POKE ScrnSize, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : GOTO Terminate IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize DEF SEG RETURN IntensityMap: DEF SEG = &HA000 FOR ScrnSize = 0 TO PlaneLength OUT &H3C4, 2: OUT &H3C5, 8 'Plane 4: Color Intensity POKE ScrnSize, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : GOTO Terminate IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize DEF SEG RETURN InvertPlane: DEF SEG = &HA000 FOR ScrnSize = 0 TO PlaneLength SELECT CASE InvertRand CASE IS = 1: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 1: 'Plane 1: Blue CASE IS = 2: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 2: 'Plane 2: Green CASE IS = 3: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 4: 'Plane 3: Red CASE IS = 4: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 8: 'Plane 4: Color Intensity END SELECT GetByte = PEEK(ScrnSize) POKE ScrnSize, NOT GetByte AND 255 X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : GOTO Terminate IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize DEF SEG RETURN NullPlane: DEF SEG = &HA000 FOR ScrnSize = 0 TO PlaneLength SELECT CASE NullRand CASE IS = 1: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 1: 'Plane 1: Blue CASE IS = 2: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 2: 'Plane 2: Green CASE IS = 3: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 4: 'Plane 3: Red CASE IS = 4: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 8: 'Plane 4: Color Intensity END SELECT POKE ScrnSize, 0 X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : GOTO Terminate IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize DEF SEG RETURN FillPlane: DEF SEG = &HA000 FOR ScrnSize = 0 TO PlaneLength SELECT CASE PlaneOn CASE IS = 1: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 1: 'Plane 1: Blue CASE IS = 2: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 2: 'Plane 2: Green CASE IS = 3: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 4: 'Plane 3: Red CASE IS = 4: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 8: 'Plane 4: Color Intensity END SELECT POKE ScrnSize, 255 X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : GOTO Terminate IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize DEF SEG RETURN XorPlane: DEF SEG = &HA000 FOR ScrnSize = 0 TO PlaneLength SELECT CASE XorRand CASE IS = 1: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 1: 'Plane 1: Blue CASE IS = 2: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 2: 'Plane 2: Green CASE IS = 3: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 4: 'Plane 3: Red CASE IS = 4: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 8: 'Plane 4: Color Intensity END SELECT GetByte = PEEK(ScrnSize) XOR 255 POKE ScrnSize, GetByte X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : GOTO Terminate IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize DEF SEG RETURN SUB ModeSet (ModeNum) STATIC Registers.AX = ModeNum CALL InterruptX(&H10, Registers, Registers) END SUB FUNCTION Monitor% (VSSegment) STATIC DEF SEG = 0 'first see if it's color or mono VSSegment = &HB800 'assume color IF PEEK(&H463) = &HB4 THEN VSSegment = &HB000 'assign the monochrome segment Status = INP(&H3BA) 'get the current video status FOR X = 1 TO 30000 'test for a Hercules 30000 times IF INP(&H3BA) <> Status THEN Monitor% = 2 'the port changed, it's a Herc EXIT FUNCTION 'all done END IF NEXT Monitor% = 1 'it's a plain monochrome ELSE 'it's some sort of color monitor Registers.AX = &H1A00 'first test for VGA CALL InterruptX(&H10, Registers, Registers) IF (Registers.AX AND &HFF) = &H1A THEN Monitor% = 5 'it's a VGA EXIT FUNCTION 'all done END IF Registers.AX = &H1200 'now test for EGA Registers.BX = &H10 CALL InterruptX(&H10, Registers, Registers) IF (Registers.BX AND &HFF) = &H10 THEN Monitor% = 3 'if BL is still &H10 it's a CGA ELSE Monitor% = 4 'otherwise it's an EGA END IF END IF DEF SEG END FUNCTION SUB STDOUT (MESSAGETEXT$) STATIC Registers.AX = &H4000 Registers.BX = &H1 Registers.CX = LEN(MESSAGETEXT$) Registers.DS = VARSEG(MESSAGETEXT$) Registers.DX = SADD(MESSAGETEXT$) CALL InterruptX(&H21, Registers, Registers) END SUB SUB VgaPsycho (PlaneLen&) STATIC DO DEF SEG = &HA000 FOR ScrnSize& = 0 TO PlaneLen& OUT &H3C4, 2: OUT &H3C5, 15 OUT &H3C4, 2: OUT &H3C5, 1 'Plane 1: Blue POKE ScrnSize&, INT(RND(1) * 255) OUT &H3C4, 2: OUT &H3C5, 2 'Plane 2: Green POKE ScrnSize&, INT(RND(1) * 255) OUT &H3C4, 2: OUT &H3C5, 4 'Plane 3: Red POKE ScrnSize&, INT(RND(1) * 255) OUT &H3C4, 2: OUT &H3C5, 8 'Plane 4: Color Intensity POKE ScrnSize&, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : EXIT SUB IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize& DEF SEG DO Times = INT(RND(1) * 31) LOOP UNTIL Times <> 0 FOR Z = 0 TO Times DO XC = INT(RND(1) * 8) LOOP UNTIL XC <> 0 SELECT CASE XC CASE 1: GOSUB VGABluePlane CASE 2: GOSUB VGAGreenPlane CASE 3: GOSUB VGARedPlane CASE 4: GOSUB VGAIntensityMap CASE 5: DO: InvertRand = INT(RND(1) * 4): LOOP UNTIL InvertRand <> 0: GOSUB VGAInvertPlane CASE 6: DO: NullRand = INT(RND(1) * 4): LOOP UNTIL NullRand <> 0: GOSUB VGANullPlane CASE 7: DO: PlaneOn = INT(RND(1) * 4): LOOP UNTIL PlaneOn <> 0: GOSUB VGAFillPlane CASE 8: DO: XorRand = INT(RND(1) * 4): LOOP UNTIL XorRand <> 0: GOSUB VGAXorPlane END SELECT NEXT Z LOOP VGABluePlane: DEF SEG = &HA000 FOR ScrnSize& = 0 TO PlaneLen& OUT &H3C4, 2: OUT &H3C5, 1 'Plane 1: Blue POKE ScrnSize&, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : EXIT SUB IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize& DEF SEG RETURN VGAGreenPlane: DEF SEG = &HA000 FOR ScrnSize& = 0 TO PlaneLen& OUT &H3C4, 2: OUT &H3C5, 2 'Plane 2: Green POKE ScrnSize&, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : EXIT SUB IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize& DEF SEG RETURN VGARedPlane: DEF SEG = &HA000 FOR ScrnSize& = 0 TO PlaneLen& OUT &H3C4, 2: OUT &H3C5, 4 'Plane 3: Red POKE ScrnSize&, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : EXIT SUB IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize& DEF SEG RETURN VGAIntensityMap: DEF SEG = &HA000 FOR ScrnSize& = 0 TO PlaneLen& OUT &H3C4, 2: OUT &H3C5, 8 'Plane 4: Color Intensity POKE ScrnSize&, INT(RND(1) * 255) X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : EXIT SUB IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize& DEF SEG RETURN VGAInvertPlane: DEF SEG = &HA000 FOR ScrnSize& = 0 TO PlaneLen& SELECT CASE InvertRand CASE IS = 1: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 1: 'Plane 1: Blue CASE IS = 2: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 2: 'Plane 2: Green CASE IS = 3: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 4: 'Plane 3: Red CASE IS = 4: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 8: 'Plane 4: Color Intensity END SELECT GetByte = PEEK(ScrnSize&) POKE ScrnSize&, NOT GetByte AND 255 X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : EXIT SUB IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize& DEF SEG RETURN VGANullPlane: DEF SEG = &HA000 FOR ScrnSize& = 0 TO PlaneLen& SELECT CASE NullRand CASE IS = 1: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 1: 'Plane 1: Blue CASE IS = 2: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 2: 'Plane 2: Green CASE IS = 3: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 4: 'Plane 3: Red CASE IS = 4: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 8: 'Plane 4: Color Intensity END SELECT POKE ScrnSize&, 0 X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : EXIT SUB IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize& DEF SEG RETURN VGAFillPlane: DEF SEG = &HA000 FOR ScrnSize& = 0 TO PlaneLen& SELECT CASE PlaneOn CASE IS = 1: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 1: 'Plane 1: Blue CASE IS = 2: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 2: 'Plane 2: Green CASE IS = 3: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 4: 'Plane 3: Red CASE IS = 4: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 8: 'Plane 4: Color Intensity END SELECT POKE ScrnSize&, 255 X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : EXIT SUB IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize& DEF SEG RETURN VGAXorPlane: DEF SEG = &HA000 FOR ScrnSize& = 0 TO PlaneLen& SELECT CASE XorRand CASE IS = 1: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 1: 'Plane 1: Blue CASE IS = 2: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 2: 'Plane 2: Green CASE IS = 3: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 4: 'Plane 3: Red CASE IS = 4: OUT &H3C4, 2: OUT &H3C5, 15: OUT &H3C4, 2: OUT &H3C5, 8: 'Plane 4: Color Intensity END SELECT GetByte = PEEK(ScrnSize&) XOR 255 POKE ScrnSize&, GetByte X$ = INKEY$: IF X$ = CHR$(27) THEN DEF SEG : EXIT SUB IF X$ = "A" OR X$ = "a" THEN EXIT FOR NEXT ScrnSize& DEF SEG RETURN END SUB