Graphic Functions


 

Windows Functions

api92::draw_sWindow
api92::draw_Window
api92::draw_sAnimedWindow
api92::draw_sWindow2
api92::draw_Window2
api92::draw_sAnimedWindow2

Graphics Utility Functions

api92::ScreenToBuffer
api92::BufferToScreen
api92::SaveScreenToPIC

Misc Graphics Functions

api92::InterfaceEngine
api92::draw_sString
api92::draw_StringSpecial
api92::draw_CharSpecial
api92::draw_sSolidRect
api92::draw_HorizontalLine
api92::draw_GFX8x8
api92::draw_GFX8xn
api92::SetFont
api92::GetFont
api92::GetFontWidthHeight
api92::InvertArea
api92::sInvertArea
api92::ZapScreen
api92::ClearScreen

 


Api92::InterfaceEngine

The Api92::InterfaceEngine is a very powerful function that draws very nice graphical interfaces in a minimum of bytes.

  • Parameters :
    A0.l : Address of a api92_IEPipe structure
  • Return Values :
    None.
    No register modified
LOOK at the Interface Engine tutorial to understand the use of Api92::InterfaceEngine


Api92::draw_sWindow ; Api92::draw_sWindow2

The Api92::draw_sWindow and Api92::draw_sWindow2 functions draw a window on the screen according to an api92_Win structure. The difference is the graphical aspect of the windows.

Notice : Don't forget that the api92::InterfaceEngine function is very powerful to draw complete graphical interfaces.

  • Parameters :
    A0.l : Address of a api92_Win structure
  • Return Values :
    None.
    No register modified

    Format of the api92_Win structure :

    00.b : X1
    01.b : Y1
    02.b : X2
    03.b : Y2
    04.x : 0-terminated title of the window

    Example

    The following example draw a nice window at (40,40) with Width=160 and height=40

          lea   Win (PC),a0           ;Address of the api92String structure
          jsr   api92::draw_sWindow
          (…)
    Win:  dc.b  40,40,200,80          ;a api92Win structure
          dc.b  "Window title",0


Api92::draw_Window ; Api92::draw_Window2

The Api92::draw_Window and Api92::draw_Window2 functions can be used sometimes instead of the two previous functions : they requires different parameters.

Notice : Don't forget that the api92::InterfaceEngine function is very powerful to draw complete graphical interfaces.

  • Parameters :
    A0.l : Address of an api92_Rect structure
    A1.l : Address of the 0-terminated title string
  • Return Values :
    No register modified

    Format of the api92_Rect structure :

00.b : X1
01.b : Y1
02.b : X2
03.b : Y2

Example

The following example draw a nice window at (40,40) with Width=160 and height=40

       lea    Rect(PC),a0           ;Address of the api92String structure
       lea    Title(PC),a1
       jsr    api92::draw_Window
       (…)
Rect:  dc.b   40,40,200,80          ;a api92Win structure
       (…)
Title: dc.b   "Window title",0      ;a api92Rect structure


Api92::draw_sAnimedWindow ; Api92::draw_sAnimedWindow2

The Api92::draw_sAnimedWindow and Api92::draw_sAnimedWindow2 functions draw a window on the screen with animation, according to an api92_AnimedWin structure.

Notice : Don't forget that the api92::InterfaceEngine function is very powerful to draw complete graphical interfaces.

  • Parameters :
    A0.l : Address of a api92_AnimedWin structure
  • Return Values :
    None.
    No register modified

Format of the api92_AnimedWin structure :

00.b : Timer value for animation speed.
01.b : X1
02.b : Y1
03.b : X2
04.b : Y2
05.x : 0-terminated title of the window

 


Api92::SetFont

The Api92::SetFont function sets the current font used. It has the advantage of changing no register and of using CPU registers. (used for size optimization)

  • Parameters :
    D0.w : Font : 0 = small ( variable x 6 )
    1 = medium ( 6 x 8 )
    2 = large ( 8 x 10 )
  • Return Values :
    No register modified

    Example

The following example set the large font :

moveq.w #2,d0
jsr     api92::SetFont
(…)


Api92::GetFont

The Api92::GetFont function gets the current font used. It has the advantage of changing no register and of using CPU registers. (used for size optimization)

  • Parameters :
    None.
  • Return Values :
    D0.w : Font : 0 = small ( variable x 6 )
    1 = medium ( 6 x 8 )
    2 = large ( 8 x 10 )
    No other register modified

Api92::draw_sString

The Api92::draw_sString function will draw on the screen a string giving its coordinates in a api92_String structure.

  • Parameters :
    A0.l : Address if an api92_String structure
  • Return Values :
    No register modified

    Format of the api92_String structure :

00.b : X
01.b : Y
02.x : 0-terminated string to show

Example

The following example draw a string at (10,50)

      lea  Str1(PC),a0                              ;Address of the api92String structure
      jsr  api92::draw_sString
      (…)
Str1: dc.b 10,50,"Draw a string at (10,50)",0      ;a api92String structure


Api92::draw_StringSpecial

The Api92::draw_StringSpecial function is often used for size optimization : it draws on the screen a string giving parameters throw CPU registers, not the stack. What it more no register will be modified.

  • Parameters :
    D0.w : X coordinate
    D1.w : Y coordinate
    A1.l : Address of the string (zero terminated)
  • Return Values :
    No register modified

    Example

    The following example draw a string at (10,50)

          moveq.w #10,d0 ;X = 10
          moveq.w #50,d1 ;Y = 50
          lea     Str1(PC),a1                       ;Address of the null terminated string
          jsr     api92::draw_StringSpecial
          (…)
    Str1: dc.b    "Draw a string at (10,50)",0


Api92::draw_CharSpecial

The Api92::draw_CharSpecial function is also used for size optimization, and draws a char on the screen by giving parameters throw CPU registers. What it more no register will be modified.

  • Parameters :
    D0.w : X coordinate
    D1.w : Y coordinate
    D2.w : Char to draw
  • Return Values :
    No register modified

    Example

    The following example draw the char 200 at (10,20)

    moveq.w #10,d0
    moveq.w #20,d1
    moveq.w #200,d2
    jsr     api92::DrawCharSpecial
    (…)


Api92::ZapScreen

The Api92::ZapScreen completly clears the screen. (fast)

  • Parameters :
    None
  • Return Values :
    No register modified

Api92::ClearScreen

The Api92::ClearScreen completly clears the screen and redraw the status bar.

  • Parameters :
    None
  • Return Values :
    No register modified

Api92::draw_HorizontalLine

The Api92::HorizontalLine draws a horizontal line on the screen.

  • Parameters :
    D0.w : X position
    D1.w
    : Y Position
    D2.w
    : Width of the line
  • Return Values :
    No register modified

Api92::draw_sSolidRect

The Api92::draw_sSolidRect draws on the screen a non-aligned solid rectangle giving a api92_Rect structure

  • Parameters :
    A0.l : Address of a api92_Rect structure
  • Return Values :
    A0.l : Add +4 to the previous value of A0.l
    No other register modified

    Format of the api92_Rect structure

    00.b : X1
    01.b : Y1
    02.b : X2
    03.b : Y2

    Example

    The following example draw a rectangle on the screen

          lea   Rect(PC),a0             ;Address of the api92String structure
          jsr   api92::DrawEraseRect
          (…)
    Rect: dc.b  40,40,200,80            ;a api92Rect structure


Api92::InvertArea

The Api92::InvertArea inverts an non-aligned rectangle area on the screen by passing parameters with CPU registers.

  • Parameters :
    D0.w : X coordinate
    D1.w : Y coordinate
    D2.w : Width ( pixel )
    D3.w : Height ( pixel )
  • Return Values :
    No register modified

    Example

    The following example invert the rectangle area (10,15) ; (30,40)

    moveq.w #10,d0
    moveq.w #15,d1
    moveq.w #30,d2
    moveq.w #40,d3
    jsr     api92::InvertArea
    (…)


Api92::sInvertArea

The Api92::sInvertArea inverts an non-aligned rectangle area on the screen using an api92_Rect structure

  • Parameters :
    A0.l : Address of an api92_Rect structure
  • Return Values :
    No register modified

    Format of the api92_Rect structure

    00.b : X1
    01.b : Y1
    02.b : X2
    03.b : Y2


Api92::ScreenToBuffer

The Api92::ScreenToBuffer function copy the entire screen into a 3840 bytes buffer

  • Parameters :
    A1.l : Address of the 3840 bytes buffer
  • Return Values :
    No register modified

Api92::BufferToScreen

The Api92::BufferToScreen copy the contents of a 3840 bytes buffer to the screen

  • Parameters :
    A1.l : Address of the 3840 bytes buffer
  • Return Values :
    No register modified

Api92::draw_GFX8x8

The Api92::draw_GFX8x8 draw a non-aligned 8x8 sprite on the screen.

  • Parameters :
    D0.w : X position
    D1.w : Y position
    A0.l : Address of sprite data
  • Return Values :
    No register modified

Api92::draw_GFX8xn

The Api92::draw_GFX8xn draw a non-aligned 8x n sprite on the screen.

  • Parameters :
    D0.w : X position
    D1.w : Y position
    D2.w : Number of lines - 1
    A0.l : Address of sprite data
  • Return Values :
    No register modified

Api92::SaveScreenToPIC

The Api92::SaveScreenToPIC save a non-aligned area of the screen into a valid PIC file

  • Parameters :
    D0.w : Handle of folder
    A0.l : 0-terminated file name string
    A1.l : Address of an api92_Rect structure
  • Return Values :
    D1.w : Error Code
    No other register modified

    Format of the api92_Rect structure :

    00.b : X1
    01.b : Y1
    02.b : X2
    03.b : Y2