mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-04 23:07:46 -04:00
split memories away from Pico
saves ~3k of code on ARM because Pico no longer crosses ldr limit
This commit is contained in:
parent
e64886365d
commit
88fd63ad10
30 changed files with 633 additions and 587 deletions
|
@ -3,10 +3,22 @@
|
|||
|
||||
#include "../pico/pico_int.h"
|
||||
|
||||
#define DUMP(f, field) \
|
||||
#define DUMP(f, prefix, type, field) \
|
||||
fprintf(f, "#define %-20s 0x%02x\n", \
|
||||
"OFS_" #field, \
|
||||
(int)offsetof(struct PicoEState, field))
|
||||
prefix #field, (int)offsetof(type, field))
|
||||
|
||||
#define DUMP_P(f, field) \
|
||||
fprintf(f, "#define %-20s 0x%04x\n", \
|
||||
"OFS_Pico_" #field, (char *)&p.field - (char *)&p)
|
||||
|
||||
#define DUMP_PS(f, s1, field) \
|
||||
fprintf(f, "#define %-20s 0x%04x\n", \
|
||||
"OFS_Pico_" #s1 "_" #field, (char *)&p.s1.field - (char *)&p)
|
||||
|
||||
#define DUMP_EST(f, field) \
|
||||
DUMP(f, "OFS_EST_", struct PicoEState, field)
|
||||
|
||||
extern struct Pico p;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -21,16 +33,31 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
fprintf(f, "/* autogenerated by %s, do not edit */\n", argv[0]);
|
||||
DUMP(f, DrawScanline);
|
||||
DUMP(f, rendstatus);
|
||||
DUMP(f, DrawLineDest);
|
||||
DUMP(f, HighCol);
|
||||
DUMP(f, HighPreSpr);
|
||||
DUMP(f, Pico_video);
|
||||
DUMP(f, Pico_vram);
|
||||
DUMP(f, PicoOpt);
|
||||
DUMP(f, Draw2FB);
|
||||
DUMP(f, HighPal);
|
||||
DUMP_PS(f, video, reg);
|
||||
DUMP_PS(f, m, rotate);
|
||||
DUMP_PS(f, m, z80Run);
|
||||
DUMP_PS(f, m, dirtyPal);
|
||||
DUMP_PS(f, m, hardware);
|
||||
DUMP_PS(f, m, z80_reset);
|
||||
DUMP_PS(f, m, sram_reg);
|
||||
DUMP_P (f, sv);
|
||||
DUMP_PS(f, sv, data);
|
||||
DUMP_PS(f, sv, start);
|
||||
DUMP_PS(f, sv, end);
|
||||
DUMP_PS(f, sv, flags);
|
||||
DUMP_P (f, rom);
|
||||
DUMP_P (f, romsize);
|
||||
DUMP_EST(f, DrawScanline);
|
||||
DUMP_EST(f, rendstatus);
|
||||
DUMP_EST(f, DrawLineDest);
|
||||
DUMP_EST(f, HighCol);
|
||||
DUMP_EST(f, HighPreSpr);
|
||||
DUMP_EST(f, Pico);
|
||||
DUMP_EST(f, PicoMem_vram);
|
||||
DUMP_EST(f, PicoMem_cram);
|
||||
DUMP_EST(f, PicoOpt);
|
||||
DUMP_EST(f, Draw2FB);
|
||||
DUMP_EST(f, HighPal);
|
||||
fclose(f);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue