mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Remove LOAD FRAGMENT
It's very troublesome, with flaky semantics and a very restricted use space.
This commit is contained in:
@@ -427,6 +427,11 @@ void out_SetLoadSection(char const *name, uint32_t type, uint32_t org,
|
||||
return;
|
||||
}
|
||||
|
||||
if (mod == SECTION_FRAGMENT) {
|
||||
error("`LOAD FRAGMENT` is not allowed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
struct Section *sect = getSection(name, type, org, attribs, mod);
|
||||
|
||||
changeSection();
|
||||
|
||||
@@ -1,29 +1,2 @@
|
||||
SECTION "A", ROM0
|
||||
AData::
|
||||
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
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
ERROR: load-fragment.asm(2):
|
||||
`LOAD FRAGMENT` is not allowed
|
||||
error: Assembly aborted (1 error)!
|
||||
|
||||
Binary file not shown.
@@ -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.
@@ -1,4 +0,0 @@
|
||||
SECTION "main", ROM0
|
||||
LOAD FRAGMENT "test", SRAM
|
||||
db 0
|
||||
ENDL
|
||||
@@ -1,6 +0,0 @@
|
||||
SECTION "SECTION2", ROM0
|
||||
LOAD FRAGMENT "test", SRAM
|
||||
jr Label
|
||||
Label:
|
||||
dw Label
|
||||
ENDL
|
||||
Binary file not shown.
@@ -1,4 +0,0 @@
|
||||
SECTION FRAGMENT "output", ROM0
|
||||
LOAD FRAGMENT "loaded", SRAM
|
||||
ds 128
|
||||
ENDL
|
||||
@@ -1,6 +0,0 @@
|
||||
SECTION FRAGMENT "output", ROM0
|
||||
LOAD FRAGMENT "loaded", SRAM
|
||||
label:
|
||||
jr nz, label2
|
||||
label2:
|
||||
ENDL
|
||||
Binary file not shown.
@@ -130,17 +130,6 @@ rgblinkQuiet -o $gbtemp2 $otemp
|
||||
tryCmp $gbtemp $gbtemp2
|
||||
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"
|
||||
startTest
|
||||
$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
|
||||
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"
|
||||
startTest
|
||||
$RGBASM -o $otemp section-union/good/a.asm
|
||||
|
||||
Reference in New Issue
Block a user