mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
eliminate texrels (wip)
This commit is contained in:
parent
bc38f4d24f
commit
ea38612fad
16 changed files with 268 additions and 198 deletions
|
@ -1,6 +1,6 @@
|
|||
CFLAGS = -Wall -ggdb
|
||||
|
||||
TARGETS = amalgamate textfilter
|
||||
TARGETS = amalgamate textfilter mkoffsets
|
||||
OBJS = $(addsuffix .o,$(TARGETS))
|
||||
|
||||
all: $(TARGETS)
|
||||
|
@ -8,3 +8,6 @@ all: $(TARGETS)
|
|||
clean:
|
||||
$(RM) $(TARGETS) $(OBJS)
|
||||
|
||||
mkoffsets: CFLAGS += -m32 -I..
|
||||
|
||||
.PHONY: clean all
|
||||
|
|
31
tools/mkoffsets.c
Normal file
31
tools/mkoffsets.c
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "../pico/pico_int.h"
|
||||
|
||||
#define DUMP(f, field) \
|
||||
fprintf(f, "#define %-20s 0x%02x\n", \
|
||||
"OFS_" #field, \
|
||||
(int)offsetof(struct PicoEState, field))
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char buf[128];
|
||||
FILE *f;
|
||||
|
||||
snprintf(buf, sizeof(buf), "pico/pico_int_o%d.h", sizeof(void *) * 8);
|
||||
f = fopen(buf, "w");
|
||||
if (!f) {
|
||||
perror("fopen");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(f, "/* autogenerated by %s, do not edit */\n", argv[0]);
|
||||
DUMP(f, DrawScanline);
|
||||
DUMP(f, rendstatus);
|
||||
DUMP(f, Pico_video);
|
||||
DUMP(f, Pico_vram);
|
||||
fclose(f);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue