Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use a PUT without a GET (graphics)

Status
Not open for further replies.

qboy

Programmer
Feb 16, 2005
2
HK
I want to put multiple pictures into arrays so that I can PUT them on the screen, but i don't want them to flash across the screen.
I am quite new to programing and open to other ways, as long as you explane them.
 
This tutorial will help you get started.

DEFINT A-Z
w = 16: h = 16 'width and height of sprite
SCREEN 13
'===================================================
'PUT without GET demo (NOGET.BAS) by Toshi
'released to the public domain on 7/14/2001
'===================================================

'Note: this ONLY WORKS FOR SCREEN 13!
'The internal structure of GET sprite arrays
'are different for screen 1-12
DIM sprite%(4 + w * h / 2)

'GET (0, 0)-(w - 1, h - 1), sprite%
'DEF SEG = VARSEG(sprite%(0))
'FOR i% = 0 TO 4
'PRINT PEEK(i%)
'NEXT
'DEF SEG
'END

DEF SEG = VARSEG(sprite%(0))
offset& = VARPTR(sprite%(0))
POKE offset& + 0, (w * 8) AND 255
POKE offset& + 1, (w * 8) \ 256
POKE offset& + 2, h AND 255
POKE offset& + 3, h \ 256
offset& = 5
FOR y = 0 TO h - 1
FOR x = 0 TO w - 1
READ pixelcolor%
POKE offset&, pixelcolor%
offset& = offset& + 1

NEXT
NEXT
PUT (0, 0), sprite%, PSET

DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,14,14,6,7,8,9,14,14,12,13,14,15
DATA 0,1,2,3,14,255,6,7,8,9,14,180,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,7,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,7,5,6,7,8,9,10,7,12,13,14,15
DATA 0,1,2,3,4,7,7,7,7,7,7,11,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 

Hello...

If i understand correctly what you want to achieve -- you're wanting to load and put the stuff without letting the user see it being done. Well, there's an easy way to do this -- turn off the screen while doing it, then when you've finished, turn it back on. It's a simple trick using OUT. Here it is...

'=========================================
OUT 966, 0 'hide screen

'...then set your screen up, get, put, etc...

OUT 966, 255 'show screen again.
'=========================================

It's a useful call for many things. I use it often. Hope this helps you.

- Dav
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top