FNX6809 GraphicsVTIOCalls: Difference between revisions

From Foenix F256 / Wildbits/K2 Wiki
Jump to navigationJump to search
(→‎Basic09 Calls (via the Foenix module): Change FOENIX calls to WILD)
 
Line 4: Line 4:
There is a default clut memory module included called <code>xtclut</code> in CMDS.  This has the xterm colors according to [https://www.ditig.com/publications/256-colors-cheat-sheet this chart]
There is a default clut memory module included called <code>xtclut</code> in CMDS.  This has the xterm colors according to [https://www.ditig.com/publications/256-colors-cheat-sheet this chart]


== Basic09 Calls (via the Foenix module) ==
== Basic09 Calls (via the WILD module) ==


=== INKEY ===
=== INKEY ===
calling syntax: RUN FOENIX([path,],"INKEY",keyval)
calling syntax: RUN WILD([path,],"INKEY",keyval)


=== MouseHR ===
=== MouseHR ===
returns 640x480 XY
returns 640x480 XY


calling syntax: RUN FOENIX([path,],"MouseHR",X,Y,Button)
calling syntax: RUN WILD([path,],"MouseHR",X,Y,Button)


=== Mouse ===
=== Mouse ===
returns 320x240 XY
returns 320x240 XY


calling syntax: RUN FOENIX([path,],"Mouse",X,Y,Button)
calling syntax: RUN WILD([path,],"Mouse",X,Y,Button)


=== Graphics On ===
=== Graphics On ===
calling syntax: RUN FOENIX([path,],"Gon")
calling syntax: RUN WILD([path,],"Gon")


=== Graphics Off ===
=== Graphics Off ===
calling syntax: RUN FOENIX([path,],"Goff")
calling syntax: RUN WILD([path,],"Goff")


=== BMLoad ===
=== BMLoad ===
Load Bitmap file into allocated Bitmap
Load Bitmap file into allocated Bitmap


calling syntax: RUN FOENIX([path,],"BMLoad",bmblock,bitmappath)
calling syntax: RUN WILD([path,],"BMLoad",bmblock,bitmappath)


=== BMClear ===
=== BMClear ===
Clear image of allocated Bitmap
Clear image of allocated Bitmap


calling syntax: RUN FOENIX([path,],"BMClear",bmblock, color)
calling syntax: RUN WILD([path,],"BMClear",bmblock, color)


=== Bitmap ===
=== Bitmap ===
Allocate bitmap
Allocate bitmap


calling syntax: RUN FOENIX([path,],"Bitmap",bitmap#,screenmode,bmblock,layer,clut#,clutname)
calling syntax: RUN WILD([path,],"Bitmap",bitmap#,screenmode,bmblock,layer,clut#,clutname)


=== BMSave ===
=== BMSave ===
Save current Bitmap
Save current Bitmap


calling syntax: RUN FOENIX([path,],"BMClear",bmblock, filename)
calling syntax: RUN WILD([path,],"BMClear",bmblock, filename)


=== Bitmap Status ===
=== Bitmap Status ===
Returns 0 bm(x) if disabled, returns 1 bm(x) enabled
Returns 0 bm(x) if disabled, returns 1 bm(x) enabled


calling syntax: RUN FOENIX([path,],"BMstatus",bm0,bm1,bm2)
calling syntax: RUN WILD([path,],"BMstatus",bm0,bm1,bm2)


=== Bitmap Off/Free ===
=== Bitmap Off/Free ===
Disables bitmap and frees bitmap memory
Disables bitmap and frees bitmap memory


calling syntax: RUN FOENIX([path,],"BMoff",bitmap#)
calling syntax: RUN WILD([path,],"BMoff",bitmap#)


=== GFree ===
=== GFree ===
Calling syntax: RUN FOENIX([path,],"GFree",bitmap#)   
Calling syntax: RUN WILD([path,],"GFree",bitmap#)   


=== ClutFree ===
=== ClutFree ===
Clut Unlink
Clut Unlink


calling syntax: RUN FOENIX([path,],"ClutFree",clutheader)
calling syntax: RUN WILD([path,],"ClutFree",clutheader)


=== Pixel ===
=== Pixel ===
Line 70: Line 70:
x=X, y=Y, a=color
x=X, y=Y, a=color


calling syntax: RUN FOENIX([path,],"Pixel",X,Y,Color,bmblock)
calling syntax: RUN WILD([path,],"Pixel",X,Y,Color,bmblock)


=== GetPixel ===
=== GetPixel ===
Line 79: Line 79:
x=X, y=Y, a=color
x=X, y=Y, a=color


calling syntax: RUN FOENIX([path,],"GetPixel",X,Y,Color,bmblock)
calling syntax: RUN WILD([path,],"GetPixel",X,Y,Color,bmblock)


=== Line ===
=== Line ===
Line 88: Line 88:
pc=01 x=23 y=4 x=56 y=7 c=8
pc=01 x=23 y=4 x=56 y=7 c=8


calling syntax: RUN FOENIX([path,],"Line",X1,Y1,X2,Y2,color,bmblock)
calling syntax: RUN WILD([path,],"Line",X1,Y1,X2,Y2,color,bmblock)


=== Multiply ===
=== Multiply ===
Multiply 2 16 bit integers
Multiply 2 16 bit integers


Calling syntax: RUN FOENIX([path,],"MULTIPLY", integer_A, integer_B,result_REAL)
Calling syntax: RUN WILD([path,],"MULTIPLY", integer_A, integer_B,result_REAL)


=== GetDow ===
=== GetDow ===
Line 100: Line 100:
Returns integer day of week
Returns integer day of week


Calling syntax: RUN FOENIX([path,] "GetDow", dow)
Calling syntax: RUN WILD([path,] "GetDow", dow)


=== GetTime ===
=== GetTime ===
Get the current time.
Get the current time.


Calling syntax: RUN FOENIX([path,] "GetTime", hour,minute,seconds)
Calling syntax: RUN WILD([path,] "GetTime", hour,minute,seconds)


=== GetDate ===
=== GetDate ===
Line 112: Line 112:
RTC.Base $FE40
RTC.Base $FE40


Calling syntax: RUN FOENIX([path,] "GetDate", month,day,year)
Calling syntax: RUN WILD([path,] "GetDate", month,day,year)


=== WINFO ===
=== WINFO ===
Get window information.
Get window information.


Calling syntax: RUN FOENIX([path,] "WINFO", format, width, height, foreground, background, border)
Calling syntax: RUN WILD([path,] "WINFO", format, width, height, foreground, background, border)


=== DWSET ===
=== DWSET ===
Define a device window.
Define a device window.


Calling syntax: RUN FOENIX([path,] "DWSET", format, xcor, ycor, width, height, foreground, background, border)
Calling syntax: RUN WILD([path,] "DWSET", format, xcor, ycor, width, height, foreground, background, border)


=== COLOR ===
=== COLOR ===
Set the window colors.
Set the window colors.


Calling syntax: RUN FOENIX([path,] "COLOR", foreground [,background] [,border])
Calling syntax: RUN WILD([path,] "COLOR", foreground [,background] [,border])


=== SEED ===
=== SEED ===
Seeds the hardware-based random number.
Seeds the hardware-based random number.


Calling syntax: RUN FOENIX([path,] "SEED" ,value)
Calling syntax: RUN WILD([path,] "SEED" ,value)


=== RANDOM ===
=== RANDOM ===
Returns a hardware-based random number.
Returns a hardware-based random number.


Calling syntax: RUN FOENIX([path,] "RANDOM" ,value)
Calling syntax: RUN WILD([path,] "RANDOM" ,value)


=== CURHOME ===
=== CURHOME ===
Home the cursor.
Home the cursor.


Calling syntax: RUN FOENIX([path,] "CURHOME")
Calling syntax: RUN WILD([path,] "CURHOME")


=== CURXY ===
=== CURXY ===
Move the cursor to a column and row.
Move the cursor to a column and row.


Calling syntax: RUN FOENIX([path,] "CURXY", column, row)
Calling syntax: RUN WILD([path,] "CURXY", column, row)


=== ERLINE ===
=== ERLINE ===
Delete the line of text the cursor is on.
Delete the line of text the cursor is on.


Calling syntax: RUN FOENIX([path,] "ERLINE")
Calling syntax: RUN WILD([path,] "ERLINE")


=== EREOLINE ===
=== EREOLINE ===
Delete text from the cursor to the end of the current line.
Delete text from the cursor to the end of the current line.


Calling syntax: RUN FOENIX([path,] "EREOLINE")
Calling syntax: RUN WILD([path,] "EREOLINE")


=== CUROFF ===
=== CUROFF ===
Make the cursor invisible
Make the cursor invisible


Calling syntax: RUN FOENIX([path,] "CUROFF")
Calling syntax: RUN WILD([path,] "CUROFF")


=== CURRGT ===
=== CURRGT ===
Move the cursor one character to the right.
Move the cursor one character to the right.


Calling syntax: RUN FOENIX([path,] "CURRGT")
Calling syntax: RUN WILD([path,] "CURRGT")


=== BELL ===
=== BELL ===
Produce a beep through the terminal's speaker.
Produce a beep through the terminal's speaker.


Calling syntax: RUN FOENIX([path,] "BELL")
Calling syntax: RUN WILD([path,] "BELL")


=== CURLFT ===
=== CURLFT ===
Move the cursor one character to the left.
Move the cursor one character to the left.


Calling syntax: RUN FOENIX([path,] "CURLFT")
Calling syntax: RUN WILD([path,] "CURLFT")


=== CURUP ===
=== CURUP ===
Move the cursor one line up.
Move the cursor one line up.


Calling syntax: RUN FOENIX([path,] "CURUP")
Calling syntax: RUN WILD([path,] "CURUP")


=== CURDWN ===
=== CURDWN ===
Move the cursor one line down.
Move the cursor one line down.


Calling syntax: RUN FOENIX([path,] "CURDWN")
Calling syntax: RUN WILD([path,] "CURDWN")


=== EREOWNDW ===
=== EREOWNDW ===
Delete text from the current cursor position to the end of the window.
Delete text from the current cursor position to the end of the window.


Calling syntax: RUN FOENIX([path,] "EREOWNDW")
Calling syntax: RUN WILD([path,] "EREOWNDW")


=== Clear ===
=== Clear ===
Calling syntax: RUN FOENIX([path,] "CLEAR")
Calling syntax: RUN WILD([path,] "CLEAR")


=== CRRTN ===
=== CRRTN ===
Send a carriage return.
Send a carriage return.


Calling syntax: RUN FOENIX([path,] "CRRTN")
Calling syntax: RUN WILD([path,] "CRRTN")


=== INSLIN ===
=== INSLIN ===
Insert a blank line at the current cursor.
Insert a blank line at the current cursor.


Calling syntax: RUN FOENIX([path,] "INSLIN")
Calling syntax: RUN WILD([path,] "INSLIN")


=== DELLIN ===
=== DELLIN ===
Delete the line at the current cursor.
Delete the line at the current cursor.


Calling syntax: RUN FOENIX([path,] "DELLIN")
Calling syntax: RUN WILD([path,] "DELLIN")


=== DEFCOL ===
=== DEFCOL ===
Set palette registers to the default values.
Set palette registers to the default values.


Calling syntax: RUN FOENIX([path,] "DEFCOL"
Calling syntax: RUN WILD([path,] "DEFCOL"


== vtio Get/Set Stat Calls ==
== vtio Get/Set Stat Calls ==

Latest revision as of 12:34, 16 January 2026

Graphics Summary

Use the fstatus command in Level 2 to see the current status of the graphics registers.

There is a default clut memory module included called xtclut in CMDS. This has the xterm colors according to this chart

Basic09 Calls (via the WILD module)

INKEY

calling syntax: RUN WILD([path,],"INKEY",keyval)

MouseHR

returns 640x480 XY

calling syntax: RUN WILD([path,],"MouseHR",X,Y,Button)

Mouse

returns 320x240 XY

calling syntax: RUN WILD([path,],"Mouse",X,Y,Button)

Graphics On

calling syntax: RUN WILD([path,],"Gon")

Graphics Off

calling syntax: RUN WILD([path,],"Goff")

BMLoad

Load Bitmap file into allocated Bitmap

calling syntax: RUN WILD([path,],"BMLoad",bmblock,bitmappath)

BMClear

Clear image of allocated Bitmap

calling syntax: RUN WILD([path,],"BMClear",bmblock, color)

Bitmap

Allocate bitmap

calling syntax: RUN WILD([path,],"Bitmap",bitmap#,screenmode,bmblock,layer,clut#,clutname)

BMSave

Save current Bitmap

calling syntax: RUN WILD([path,],"BMClear",bmblock, filename)

Bitmap Status

Returns 0 bm(x) if disabled, returns 1 bm(x) enabled

calling syntax: RUN WILD([path,],"BMstatus",bm0,bm1,bm2)

Bitmap Off/Free

Disables bitmap and frees bitmap memory

calling syntax: RUN WILD([path,],"BMoff",bitmap#)

GFree

Calling syntax: RUN WILD([path,],"GFree",bitmap#)   

ClutFree

Clut Unlink

calling syntax: RUN WILD([path,],"ClutFree",clutheader)

Pixel

Draw Pixel

takes X,Y and color and puts it in the bitmap bmblock

x=X, y=Y, a=color

calling syntax: RUN WILD([path,],"Pixel",X,Y,Color,bmblock)

GetPixel

Return the color of pixel at x,y

takes X,Y and color and puts it in the bitmap bmblock

x=X, y=Y, a=color

calling syntax: RUN WILD([path,],"GetPixel",X,Y,Color,bmblock)

Line

draw line between 2 coordinates

x=16 bit value, y=8 bit value

pc=01 x=23 y=4 x=56 y=7 c=8

calling syntax: RUN WILD([path,],"Line",X1,Y1,X2,Y2,color,bmblock)

Multiply

Multiply 2 16 bit integers

Calling syntax: RUN WILD([path,],"MULTIPLY", integer_A, integer_B,result_REAL)

GetDow

Get Day of week

Returns integer day of week

Calling syntax: RUN WILD([path,] "GetDow", dow)

GetTime

Get the current time.

Calling syntax: RUN WILD([path,] "GetTime", hour,minute,seconds)

GetDate

Get the current time.

RTC.Base $FE40

Calling syntax: RUN WILD([path,] "GetDate", month,day,year)

WINFO

Get window information.

Calling syntax: RUN WILD([path,] "WINFO", format, width, height, foreground, background, border)

DWSET

Define a device window.

Calling syntax: RUN WILD([path,] "DWSET", format, xcor, ycor, width, height, foreground, background, border)

COLOR

Set the window colors.

Calling syntax: RUN WILD([path,] "COLOR", foreground [,background] [,border])

SEED

Seeds the hardware-based random number.

Calling syntax: RUN WILD([path,] "SEED" ,value)

RANDOM

Returns a hardware-based random number.

Calling syntax: RUN WILD([path,] "RANDOM" ,value)

CURHOME

Home the cursor.

Calling syntax: RUN WILD([path,] "CURHOME")

CURXY

Move the cursor to a column and row.

Calling syntax: RUN WILD([path,] "CURXY", column, row)

ERLINE

Delete the line of text the cursor is on.

Calling syntax: RUN WILD([path,] "ERLINE")

EREOLINE

Delete text from the cursor to the end of the current line.

Calling syntax: RUN WILD([path,] "EREOLINE")

CUROFF

Make the cursor invisible

Calling syntax: RUN WILD([path,] "CUROFF")

CURRGT

Move the cursor one character to the right.

Calling syntax: RUN WILD([path,] "CURRGT")

BELL

Produce a beep through the terminal's speaker.

Calling syntax: RUN WILD([path,] "BELL")

CURLFT

Move the cursor one character to the left.

Calling syntax: RUN WILD([path,] "CURLFT")

CURUP

Move the cursor one line up.

Calling syntax: RUN WILD([path,] "CURUP")

CURDWN

Move the cursor one line down.

Calling syntax: RUN WILD([path,] "CURDWN")

EREOWNDW

Delete text from the current cursor position to the end of the window.

Calling syntax: RUN WILD([path,] "EREOWNDW")

Clear

Calling syntax: RUN WILD([path,] "CLEAR")

CRRTN

Send a carriage return.

Calling syntax: RUN WILD([path,] "CRRTN")

INSLIN

Insert a blank line at the current cursor.

Calling syntax: RUN WILD([path,] "INSLIN")

DELLIN

Delete the line at the current cursor.

Calling syntax: RUN WILD([path,] "DELLIN")

DEFCOL

Set palette registers to the default values.

Calling syntax: RUN WILD([path,] "DEFCOL"

vtio Get/Set Stat Calls

SS.AScrn

Allocate a bitmap screen

Entry: R$Y = bitmap# (0-2)
       R$X = screentype (0=320x240, 1=320x200)
Exit:  B = A non-zero error code.
      CC = Carry flag clear to indicate success
       X = Starting Page# of bitmap address

SS.DScrn

Display Screen Settings

Set MCR to display text or graphics or both

Entry: R$X = Vicky_MCR Low Byte
       R$Y = Vicky_MCR High Byte
Exit:  Nothing. This just sets the register and updates driver variables

VICKY MASTER CONTROL REGISTER to enable graphics and capabilities

| 7 |   6   |    5   |   4  |    3   |   2   |   1   |   0  |
| X | GAMMA | SPRITE | TILE | BITMAP | GRAPH | OVRLY | TEXT |
|   -----   | FON_SET|FON_OV| MON_SLP| DBL_Y | DBL_X | CLK70|
$FFC0 MASTER_CTRL_REG_L, MASTER_CTRL_REG_H

********************************************************************
* vtio graphics constants (in f256.d)
********************************************************************
* Constants used in SS.DScrn to set the display screen type
FX_GAM             equ       %01000000              Gamma Correction On
FX_SPR             equ       %00100000              Sprites On
FX_TIL             equ       %00010000              Tile Maps On
FX_BM              equ       %00001000              Bitmaps On
FX_GRF             equ       %00000100              Graphics Mode On
FX_OVR             equ       %00000010              Overlay Text on Graphics
FX_TXT             equ       %00000001              Text Mode On
FT_FSET            equ       %00100000              Font Set 1 On (0=Font Set 0)
FT_FOVR            equ       %00010000              FG and BG colors displayed when overlay text 0=transparent
FT_MON             equ       %00001000              Turn off monitor sync and sleep monitor
FT_DBX             equ       %00000100              Double-wide text mode characters
FT_DBY             equ       %00000010              Double-high text mode characters
FT_CLK70           equ       %00000001              70 Hz screen (640x400 txt,320x200 grf)
FX_OMIT            equ       %11111111              Setting for SS.DScrn don't change first byte in MCR
FT_OMIT            equ       %11111111              Setting for SS.DScrn don't change second byte in MCR 

SS.PScrn

Position Screen Layers

Set layer to display a screen

Entry: R$X = layer (0-2)
       R$Y = bitmap# (0-2), tilemap (4-6)
       
Exit:  B = A non-zero error code.
      CC = Carry flag clear to indicate success

SS.FScrn

Free a bitmap screen

Entry: R$Y = bitmap# (0-2)
Exit:  B = A non-zero error code.
      CC = Carry flag clear to indicate success

SS.DfPal

Define Palette and populate a CLUT from Memory Module

Entry: R$X = CLUT # (0-3)
       R$Y = pointer to location of data in caller process
       (Caller must load data module)
Exit:  B = A non-zero error code.
      CC = Carry flag clear to indicate success