aoineko-fr / MSXgl

The MSX Game Library in C language
113 stars 9 forks source link

Allow MSXbin to write size of the imported data as a constant #16

Open pvmm opened 2 years ago

pvmm commented 2 years ago

For instance:

const unsigned char data[] = {
        0x43, 0x33, 0x33, 0x34, 0x43, 0x33, 0x33, 0x34, 0x43, 0x33, 0x33, 0x34, 
        0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 
};
const unsigned int data_length = 24;
aoineko-fr commented 2 years ago

Why don't just use sizeof(data)?

pvmm commented 2 years ago

Eh, I used the wrong example here. I think it would be useful for generated assembly code when you are generating code on the fly, so you are not expected to edit the file manually and add something like: length equ $-data