From cd92bf8ffb5736a1cc2acaf0317079eb3c080858 Mon Sep 17 00:00:00 2001 From: Matt Evans Date: Tue, 27 Aug 2024 02:32:56 +0100 Subject: [PATCH] Add MEMSIZE build option This is plumbed through to the UMAC_MEMSIZE build parameter, and allows the default of 128KB to be overridden (for instance, to make a "Mac 208K"). --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7371ab0..932f721 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,13 @@ # cmake_minimum_required(VERSION 3.13) +# Options that should be defined when initialising the build +# directory with cmake, e.g. "cmake .. -DOPTION=true": +# + +# See below, -DMEMSIZE= will configure umac's memory size, +# overriding defaults. + # initialize the SDK based on PICO_SDK_PATH # note: this must happen before project() include(pico_sdk_import.cmake) @@ -57,7 +64,9 @@ set(UMAC_SOURCES ${UMAC_MUSASHI_PATH}/m68kops.c ${UMAC_MUSASHI_PATH}/softfloat/softfloat.c ) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DPICO -DMUSASHI_CNF=\\\"../include/m68kconf.h\\\"") + +set(MEMSIZE 128 CACHE STRING "Memory size, in KB") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DPICO -DMUSASHI_CNF=\\\"../include/m68kconf.h\\\" -DUMAC_MEMSIZE=${MEMSIZE}") if (TARGET tinyusb_device) add_executable(firmware