GRAPHICS 52 (Reference Tables) öm2,2 öcINTERESTING MEMORY LOCATIONS Most of GRAPHICS 52's screen oriented commands use a "raster read" technique to make sure the screen is not being scanned. This technique works very well to eliminate any flickering on the screen. The only problem which may occur is that by using the "raster read", your program's execution time might be slowed down a bit. If you want your program to RUN at maximum speed, you can eliminate the "raster read" by POKEing 37540 (default value of 183) with the value of 96. If you have run out of room for your programmable characters and need (or wish) to use another 4K of memory for characters, you can use the memory 40960-45055 just like you have before. To do this only requires a few simple POKEs: POKE 39745, 8 :REM DEFAULT 12 POKE 39768, 160 :REM DEFAULT 176 POKE 51566, 160 :REM DEFAULT 176 POKE 51567, 168 :REM DEFAULT 184 The first POKE will make the 'SET' command (when used) enable the custom character set at 40960 instead of at 45056. The second POKE will make the 'SET C' command (when used) copy the normal characters set to 40960-45055. The third and fourth POKE statements will switch the pointers to character sets zero and one for the 'CPROG' command. If you need a few 16 bit counters (which are independent from your program), then you can use any one of the three timers which are used as a delay with the 'WAVE' command, as long as you are not using that voice. Timer locations: 51538, 51539 :Timer (or voice) 1 51540, 51541 :Timer (or voice) 2 51542, 51543 :Timer (or voice) 3 Just POKE the starting count in the proper location and it will immediately start counting from your number, down to zero. A decrement of sixty is approx. 1 second. NOTE: You may also want to PEEK these locations to see if a certain voice is on or off (zero=off). Now let us say you want the 'TRANSFER' or 'SWAP' commands to only work within a certain area of the screen. All you would have to do is, POKE the starting location of screen memory into 52071 and 52072 (LSB,MSB). Next you will have to POKE 52069 with the number of columns and POKE 52070 with the number of rows. EXAMPLE: To change the screen area so the start is 1 row down from the top, 20 columns wide, and 20 rows down, you would type: POKE 52071, 40 :REM DEFAULT ZERO POKE 52072, 132 :REM DEFAULT 132 POKE 52069, 20 :REM DEFAULT 40 POKE 52070, 19 :REM DEFAULT 24 As mentioned earlier, the color the screen, border, and cursor becomes when you press the äRUN/STOPå and äRESTOREå key at the same time, can be anything you want. Here are the location to be changed: POKE 51419, 0 :REM DEFAULT 10 POKE 51424, 1 :REM DEFAULT ZERO POKE 51435, 28 :REM DEFAULT 5 IN ASCII CODE �*cn1; GRAPHICS 52 DISK �*cn0 On the GRAPHICS 52 disk, there are a number of demonstration programs. There is also a simple game to show you how easy it is to design games with GRAPHICS 52. The name of the program is " TEST GAME". The object is to use a joystick in port 2 (closest to power plug) to move your creature at the bottom of the screen, to the top of the screen. To move up a row, push the joystick up and press the fire button. As you go up throw the maze, watch out for the other two creatures. If one of them touches you, you are dead. This program is not (by far) the fastest, except it is a lot easier to understand, debug, and is faster than possible from regular BASIC. There is also a program called " VIEWER", which allows you to view the image of the characters in ROM memory. This program is the same as the " 'BIT()' DEMO", except it uses the "↑" function to select the bits (of the bytes which make up the characters) instead of the BIT() function. When you RUN the " VIEWER" program, then LOAD and RUN the " 'BIT()' DEMO" program, you will notice a big difference in the speed at which the image is formed. öp öcCHARACTER SET TABLE Of the six character sets available, only four of them may be used for custom characters, and only two of them may be able to be used on the normal screen, and only one of the two may be used at a time. If you are using graphic screens one or three, you will ruin character sets zero and one. So, you should use the COPY command to place them somewhere in safe memory. If you use sets three or four, you will have to protect them from BASIC putting any variables there. This will reduce the amount of memory available for you to use, and should be one of the first things you do in your program. To do this, and the following line to your program. 10 POKE 52,111:POKE 56,111:POKE 51, 255:POKE 55,255:CLR Here is a list of where the character set are located, and the set number which are to be used with GRAPHICS 52's commands. SET # DEC. HEX. TYPE ---------------------------------------------------------------- 0 45056-47103 $B000-$B7FF custom set 1 47104-49151 $B800-$BFFF custom set 2 28672-30719 $7000-$78FF custom set 3 30720-32767 $7800-$7FFF custom set 4 53248-55295 $D000-$D7FF normal upper case 5 55296-57343 $D800-$DFFF upper and lower case ---------------------------------------------------------------- öcMEMORY MAP LOCATION DEFAULT DESCRIPTION ---------------------------------------------------------------- 37540 183 :Raster read enabled or disabled 39745 12 :Character set position for SET 39768 176 :SETC command vector 40957 0 :Replaced character 40958 0 :Replaced character's color 40958 0 :Copy of sprite to sprite reg. 40959 0 :Copy of sprite to background reg. 51419 10 :Reset border color (screen code) 51424 0 :Reset screen color (screen code) 51435 5 :Reset cursor color (ASCII code) 51538-51543 0 :Timers for the WAVE command 51566 176 :Character set zero pointer 51567 184 :Character set one pointer 52069 40 :TRANSFER and SWAP columns 52070 24 :TRANSFER and SWAP rows 52071 0 :TRANSFER and SWAP screen pointer 52072 132 :TRANSFER and SWAP screen pointer ---------------------------------------------------------------- öp öcABBREVIATIONS TABLE COMMAND ABBREVIATION COMMAND ABBREVIATION ---------------------------------------------------------------- 1) ADSR A äSHIFTå D : 27) PEN P äSHIFTå E 2) BIT( B äSHIFTå I : 28) PITCH P äSHIFTå I 3) BLOCK B äSHIFTå L : 29) PLACE PL äSHIFTå A 4) BOTTOM B äSHIFTå O : 30) PLOT P äSHIFTå L 5) BRD&BKG B äSHIFTå R : 31) POINT P äSHIFTå O 6) CHAR C äSHIFTå H : 32) PULSE P äSHIFTå U 7) CHRSV CH äSHIFTå R : 33) PUT N/A 8) CLEAR C äSHIFTå L : 34) SCREEN S äSHIFTå C 9) COLOR C äSHIFTå O : 35) SCRSV SCR äSHIFTå S 10) COPY CO äSHIFTå P : 36) SDP S äSHIFTå D 11) CPROG C äSHIFTå P : 37) SET S äSHIFTå E 12) DETECT D äSHIFTå E : 38) SHIFT S äSHIFTå H 13) DRAW D äSHIFTå R : 39) SHRINK SH äSHIFTå R 14) ERASE E äSHIFTå R : 40) SMOOTH SMO äSHIFTå O 15) EXPAND N/A : 41) SMOVE S äSHIFTå M 16) FLIP F äSHIFTå L : 42) SPRCL S äSHIFTå P 17) JOY( J äSHIFTå O : 43) SPRITE SPR äSHIFTå I 18) LOC( N/A : 44) SPROG SPR äSHIFTå P 19) LOCHR LO äSHIFTå C : 45) SPRSV SPR äSHIFTå S 20) LOMEM LO äSHIFTå M : 46) SWAP S äSHIFTå W 21) LOSCR LO äSHIFTå S : 47) SWITCH SW äSHIFTå I 22) LOSPR LOS äSHIFTå P : 48) TOGL T äSHIFTå O 23) MEMSV M äSHIFTå E : 49) TRANSFER T äSHIFTå R 24) MOVE M äSHIFTå O : 50) UNLESS U äSHIFTå N 25) MULTI M äSHIFTå U : 51) VOLUME V äSHIFTå O 26) PADL( P äSHIFTå A : 52) WAVE W äSHIFTå A ---------------------------------------------------------------- öcSCREEN MEMORY TABLE HEX. DEC. MODE ---------------------------------------------------------------- $8400 33792 : This is the normal, SCREEN 0. This : is the only memory which can be used : with PLACE, MOVE, UNLESS, AND LOC(). $8000 32768 : This is SCREEN 1 and 3, also used as : the alternate screen with the SWITCH : command. $C000 49152 : This is SCREEN 2 ---------------------------------------------------------------- öp öcREFERENCE TABLE COMMAND PURPOSE -------------------------------------------------------------- 1) ADSR : Set Attack/Decay/Sustain/Release. 2) BIT() : Returns the value of a bit position. 3) BLOCK : Change the color of one color block. 4) BOTTOM : Change coordinates of a graphic screen. 5) BRD&BKG : Set the border and background color. 6) CHAR : Place a character on a graphic screen. 7) CHRSV : SAVE custom characters to disk or cass. 8) CLEAR : Clear the graphic screen enabled. 9) COLOR : Set the color of all graphic screens. 10) COPY : Copy an area of memory (even under ROM). 11) CPROG : Convert the bit image of a character(s). 12) DETECT : Check for sprite collisions. 13) DRAW : Draw a line between two points. 14) ERASE : Erase points to be PLOTted or DRAWn. 15) EXPAND : Expand or contract certain sprites. 16) FLIP : Flip between the two hi-res. screens. 17) JOY() : Reads one of the joy sticks. 18) LOC() : PEEKs a location on the screen. 19) LOCHR : LOAD custom characters. 20) LOMEM : LOAD a section of memory. 21) LOSCR : LOAD a graphic screen. 22) LOSPR : LOAD a section of sprites. 23) MEMSV : SAVE a section of memory. 24) MOVE : Move a character on the screen. 25) MULTI : Set the screen in multi color mode. 26) PADL() : Reads one of the four paddles. 27) PEN : Selects the color to be PLOTted or DRAWn. 28) PITCH : Set the pitch of one voice. 29) PLACE : Places a character on the screen. 30) PLOT : Turn one pixel on. 31) POINT() : Checks the condition of one pixel. 32) PULSE : Set the pulse width for one voice. 33) PUT : Fills a section of memory with one value. 34) SCREEN : Selects the graphic screen desired. 35) SCRSV : SAVEs a graphic screen to disk. 36) SDP : Sets a Sprites Display Priority. 37) SET : Enable, disable, or copy a character set. 38) SHIFT : Scrolls a character's image to another. 39) SHRINK : Puts the screen in 24 row or 38 columns. 40) SMOOTH : Sets the smooth scroll registers. 41) SMOVE : Moves a sprite from one place to another. 42) SPRCL : Selects the colors of one sprite. 43) SPRITE : Enables or disables one sprite. 44) SPROG : Convert the bit image of a sprite. 45) SPRSV : SAVEs selected sprites to disk or cass. 46) SWAP : Swap one type of a character for another. 47) SWITCH : Switches screens for smooth scrolls. 48) TOGL : Toggles all pixels DRAWn or PLOTted. 49) TRANSFER : Puts a section of memory on the screen. 50) UNLESS : MOVE or PLACE under a certain condition. 51) VOLUME : Sets the volume or clears the SID chip. 52) WAVE : Enables a certain wave for one voice. -------------------------------------------------------------