Describe the bug
When the application code size of MegaROM was larger than 16KiB (e.g. #pragma codeseg BANK1 is used),
the wrong libmsx_resources.c is generated by make command so resource_*() APIs don't work correctly.
To Reproduce
Assuming that there is only one file a.bin in the resources folder of application's source tree.
Makefile
CONFIG_ROM_TYPE = ascii16
...snip...
src/main.c
#pragma codeseg BANK1
#include <msx.h>
#include <resources.h>
#include <assert.h>
void main(void) {
const ResourceIndex * res = resource_find("a.bin"); // search the file "resources/a.bin"
assert(res && res->offset == 0x08000); // This assertion fails.
for (;;) await_vsync();
}
Expected behavior
Offset of resources and/or banked memory shall start from the next 16KiB segment follows application code.
For example, apllication has two 16KiB code segments CODE and BANK1, the 1st offset of resources must be 0x08000.
Development environment (please complete the following information):
Describe the bug When the application code size of MegaROM was larger than 16KiB (e.g.
#pragma codeseg BANK1
is used), the wronglibmsx_resources.c
is generated bymake
command soresource_*()
APIs don't work correctly.To Reproduce
Assuming that there is only one file
a.bin
in theresources
folder of application's source tree.Makefile
src/main.c
Expected behavior Offset of resources and/or banked memory shall start from the next 16KiB segment follows application code. For example, apllication has two 16KiB code segments
CODE
andBANK1
, the 1st offset of resources must be0x08000
.Development environment (please complete the following information):
Target Platform
Additional context