[GBZ80] ROM Bank Support
Didnt know that this is a standard macro, I actually defined that in my own library for the gbz80.
the exact code you supplied does not compile, supplying the following error: src/foo.h:47: error 226: no type specifier for '_xy_t_x' Adding a specifier (like char), making the compiler store the value in ROM, is valid. It does save the initial overhead of loading the offsets to the stack, but it is kind of tedious adding these lines after creating the struct definition, and it wastes ROM space. Thanks anyways for the hint, that works as a workaround, kind of like this: const char xy_t_a = __builtin_offsetof(xy_t,...
the exact code you supplied does not compile, supplying the following error: src/foo.h:47: error 226: no type specifier for '_xy_t_x' Adding a specifier (like char), making the compiler store the value in ROM, is valid. It does save the initial overhead of loading the offsets to the stack, but it is kind of tedious adding these lines after creating the struct definition, and it wastes ROM space. Thanks anyways for the hint, that works as a workaround, kind of like this: const char xy_t_a = __builtin_offsetof(xy_t,...
[gbz80] Defining struct member offsets in order to access them with inline assembly