From d9b0615ad5e2d974ca28e8ad362fa0a62f3577be Mon Sep 17 00:00:00 2001 From: "E. C. Masloch" Date: Wed, 7 Feb 2024 00:17:40 +0100 Subject: [PATCH] magic: prepare for FAT32 use --- boot/magic.mac | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/boot/magic.mac b/boot/magic.mac index a343855..8580f48 100644 --- a/boot/magic.mac +++ b/boot/magic.mac @@ -44,22 +44,33 @@ _appenddigitstrdef %1, (%2 >> (0 * 4)) & 0Fh %endif %endmacro - %macro magicoffset 3.nolist -%ifdef ISFAT12 + %macro magicoffset 2-3.nolist +%if ISFAT1216DUAL + %ifdef ISFAT12 %define SYSOFFSET %2 -%elifdef ISFAT16 + %elifdef ISFAT16 %define SYSOFFSET %3 -%else + %else %define SYSOFFSET 0 ; Just a placeholder, so the proper error message ; will be shown when assembling without either ; of the ISFATx defines. + %endif +%else + %define SYSOFFSET %2 + %ifnempty %3 + %error Not in dual mode + %endif %endif %assign NEWOFFSET $ - Entry %if NEWOFFSET != SYSOFFSET _autohexitsstrdef NEWOFFSETHEX, NEWOFFSET %strcat _NEWOFFSETHEX _NEWOFFSETHEX,'h' %deftok NEWOFFSET _NEWOFFSETHEX - %error Magic offset %1 changed for FATFS, old=SYSOFFSET, new=NEWOFFSET + %if ISFAT1216DUAL + %error Magic offset %1 changed for FATFS, old=SYSOFFSET, new=NEWOFFSET + %else + %error Magic offset %1 changed, old=SYSOFFSET, new=NEWOFFSET + %endif %endif %endmacro