Remove LOAD FRAGMENT

It's very troublesome, with flaky semantics and a very restricted use space.
This commit is contained in:
ISSOtm
2021-05-02 23:51:41 +02:00
parent 02cb5a0526
commit 1d01268249
15 changed files with 8 additions and 79 deletions

View File

@@ -427,6 +427,11 @@ void out_SetLoadSection(char const *name, uint32_t type, uint32_t org,
return; return;
} }
if (mod == SECTION_FRAGMENT) {
error("`LOAD FRAGMENT` is not allowed\n");
return;
}
struct Section *sect = getSection(name, type, org, attribs, mod); struct Section *sect = getSection(name, type, org, attribs, mod);
changeSection(); changeSection();

View File

@@ -1,29 +1,2 @@
SECTION "A", ROM0 SECTION "A", ROM0
AData::
LOAD FRAGMENT "RAM", WRAM0 LOAD FRAGMENT "RAM", WRAM0
AMem::
db 0, 1, 2
AMemEnd::
ENDL
ADataEnd::
dw AMem
SECTION "B", ROM0
BData::
LOAD FRAGMENT "RAM", WRAM0
BMem::
db 3, 4, 5, 6, 7
BMemEnd::
ENDL
BDataEnd::
dw BMem
SECTION "C", ROM0
CData::
LOAD FRAGMENT "RAM", WRAM0
CMem::
db 8, 9
CMemEnd::
ENDL
CDataEnd::
dw CMem

View File

@@ -0,0 +1,3 @@
ERROR: load-fragment.asm(2):
`LOAD FRAGMENT` is not allowed
error: Assembly aborted (1 error)!

Binary file not shown.

View File

@@ -1,12 +0,0 @@
SECTION "main", ROM0
LOAD FRAGMENT "test", SRAM
ENDL
; The RPN patch for 'jr Label' in section "alt" refers to section "test",
; but the object file puts section "test" after section "alt".
; This case needs to be handled when identifying patches' PC sections.
SECTION "alt", ROM0
LOAD FRAGMENT "test", SRAM
jr Label
Label:
ENDL

Binary file not shown.

View File

@@ -1,4 +0,0 @@
SECTION "main", ROM0
LOAD FRAGMENT "test", SRAM
db 0
ENDL

View File

@@ -1,6 +0,0 @@
SECTION "SECTION2", ROM0
LOAD FRAGMENT "test", SRAM
jr Label
Label:
dw Label
ENDL

Binary file not shown.

View File

@@ -1,4 +0,0 @@
SECTION FRAGMENT "output", ROM0
LOAD FRAGMENT "loaded", SRAM
ds 128
ENDL

View File

@@ -1,6 +0,0 @@
SECTION FRAGMENT "output", ROM0
LOAD FRAGMENT "loaded", SRAM
label:
jr nz, label2
label2:
ENDL

View File

@@ -130,17 +130,6 @@ rgblinkQuiet -o $gbtemp2 $otemp
tryCmp $gbtemp $gbtemp2 tryCmp $gbtemp $gbtemp2
rc=$(($? || $rc)) rc=$(($? || $rc))
i="load-fragment.asm"
startTest
$RGBASM -o $otemp load-fragment/a.asm
$RGBASM -o $gbtemp2 load-fragment/b.asm
rgblinkQuiet -o $gbtemp $otemp $gbtemp2 2>$outtemp
tryDiff load-fragment/out.err $outtemp
rc=$(($? || $rc))
dd if=$gbtemp count=1 bs=$(printf %s $(wc -c < load-fragment/out.gb)) > $otemp 2>/dev/null
tryCmp load-fragment/out.gb $otemp
rc=$(($? || $rc))
i="overlay.asm" i="overlay.asm"
startTest startTest
$RGBASM -o $otemp overlay/a.asm $RGBASM -o $otemp overlay/a.asm
@@ -160,15 +149,6 @@ dd if=$gbtemp count=1 bs=$(printf %s $(wc -c < section-fragment/jr-offset/ref.ou
tryCmp section-fragment/jr-offset/ref.out.bin $otemp tryCmp section-fragment/jr-offset/ref.out.bin $otemp
rc=$(($? || $rc)) rc=$(($? || $rc))
i="section-fragment/jr-offset-load.asm"
startTest
$RGBASM -o $otemp section-fragment/jr-offset-load/a.asm
$RGBASM -o $gbtemp2 section-fragment/jr-offset-load/b.asm
rgblinkQuiet -o $gbtemp $otemp $gbtemp2
dd if=$gbtemp count=1 bs=$(printf %s $(wc -c < section-fragment/jr-offset-load/ref.out.bin)) > $otemp 2>/dev/null
tryCmp section-fragment/jr-offset-load/ref.out.bin $otemp
rc=$(($? || $rc))
i="section-union/good.asm" i="section-union/good.asm"
startTest startTest
$RGBASM -o $otemp section-union/good/a.asm $RGBASM -o $otemp section-union/good/a.asm