diff --git a/data/OpenOS/LICENSE b/data/OpenOS/LICENSE new file mode 100644 index 0000000..e2f5628 --- /dev/null +++ b/data/OpenOS/LICENSE @@ -0,0 +1,46 @@ +Copyright (c) 2013-2015 Florian "Sangar" Nücke + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +------------------------------------------------------------------------------- + +All images / textures and localization strings (resources) are put in the +public domain, unless explicitly excluded below. More specicially, see CC0 1.0 +Universal: + + http://creativecommons.org/publicdomain/zero/1.0/ + +Contributions: + PixelToast - Capacitor textures. + asie - Disk drive inject/eject and floppy disk access sound samples. + +Thanks a lot! + +------------------------------------------------------------------------------- + +The font used for screens and for monospace text in manual is unscii, made by +viznut, and was further expanded by asie. For more information, please see: + + https://github.com/asiekierka/unscii-asie + +------------------------------------------------------------------------------- + +Assets from other sources: + HDD access samples based on this sample from freesound.org: + https://www.freesound.org/people/artykris/sounds/117401/ diff --git a/data/luaBios.lua b/data/luaBios.lua index f267fd4..ea37069 100644 --- a/data/luaBios.lua +++ b/data/luaBios.lua @@ -1,3 +1,52 @@ +--[[ +Copyright (c) 2013-2015 Florian "Sangar" Nücke + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +------------------------------------------------------------------------------- + +All images / textures and localization strings (resources) are put in the +public domain, unless explicitly excluded below. More specicially, see CC0 1.0 +Universal: + + http://creativecommons.org/publicdomain/zero/1.0/ + +Contributions: + PixelToast - Capacitor textures. + asie - Disk drive inject/eject and floppy disk access sound samples. + +Thanks a lot! + +------------------------------------------------------------------------------- + +The font used for screens and for monospace text in manual is unscii, made by +viznut, and was further expanded by asie. For more information, please see: + + https://github.com/asiekierka/unscii-asie + +------------------------------------------------------------------------------- + +Assets from other sources: + HDD access samples based on this sample from freesound.org: + https://www.freesound.org/people/artykris/sounds/117401/ +]] + local init do local component_invoke = component.invoke diff --git a/src/components/gpu.c b/src/components/gpu.c index bc1b6b7..7ccca6b 100644 --- a/src/components/gpu.c +++ b/src/components/gpu.c @@ -141,7 +141,7 @@ void nni_gpu_set(nni_gpu *gpu, void *_, nn_component *component, nn_computer *co } int current = 0; - while(s[current]) { + while(s[current] != 0) { int codepoint = nn_unicode_codepointAt(s, current); nn_setPixel(gpu->currentScreen, x, y, nni_gpu_makePixel(gpu, s + current)); if(isVertical) { diff --git a/src/emulator.c b/src/emulator.c index 7709ef7..c6f656e 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -315,6 +315,8 @@ int main() { SetConfigFlags(FLAG_WINDOW_RESIZABLE); InitWindow(800, 600, "emulator"); + Font unscii = LoadFont("unscii-16-full.ttf"); + double lastTime = nn_realTime(); while(true) { if(WindowShouldClose()) break; @@ -362,7 +364,8 @@ render: int scrW = 1, scrH = 1; nn_getResolution(s, &scrW, &scrH); int pixelHeight = GetScreenHeight() / scrH; - int pixelWidth = MeasureText("A", pixelHeight); + float spacing = (float)pixelHeight/10; + int pixelWidth = MeasureTextEx(unscii, "A", pixelHeight, spacing).x; for(size_t x = 0; x < scrW; x++) { for(size_t y = 0; y < scrH; y++) { @@ -373,7 +376,7 @@ render: Color fgColor = ne_processColor(p.fg); Color bgColor = ne_processColor(p.bg); DrawRectangle(x * pixelWidth, y * pixelHeight, pixelWidth, pixelHeight, bgColor); - DrawText(s, x * pixelWidth, y * pixelHeight, pixelHeight - 5, fgColor); + DrawTextEx(unscii, s, (Vector2) {x * pixelWidth, y * pixelHeight}, pixelHeight - 5, spacing, fgColor); } } diff --git a/unscii-16-full.ttf b/unscii-16-full.ttf new file mode 100644 index 0000000..0a3a84e Binary files /dev/null and b/unscii-16-full.ttf differ