Browse Source

Add global extension member suport

master
Marrub 5 years ago
parent
commit
e4e6c07a7a
  1. 9
      Makefile
  2. 1
      src/extmem.nts
  3. 2
      src/g_object.c
  4. 10
      src/g_object.h

9
Makefile

@ -1,6 +1,7 @@
## Copyright © 2017 Project Golan, all rights reserved.
GDCC_CC=gdcc-cc
GDCC_LD=gdcc-ld
GDCC_NTSC=gdcc-ntsc
GDCC_MAKELIB=gdcc-makelib
CFLAGS += -O2 -g -c
@ -59,13 +60,16 @@ MISC_LIBOUTS=$(MISC_SOURCES:$(SRC)/%.c=$(BIN)/%.o)
MAPS_SOURCES=$(wildcard $(MAPSRC)/*.gmf9)
MAPS_OUTPUTS=$(MAPS_SOURCES:$(MAPSRC)/%.gmf9=$(MAPBIN)/%.gmf0)
NTSC_SOURCES=$(SRC)/extmem.nts
NTSC_BINARYS=$(CODEDEFS)/eikyo-extmem.bin
LIBC_OUTPUTS=$(IR)/libc.ir $(IR)/libGDCC.ir
LIBC_BINARYS=$(CODEDEFS)/stdlib.bin
.PHONY: clean
.SECONDARY: $(MISC_LIBOUTS)
all: $(FOLDERS) $(GAME_BINARYS) $(INTR_BINARYS) $(MAIN_BINARYS) $(MFED_BINARYS) $(MISC_BINARYS) $(RNDR_BINARYS) $(LIBC_BINARYS) $(MAPS_OUTPUTS)
all: $(FOLDERS) $(GAME_BINARYS) $(INTR_BINARYS) $(MAIN_BINARYS) $(MFED_BINARYS) $(MISC_BINARYS) $(RNDR_BINARYS) $(LIBC_BINARYS) $(MAPS_OUTPUTS) $(NTSC_BINARYS)
$(GAME_BINARYS): $(GAME_OUTPUTS)
$(GOL5_BINARYS): $(GOL5_OUTPUTS)
@ -95,6 +99,9 @@ $(BIN)/%.o: $(SRC)/%.c $(MISC_HEADERS)
%.bin:
$(GDCC_LD) $(GDCC_LFLAGS) -o $@ $^
$(NTSC_BINARYS): $(NTSC_SOURCES)
$(GDCC_NTSC) -t CODEDEFS -o $@ $^
$(IR)/%.ir: $(SRC)/%.c $(GAME_HEADERS) $(INTR_HEADERS) $(MISC_HEADERS) $(RNDR_HEADERS) $(STRH_BINARYS)
$(GDCC_CC) $(GDCC_CFLAGS) -DM_fileHash=$(shell bin/strh $<) -o $@ $<

1
src/extmem.nts

@ -0,0 +1 @@
extmem Entity subtype 1;

2
src/g_object.c

@ -16,7 +16,7 @@ void G_Entity_Create(G_mfdat *info)
{
G_entty const *type = G_ObjDef_GetType(info->ent.name);
DGE_Entity ent = {DGE_Entity_Create(type ? type->ext : 0)};
G_entit ent = {DGE_Entity_Create(type ? type->ext : 0)};
ent.x = info->ent.x;
ent.y = info->ent.y;

10
src/g_object.h

@ -16,10 +16,18 @@
#define G_Entity_propMem(ofs, t, name) \
G_propMemExt(Entity, ofs, t, name)
#define G_Entity_props() DGE_EntityProps()
#define G_Entity_props() DGE_EntityProps() \
G_propMemOfs(DGE_OME(Entity.subtype), int, subtype)
// Types ---------------------------------------------------------------------|
enum G_subty
{
subtype_none,
subtype_player,
subtype_max,
};
enum
{
G_Player_ammo,

Loading…
Cancel
Save