Hello everyone!
Meet - virtual fantasy nano console "b53"
Technical parameters.
Startup environment: virtual home computer Mini Micro
Display: Mini Micro text mode display
Programming language: MiniScript
Screen resolution: 32x24
Palette: 53 colors
Border: has 8 colors
Why is the name b53 so strange?
The console is very small, so the name is also abbreviated.
"b" - indicates the bear's mascot, "53" - the number of colors in the palette.
To be continued...
// Virtual fantasy nano console b53
// Author: Al-Rado
// Date: 01.04.2020
_p = {}
_p.version = 0.01
_p.textWidth = 68
_p.textHeight = 26
_p.borderX = 2
_p.borderY = 1
_p.width = 32
_p.height = 24
_p.inkColors = ["#000000FF", "#606060FF", "#7F7F7FFF", "#C0C0C0FF", "#FFFFFFFF", "#C06060FF", "#FF7F7FFF", "#C0C060FF", "#FFFF7FFF", "#60C060FF",
"#7FFF7FFF", "#60C0C0FF", "#7FFFFFFF", "#6060C0FF", "#7F7FFFFF", "#C060C0FF", "#FF7FFFFF", "#600000FF", "#7F0000FF", "#C00000FF",
"#FF0000FF", "#C06000FF", "#FF7F00FF", "#606000FF", "#7F7F00FF", "#C0C000FF", "#FFFF00FF", "#60C000FF", "#7FFF00FF", "#006000FF",
"#007F00FF", "#00C000FF", "#00FF00FF", "#00C060FF", "#00FF7FFF", "#006060FF", "#007F7FFF", "#00C0C0FF", "#00FFFFFF", "#0060C0FF",
"#007FFFFF", "#000060FF", "#00007FFF", "#0000C0FF", "#0000FFFF", "#6000C0FF", "#7F00FFFF", "#600060FF", "#7F007FFF", "#C000C0FF",
"#FF00FFFF", "#C00060FF", "#FF007FFF"]
_p.borderColors = ["#000000FF", "#0000C0FF", "#C00000FF", "#C000C0FF", "#00C000FF", "#00C0C0FF", "#C0C000FF", "#C0C0C0FF"]
_screen = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,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0,0,0,0,0,0,0,3,2,2,20,1,2,2,2,3,2,1,3,
2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,2,2,2,2,2,2,3,1,0,0,2,2,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,1,0,0,3,2,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
splashScreen = function()
clear
cls
setBorder 2
i = 0
for y in range(0, _p.height - 1)
for x in range(0, _p.width - 1)
setInk x, _p.height - y, _screen[i]
i = i + 1
end for
end for
print "Welcome to b53 virtual fantasy nano console!"
end function
logPalettes = function ()
cls
print "b53 palettes:"
_logColors "colors", _p.inkColors
_logColors "border colors", _p.borderColors
end function
width = function()
return _p.width
end function
height = function()
return _p.height
end function
setInk = function(x, y, inkIndex)
_color = _getColor(_p.inkColors, inkIndex)
setPixel x, y, _color
end function
setBorder = function(borderColorIndex)
_color = _getColor(_p.borderColors, borderColorIndex)
for x in range(0, _p.textWidth - 1)
text.setCellBackColor x, 0, _color
text.setCellBackColor x, _p.textHeight - 1, _color
end for
for y in range(0, _p.textHeight - 1)
text.setCellBackColor 0, y, _color
text.setCellBackColor 1, y, _color
text.setCellBackColor _p.textWidth - 2, y, _color
text.setCellBackColor _p.textWidth - 1, y, _color
end for
end function
setPixel = function(x, y, color)
if x >= 0 and x < _p.width and y >= 0 and y < _p.height then
x = _getX(x)
y = _getY(y)
text.setCellBackColor x, y, color
text.setCellBackColor x + 1, y, color
end if
end function
cls = function()
for x in range(0, _p.textWidth - 1)
for y in range(0, _p.textHeight - 1)
text.setCellBackColor x, y, color.clear
end for
end for
end function
getInk = function (color)
for i in range(0, _p.inkColors.len-1)
if _p.inkColors[i] == color then return i
end for
return 0
end function
// private methods
_getX = function(x)
return _p.borderX + x * 2
end function
_getY = function(y)
return _p.height - y + _p.borderY
end function
_getColor = function(colors, index)
sign = sign(index)
newIndex = abs(index) % colors.len * sign
return colors[newIndex]
end function
_logColors = function (name, colors)
textCol = text.color
text.delimiter = ""
print " " + colors.len + " " + name + " ["
text.inverse = true
for col in colors
text.color = col
print " "
end for
text.inverse = false
text.color = textCol
print "]"
text.delimiter = char(13)
print " "
end function