summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2024-03-08 01:08:51 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2024-03-09 23:34:36 -0500
commit5532bcd37f67cd6c5871bad71eee2ebb1792b5c5 (patch)
tree3daae1b689de9c88c72f6099e3f645dc8385e09b /pcr
parent99f62f107c04fc098ab4a5fd9fc49cc2536b6e84 (diff)
neo6502: upgrade to v0.16.5
Diffstat (limited to 'pcr')
-rw-r--r--pcr/neo6502/PKGBUILD53
-rw-r--r--pcr/neo6502/no_harmless_exit_fails.patch13
-rw-r--r--pcr/neo6502/offline_build.patch (renamed from pcr/neo6502/build_offline.patch)124
-rw-r--r--pcr/neo6502/separate_emulators.patch49
4 files changed, 179 insertions, 60 deletions
diff --git a/pcr/neo6502/PKGBUILD b/pcr/neo6502/PKGBUILD
index 34005354b..91cc96cd9 100644
--- a/pcr/neo6502/PKGBUILD
+++ b/pcr/neo6502/PKGBUILD
@@ -4,14 +4,14 @@
pkgbase=neo6502
pkgname=(neo6502-docs neo6502-emulator neo6502-firmware)
_upstream_name=neo6502-firmware
-pkgver=0.16.3
+pkgver=0.16.5
_pico_sdk_ver=1.5.1
_tinyusb_ver=0.16.0
_picodvi_rev=a248d72b8cc95a08b43ef4307cd954eb801272b2 # no stable release available
_pico_fatfs_ver=1.0.8
pkgrel=1
-pkgdesc="Emulator and firmware for the Neo6502 Retro-computer"
-arch=(armv7h i686 x86_64)
+pkgdesc="Emulator and firmware for the Neo6502 retro-computer"
+arch=(x86_64) # armv7h i686 are both lacking some makedepends
license=(custom:MIT)
url=http://www.neo6502.com/
@@ -24,34 +24,40 @@ source=(neo6502-firmware-${pkgver}.tar.gz::https://github.com/paulscottrobson/${
tinyusb-${_tinyusb_ver}.tar.gz::https://github.com/hathach/tinyusb/archive/refs/tags/${_tinyusb_ver}.tar.gz
PicoDVI-${_picodvi_rev}.tar.gz::https://github.com/Wren6991/PicoDVI/archive/${_picodvi_rev}.tar.gz
pico_fatfs-${_pico_fatfs_ver}.tar.gz::https://github.com/carlk3/no-OS-FatFS-SD-SPI-RPi-Pico/archive/refs/tags/v${_pico_fatfs_ver}.tar.gz)
-source+=(build_offline.patch)
-sha256sums=('a935688087259743f98fb707cfcde39e9d2bf2192a77e550a71e325a43dc9c80'
+source+=(separate_emulators.patch)
+source+=(offline_build.patch) # includes dep_checks.patch
+source+=(no_harmless_exit_fails.patch)
+sha256sums=('efea50fc3355ed98e6faf20ed48a6ae5ac2012181cbfeabbf2efd476dcc61dbe'
'95f5e522be3919e36a47975ffd3b208c38880c14468bd489ac672cfe3cec803c'
'5b24ed6d7732d07bb25a2013b3ad65fdb8752da3e9faac6372ff0574b26a0447'
'efd85ffe21335004f8ebfe6d07c2a6482c4dd96bc6f0132fa4adb21464845a88'
'68ffa9f157b94df969d3bc34f32acb4d4fdf2bdf5391952cf242fec20f53b0b8')
-sha256sums+=(SKIP)
+sha256sums+=(4b20bfc8c5098a8e9c3d2a9ba8f1be26a70026ae418f86526d90deeeb4f5a7b3)
+sha256sums+=(5ebdea1d7dc5eb534b4fbecc1f70a193e6354506cffbfaf97829bdb494fff953)
+sha256sums+=(e8d3d24dae1fdc502180f4f79f931689569c7ea08ed7f9dba5270af4ed28f24d)
prepare()
{
cd "${srcdir}"/pico-sdk-${_pico_sdk_ver}
+ # configure cross-compiler for pico firmware
sed -i 's|ARM_TOOLCHAIN_COMMON_FLAGS "|& -march=armv6-m -mtune=cortex-m0plus -fcf-protection=none -fstack-check=generic -fno-stack-clash-protection |' cmake/preload/toolchains/pico_arm_gcc.cmake
cd "${srcdir}"/${_upstream_name}-${pkgver}
- # avoid downloading sources at build-time
- patch -Np1 < "${srcdir}"/build_offline.patch
-
# avoid building the windows emulator
- sed -i 's|emulator release|emulator clean\n\t$(MAKE) -B -C emulator elinux|' Makefile
- sed -i '/neo.exe/d' release/Makefile
+ echo "applying separate_emulators.patch"
+ patch -Np1 < "${srcdir}"/separate_emulators.patch
+
+ # avoid downloading sources at build-time
+ echo "applying offline_build.patch"
+ patch -Np1 < "${srcdir}"/offline_build.patch
- sed -i 's|STORAGE = USBKEY|STORAGE = NO|' firmware/Makefile
# prevent exit failure when sourcing cvimg.py
- sed -i 's|sys\.exit(1)|sys.exit(0)|' basic/images/cvimg.py
+ echo "applying no_harmless_exit_fails.patch"
+ patch -Np1 < "${srcdir}"/no_harmless_exit_fails.patch
}
build()
@@ -59,40 +65,45 @@ build()
cd "${srcdir}"/${_upstream_name}-${pkgver}
# avoid downloading sources at build-time
- export PICO_SDK_FETCH_FROM_GIT=off
+ export PICO_SDK_FETCH_FROM_GIT=OFF
export PICO_SDK_PATH="${srcdir}"/pico-sdk-${_pico_sdk_ver}
export PICO_TINYUSB_PATH="${srcdir}"/tinyusb-${_tinyusb_ver}
export PICO_DVI_PATH="${srcdir}"/PicoDVI-${_picodvi_rev}
export PICO_FATFS_PATH="${srcdir}"/no-OS-FatFS-SD-SPI-RPi-Pico-${_pico_fatfs_ver}
- make
+ make firmware
+ make linux
}
package_neo6502-docs()
{
+ pkgdesc="Documentation for the Neo6502 retro-computer"
cd "${srcdir}"/${_upstream_name}-${pkgver}
install -Dm644 documents/release/*.odt -t "${pkgdir}"/usr/share/doc/${pkgbase}/
install -Dm644 documents/release/*.pdf -t "${pkgdir}"/usr/share/doc/${pkgbase}/
install -Dm644 documents/*.pdf -t "${pkgdir}"/usr/share/doc/${pkgbase}/
+ install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgbase}/
}
package_neo6502-emulator()
{
+ pkgdesc="Emulator for the Neo6502 retro-computer"
optdepends=("neo6502-docs: Neo6502 documentation")
cd "${srcdir}"/${_upstream_name}-${pkgver}
- install -Dm755 bin/neo "${pkgdir}"/usr/bin/neo
- install -d "${pkgdir}"/usr/share/${pkgbase}/examples/
- cp -a examples/ "${pkgdir}"/usr/share/${pkgbase}/examples/
- chmod -R 644 "${pkgdir}"/usr/share/${pkgbase}/examples/
- install -Dm644 bin/*.zip -t "${pkgdir}"/usr/share/${pkgbase}/utils/
- install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgbase}/
+ install -Dm755 bin/neo "${pkgdir}"/usr/bin/neo
+ install -Dm644 bin/*.zip -t "${pkgdir}"/usr/share/${pkgbase}/utils/
+ install -d "${pkgdir}"/usr/share/${pkgbase}/examples/
+ cp -a examples/{assembly,basic,C} "${pkgdir}"/usr/share/${pkgbase}/examples/
+ chmod -R 644 "${pkgdir}"/usr/share/${pkgbase}/examples/
+ install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgbase}/
}
package_neo6502-firmware()
{
+ pkgdesc="Firmware for the Neo6502 retro-computer"
optdepends=("neo6502-docs: Neo6502 documentation")
cd "${srcdir}"/${_upstream_name}-${pkgver}
diff --git a/pcr/neo6502/no_harmless_exit_fails.patch b/pcr/neo6502/no_harmless_exit_fails.patch
new file mode 100644
index 000000000..c7971c76a
--- /dev/null
+++ b/pcr/neo6502/no_harmless_exit_fails.patch
@@ -0,0 +1,13 @@
+diff --git a/basic/images/cvimg.py b/basic/images/cvimg.py
+index e0eb1125..d82ce95f 100644
+--- a/basic/images/cvimg.py
++++ b/basic/images/cvimg.py
+@@ -15,7 +15,7 @@ from gfxtext import *
+ if len(sys.argv) != 3:
+ print("python cvimg.zip <graphics file> <text file>")
+ print("python cvimg.zip <text file> <graphics file> ")
+- sys.exit(1)
++ sys.exit(0)
+
+ if sys.argv[1].endswith(".gfx"):
+ GraphicsConvert().toText(sys.argv[1],sys.argv[2])
diff --git a/pcr/neo6502/build_offline.patch b/pcr/neo6502/offline_build.patch
index 66616024f..64cb6dac5 100644
--- a/pcr/neo6502/build_offline.patch
+++ b/pcr/neo6502/offline_build.patch
@@ -1,5 +1,86 @@
+diff --git a/Makefile b/Makefile
+index 31797203..6e3cc6bc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -22,7 +22,7 @@ endif
+ #
+ # ***************************************************************************************
+
+-all:
++all: firmware-deps emulator-deps-nix emulator-deps-win docs-deps
+ $(CMAKEDIR) bin
+ $(CMAKEDIR) release
+ $(MAKE) -B -C kernel release
+@@ -39,7 +39,7 @@ all:
+ #
+ # ***************************************************************************************
+
+-firmware:
++firmware: firmware-deps
+ $(CMAKEDIR) bin
+ $(MAKE) -B -C kernel release
+ $(MAKE) -B -C basic release
+@@ -52,7 +52,8 @@ firmware:
+ #
+ # ***************************************************************************************
+
+-windows:
++windows: firmware-deps emulator-deps-nix emulator-deps-win
++ @echo building windows emulator
+ $(CMAKEDIR) bin
+ $(MAKE) -B -C kernel
+ $(MAKE) -B -C basic release
+@@ -60,7 +61,8 @@ windows:
+ $(MAKE) -B -C emulator ewindows
+ $(MAKE) -B -C examples release
+
+-linux:
++linux: firmware-deps emulator-deps-nix
++ @echo building nix emulator
+ $(CMAKEDIR) bin
+ $(MAKE) -B -C kernel
+ $(MAKE) -B -C basic release
+@@ -73,6 +75,38 @@ macos:
+ make -B -C examples release
+
+
++# ***************************************************************************************
++#
++# Verify that dependencies are installed
++#
++# ***************************************************************************************
++
++firmware-deps:
++ @echo checking for firmware dependencies:
++ @cmake --version
++ @g++ --version
++ @arm-none-eabi-g++ --version
++ @# NOTE: this is not accounting for 'arm-none-eabi-newlib'
++
++emulator-deps-win:
++ @x86_64-w64-mingw32-g++ --version
++
++emulator-deps-nix:
++ @echo checking for emulator dependencies:
++ @cmake --version
++ @64tass --version
++ @sdl2-config --version
++ @zip --version
++ @python3 --version
++ @python -c 'from importlib.metadata import version ; pkg="gitpython" ; print("python-%s: %s" % (pkg , version(pkg)))'
++ @python -c 'from importlib.metadata import version ; pkg="pillow" ; print("python-%s: %s" % (pkg , version(pkg)))'
++
++docs-deps:
++ @pandoc --version
++ @pdflatex --version
++ @# NOTE: this is not accounting for the needed latex plugins
++
++
+ # ***************************************************************************************
+ #
+ # Clean everything
diff --git a/firmware/CMakeLists.txt b/firmware/CMakeLists.txt
-index a347acf4..7c4e484e 100644
+index a347acf4..f91da786 100644
--- a/firmware/CMakeLists.txt
+++ b/firmware/CMakeLists.txt
@@ -3,19 +3,28 @@ cmake_minimum_required(VERSION 3.14)
@@ -38,7 +119,7 @@ index a347acf4..7c4e484e 100644
set(PICO_TINYUSB_PATH ${tinyusb_SOURCE_DIR})
pico_sdk_init()
-@@ -34,13 +43,18 @@ include_directories(
+@@ -34,13 +43,17 @@ include_directories(
common/include
)
@@ -49,7 +130,6 @@ index a347acf4..7c4e484e 100644
-)
-FetchContent_MakeAvailable(PicoDVI)
-
-+# if ((NOT DEFINED ENV{PICO_DVI_FETCH_FROM_GIT}) OR ENV{PICO_DVI_FETCH_FROM_GIT})
+if(DEFINED ENV{PICO_DVI_PATH})
+ set(picodvi_SOURCE_DIR $ENV{PICO_DVI_PATH})
+ set(picodvi_BINARY_DIR "_deps/picodvi-build")
@@ -64,7 +144,7 @@ index a347acf4..7c4e484e 100644
add_subdirectory(${picodvi_SOURCE_DIR}/software/libdvi ${picodvi_BINARY_DIR})
add_library(fatfs INTERFACE)
-@@ -54,4 +68,4 @@ target_include_directories(fatfs INTERFACE ${tinyusb_SOURCE_DIR}/lib/fatfs/sourc
+@@ -54,4 +67,4 @@ target_include_directories(fatfs INTERFACE ${tinyusb_SOURCE_DIR}/lib/fatfs/sourc
add_subdirectory(sources)
pico_enable_stdio_usb(firmware 0)
@@ -72,7 +152,7 @@ index a347acf4..7c4e484e 100644
\ No newline at end of file
+pico_enable_stdio_uart(firmware 0)
diff --git a/firmware/sources/CMakeLists.txt b/firmware/sources/CMakeLists.txt
-index a767fc49..1dd8f093 100644
+index a767fc49..a3ea8fcd 100644
--- a/firmware/sources/CMakeLists.txt
+++ b/firmware/sources/CMakeLists.txt
@@ -1,11 +1,16 @@
@@ -98,37 +178,3 @@ index a767fc49..1dd8f093 100644
pico_generate_pio_header(firmware ${CMAKE_CURRENT_LIST_DIR}/system/sm0_memory_emulation_with_clock.pio)
-@@ -13,26 +18,26 @@ add_definitions(-Wno-error=unused-variable)
-
- set(COMMONSRC "../common/sources/interface")
-
--target_sources(firmware PRIVATE main.cpp
-+target_sources(firmware PRIVATE main.cpp
- #
- # Common ${COMMONSRC} routines
- #
-- ${COMMONSRC}/graphics.cpp ${COMMONSRC}/console.cpp ${COMMONSRC}/keyboard.cpp ${COMMONSRC}/memory.cpp
-- ${COMMONSRC}/dispatch.cpp ${COMMONSRC}/maths.cpp ${COMMONSRC}/config.cpp ${COMMONSRC}/efla.cpp
-- ${COMMONSRC}/gfxcommands.cpp ${COMMONSRC}/ellipse.cpp ${COMMONSRC}/fileinterface.cpp
-+ ${COMMONSRC}/graphics.cpp ${COMMONSRC}/console.cpp ${COMMONSRC}/keyboard.cpp ${COMMONSRC}/memory.cpp
-+ ${COMMONSRC}/dispatch.cpp ${COMMONSRC}/maths.cpp ${COMMONSRC}/config.cpp ${COMMONSRC}/efla.cpp
-+ ${COMMONSRC}/gfxcommands.cpp ${COMMONSRC}/ellipse.cpp ${COMMONSRC}/fileinterface.cpp
- ${COMMONSRC}/sprites.cpp ${COMMONSRC}/logo.cpp ${COMMONSRC}/sprites_xor.cpp ${COMMONSRC}/tilemap.cpp
- ${COMMONSRC}/sndmanager.cpp ${COMMONSRC}/sfxmanager.cpp ${COMMONSRC}/tick.cpp ${COMMONSRC}/serialmanager.cpp
- ${COMMONSRC}/turtle.cpp ${COMMONSRC}/locale.cpp ${COMMONSRC}/pininterface.cpp
- #
- # Hardware sources
- #
-- hardware/dvi_320x240x256.cpp hardware/usbdriver.cpp hardware/timer.cpp hardware/sound.cpp
-+ hardware/dvi_320x240x256.cpp hardware/usbdriver.cpp hardware/timer.cpp hardware/sound.cpp
- hardware/fileimplementation.cpp hardware/tick.cpp hardware/serial.cpp hardware/ports.cpp
- #
- # CPU type (pretty much permanently PIO now)
- #
-- system/processor_pio.cpp
-- #system/processor_bitbang.cpp
-+ system/processor_pio.cpp
-+ #system/processor_bitbang.cpp
- )
-
- #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
diff --git a/pcr/neo6502/separate_emulators.patch b/pcr/neo6502/separate_emulators.patch
new file mode 100644
index 000000000..bd1b41bde
--- /dev/null
+++ b/pcr/neo6502/separate_emulators.patch
@@ -0,0 +1,49 @@
+diff --git a/Makefile b/Makefile
+index 4ab01f69..f99b0202 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,7 +35,20 @@ all:
+
+ # ***************************************************************************************
+ #
+-# Make windows & linux versions
++# Make firmware only
++#
++# ***************************************************************************************
++
++firmware:
++ $(CMAKEDIR) bin
++ $(MAKE) -B -C kernel release
++ $(MAKE) -B -C basic release
++ $(MAKE) -B -C firmware release
++
++
++# ***************************************************************************************
++#
++# Make emulator only
+ #
+ # ***************************************************************************************
+
+@@ -45,6 +58,8 @@ windows:
+ $(MAKE) -B -C basic release
+ $(MAKE) -B -C emulator clean
+ $(MAKE) -B -C emulator ewindows
++ $(MAKE) -B -C examples release
++ $(MAKE) -B -C release documentation
+
+ linux:
+ $(CMAKEDIR) bin
+@@ -52,9 +67,13 @@ linux:
+ $(MAKE) -B -C basic release
+ $(MAKE) -B -C emulator clean
+ $(MAKE) -B -C emulator elinux
++ $(MAKE) -B -C examples release
++ $(MAKE) -B -C release documentation
+
+ macos:
+ make -B -C emulator emacos
++ make -B -C examples release
++ $(MAKE) -B -C release documentation
+
+
+ # ***************************************************************************************