From c4bd53dbb7dfe4ba71eb66413b6b1fb6ae18fb8b Mon Sep 17 00:00:00 2001 From: Matthieu Bucchianeri Date: Sun, 16 Feb 2025 15:10:31 -0800 Subject: [PATCH] Revert "Uploaded_2_9_2025" This reverts commit ec79bbdbc9052617461a3c1b4952290a05a51adb. --- XTMax/Code/XTMax/XTMax.ino | 45 ++++++++++--- XTMax/Code/XTMax/bootrom.h | 130 +++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+), 9 deletions(-) create mode 100644 XTMax/Code/XTMax/bootrom.h diff --git a/XTMax/Code/XTMax/XTMax.ino b/XTMax/Code/XTMax/XTMax.ino index 2ac3958..2bb8b56 100644 --- a/XTMax/Code/XTMax/XTMax.ino +++ b/XTMax/Code/XTMax/XTMax.ino @@ -37,11 +37,15 @@ // // Revision 7 01/12/2025 // - Refactor SD card I/O -// - Add support for 16-bit EMS page offsets. +// - Add support for 16-bit EMS page offsets // // Revision 8 01/20/2025 // - Added chip select for a second PSRAM to allow access to 16 MB of Expanded RAM // +// Revision 9 01/26/2024 +// - Add support for BIOS ROM extension (Boot ROM) +// - Add scrach registers for Boot ROM hooking +// //------------------------------------------------------------------------ // // Copyright (c) 2024 Ted Fried @@ -71,6 +75,8 @@ #include #include +#include "bootrom.h" + // Teensy 4.1 pin assignments // @@ -166,7 +172,7 @@ #define EMS_TOTAL_SIZE (16*1024*1024) -#define SD_BASE 0x280 // Must be a multiple of 2. +#define SD_BASE 0x280 // Must be a multiple of 8. // -------------------------------------------------------------------------------------------------- @@ -191,6 +197,7 @@ uint8_t spi_shift_out =0; uint8_t sd_spi_datain =0; uint32_t sd_spi_cs_n = 0x0; uint32_t sd_spi_dataout =0; +uint8_t sd_scratch_register[5] = {0, 0, 0, 0, 0}; uint8_t XTMax_MEM_Response_Array[16]; @@ -573,6 +580,16 @@ inline void Mem_Read_Cycle() { GPIO8_DR = sd_pin_outputs + MUX_DATA_n_HIGH + CHRDY_OE_n_HIGH + DATA_OE_n_HIGH; } + else if (isa_address>=BOOTROM_ADDR && isa_address