Skip to content

Add hardware configuration flexibility to pico9918 build system #28

@thorpej

Description

@thorpej

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$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues related to building from sourceenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions