From 22cca7c0ca81e832214040a364c302997e16939f Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Wed, 10 Jan 2024 17:57:56 -0600 Subject: [PATCH] In theory, we have tilemap support. --- .gitignore | 3 ++ examples/cube/cube.c | 14 +++--- examples/pgztest/copy.sh | 27 +++++++++++ examples/pgztest/dump.sh | 26 ++++++++++ examples/pgztest/pgztest.c | 41 ++++++---------- examples/pgztest/start.sh | 26 ++++++++++ examples/pgztest/stop.sh | 26 ++++++++++ f256lib/bitmap.c | 82 ++++++++++++++----------------- f256lib/bitmap.h | 9 ++-- f256lib/f256.h | 15 ++++++ f256lib/graphics.c | 48 +++++++++++++----- f256lib/graphics.h | 20 ++------ f256lib/tile.c | 99 ++++++++++++++++++++++++++++++++++++++ f256lib/tile.h | 5 ++ 14 files changed, 328 insertions(+), 113 deletions(-) create mode 100755 examples/pgztest/copy.sh create mode 100755 examples/pgztest/dump.sh create mode 100755 examples/pgztest/start.sh create mode 100755 examples/pgztest/stop.sh diff --git a/.gitignore b/.gitignore index f018083..31bd19f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ software/ *.pgx *.bin *.elf +*.lst +*.hex +*.o # Crap for CrossOver .windows-serial diff --git a/examples/cube/cube.c b/examples/cube/cube.c index 848a6c1..48b6924 100644 --- a/examples/cube/cube.c +++ b/examples/cube/cube.c @@ -183,9 +183,9 @@ int main(void) { // Clear two graphics pages. bitmapSetColor(0); - bitmapSetPage(0); + bitmapSetActive(0); bitmapClear(); - bitmapSetPage(1); + bitmapSetActive(1); bitmapClear(); bitmapGetResolution(&widthOffset, &heightOffset); @@ -195,12 +195,14 @@ int main(void) { while(1) { if (p) { p = 0; - bitmapSetPage(1); - bitmapShowPage(0); + bitmapSetActive(1); + bitmapSetVisible(0, true); + bitmapSetVisible(1, false); } else { p = 1; - bitmapSetPage(0); - bitmapShowPage(1); + bitmapSetActive(0); + bitmapSetVisible(0, false); + bitmapSetVisible(1, true); } bitmapSetColor(0); for (i=0; i<12; i++) bitmapLine(past[i][p].x1, past[i][p].y1, past[i][p].x2, past[i][p].y2); diff --git a/examples/pgztest/copy.sh b/examples/pgztest/copy.sh new file mode 100755 index 0000000..0f1514d --- /dev/null +++ b/examples/pgztest/copy.sh @@ -0,0 +1,27 @@ +#!/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 --copy pgztest.pgz + diff --git a/examples/pgztest/dump.sh b/examples/pgztest/dump.sh new file mode 100755 index 0000000..e74ac14 --- /dev/null +++ b/examples/pgztest/dump.sh @@ -0,0 +1,26 @@ +#!/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 --dump 10000 --count 10 diff --git a/examples/pgztest/pgztest.c b/examples/pgztest/pgztest.c index fcda9b3..c290b86 100644 --- a/examples/pgztest/pgztest.c +++ b/examples/pgztest/pgztest.c @@ -38,35 +38,24 @@ void bitmap(void) { byte l; byte c = 0; + textPrint("\n"); + + for (l=0; l