Graphics ------------------------------------------------------------------ 1-601 Function Name: GraphicsString Purpose: Process several graphics commands designated by a table. Call address: $C136 Input requirements: $02-$03 R0 Pointer to the table of commands. Description: This routine executes the graphic commands present in a table. This routine is used by PutChar (Control-P),PutString (By calling PutChar), and DoDlgBox (Command 15). The following table describes the available commands. Graphic Command Table Command #Bytes Description $00 1 Stop, end of table. $01 4 MOVEPENTO: Set column and row variables. .word COLUMN .byte ROW $02 4 LINETO: Draw a line. .word DESTCOLUMN .byte DESTROW $03 4 RECTAGLETO: Pattern fill a region. .word BOTRIGHTCOLUMN .byte BOTRIGHTROW $04 1 No operation. $05 2 NEWPATTERN: Set fill pattern. $06 4+ ESC_PUTSTRING: Set position and display text. MUST BE last command because the zero byte that ends the text also ends this command table. .word COLUMN .byte ROW .byte "Hello World!",0 $07 4 FRAME_RECTO: Draw a solid lined box. .word BOTRIGHTCOLUMN .byte BOTRIGHTROW $08 3 PEN_X_DELTA: Add an offset to column variable. .word COLUMNOFFSET $09 2 PEN_Y_DELTA: Add an offset to row variable. .byte ROWOFFSET $0A 4 Add offsets to both column and row variables. .word COLUMNOFFSET .byte ROWOFFSET Command 1 is used to set the column and row variables used by all of the other commands which require two points. The format of the commands is that all of the necessary data follows the command byte. For example, the commands to erase the entire screen would look like this: .byte $05,$00 .byte $01 .word 0 .byte 0 .byte $03 .word 320 .byte 199 .byte $00 In the case of command 6, after the column and row bytes in the command comes the text that is to be displayed. For example: .byte $06 .word 50 .byte 50 .byte 'Hello world!' .byte $00 1-602 Function Name: i_GraphicsString Purpose: Identical to GraphicsString, but with inline data. Call address: $C1A8 Description: This routine takes an inline data table, creates a pointer to it, then calls GraphicsString to process it. See i_Rectangle for an example of inline data tables. 1-603 Function Name: SetPattern Purpose: Sets the current fill pattern. Call address: $C139 Input requirements: A The pattern number (0-31). Description: This routine sets the fill pattern used by Rectangle, i_Rectangle. 1-604 Function Name: FrameRectangle Purpose: Draws the outline of a rectangular box in a given pattern. Call address: $C127 Input requirements: A The actual bit pattern for the box. $06 R2L The top margin. $07 R2H The bottom margin. $08-$09 R3 The left margin. $0A-$0B R4 The right margin. Description: This routine draws the outline of a rectangular box in a given pattern. This routine calls HorizontalLine and VerticalLine to draw the outline. See also GetScanLine. 1-605 Function Name: i_FrameRectangle Purpose: Identical to FrameRectangle, but with inline data. Call address: $C1A2 Description: This routine draws a solid outline of a box, which is described by inline code. See i_Rectangle for an example. 1-606 Function Name: Rectangle Purpose: Fills a rectangular box with a selected design. Call address: $C124 Input requirements: $06 R2L The top margin. $07 R2H The bottom margin. $08-$09 R3 The left margin. $0A-$0B R4 The right margin. Preparatory routines: SetPattern Description: This routine fills a rectangular box in a given design. This routine calls HorizontalLine repeatedly. See also GetScanLine. 1-607 Function Name: i_Rectangle Purpose: Identical to Rectangle, but with inline data. Call address: $C19F Preparatory routines: SetPattern Description: This routine is identical to Rectangle except that data that describes the box is part of the inline code. For example: JSR i_Rectangle .byte Top margin .byte Bottom margin .word Left margin .word Right margin Control returns here after box is filled. 1-608 Function Name: RecoverRectangle Purpose: Copies a box from screen 2 to screen 1. Call address: $C12D Input requirements: $06 R2L The top margin. $07 R2H The bottom margin. $08-$09 R3 The left margin. $0A-$0B R4 The right margin. Description: This routine copies a box from screen 2 ($6000) to screen 1 ($A000). Location $2F is unaffected. This routine calls RecoverLine repeatedly to copy each line of the box. 1-609 Function Name: i_RecoverRectangle Purpose: Identical to RecoverRectangle, but with inline data. Call address: $C1A5 Description: This routine copies a box from screen 2 ($6000) to screen 1 ($A000). The box descriptor is inline with the calling code. See i_Rectangle for an example. 1-610 Function Name: ImprintRectangle Purpose: Copies a box from screen 2 to screen 1. Call address: $C250 Input requirements: $06 R2L The top margin. $07 R2H The bottom margin. $08-$09 R3 The left margin. $0A-$0B R4 The right margin. Description: This routine copies a box from screen 1 ($A000) to screen 2 ($6000). Location $2F is unaffected. This routine calls RecoverLine repeatedly to copy each line of the box. 1-611 Function Name: i_ImprintRectangle Purpose: Identical to ImprintRectangle, but with inline data. Call address: $C253 Description: This routine copies a box from screen 1 ($A000) to screen 2 ($6000). The box descriptor is inline with the calling code. See i_Rectangle for an example. 1-612 Function Name: InvertRectangle Purpose: Inverts the pixels in a box. Call address: $C12A Input requirements: $06 R2L The top margin. $07 R2H The bottom margin. $08-$09 R3 The left margin. $0A-$0B R4 The right margin. Description: This routine reverses the pixels in a given box by repeatedly calling InvertLine. See also GetScanLine. 1-613 Function Name: RecoverLine Purpose: Copies a horizontal line from screen 2 to screen 1. Call address: $C11E Input requirements: $08-$09 R3 The left margin. $0A-$0B R4 The right margin. $18 R11L The row number. Description: This routine copies a horizontal line from screen 2 ($6000) to screen 1 ($A000). Location $2F is unaffected. 1-614 Function Name: InvertLine Purpose: Inverts a horizontal line on the screen. Call address: $C11B Input requirements: $08-$09 R3 The left margin. $0A-$0B R4 The right margin. $18 R11L The row number. Description: This routine reverses the pixels on a horizontal line on the hires screen. If the pixel was on it will now be off; if it was off it will now be turned on. See also GetScanLine. 1-615 Function Name: DrawLine Purpose: Draws, erases or copies a line on the hires screen. Call address: $C130 Input requirements: N flag C Flag Operation 1 X Copy 0 1 Draw 0 0 Erase $08-$09 R3 The column for the first endpoint. $0A-$0B R4 The column for the second endpoint. $18 R11L The row for the first endpoint. $19 R11H The row for the second endpoint. Description: This is a very versatile routine. It can copy an arbitrary line from one screen to another, as well as draw or erase lines. This routine places no restrictions on the relative positions of the endpoints. This routine calls DrawPoint to plot the points. See also GetScanLine. 1-616 Function Name: HorizontalLine Purpose: Draws a horizontal line on the screen. Call address: $C118 Input requirements: A The actual bit pattern for the line. $08-$09 R3 The left margin. $0A-$0B R4 The right margin. $18 R11L The row number. Description: This routine draws a horizontal line on the hires screen in a given pattern. See also GetScanLine. 1-617 Function Name: VerticalLine Purpose: Draws a vertical line on the screen. Call address: $C121 Input requirements: A The actual bit pattern for the line. $08 R3L The top margin. $09 R3H The bottom margin. $0A-$0B R4 The right margin. Description: This routine draws a vertical line on the hires screen in a given pattern. See also GetScanLine. 1-618 Function Name: GetScanLine Purpose: Computes the address of a given row on the hires screens. Call address: $C13C Input requirements: X The row number. $2F dispBufferOn: See description. Output: $0C-$0D R5 Pointer to the row on the destination screen. $0E-$0F R6 Pointer to the row on the source screen. Description: This routine computes the address of column 0 on a given row of the hires screens. All of the graphics routines rely on this routine to get the address of the hires screens. They all take the data pointed to by $0E-$0F and store their data to both $0C-$0D R5 and $0E-$0F R6. Location $2F determines which screen is pointed to by which pointer. This is as follows: Bit 7 Bit 6 $0C-$0D $0E-$0F 0 0 $AF00 $AF00 Approximately the middle of screen 1 0 1 Screen 2 Screen 2 ST_WR_BACK 1 0 Screen 1 Screen 1 ST_WR_FORE 1 1 Screen 1 Screen 2 (Default at reset) 1-619 Function Name: TestPoint Purpose: Tests the value of a point on the hires screen. Call address: $C13F Input requirements: $08-$09 R3 The column number. $18 R11L The row number. Output: C flag is set to the value of the pixel. Description: Tests whether or not a given pixel is on or not. The carry flag is set to the value of the pixel. 1-620 Function Name: DrawPoint Purpose: Draws, erases or copies a pixel on the hires screen. Call address: $C133 Input requirements: N flag C Flag Operation 1 X Copy 0 1 Draw 0 0 Erase $08-$09 R3 The column number. $18 R11L The row number. Description: This is a very versatile routine. It can copy a point from one screen to another, as well as draw or erase it. This routine is called by DrawLine to draw lines. See also GetScanLine. 1-621 Function Name: BitmapUp Purpose: Draws a click box on the screen. Call address: $C142 Input requirements: $02-$03 R0 Pointer to the graphic data. $04 R1L Column in characters. $05 R1H The row in pixels. $06 R2L The width in bytes. $07 R2H The height in pixels. Description: This routine draws a click box on the screen. A click box is a box like Ok, Open, etc. These boxes are generally part of a window description. The graphic data is in a coded format. This format consists of a code byte followed by 1 or more data bytes. 1) Code bytes less than 128 mean that the following byte is to be repeated that many times. 2) Code bytes ranging from 128 to 219 mean that if 128 is subtracted from the code byte, then the result is the number of data bytes that follow. 3) Code bytes ranging from 220 to 225 are special. First 219 is subtracted from the code byte, the result is the number of bytes in the pattern. Following this code byte is a repetition count for the pattern. Following this are the bytes that constitute the pattern. These could include either of the previous two code types. 1-622 Function Name: i_BitmapUp Purpose: Identical to BitmapUp, but with inline data. Call address: $C1AB Description: This routine takes a click box descriptor from inline data and draws it. The inline data does NOT include the processing vector, i.e. JSR DRWCB2 .word address of graphic image .byte start column in bytes .byte start margin in pixels .byte width of box in bytes .byte height of box in pixels Control returns here after the box is drawn. 1-623 Function Name: BitmapClip Purpose: Draw a section of a coded graphic image. Call address: $C2AA Input requirements: $02-$03 R0 Pointer to graphic image data. $04 R1L Column to start on, in bytes. $05 R1H Row to start drawing the image on. $06 R2L Image width in bytes (<= actual width). $07 R2H Image height in pixels (<= actual height). $18 R11L # bytes to skip on the left side. $19 R11H # bytes on the right side. $1A-$1B R12 # rows to skip from the bottom. Description: The coding of the image is the same as that of the click boxes, see BitmapUp for more information. This routine seems to be for drawing pieces of Photo Scraps. Photo Scraps have this coded format. The parameters for this routine allow a section of the image to be drawn by specifying how many rows to skip down, as well as how many bytes to skip on the left and the right of the desired section. This is not used by GEOpaint unless GEOpaint converts its files because they are in a different format; however, Photo Scraps are in this format. 1-624 Function Name: BitOtherClip Purpose: Draw a section of a coded graphic image. Call address: $C2C5 Input requirements: $02-$03 R0 Pointer to graphic image buffer (134 bytes). $04 R1L Column to start on, in bytes. $05 R1H Row to start drawing the image on. $06 R2L Image width in bytes. (<= actual width) $07 R2H Image height in pixels (<= actual height) $18 R11L # bytes to skip on the left side. $19 R11H # bytes on the right side. $1A-$1B R12 # rows to skip from the bottom. $1C-$1D R13 Byte read and save routine vector. $1E-$1F R14 Sync routine vector. Description: This routine is identical to BitmapClip, except that before each byte is read, the first user routine is called. It should return its byte in A and save that byte to the address currently pointed to by R0 before returning. The second routine need only reload R0 with the address of the image buffer. 1-625 Function Name: DrawSprite Purpose: Copies a sprite into GEOS's storage area. Call address: $C1C6 Input requirements: $08 R3L The sprite number (0-7). $0A-$0B R4 Pointer to the sprite data. Description: This routine simply copies 63 bytes of data pointed to by $0A-$0B (R4) to the specified sprite block. GEOS uses sprite blocks 40 to 47. 1-626 Function Name: PosSprite Purpose: Sets the position of a sprite. Call address: $C1CF Input requirements: $08 R3L Sprite number (0-7). $0A-$0B R4 Sprite X position. $0C R5L Sprite Y position. Preparatory routines: DrawSprite Description: This routine copies the sprite's position to the VIC chip, relieving the user of the burden of handling the crossover in the screen from column 255 to column 256. 1-627 Function Name: EnablSprite Purpose: Turns on a sprite. Call address: $C1D2 Input requirements: $08 R3L Sprite number (0-7). Preparatory routines: DrawSprite, PosSprite Description: This routine turns the sprite on, so that it is visible. 1-628 Function Name: DisablSprite Purpose: Turns off a sprite. Call address: $C1D5 Input requirements: $08 R3L Sprite number (0-7). Preparatory routines: DrawSprite, PosSprite, EnablSprite Description: This routine turns the sprite off, so that it is no longer visible.