FNX6809 GraphicsVTIOCalls: Difference between revisions
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Use the <code>fstatus</code> command in Level 2 to see the current status of the graphics registers. | Use the <code>fstatus</code> command in Level 2 to see the current status of the graphics registers. | ||
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) == | |||
=== INKEY === | |||
calling syntax: RUN FOENIX([path,],"INKEY",keyval) | |||
=== MouseHR === | |||
returns 640x480 XY | |||
calling syntax: RUN FOENIX([path,],"MouseHR",X,Y,Button) | |||
=== Mouse === | |||
returns 320x240 XY | |||
calling syntax: RUN FOENIX([path,],"Mouse",X,Y,Button) | |||
=== Graphics On === | |||
calling syntax: RUN FOENIX([path,],"Gon") | |||
=== Graphics Off === | |||
calling syntax: RUN FOENIX([path,],"Goff") | |||
=== BMLoad === | |||
Load Bitmap file into allocated Bitmap | |||
calling syntax: RUN FOENIX([path,],"BMLoad",bmblock,bitmappath) | |||
=== BMClear === | |||
Clear image of allocated Bitmap | |||
calling syntax: RUN FOENIX([path,],"BMClear",bmblock, color) | |||
=== Bitmap === | |||
Allocate bitmap | |||
calling syntax: RUN FOENIX([path,],"Bitmap",bitmap#,screenmode,bmblock,layer,clut#,clutname) | |||
=== BMSave === | |||
Save current Bitmap | |||
calling syntax: RUN FOENIX([path,],"BMClear",bmblock, filename) | |||
=== Bitmap Status === | |||
Returns 0 bm(x) if disabled, returns 1 bm(x) enabled | |||
calling syntax: RUN FOENIX([path,],"BMstatus",bm0,bm1,bm2) | |||
=== Bitmap Off/Free === | |||
Disables bitmap and frees bitmap memory | |||
calling syntax: RUN FOENIX([path,],"BMoff",bitmap#) | |||
=== GFree === | |||
Calling syntax: RUN FOENIX([path,],"GFree",bitmap#) | |||
=== ClutFree === | |||
Clut Unlink | |||
calling syntax: RUN FOENIX([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 FOENIX([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 FOENIX([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 FOENIX([path,],"Line",X1,Y1,X2,Y2,color,bmblock) | |||
=== Multiply === | |||
Multiply 2 16 bit integers | |||
Calling syntax: RUN FOENIX([path,],"MULTIPLY", integer_A, integer_B,result_REAL) | |||
=== GetDow === | |||
Get Day of week | |||
Returns integer day of week | |||
Calling syntax: RUN FOENIX([path,] "GetDow", dow) | |||
=== GetTime === | |||
Get the current time. | |||
Calling syntax: RUN FOENIX([path,] "GetTime", hour,minute,seconds) | |||
=== GetDate === | |||
Get the current time. | |||
RTC.Base $FE40 | |||
Calling syntax: RUN FOENIX([path,] "GetDate", month,day,year) | |||
=== WINFO === | |||
Get window information. | |||
Calling syntax: RUN FOENIX([path,] "WINFO", format, width, height, foreground, background, border) | |||
=== DWSET === | |||
Define a device window. | |||
Calling syntax: RUN FOENIX([path,] "DWSET", format, xcor, ycor, width, height, foreground, background, border) | |||
=== COLOR === | |||
Set the window colors. | |||
Calling syntax: RUN FOENIX([path,] "COLOR", foreground [,background] [,border]) | |||
=== SEED === | |||
Seeds the hardware-based random number. | |||
Calling syntax: RUN FOENIX([path,] "SEED" ,value) | |||
=== RANDOM === | |||
Returns a hardware-based random number. | |||
Calling syntax: RUN FOENIX([path,] "RANDOM" ,value) | |||
=== CURHOME === | |||
Home the cursor. | |||
Calling syntax: RUN FOENIX([path,] "CURHOME") | |||
=== CURXY === | |||
Move the cursor to a column and row. | |||
Calling syntax: RUN FOENIX([path,] "CURXY", column, row) | |||
=== ERLINE === | |||
Delete the line of text the cursor is on. | |||
Calling syntax: RUN FOENIX([path,] "ERLINE") | |||
=== EREOLINE === | |||
Delete text from the cursor to the end of the current line. | |||
Calling syntax: RUN FOENIX([path,] "EREOLINE") | |||
=== CUROFF === | |||
Make the cursor invisible | |||
Calling syntax: RUN FOENIX([path,] "CUROFF") | |||
=== CURRGT === | |||
Move the cursor one character to the right. | |||
Calling syntax: RUN FOENIX([path,] "CURRGT") | |||
=== BELL === | |||
Produce a beep through the terminal's speaker. | |||
Calling syntax: RUN FOENIX([path,] "BELL") | |||
=== CURLFT === | |||
Move the cursor one character to the left. | |||
Calling syntax: RUN FOENIX([path,] "CURLFT") | |||
=== CURUP === | |||
Move the cursor one line up. | |||
Calling syntax: RUN FOENIX([path,] "CURUP") | |||
=== CURDWN === | |||
Move the cursor one line down. | |||
Calling syntax: RUN FOENIX([path,] "CURDWN") | |||
=== EREOWNDW === | |||
Delete text from the current cursor position to the end of the window. | |||
Calling syntax: RUN FOENIX([path,] "EREOWNDW") | |||
=== Clear === | |||
Calling syntax: RUN FOENIX([path,] "CLEAR") | |||
=== CRRTN === | |||
Send a carriage return. | |||
Calling syntax: RUN FOENIX([path,] "CRRTN") | |||
=== INSLIN === | |||
Insert a blank line at the current cursor. | |||
Calling syntax: RUN FOENIX([path,] "INSLIN") | |||
=== DELLIN === | |||
Delete the line at the current cursor. | |||
Calling syntax: RUN FOENIX([path,] "DELLIN") | |||
=== DEFCOL === | |||
Set palette registers to the default values. | |||
Calling syntax: RUN FOENIX([path,] "DEFCOL" | |||
== vtio Get/Set Stat Calls == | == vtio Get/Set Stat Calls == |
Latest revision as of 13:51, 25 January 2025
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 Foenix module)
INKEY
calling syntax: RUN FOENIX([path,],"INKEY",keyval)
MouseHR
returns 640x480 XY
calling syntax: RUN FOENIX([path,],"MouseHR",X,Y,Button)
Mouse
returns 320x240 XY
calling syntax: RUN FOENIX([path,],"Mouse",X,Y,Button)
Graphics On
calling syntax: RUN FOENIX([path,],"Gon")
Graphics Off
calling syntax: RUN FOENIX([path,],"Goff")
BMLoad
Load Bitmap file into allocated Bitmap
calling syntax: RUN FOENIX([path,],"BMLoad",bmblock,bitmappath)
BMClear
Clear image of allocated Bitmap
calling syntax: RUN FOENIX([path,],"BMClear",bmblock, color)
Bitmap
Allocate bitmap
calling syntax: RUN FOENIX([path,],"Bitmap",bitmap#,screenmode,bmblock,layer,clut#,clutname)
BMSave
Save current Bitmap
calling syntax: RUN FOENIX([path,],"BMClear",bmblock, filename)
Bitmap Status
Returns 0 bm(x) if disabled, returns 1 bm(x) enabled
calling syntax: RUN FOENIX([path,],"BMstatus",bm0,bm1,bm2)
Bitmap Off/Free
Disables bitmap and frees bitmap memory
calling syntax: RUN FOENIX([path,],"BMoff",bitmap#)
GFree
Calling syntax: RUN FOENIX([path,],"GFree",bitmap#)
ClutFree
Clut Unlink
calling syntax: RUN FOENIX([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 FOENIX([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 FOENIX([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 FOENIX([path,],"Line",X1,Y1,X2,Y2,color,bmblock)
Multiply
Multiply 2 16 bit integers
Calling syntax: RUN FOENIX([path,],"MULTIPLY", integer_A, integer_B,result_REAL)
GetDow
Get Day of week
Returns integer day of week
Calling syntax: RUN FOENIX([path,] "GetDow", dow)
GetTime
Get the current time.
Calling syntax: RUN FOENIX([path,] "GetTime", hour,minute,seconds)
GetDate
Get the current time.
RTC.Base $FE40
Calling syntax: RUN FOENIX([path,] "GetDate", month,day,year)
WINFO
Get window information.
Calling syntax: RUN FOENIX([path,] "WINFO", format, width, height, foreground, background, border)
DWSET
Define a device window.
Calling syntax: RUN FOENIX([path,] "DWSET", format, xcor, ycor, width, height, foreground, background, border)
COLOR
Set the window colors.
Calling syntax: RUN FOENIX([path,] "COLOR", foreground [,background] [,border])
SEED
Seeds the hardware-based random number.
Calling syntax: RUN FOENIX([path,] "SEED" ,value)
RANDOM
Returns a hardware-based random number.
Calling syntax: RUN FOENIX([path,] "RANDOM" ,value)
CURHOME
Home the cursor.
Calling syntax: RUN FOENIX([path,] "CURHOME")
CURXY
Move the cursor to a column and row.
Calling syntax: RUN FOENIX([path,] "CURXY", column, row)
ERLINE
Delete the line of text the cursor is on.
Calling syntax: RUN FOENIX([path,] "ERLINE")
EREOLINE
Delete text from the cursor to the end of the current line.
Calling syntax: RUN FOENIX([path,] "EREOLINE")
CUROFF
Make the cursor invisible
Calling syntax: RUN FOENIX([path,] "CUROFF")
CURRGT
Move the cursor one character to the right.
Calling syntax: RUN FOENIX([path,] "CURRGT")
BELL
Produce a beep through the terminal's speaker.
Calling syntax: RUN FOENIX([path,] "BELL")
CURLFT
Move the cursor one character to the left.
Calling syntax: RUN FOENIX([path,] "CURLFT")
CURUP
Move the cursor one line up.
Calling syntax: RUN FOENIX([path,] "CURUP")
CURDWN
Move the cursor one line down.
Calling syntax: RUN FOENIX([path,] "CURDWN")
EREOWNDW
Delete text from the current cursor position to the end of the window.
Calling syntax: RUN FOENIX([path,] "EREOWNDW")
Clear
Calling syntax: RUN FOENIX([path,] "CLEAR")
CRRTN
Send a carriage return.
Calling syntax: RUN FOENIX([path,] "CRRTN")
INSLIN
Insert a blank line at the current cursor.
Calling syntax: RUN FOENIX([path,] "INSLIN")
DELLIN
Delete the line at the current cursor.
Calling syntax: RUN FOENIX([path,] "DELLIN")
DEFCOL
Set palette registers to the default values.
Calling syntax: RUN FOENIX([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