320x400

 BBS: Inland Empire Archive
Date: 04-15-93 (23:44)             Number: 377
From: EARL MONTGOMERY              Refer#: NONE
  To: FRED DISANO                   Recvd: NO  
Subj: 320x400                        Conf: (2) Quik_Bas
'Fred, sometimes an example is better than a long windy explanation.
'Here is an example of setting a pixel in 320*400*256.
'Noticed whenever I move right or left I have to address each
'plane but if I move up or down I don't. I'm sure you see why.
'Use the arrow keys to move Right-Left-Up-Down.
'Let me know how you went about getting two pages.
'The reason I ask about the second page, is that if you managed
'to do that then in affect you have your virtual screen. Right?
'What do you plan on using the virtual screen for? Pans and
'scrolls? If so, it might be too slow unless you used ASM lang.
'I'm not well enough versed in ASM to help you in that area.
'Hope this helps. Earl
'P.S. Press <C> to change colors!
DEFINT A-Z
setmode:
SCREEN 13
OUT &H3D4, 9
OUT &H3D5, &H40
OUT &H3D4, 20
OUT &H3D5, 0
OUT &H3D4, 23
OUT &H3D5, &HE3
OUT &H3C4, 4
OUT &H3C5, &H6
DEF SEG = &HA000
OUT &H3C4, 2: OUT &H3C5, 15: CLS 'rem this clears (CLS) all 4 planes
DEF SEG = &HA000
OUT &H3C4, 2: OUT &H3C5, 1
begin:
hv = 15318: c = 15: plane = 1: OUT &H3C4, 2: OUT &H3C5, 1
POKE hv, c
waitkey1:
i$ = INKEY$: IF i$ = "" THEN GOTO waitkey1
keycode% = CVI(i$ + CHR$(0))
IF keycode% = 19712 THEN GOTO moveright
IF keycode% = 19200 THEN GOTO moveleft
IF keycode% = 18432 THEN GOTO moveup
IF keycode% = 20480 THEN GOTO movedown
IF i$ = "c" OR i$ = "C" THEN GOTO changecolor
GOTO waitkey1
moveright:
IF hv > 31999 THEN hv = 31999
IF plane = 1 THEN OUT &H3C4, 2: OUT &H3C5, 2: plane = 2: GOTO doit
IF plane = 2 THEN OUT &H3C4, 2: OUT &H3C5, 4: plane = 4: GOTO doit
IF plane = 4 THEN OUT &H3C4, 2: OUT &H3C5, 8: plane = 8: GOTO doit
IF plane = 8 THEN OUT &H3C4, 2: OUT &H3C5, 1: plane = 1: hv
= hv + 1: GOTO doit
moveleft:
IF hv < 0 THEN hv = 0
IF plane = 1 THEN OUT &H3C4, 2: OUT &H3C5, 8: plane = 8: hv
= hv - 1: GOTO doit
IF plane = 2 THEN OUT &H3C4, 2: OUT &H3C5, 1: plane = 1: GOTO doit
IF plane = 4 THEN OUT &H3C4, 2: OUT &H3C5, 2: plane = 2: GOTO doit
IF plane = 8 THEN OUT &H3C4, 2: OUT &H3C5, 4: plane = 4: GOTO doit
doit:
POKE hv, c
GOTO waitkey1
moveup:
hv = hv - 80
IF hv < 0 THEN hv = hv + 80
POKE hv, c
GOTO waitkey1
movedown:
hv = hv + 80
IF hv > 32000 THEN hv = hv - 80
POKE hv, c
GOTO waitkey1
changecolor:
c = c + 1
IF c > 255 THEN c = 0
POKE hv, c
GOTO waitkey1
'P.S. I noticed a couple of those GOTO DOIT need to be placed back
'where they belong.

--- Maximus 2.01wb
 * Origin: Verbose Ink * Dallas * 214-437-0914 * V32b/HST (1:124/5125)
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