From 96654315574a78a5076d73e47e4f6cdba8ec4b97 Mon Sep 17 00:00:00 2001 From: "Christopher A. Mosher" Date: Sun, 30 Oct 2022 22:36:44 -0400 Subject: [PATCH] github build/deb; fix warnings/errors --- .github/workflows/publish.yaml | 53 ++++++++++++++++++++++++++++++++++ .gitignore | 8 +++++ configure.ac | 2 +- src/analogtv.cpp | 1 + src/cpu.cpp | 10 +++---- src/memoryrandomaccess.cpp | 2 +- src/memoryrow.cpp | 2 +- src/wozfile.cpp | 2 +- 8 files changed, 71 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..aff382d --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,53 @@ +--- +on: + push: + tags: + - "*" + +env: + name: "epple2" + desc: "Apple ][ emulator" + deb_depends: "libSDL2" + +permissions: + contents: "write" + +jobs: + "publish": + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + + - run: | + set -x + sudo apt-get install -qqq xa65 libsdl2-dev + ./bootstrap + ./configure + make + + - run: | + mkdir -p ./deb/usr/local/bin + cp ./src/epple2 ./deb/usr/local/bin/ + mkdir -p ./deb/usr/local/etc/epple2 + cp ./conf/epple2.conf ./deb/usr/local/etc/epple2/ + mkdir -p ./deb/usr/local/lib/epple2/system + cp ./rom/epple2sys.a65 ./deb/usr/local/lib/epple2/system/ + mkdir -p ./deb/usr/local/lib/epple2/cards + cp ./rom/stdout.a65 ./deb/usr/local/lib/epple2/cards/ + cp ./rom/stdin.a65 ./deb/usr/local/lib/epple2/cards/ + cp ./rom/clock.a65 ./deb/usr/local/lib/epple2/cards/ + + - uses: "jiro4989/build-deb-action@v2" + with: + package: "${{ env.name }}" + desc: "${{ env.desc }}" + maintainer: "${{ github.repository_owner }}" + version: "${{ github.ref }}" + arch: "amd64" + package_root: "./deb/" + depends: "${{ env.deb_depends }}" + + - uses: "softprops/action-gh-release@v1" + with: + files: | + *.deb diff --git a/.gitignore b/.gitignore index e2ed5ba..8784d0e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ Makefile.in /aclocal.m4 /compile /configure +/configure~ /depcomp /install-sh /missing @@ -29,3 +30,10 @@ Makefile # netbeans /nbproject/ + +# eclipse + +/.autotools +/.cproject +/.project +/.settings/ diff --git a/configure.ac b/configure.ac index 49213a0..83e0ed6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT(epple2, v1.0.5) +AC_INIT(epple2, v1.0.6) AC_PREREQ(2.68) AC_CONFIG_SRCDIR([src/apple2.cpp]) diff --git a/src/analogtv.cpp b/src/analogtv.cpp index 451372c..930a630 100644 --- a/src/analogtv.cpp +++ b/src/analogtv.cpp @@ -236,6 +236,7 @@ void AnalogTV::drawCurrent() case MONITOR_COLOR: drawMonitorColor(); break; case MONITOR_GREEN: drawMonitorGreen(); break; case TV_OLD_COLOR: drawTVOld(); break; + case NUM_DISPLAY_TYPES: break; } } else diff --git a/src/cpu.cpp b/src/cpu.cpp index 6f79457..acdfcbc 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -132,7 +132,7 @@ int CPU::getInterruptPseudoOpCode() return 0; // can't happen } -void (CPU::*(CPU::addr[]))() = +void (CPU::*CPU::addr[])() = { &CPU::addr_MISC_BREAK, &CPU::addr_INTERNAL_INDIRECT_X, @@ -395,7 +395,7 @@ void (CPU::*(CPU::addr[]))() = &CPU::addr_IRQ, }; -void (CPU::*(CPU::exec[]))() = +void (CPU::*CPU::exec[])() = { &CPU::BRK, &CPU::ORA, @@ -1826,14 +1826,14 @@ void CPU::ADC() int Op2 = this->data; if (this->p & PMASK_D) { - setP(PMASK_Z,!(Op1 + Op2 + !!(this->p & PMASK_C) & 0xff)); + setP(PMASK_Z,!((Op1 + Op2 + !!(this->p & PMASK_C)) & 0xff)); int tmp = (Op1 & 0xf) + (Op2 & 0xf) + !!(this->p & PMASK_C); tmp = tmp >= 10 ? tmp + 6 : tmp; this->a = tmp; tmp = (Op1 & 0xf0) + (Op2 & 0xf0) + (tmp & 0xf0); setP(PMASK_N,tmp < 0); setP(PMASK_V,((Op1 ^ tmp) & ~(Op1 ^ Op2) & 0x80)); - tmp = this->a & 0xf | (tmp >= 160 ? tmp + 96 : tmp); + tmp = (this->a & 0xf) | (tmp >= 160 ? tmp + 96 : tmp); setP(PMASK_C,tmp >= 0x100); this->a = tmp & 0xff; } @@ -1861,7 +1861,7 @@ void CPU::SBC() tmp = (tmp & 0x10) != 0 ? tmp - 6 : tmp; this->a = tmp; tmp = (Op1 & 0xf0) - (Op2 & 0xf0) - (this->a & 0x10); - this->a = this->a & 0xf | ((tmp & 0x100) != 0 ? tmp - 96 : tmp); + this->a = (this->a & 0xf) | ((tmp & 0x100) != 0 ? tmp - 96 : tmp); tmp = Op1 - Op2 - !(this->p & PMASK_C); setP(PMASK_C,0 <= tmp && tmp < 0x100); setStatusRegisterNZ(tmp); diff --git a/src/memoryrandomaccess.cpp b/src/memoryrandomaccess.cpp index d6eaa14..12306e0 100644 --- a/src/memoryrandomaccess.cpp +++ b/src/memoryrandomaccess.cpp @@ -1,7 +1,7 @@ #include "memoryrandomaccess.h" #include #include -#include +#include #define K 1024u diff --git a/src/memoryrow.cpp b/src/memoryrow.cpp index 221a688..dd2c028 100644 --- a/src/memoryrow.cpp +++ b/src/memoryrow.cpp @@ -1,5 +1,5 @@ #include "memoryrow.h" -#include +#include #include diff --git a/src/wozfile.cpp b/src/wozfile.cpp index a7fe800..083ea17 100644 --- a/src/wozfile.cpp +++ b/src/wozfile.cpp @@ -527,7 +527,7 @@ void WozFile::rotateOneBit(std::uint8_t currentQuarterTrack) { // Check for hitting the end of our track, // and if so, move back to the beginning. // This is how we emulate a circular track on the floppy. - if (this->trk_bits[this->tmap[currentQuarterTrack]] <= this->byt*8+bc(this->bit)) { + if (this->trk_bits[this->tmap[currentQuarterTrack]] <= this->byt*8u+bc(this->bit)) { this->byt = 0; this->bit = 0x80u; }