PEEK/POKE Video buffer
#2
PEEK/POKE emulate the old DOS/QBasic system so I'd expect it to work with SCREEN 0.

With the newer screen modes you probably need to investigate _MEM and _MEMIMAGE usage. I'm just starting to play with mem commands myself, but here's what I came up with. It seems to be doing what you're trying, plus it's safer, memory wise.


Code: (Select All)
SCREEN _NEWIMAGE(80, 25, 0)
'DEF SEG = &HB800
DIM m AS _MEM
m = _MEMIMAGE(0)
DO
    FOR a = 0 TO 3996 STEP 4
        x = INT(RND * 2) + 48
        y = ((INT(RND * 2)) * 8) + 2
        'POKE a, x
        _MEMPUT m, m.OFFSET + a, x AS INTEGER
        'POKE a + 1, y
        _MEMPUT m, m.OFFSET + a + 1, y AS INTEGER
    NEXT
LOOP UNTIL INKEY$ <> ""
_MEMFREE m
SYSTEM


Oops, changed that STEP back to 4 for the spacing.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply


Messages In This Thread
PEEK/POKE Video buffer - by BDS107 - 08-25-2022, 09:31 AM
RE: PEEK/POKE Video buffer - by OldMoses - 08-25-2022, 11:09 AM
RE: PEEK/POKE Video buffer - by SMcNeill - 08-25-2022, 11:19 AM
RE: PEEK/POKE Video buffer - by OldMoses - 08-25-2022, 11:24 AM
RE: PEEK/POKE Video buffer - by BDS107 - 08-25-2022, 11:50 AM
RE: PEEK/POKE Video buffer - by OldMoses - 08-25-2022, 12:34 PM
RE: PEEK/POKE Video buffer - by SMcNeill - 08-25-2022, 11:59 AM
RE: PEEK/POKE Video buffer - by BDS107 - 08-25-2022, 12:05 PM



Users browsing this thread: 5 Guest(s)