Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hardware configuration flexibility to pico9918 build system #28

Open
thorpej opened this issue Jan 6, 2025 · 1 comment
Open

Add hardware configuration flexibility to pico9918 build system #28

thorpej opened this issue Jan 6, 2025 · 1 comment

Comments

@thorpej
Copy link

thorpej commented Jan 6, 2025

pico9918 is fantastic, and I've been using a modified version of it in a couple of different projects. Namely, CoPicoVision, a ColecoVision clone that uses a Pi Pico module for the display, and a small BASIC computer running my own BASIC interpreter natively on a Pi Pico, which uses the 9918 emulation and VGA engine from pico9918 for it's native text/graphics display/terminal emulator (in this case, the "bus interface" is not using PIO, but rather a native interface using shared memory buffers and the multicore FIFO to communicate from the BASIC side to the display side).

In order to facilitate the hardware differences from the base pico9918 module, I've added some hooks to the pico9918 build system to make it easier to make the necessary configuration tweaks without having to modify pico9918 directly. The config parameters are placed into a CMake file:

dhcp-194:thorpej$ cat CoPicoVision_pico9918_config.cmake
set(PICO9918_RESTRICTED_HW_RPI_PICO 1)
set(PICO9918_INT_ACTIVE_HIGH 1)
dhcp-194:thorpej$ 

...and this config file is used like so:

dhcp-194:thorpej$ cat build.sh 
#!/bin/sh -

#
# Build the CoPicoVision version of the pico9918 firmware.
#

FIRMWARE_DIR=$PWD
PICO9918_CONFIG="${FIRMWARE_DIR}/CoPicoVision_pico9918_config.cmake"
PICO9918_DIR="${FIRMWARE_DIR}/../../submodules/pico9918"

rm -rf ${FIRMWARE_DIR}/build || exit 1
mkdir ${FIRMWARE_DIR}/build
cd ${FIRMWARE_DIR}/build || exit 1
cmake -DPICO9918_CONFIG="${PICO9918_CONFIG}" ${PICO9918_DIR} || exit 1
cmake --build . || exit 1
mv ${FIRMWARE_DIR}/build/src/pico9918.uf2 \
    ${FIRMWARE_DIR}/CoPicoVision_pico9918.uf2 || exit 1
cd ${FIRMWARE_DIR} || exit 1
rm -rf ${FIRMWARE_DIR}/build || exit 1

exit 0
dhcp-194:thorpej$ 
@thorpej
Copy link
Author

thorpej commented Jan 6, 2025

A pull request that implements these changes is forthcoming.

thorpej added a commit to thorpej/pico9918 that referenced this issue Jan 6, 2025
that parameterizes:
- board type
- disabling clock outputs
- interrupt polarity
- RGB signal / color pin origins

Addresses issue visrealm#28.
thorpej added a commit to thorpej/pico9918 that referenced this issue Jan 7, 2025
that parameterizes:
  - board type
  - product name
  - disabling clock outputs
  - interrupt polarity
  - RGB signal / color pin origins

...and consult the config file for these parameters that already existed:
  - scanlines yes/no
  - SCART yes/no/mode

Addresses issue visrealm#28.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant