diff --git a/.gitignore b/.gitignore index bd52784..f018083 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,8 @@ llvm-mos/ llvm-mos-source/ llvm-mos-sdk-source/ FoenixMgr/ +FoenixIDE-source/ +FoenixIDE/ depot_tools/ skia/ aseprite/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..83b293d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Jason Andersen + +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. diff --git a/build-aseprite.sh b/build-aseprite.sh index 4004bb4..5585c1e 100755 --- a/build-aseprite.sh +++ b/build-aseprite.sh @@ -1,5 +1,28 @@ #!/bin/bash +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + if [[ ! -d depot_tools ]]; then sudo apt-get install -y libgnutls28-dev libbz2-dev libharfbuzz-dev g++ cmake ninja-build libx11-dev libxcursor-dev libgl1-mesa-dev libfontconfig1-dev git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git diff --git a/build-header-tool.sh b/build-header-tool.sh index d84adab..3f9b6d7 100755 --- a/build-header-tool.sh +++ b/build-header-tool.sh @@ -1,5 +1,28 @@ #!/bin/bash +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + pushd header - cc header.c -o header -lm + cc header.c -o header -lm popd diff --git a/build-llvm-mos.sh b/build-llvm-mos.sh index 3d6531e..9b2c1ab 100755 --- a/build-llvm-mos.sh +++ b/build-llvm-mos.sh @@ -1,5 +1,28 @@ #!/bin/bash -e +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + INSTALL=$(pwd)/llvm-mos if [[ "${1,,}" == "all" ]]; then @@ -9,14 +32,14 @@ if [[ "${1,,}" == "all" ]]; then fi pushd llvm-mos-source - cmake \ - -C clang/cmake/caches/MOS.cmake \ - -G Ninja \ - -S llvm \ - -B build \ - -DCMAKE_INSTALL_PREFIX=${INSTALL} - cmake --build build - cmake --install build + cmake \ + -C clang/cmake/caches/MOS.cmake \ + -G Ninja \ + -S llvm \ + -B build \ + -DCMAKE_INSTALL_PREFIX=${INSTALL} + cmake --build build + cmake --install build popd fi diff --git a/build-merlin.sh b/build-merlin.sh index 97f71a0..f957bf3 100755 --- a/build-merlin.sh +++ b/build-merlin.sh @@ -1,5 +1,28 @@ #!/bin/bash +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + PREFIX=$(pwd)/merlin32 if [[ ! -d merlin32-source ]]; then diff --git a/examples/kuptest/build.sh b/examples/kuptest/build.sh index b9d7fb1..486a5fa 100755 --- a/examples/kuptest/build.sh +++ b/examples/kuptest/build.sh @@ -1,5 +1,28 @@ #!/bin/bash -ex +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + F256=$(pwd)/../.. LLVM=${F256}/llvm-mos SETTINGS=${LLVM}/mos-platform/f256k/lib/settings.ld diff --git a/examples/kuptest/kuptest.c b/examples/kuptest/kuptest.c index 78f2de1..75b121a 100644 --- a/examples/kuptest/kuptest.c +++ b/examples/kuptest/kuptest.c @@ -1 +1,24 @@ +/* + * Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com + * + * 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. + */ + + int main(void) { return 0; } diff --git a/examples/pgztest/CMakeLists.txt b/examples/pgztest/CMakeLists.txt index 8385a48..ad82bf0 100644 --- a/examples/pgztest/CMakeLists.txt +++ b/examples/pgztest/CMakeLists.txt @@ -1,3 +1,26 @@ +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + # This is only to make my IDE happy. # We can't actually build with it until I get llvm-mos integrated into # toolchains. -- SCD @@ -11,7 +34,6 @@ set(DEFINES ${CMAKE_SOURCE_DIR}/../../include) set(F256LIB ${CMAKE_SOURCE_DIR}/../../f256lib) set(PGZTEST_SOURCE - ${F256LIB}/api.h ${F256LIB}/f256.h ${F256LIB}/f256.c pgztest.c diff --git a/examples/pgztest/build.sh b/examples/pgztest/build.sh index ace5133..5e4df1d 100755 --- a/examples/pgztest/build.sh +++ b/examples/pgztest/build.sh @@ -1,5 +1,28 @@ #!/bin/bash -ex +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + F256=$(pwd)/../.. LLVM=${F256}/llvm-mos SETTINGS=${LLVM}/mos-platform/f256k/lib/settings.ld @@ -24,6 +47,6 @@ ${F256}/header/header \ ${START} \ pgztest.bin ${START} -#llvm-nm pgztest.elf -#llvm-objdump -d --print-imm-hex pgztest.elf -#hexdump -C pgztest.pgz +#llvm-nm pgztest.elf > pgztest.lst +llvm-objdump -d --print-imm-hex pgztest.elf > pgztest.lst +hexdump -C pgztest.pgz > pgztest.hex diff --git a/examples/pgztest/pgztest.c b/examples/pgztest/pgztest.c index 43684dd..16d5970 100644 --- a/examples/pgztest/pgztest.c +++ b/examples/pgztest/pgztest.c @@ -1,10 +1,40 @@ +/* + * Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com + * + * 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. + */ + + #include "f256.h" int main(void) { - reset(); + f256Init(); + + /* + resetText(); print("F256 LIVES!\n"); setTextColor(LIGHT_GREEN, BLACK); print("Green!"); + */ + + resetGraphics(); + return 0; } diff --git a/examples/pgztest/run.sh b/examples/pgztest/run.sh index 1c15024..3419eb3 100755 --- a/examples/pgztest/run.sh +++ b/examples/pgztest/run.sh @@ -1,5 +1,29 @@ #!/bin/bash + +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + #python ../../FoenixMgr/FoenixMgr/fnxmgr.py --boot FLASH python ../../FoenixMgr/FoenixMgr/fnxmgr.py --run-pgz pgztest.pgz -#python ../../FoenixMgr/FoenixMgr/fnxmgr.py --dump 2000 --count 200 +#python ../../FoenixMgr/FoenixMgr/fnxmgr.py --dump 10000 --count 10 #python ../../FoenixMgr/FoenixMgr/fnxmgr.py --copy pgztest.pgz diff --git a/f256lib/bitmap.c b/f256lib/bitmap.c new file mode 100644 index 0000000..f278c64 --- /dev/null +++ b/f256lib/bitmap.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com + * + * 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. + */ + + +#include "bitmap.h" + + +static int _MAX_X = 320; +static int _MAX_Y = 200; +static uint32_t _BITMAP_BASE = 0x10000; +static byte _color = 255; + + +char error; + + +void clear(void) { + int x; + int y; + + //***TODO*** Use DMA + + // This is just test code. + for (y=0; y<_MAX_Y; y++) { + for (x=0; x<_MAX_X; x++) { + putpixel(x, y); + } + _color++; // Let it roll over. + } +} + + +void defineGraphicsColor(byte slot, byte r, byte g, byte b) { + byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. + byte *write; + + POKE(MMU_IO_CTRL, MMU_IO_PAGE_1); // Swap I/O page 1 into bank 6. + + write = (byte *)VKY_GR_CLUT_0 + slot * 4; + *write++ = b; + *write++ = g; + *write++ = r; + *write++ = 0xff; + + POKE(MMU_IO_CTRL, mmu); // Restore MMU state. +} + + +void putpixel(int x, int y) { + uint32_t pixelRAM; + byte block; + + // We only map 8k of the bitmap into CPU RAM at once. + // We use slot 5 for this. We need to figure out + // where our pixel lands and bring that into RAM. + pixelRAM = _BITMAP_BASE + (y * _MAX_X) + x; + block = pixelRAM / 0x2000; + POKE(MMU_MEM_BANK_5, block); + //pixelRAM -= 0x2000 * block; // Find offset into this block. + pixelRAM &= 0x1FFF; + POKE(0xa000 + pixelRAM, _color); + POKE(MMU_MEM_BANK_5, 5); +} + + +void resetGraphics(void) { + byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. + byte x; + int y; + + _MAX_X = 320; + _MAX_Y = 200; + _BITMAP_BASE = 0x10000; + _color = 255; + + POKE(MMU_IO_CTRL, MMU_IO_PAGE_0); // Swap I/O page 0 into bank 6. + + POKE(VKY_LAYER_CTRL_0, 16); // Bitmaps on all layers. + POKE(VKY_LAYER_CTRL_1, 1); // Bitmaps on all layers. + POKE(VKY_BM1_CTRL, 0); // Disable bitmap 1. + POKE(VKY_BM2_CTRL, 0); // Disable bitmap 2. + + // Set up bitmap 0. + POKE(VKY_BM0_CTRL, 1); // Enable bitmap 0, GLUT 0. + //POKED(VKY_BM0_ADDR_L, _BITMAP_BASE); // Location of bitmap data. + POKE(VKY_BM0_ADDR_L, _BITMAP_BASE & 0xFF); // Location of bitmap data. + POKE(VKY_BM0_ADDR_M, (_BITMAP_BASE >> 8) & 0xFF); // Location of bitmap data. + POKE(VKY_BM0_ADDR_H, (_BITMAP_BASE >> 16) & 0xFF); // Location of bitmap data. + + // Set palette to a gradient so there's at least *something*. + for (x=0; x<=255; x++) defineGraphicsColor(x, x, x, x); + + clear(); + + /* + POKE(MMU_MEM_BANK_5, 8); + for (y=0; y<8192; y++) POKE(0xa000 + y, 255); + POKE(MMU_MEM_BANK_5, 5); + */ + + POKE(MMU_IO_CTRL, mmu); // Restore MMU state. +} + + +void setGraphicsColor(byte c) { + _color = c; +} diff --git a/f256lib/bitmap.h b/f256lib/bitmap.h new file mode 100644 index 0000000..7545692 --- /dev/null +++ b/f256lib/bitmap.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com + * + * 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. + */ + + +#ifndef BITMAP_H +#define BITMAP_H + + +#ifdef __cplusplus +extern "C" +{ +#endif + + +#include "f256.h" + + +void clear(void); +void defineGraphicsColor(byte slot, byte r, byte g, byte b); +void putpixel(int x, int y); +void resetGraphics(void); +void setGraphicsColor(byte c); + + +#ifdef __cplusplus +} +#endif + + +#endif // BITMAP_H diff --git a/f256lib/f256.c b/f256lib/f256.c index 7bc24d9..b1f6a65 100644 --- a/f256lib/f256.c +++ b/f256lib/f256.c @@ -1,198 +1,52 @@ +/* + * Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com + * + * 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. + */ + + #include "f256.h" - -char error; - -colorT textColors[16] = { - { 0x00, 0x00, 0x00 }, // 0 Black - { 0xdd, 0x00, 0x33 }, // 1 Deep Red - { 0x00, 0x00, 0x99 }, // 2 Dark Blue - { 0xdd, 0x22, 0xdd }, // 3 Purple - { 0x00, 0x77, 0x22 }, // 4 Dark Green - { 0x55, 0x55, 0x55 }, // 5 Dark Gray - { 0x22, 0x22, 0xff }, // 6 Medium Blue - { 0x66, 0xaa, 0xff }, // 7 Light Blue - { 0x88, 0x55, 0x00 }, // 8 Brown - { 0xff, 0x66, 0x00 }, // 9 Orange - { 0xaa, 0xaa, 0xaa }, // A Light Gray - { 0xff, 0x99, 0x88 }, // B Pink - { 0x00, 0xdd, 0x00 }, // C Light Green - { 0xff, 0xff, 0x00 }, // D Yellow - { 0x55, 0xff, 0x99 }, // E Aquamarine - { 0xff, 0xff, 0xff } // F White -}; +#include "text.c" +#include "bitmap.c" -static byte _MAX_COL = 80; -static byte _MAX_ROW = 60; -static byte _row = 0; -static byte _col = 0; -static byte _fcolor = 15; -static byte _bcolor = 0; -static byte _ccolor = 240; - - -// Clear screen to current text attributes. -void cls(void) { - int i; - byte *vram = (byte *)TEXT_MATRIX; - byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. - - POKE(MMU_IO_CTRL, MMU_IO_TEXT); // Swap I/O page 2 into bank 6. - for (i = 0; i < _MAX_COL * _MAX_ROW; i++) *vram++ = 32; - - POKE(MMU_IO_CTRL, MMU_IO_COLOR); // Swap I/O page 3 into bank 6. - vram = (byte *)TEXT_MATRIX; - for (i = 0; i < _MAX_COL * _MAX_ROW; i++) *vram++ = _ccolor; - - POKE(MMU_IO_CTRL, mmu); // Restore MMU state. - - gotoxy(0, 0); -} - - -// Define text color. -void defineTextColor(byte slot, byte fr, byte fg, byte fb, byte br, byte bg, byte bb) { - byte mmu; - byte *write; - - mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. - POKE(MMU_IO_CTRL, MMU_IO_PAGE_0); // Swap I/O page 0 into bank 6. - - write = (byte *)VKY_TXT_FGLUT + slot * 4; - *write++ = fb; - *write++ = fg; - *write++ = fr; - *write++ = 0xff; - - write = (byte *)VKY_TXT_BGLUT + slot * 4; - *write++ = bb; - *write++ = bg; - *write++ = br; - *write++ = 0xff; - - POKE(MMU_IO_CTRL, mmu); // Restore MMU state. -} - - -// Move cursor. -void gotoxy(byte x, byte y) { - byte mmu; - - mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. - POKE(MMU_IO_CTRL, MMU_IO_PAGE_0); // Swap I/O page 0 into bank 6. - - _col = x; - POKE(VKY_CRSR_X_L, _col); // Set cursor X position. - POKE(VKY_CRSR_X_H, 0); - - _row = y; - POKE(VKY_CRSR_Y_L, _row); // Set cursor Y position. - POKE(VKY_CRSR_Y_H, 0); - - POKE(MMU_IO_CTRL, mmu); // Restore MMU state. -} - - -// Print a string to the screen. -void print(char *message) { - int x = 0; - int i = 0; - int j = 0; - byte *vram = (byte *)TEXT_MATRIX + _col + (_MAX_COL * _row); - byte *save = 0; - byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. - - while (message[x] != 0) { - switch (message[x]) { - default: - POKE(MMU_IO_CTRL, MMU_IO_COLOR); // Swap I/O page 3 into bank 6. - vram[_col] = _ccolor; - POKE(MMU_IO_CTRL, MMU_IO_TEXT); // Swap I/O page 2 into bank 6. - vram[_col] = message[x]; - _col++; - if (_col != _MAX_COL) break; - // Fall through. - case 10: - case 13: - _col = 0; - _row++; - if (_row == _MAX_ROW) { - // Scroll contents up one line. - vram = (byte *)TEXT_MATRIX; - POKE(MMU_IO_CTRL, MMU_IO_COLOR); // Swap I/O page 3 into bank 6. - for (j=0; j<2; j++) { - for (i = 0; i < _MAX_COL * (_MAX_ROW - 1); i++) vram[i] = vram[i+_MAX_COL]; - POKE(MMU_IO_CTRL, MMU_IO_TEXT); // Swap I/O page 2 into bank 6. - } - // Clear bottom line. - vram += i; - save = vram; - POKE(MMU_IO_CTRL, MMU_IO_COLOR); // Swap I/O page 3 into bank 6. - for (i = 0; i < _MAX_COL; i++) *vram++ = _ccolor; - POKE(MMU_IO_CTRL, MMU_IO_TEXT); // Swap I/O page 2 into bank 6. - vram = save; - for (i = 0; i < _MAX_COL; i++) *vram++ = 32; - // Set up on bottom line. - _row--; - vram = (byte *)TEXT_MATRIX + _MAX_COL * (_MAX_ROW - 2) + 1; - break; - } - vram += _MAX_COL; - break; - } - x++; - } - - POKE(MMU_IO_CTRL, mmu); // Restore MMU state. - - gotoxy(_col, _row); -} - - -// Reset display to text, "standard" colors. -void reset(void) { - byte mmu; - byte x; - byte y; - - mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. - POKE(MMU_IO_CTRL, MMU_IO_TEXT); // Swap I/O page 2 into bank 6. - - // If we set 0xD000 to 0x01 and 0xD001 to 0x00, that will put us into text mode at 80 × 60. - POKE(VKY_MSTR_CTRL_0, 1); - POKE(VKY_MSTR_CTRL_1, 0); - - _MAX_COL = 80; - _MAX_ROW = 60; - - _fcolor = 15; - _bcolor = 0; - _ccolor = 240; +void f256Init(void) { + byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. POKE(MMU_IO_CTRL, MMU_IO_PAGE_0); // Swap I/O page 0 into bank 6. - POKE(VKY_CRSR_CTRL, 3); // Enable cursor, 1/2s flash. - POKE(VKY_CRSR_CHAR, '_'); // Set cursor shape. (199 = Checkerboard) - - // Set up default text colors. - for (x=0; xmember) #define EVENT(member) (size_t)(&((struct events *)0)->member) #define CALL(fn) \ - asm("jsr %[addy] \n" \ - "stz %[err] \n" \ - "ror %[err]" \ - : [err] "+m"(error) \ - : [addy] "i"(VECTOR(fn)) \ - : "a", "x", "y", "c", "v"); - +asm("jsr %[addy] \n" \ + "stz %[err] \n" \ + "ror %[err]" \ + : [err] "+m"(error) \ + : [addy] "i"(VECTOR(fn)) \ + : "a", "x", "y", "c", "v"); extern struct event_t event; // The event struct is allocated in crt0. extern char error; -// Apple IIgs Colors, because that's how we roll. -typedef enum textColorsE { - BLACK = 0, - DEEP_RED, - DARK_BLUE, - PURPLE, - DARK_GREEN, - DARK_GRAY, - MEDIUM_BLUE, - LIGHT_BLUE, - BROWN, - ORANGE, - LIGHT_GRAY, - PINK, - LIGHT_GREEN, - YELLOW, - AQUAMARINE, - WHITE, - TEXTCOLORS_COUNT -} textColorsT; - -typedef struct colorS { - byte r; - byte g; - byte b; -} colorT; - -extern colorT textColors[16]; +void f256Init(void); -void cls(void); -void defineTextColor(byte slot, byte fr, byte fg, byte fb, byte br, byte bg, byte bb); -void gotoxy(byte x, byte y); -void print(char *message); -void reset(void); -void setTextColor(byte f, byte b); +#include "text.h" +#include "bitmap.h" #ifdef __cplusplus diff --git a/f256lib/text.c b/f256lib/text.c new file mode 100644 index 0000000..cdba9b2 --- /dev/null +++ b/f256lib/text.c @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com + * + * 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. + */ + + +#include "text.h" + + +char error; + + +colorT textColors[16] = { + { 0x00, 0x00, 0x00 }, // 0 Black + { 0xdd, 0x00, 0x33 }, // 1 Deep Red + { 0x00, 0x00, 0x99 }, // 2 Dark Blue + { 0xdd, 0x22, 0xdd }, // 3 Purple + { 0x00, 0x77, 0x22 }, // 4 Dark Green + { 0x55, 0x55, 0x55 }, // 5 Dark Gray + { 0x22, 0x22, 0xff }, // 6 Medium Blue + { 0x66, 0xaa, 0xff }, // 7 Light Blue + { 0x88, 0x55, 0x00 }, // 8 Brown + { 0xff, 0x66, 0x00 }, // 9 Orange + { 0xaa, 0xaa, 0xaa }, // A Light Gray + { 0xff, 0x99, 0x88 }, // B Pink + { 0x00, 0xdd, 0x00 }, // C Light Green + { 0xff, 0xff, 0x00 }, // D Yellow + { 0x55, 0xff, 0x99 }, // E Aquamarine + { 0xff, 0xff, 0xff } // F White +}; + + +static byte _MAX_COL = 80; +static byte _MAX_ROW = 60; +static byte _row = 0; +static byte _col = 0; +static byte _fcolor = 15; +static byte _bcolor = 0; +static byte _ccolor = 240; + + +// Clear screen to current text attributes. +void cls(void) { + int i; + byte *vram = (byte *)TEXT_MATRIX; + byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. + + POKE(MMU_IO_CTRL, MMU_IO_TEXT); // Swap I/O page 2 into bank 6. + for (i = 0; i < _MAX_COL * _MAX_ROW; i++) *vram++ = 32; + + POKE(MMU_IO_CTRL, MMU_IO_COLOR); // Swap I/O page 3 into bank 6. + vram = (byte *)TEXT_MATRIX; + for (i = 0; i < _MAX_COL * _MAX_ROW; i++) *vram++ = _ccolor; + + POKE(MMU_IO_CTRL, mmu); // Restore MMU state. + + gotoxy(0, 0); +} + + +// Define text color. +void defineTextColor(byte slot, byte fr, byte fg, byte fb, byte br, byte bg, byte bb) { + byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. + byte *write; + + POKE(MMU_IO_CTRL, MMU_IO_PAGE_0); // Swap I/O page 0 into bank 6. + + write = (byte *)VKY_TXT_FGLUT + slot * 4; + *write++ = fb; + *write++ = fg; + *write++ = fr; + *write++ = 0xff; + + write = (byte *)VKY_TXT_BGLUT + slot * 4; + *write++ = bb; + *write++ = bg; + *write++ = br; + *write++ = 0xff; + + POKE(MMU_IO_CTRL, mmu); // Restore MMU state. +} + + +// Move cursor. +void gotoxy(byte x, byte y) { + byte mmu; + + mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. + POKE(MMU_IO_CTRL, MMU_IO_PAGE_0); // Swap I/O page 0 into bank 6. + + _col = x; + POKE(VKY_CRSR_X_L, _col); // Set cursor X position. + POKE(VKY_CRSR_X_H, 0); + + _row = y; + POKE(VKY_CRSR_Y_L, _row); // Set cursor Y position. + POKE(VKY_CRSR_Y_H, 0); + + POKE(MMU_IO_CTRL, mmu); // Restore MMU state. +} + + +// Print a string to the screen. +void print(char *message) { + int x = 0; + int i = 0; + int j = 0; + byte *vram = (byte *)TEXT_MATRIX + _col + (_MAX_COL * _row); + byte *save = 0; + byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. + + while (message[x] != 0) { + switch (message[x]) { + default: + POKE(MMU_IO_CTRL, MMU_IO_COLOR); // Swap I/O page 3 into bank 6. + vram[_col] = _ccolor; + POKE(MMU_IO_CTRL, MMU_IO_TEXT); // Swap I/O page 2 into bank 6. + vram[_col] = message[x]; + _col++; + if (_col != _MAX_COL) break; + // Fall through. + case 10: + case 13: + _col = 0; + _row++; + if (_row == _MAX_ROW) { + // Scroll contents up one line. + vram = (byte *)TEXT_MATRIX; + POKE(MMU_IO_CTRL, MMU_IO_COLOR); // Swap I/O page 3 into bank 6. + for (j=0; j<2; j++) { + for (i = 0; i < _MAX_COL * (_MAX_ROW - 1); i++) vram[i] = vram[i+_MAX_COL]; + POKE(MMU_IO_CTRL, MMU_IO_TEXT); // Swap I/O page 2 into bank 6. + } + // Clear bottom line. + vram += i; + save = vram; + POKE(MMU_IO_CTRL, MMU_IO_COLOR); // Swap I/O page 3 into bank 6. + for (i = 0; i < _MAX_COL; i++) *vram++ = _ccolor; + POKE(MMU_IO_CTRL, MMU_IO_TEXT); // Swap I/O page 2 into bank 6. + vram = save; + for (i = 0; i < _MAX_COL; i++) *vram++ = 32; + // Set up on bottom line. + _row--; + vram = (byte *)TEXT_MATRIX + _MAX_COL * (_MAX_ROW - 2) + 1; + break; + } + vram += _MAX_COL; + break; + } + x++; + } + + POKE(MMU_IO_CTRL, mmu); // Restore MMU state. + + gotoxy(_col, _row); +} + + +// Reset display to text, "standard" colors. +void resetText(void) { + byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state. + byte x; + byte y; + + _MAX_COL = 80; + _MAX_ROW = 60; + + _fcolor = 15; + _bcolor = 0; + _ccolor = 240; + + POKE(MMU_IO_CTRL, MMU_IO_PAGE_0); // Swap I/O page 0 into bank 6. + + POKE(VKY_CRSR_CTRL, 3); // Enable cursor, 1/2s flash. + POKE(VKY_CRSR_CHAR, '_'); // Set cursor shape. (199 = Checkerboard) + + // Set up default text colors. + for (x=0; x #include #include diff --git a/start-quartus.sh b/start-quartus.sh index 98b39e7..6122770 100755 --- a/start-quartus.sh +++ b/start-quartus.sh @@ -1,5 +1,28 @@ #!/bin/bash +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + BIN=$(pwd)/intelFPGA_lite/23.1std/quartus/bin ${BIN}/jtagconfig diff --git a/update-defines.sh b/update-defines.sh index 1b97adf..c1d2e25 100755 --- a/update-defines.sh +++ b/update-defines.sh @@ -1,5 +1,28 @@ #!/bin/bash -ex +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + INC=$(pwd)/include mkdir -p ${INC} @@ -12,7 +35,7 @@ else fi pushd merlin-code/merlin32/jr - for FILE in $(ls *.asm); do + for FILE in $(ls *.asm); do HEADER=${INC}/$(basename ${FILE} .asm).h BLOCK=_$(basename ${FILE^^} .ASM)_H_ echo "#ifndef ${BLOCK}" > ${HEADER} @@ -24,5 +47,5 @@ pushd merlin-code/merlin32/jr sed 's/\(^[[:alpha:]].*$\)/#define \1/' >> ${HEADER} echo >> ${HEADER} echo "#endif // ${BLOCK}" >> ${HEADER} - done + done popd diff --git a/update-ide-firmware.sh b/update-ide-firmware.sh index 9d3eca8..5474a2a 100755 --- a/update-ide-firmware.sh +++ b/update-ide-firmware.sh @@ -1,5 +1,28 @@ #!/bin/bash +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# 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. +# + + if [[ ! -d f256-firmware ]]; then git clone https://github.com/FoenixRetro/f256-firmware.git else