magic: prepare for FAT32 use

This commit is contained in:
E. C. Masloch 2024-02-07 00:17:40 +01:00 committed by Kenneth J Davis
parent 5a6d3a449f
commit d9b0615ad5

View File

@ -44,7 +44,8 @@ _appenddigitstrdef %1, (%2 >> (0 * 4)) & 0Fh
%endif
%endmacro
%macro magicoffset 3.nolist
%macro magicoffset 2-3.nolist
%if ISFAT1216DUAL
%ifdef ISFAT12
%define SYSOFFSET %2
%elifdef ISFAT16
@ -55,11 +56,21 @@ _appenddigitstrdef %1, (%2 >> (0 * 4)) & 0Fh
; 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
%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