Jump to content
IGNORED

GET and PUT graphics


MrFish

Recommended Posts

Hi Everyone,

 

I needed some help in finding an old machine language subroutine, if possible. It was a listing in: Compute! Issue 91 - December 1987. The routine was very useful for manipulating playfield graphics in any mode. If anyone could help in getting a copy of the listing, or direct me to a suitable alternative, it would be much appreciated.

 

Thanks,

MrFish

Link to comment
Share on other sites

1000 REM D=USR(ADR(GP$)+GET,X,Y,WIDTH,LENGTH,BYTES PER ROW,ADR(IMAGE$))

1010 REM D=USR(ADR(GP$)+PUT,X,Y,WIDTH,LENGTH,BYTES PER ROW,ADR(IMAGE$),CMD)

1015 REM COPYRIGHT 1987 COMPUTE! PUBLICATIONS, INC.   ALL RIGHTS RESERVED

1020 DIM GP$(244):FOR I=1 TO 244:READ CODE:GP$(I,I)=CHR$(CODE):NEXT I:LET GET=0:LET PUT=0:RETURN

1021 DATA 104,56,233,6,133,227,104,133,215,104,133,214,104,133,217,104

1022 DATA 133,216,104,104,133,218,104,104,133,219,104,133,221,104,133,220

1023 DATA 104,133,223,104,133,222,165,227,201,0,240,4,104,104,133,224

1024 DATA 169,0,133,212,133,213,165,88,24,101,214,133,225,165,89,101

1025 DATA 215,133,226,162,0,228,216,240,32,165,225,24,101,220,133,225

1026 DATA 165,226,101,221,133,226,165,216,56,233,1,133,216,165,217,233

1027 DATA 0,133,217,169,0,201,0,240,220,228,217,240,6,169,0,201

1028 DATA 0,240,214,162,1,160,0,196,218,240,81,165,227,201,1,208

1029 DATA 55,165,224,201,1,208,22,177,222,201,0,240,10,177,225,201

1030 DATA 0,240,4,169,1,133,212,177,222,201,0,240,20,165,224,201

1031 DATA 1,240,10,177,225,201,0,240,4,169,1,133,212,177,222,145

1032 DATA 225,200,169,0,201,0,240,191,177,225,201,0,240,6,169,1

1033 DATA 133,212,177,225,145,222,169,0,201,0,240,229,228,219,240,35

1034 DATA 160,0,165,222,24,101,218,133,222,165,223,105,0,133,223,165

1035 DATA 225,24,101,220,133,225,165,226,101,221,133,226,232,169,0,201

1036 DATA 0,240,191,96

 

 

Notes:

The variables GET and PUT (holding the starting location for each operation) are really the same, they are initialized at zero...but are included in USR commands so that you can see at a glance which operation is being done when debugging.

 

X=the horizontal byte offset from the left border of the object you wish to GET or PUT. For GTIA graphics modes, divide the number of pixels by 2 (2 pixels per byte)...4-color modes divide by 4, and single color mode divide by 8.

 

Y=vertical starting pixel from the top border

 

WIDTH=the width in bytes of the image to GET or PUT. The number of pixels divided by how many fit in a byte (described above).

 

LENGTH=the vertical size in pixels

 

BYTES PER ROW=the number of bytes per scanline for the corresponding graphics mode...

 

GR.0 = 40

GR.1 = 20

GR.2 = 20

GR.3 = 10

GR.4 = 10

GR.5 = 20

GR.6 = 20

GR.7 = 40

GR.8 = 40

GR.9 = 40

GR.10 = 40

GR.11 = 40

GR.12 = 40

GR.13 = 40

GR.14 = 20

GR.15 = 40

 

ADR(IMAGE$)=the buffer area to hold the object data that is being moved. It should be DIMensioned as the maximum WIDTH x LENGTH you will be using.

 

CMD=Used only for PUT commands. When 0, the image placed will overwrite any previous data. When 1, existing data will be allowed to show through any "holes" in the picture (i.e. pasting w/transparancy).

 

 

The value returned by a USR/GET will be 0 if no pixels existed from the area, 1 if there were. When performing USR/PUT, this value will be 1 if there was already pixels in the area where you placed the buffer image to.

 

 

The program is under a page of space and totally relocatable (which means that Page 6 would probably be a good candidate to store the routine if your program does any multiloading). Otherwise, you can just GOSUB 1020 to initialize the routine and place it into the string GP$.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...