________ ________ _____ ______ ________ ________
|\ ____\|\ ____\|\ _ \ _ \|\ __ \|\ ____\
\ \ \___|\ \ \___|\ \ \\\__\ \ \ \ \|\ \ \ \___|_
\ \_____ \ \ \ \ \ \\|__| \ \ \ \\\ \ \_____ \
\|____|\ \ \ \____\ \ \ \ \ \ \ \\\ \|____|\ \
____\_\ \ \_______\ \__\ \ \__\ \_______\____\_\ \
|\_________\|_______|\|__| \|__|\|_______|\_________\
\|_________| \|_________|
Windows SCMOS Simulator.
OS X SCMOS Simulator. Intel only. (10.6+ ????????)
Drag contents of the zip files to the fjords folder of your SHARECART directory.
All SCMOS Applications run on a 32x45 character display supporting Code Page 437. The display uses the 16 colors from the SHARECART1000 palette.
SCMOS API
Booleans in Lua are different from most other languages, SCMOS developers should read about types in Lua
void TITLE(string text)
Sets the text in the title bar. Horizontal lines are added to each side of the application's title.
void CLEAR()
Clears the application window with the DEFAULT BACKGROUND COLOR.
void COLOR(int foregroundcolorid, int backgroundcolorid)
Sets the foreground and background color IDs for text display.
boolean ACTIVECOLOR(int foregroundcolorid, int backgroundcolorid)
Sets the foreground and background color IDs for activated text.
boolean CHECKBOX(int x, int y, string text, boolean checked, boolean activated)
Displays a checkbox at a location with text
boolean BUTTON(int x, int y, int width, int height, string text)
Displays a button using the two ACTIVE colors at a position with size and text. Minimum button size is 5x5 characters. Returns whether the button has been tapped.
boolean TEXT(int x, int y, string text)
Displays text using the default colors at a position
void RECT(int x, int y, int width, int height)
Displays a rectangle using the default background color at a position with a size
TYPE SCMOSSET(string variable, TYPE value)
Sets the value of the variable in the ini file. VALUE can be an integer, boolean, or string.
TYPE SCMOSSET(string variable)
Gets the value of the variable in the ini file. Returns an integer, boolean, or string.
void AUDIOPLAY(int id)
Play the sound resource with the given id. Id range is 0-72 inclusive.
void AUDIOLOOP(int id)
Stop the sound resource with the given id. Id range is 0-72 inclusive.
void AUDIOSTOP(int id)
Stop the sound resource with the given id. Id range is 0-72 inclusive.
boolean AUDIOISPLAYING(int id)
Returns whether the sound resource with the given id is playing. Id range is 0-72 inclusive.
number AUDIOGETFREQ(int id)
Returns the frequency of the sound resource with the given id. Id range is 0-72 inclusive.
void AUDIOSETFREQ(int id, number frequency)
Set the frequency of the sound resource with the given id. Id range is 0-72 inclusive. 44100 Hz is the default value.
boolean INPUT(int x, int y, int width, int height)
Checks for an invisible button's tap property at the given position with size and text. Minimum button size is 5x5 characters.
COLOR IDs:
0 - BLACK | 8 - OLIVE YELLOW TAN THING |
1 - DARKEST BROWN | 9 - GREEN |
2 - DARKEST GREEN | 10 - SKYBLUE |
3 - DARKEST BLUE | 11 - GRAY |
4 - DARK BROWN | 12 - TAN |
5 - GRAYBROWN | 13 - LIGHT GREEN |
6 - BLUE | 14 - LIGHT BLUE |
7 - BRICK | 15 - WHITE |
1000 - BLACK | 1008 - DARK GRAY |
1001 - DARK BLUE | 1009 - LIGHT BLUE |
1002 - GREEN | 1010 - LIME |
1003 - DARKEST CYAN | 1011 - CYAN |
1004 - DARK RED | 1012 - RED |
1005 - DARK FUCHSIA | 1013 - FUCHSIA |
1006 - BROWN | 1014 - YELLOW |
1007 - DARK WHITE | 1015 - WHITE |
SCMOS Bitmap Font
The @ character is missing from this image.
Sample Code
This code is a direct copy of PARAMETERS.SCMOS, used in iOS version of the hit videogame FJORDS
function open()
TITLE("Parameters")
activeID = 0
COLOR(0,15)
ACTIVECOLOR(15,10)
end
function run()
CLEAR()
COLOR(0,15)
ACTIVECOLOR(15,10)
CHECKBOX(1,1,"BOMBS",SCMOSGET("SWITCH0")=="TRUE",activeID == 0)
CHECKBOX(1,3,"WATERFALLS",SCMOSGET("SWITCH1")=="TRUE",activeID == 1)
CHECKBOX(1,5,"ESCALATORS",SCMOSGET("SWITCH2")=="TRUE",activeID == 2)
CHECKBOX(1,7,"FERRY",SCMOSGET("SWITCH3")=="TRUE",activeID == 3)
CHECKBOX(1,9,"MAGIC",SCMOSGET("SWITCH4")=="TRUE",activeID == 4)
CHECKBOX(1,11,"GHOSTS",SCMOSGET("SWITCH5")=="TRUE",activeID == 5)
CHECKBOX(1,13,"DOORS",SCMOSGET("SWITCH6")=="TRUE",activeID == 6)
CHECKBOX(1,15,"WARP",SCMOSGET("SWITCH7")=="TRUE",activeID == 7)
ACTIVECOLOR(15,6)
if BUTTON(2,30,5,5,"\30") then
activeID = activeID - 1
if activeID < 0 then
activeID = 7
end
end
if BUTTON(9,30,14,5," TOGGLE") then
if activeID == 0 then --bombs
if SCMOSGET("SWITCH0") == "FALSE" then
SCMOSSET("SWITCH0","TRUE")
else
SCMOSSET("SWITCH0","FALSE")
end
end
if activeID == 1 then --waterfalls
if SCMOSGET("SWITCH1") == "FALSE" then
SCMOSSET("SWITCH1","TRUE")
else
SCMOSSET("SWITCH1","FALSE")
end
end
if activeID == 2 then --ladders
if SCMOSGET("SWITCH2") == "FALSE" then
SCMOSSET("SWITCH2","TRUE")
else
SCMOSSET("SWITCH2","FALSE")
end
end
if activeID == 3 then --ferry
if SCMOSGET("SWITCH3") == "FALSE" then
SCMOSSET("SWITCH3","TRUE")
else
SCMOSSET("SWITCH3","FALSE")
end
end
if activeID == 4 then --magic
if SCMOSGET("SWITCH4") == "FALSE" then
SCMOSSET("SWITCH4","TRUE")
else
SCMOSSET("SWITCH4","FALSE")
end
end
if activeID == 5 then --ghosts
if SCMOSGET("SWITCH5") == "FALSE" then
SCMOSSET("SWITCH5","TRUE")
else
SCMOSSET("SWITCH5","FALSE")
end
end
if activeID == 6 then --doors
if SCMOSGET("SWITCH6") == "FALSE" then
SCMOSSET("SWITCH6","TRUE")
else
SCMOSSET("SWITCH6","FALSE")
end
end
if activeID == 7 then --warp
if SCMOSGET("SWITCH7") == "FALSE" then
SCMOSSET("SWITCH7","TRUE")
else
SCMOSSET("SWITCH7","FALSE")
end
end
end
if BUTTON(25,30,5,5,"\31") then
activeID = activeID + 1
if activeID > 7 then
activeID = 0
end
end
if BUTTON(2,37,28,5," \16 EXIT PARAMETERS") then
EXIT()
end
end
function close()
-- nothing
end