16 color cga mode 2/2

 BBS: Inland Empire Archive
Date: 04-10-93 (02:18)             Number: 158
From: MATT PRITCHARD @ 930/21      Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: 16 color cga mode     2/2      Conf: (1) 80xxx

>>> Continued from previous message b! = dy / dx ELSE b! = 0 END IF m! = y1 - x1 * b! FOR y = y1 TO y2 IF b! <> 0 THEN x = INT((y - m!) / b!) + .5 ELSE x = x1 END IF DrawDot x, y, DrawColor NEXT y END IF END SUB SUB ExitMode DEF SEG SCREEN 0, 0, 0 WIDTH 80 END SUB DEFINT A-Z SUB GetInput Quit = 0: BackG = 0: CurrentMode = 1 WHILE Quit = 0 DO: a$ = INKEY$: LOOP UNTIL a$ <> "" SELECT CASE a$ CASE "=", "+" IF BackG < 255 THEN BackG = BackG + 1 ELSE SOUND 1000, .1 ClearScreen CurrentMode, BackG, 1 CASE "-" IF BackG > 0 THEN BackG = BackG - 1 ELSE SOUND 1000, .1 ClearScreen CurrentMode, BackG, 1 CASE "L", "l" x1 = INT(79 * RND) y1 = INT(99 * RND) x2 = INT(79 * RND) y2 = INT(99 * RND) DrawColor = (255 * RND) DrawLine x1, y1, x2, y2, DrawColor CASE "M", "m" IF CurrentMode <> 0 THEN CurrentMode = 0 ELSE CurrentMode = 1 ClearScreen CurrentMode, 0, 0 CASE "Q", "q" Quit = 1 END SELECT a$ = "" 'clear a$ variable for more input WEND END SUB SUB Pause WHILE INKEY$ = "": WEND END SUB SUB ScreenMode160 (Mode%) WIDTH 80 ' 80 COLUMN MODE SCREEN 0, 1, 0, 0 ' COLOR MODE OUT &H3D8, 9 ' DISABLES BLINK BIT DEF SEG = &HB800 ' COLOR DISPLAY AREA FOR I = 0 TO 80 * 100 * 2 STEP 2 ' FILL "SCREEN" POKE I, 222 ' HALF AND HALF CHAR POKE I + 1, 0 ' BLACK ON BLACK NEXT I OUT &H3D4, 4 ' R4 SELECTED OUT &H3D5, 124 ' R4 VERTICAL TOTAL OUT &H3D4, 6 ' R6 SELECTED OUT &H3D5, 100 ' R6 VERTICAL DISPLAYED OUT &H3D4, 7 ' R7 SELECTED OUT &H3D5, 112 ' R7 VERTICAL SYNC OUT &H3D4, 9 ' R9 SELECTED OUT &H3D5, 1 ' R9 SCAN LINES (2) IF Mode% <> 0 THEN ClearScreen 1, 0, 0 END SUB SUB ClearScreen (Mode%, DrawColor%, NoClear%) 'check for out of bounds IF DrawColor < 0 OR DrawColor > 255 THEN SOUND 1000, .1: EXIT SUB 'check for box or fuzz mode IF Mode% <> 0 THEN 'clear screen: &HB1 = 177, DrawColor = 'Background Color' FOR CHAR = 0 TO 15998 STEP 2: POKE CHAR, &HB1: NEXT IF NoClear% <> 0 THEN FOR ATTR = 1 TO 16000 STEP 2: POKE ATTR, DrawColor: NEXT END IF ELSE 'black screen: FOR I = 0 TO 80 * 100 * 2 STEP 2 ' fill the "screen" POKE I, &HDE ' decimal for &HDE=222 IF NoClear% <> 0 THEN POKE I + 1, DrawColor ' color black on black END IF NEXT I END IF END SUB ------------------------ That's it -Matt Pritchard === * SLMR 2.1a * Yesterday I got so old --- InterPCB 1.50 # Origin: CENTRAL BBS -Texas' BEST BBS! 214-393-7090 HST 3+GIGs (8:930/21) * Origin: Gateway System to/from RBBS-NET (RBBS-PC 1:10/8)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET