WIP: idk
This commit is contained in:
14
Makefile
14
Makefile
@@ -2,8 +2,6 @@ CONFIG = config.mak
|
|||||||
|
|
||||||
include $(CONFIG)
|
include $(CONFIG)
|
||||||
|
|
||||||
CONFIGURE = $(SRC_DIR)/
|
|
||||||
|
|
||||||
COV_DIR=$(OUT)/coverage/
|
COV_DIR=$(OUT)/coverage/
|
||||||
APP_DIR=$(SRC_DIR)/apps/
|
APP_DIR=$(SRC_DIR)/apps/
|
||||||
CC=gcc
|
CC=gcc
|
||||||
@@ -22,7 +20,7 @@ LDFLAGS += $(LDFLAGS_EXTRA)
|
|||||||
FILTER = $(foreach v,$(2),$(if $(findstring $(1),$(v)),$(v),))
|
FILTER = $(foreach v,$(2),$(if $(findstring $(1),$(v)),$(v),))
|
||||||
|
|
||||||
C_SOURCES = $(shell find $(SRC_DIR) -name "*.c")
|
C_SOURCES = $(shell find $(SRC_DIR) -name "*.c")
|
||||||
ALL_OBJS = $(patsubst $(SRC_DIR)%.c, $(OUT)%.o, $(C_SOURCES))
|
ALL_OBJS = $(patsubst $(SRC_DIR)/%.c, $(OUT)/%.o, $(C_SOURCES))
|
||||||
APP_OBJS = $(filter $(OUT)/apps/%, $(ALL_OBJS))
|
APP_OBJS = $(filter $(OUT)/apps/%, $(ALL_OBJS))
|
||||||
TEST_OBJS = $(call FILTER,/tests/, $(ALL_OBJS))
|
TEST_OBJS = $(call FILTER,/tests/, $(ALL_OBJS))
|
||||||
OBJS = $(filter-out $(TEST_OBJS) $(APP_OBJS), $(ALL_OBJS))
|
OBJS = $(filter-out $(TEST_OBJS) $(APP_OBJS), $(ALL_OBJS))
|
||||||
@@ -31,7 +29,7 @@ APPS = $(patsubst %.o, %, $(APP_OBJS))
|
|||||||
$(info SRC_DIR is ${SRC_DIR})
|
$(info SRC_DIR is ${SRC_DIR})
|
||||||
$(info OUT is ${OUT})
|
$(info OUT is ${OUT})
|
||||||
$(info C_SOURCES is ${C_SOURCES})
|
$(info C_SOURCES is ${C_SOURCES})
|
||||||
$(info OBJSs ${OBJS})
|
$(info OBJSs is ${OBJS})
|
||||||
$(info ALL_OBJS is ${ALL_OBJS})
|
$(info ALL_OBJS is ${ALL_OBJS})
|
||||||
$(info APP_OBJS is ${APP_OBJS})
|
$(info APP_OBJS is ${APP_OBJS})
|
||||||
$(info TEST_OBJS is ${TEST_OBJS})
|
$(info TEST_OBJS is ${TEST_OBJS})
|
||||||
@@ -50,7 +48,7 @@ tests: $(TESTS)
|
|||||||
|
|
||||||
$(ALL_OBJS): $(CONFIG)
|
$(ALL_OBJS): $(CONFIG)
|
||||||
|
|
||||||
$(OUT)%.o: $(SRC_DIR)%.c $(CONFIG)
|
$(OUT)/%.o: $(SRC_DIR)/%.c $(CONFIG)
|
||||||
@echo " CC $@"
|
@echo " CC $@"
|
||||||
$(shell mkdir -p $(@D))
|
$(shell mkdir -p $(@D))
|
||||||
$(CC) -c $(CCFLAGS) -o $@ $<
|
$(CC) -c $(CCFLAGS) -o $@ $<
|
||||||
@@ -64,7 +62,6 @@ $(APPS) $(TESTS): $(OBJS) $$@.o
|
|||||||
@$(shell mkdir -p $(@D))
|
@$(shell mkdir -p $(@D))
|
||||||
$(CC) $^ $(LDFLAGS) -o $@
|
$(CC) $^ $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
|
||||||
.PHONY: check cov-report
|
.PHONY: check cov-report
|
||||||
|
|
||||||
define run_tests =
|
define run_tests =
|
||||||
@@ -100,7 +97,7 @@ coverage-report: coverage
|
|||||||
.PHONY: clean realclean cov-clean
|
.PHONY: clean realclean cov-clean
|
||||||
|
|
||||||
cov-clean:
|
cov-clean:
|
||||||
@find $(OUT)/ \( -iname *.gcno -o -iname *.gcda \) -delete
|
@find $(OUT) \( -iname *.gcno -o -iname *.gcda \) -delete
|
||||||
@rm -rf $(COV_DIR)
|
@rm -rf $(COV_DIR)
|
||||||
|
|
||||||
clean: cov-clean
|
clean: cov-clean
|
||||||
@@ -108,3 +105,6 @@ clean: cov-clean
|
|||||||
|
|
||||||
realclean: clean
|
realclean: clean
|
||||||
@rm -f $(CONFIG)
|
@rm -f $(CONFIG)
|
||||||
|
|
||||||
|
%.o:
|
||||||
|
$(info "caught in default rule $@")
|
||||||
|
|||||||
@@ -409,6 +409,8 @@ static int cpu_reg8_to_idx[NUM_LR35902_REGS_8] = {
|
|||||||
[LR35902_REG_HL_DEREF] = -1,
|
[LR35902_REG_HL_DEREF] = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint8_t lr35902_get_reg_8(const struct lr35902_state *cpu, lr35902_regs_8 reg)
|
uint8_t lr35902_get_reg_8(const struct lr35902_state *cpu, lr35902_regs_8 reg)
|
||||||
{
|
{
|
||||||
ASSERT(reg < NUM_LR35902_REGS_8);
|
ASSERT(reg < NUM_LR35902_REGS_8);
|
||||||
@@ -421,6 +423,7 @@ void lr35902_set_reg_16(struct lr35902_state *cpu, lr35902_regs_16 reg,
|
|||||||
{
|
{
|
||||||
ASSERT(reg < NUM_LR35902_REGS_16 && reg >= 0);
|
ASSERT(reg < NUM_LR35902_REGS_16 && reg >= 0);
|
||||||
cpu->regs_16[cpu_reg16_to_idx[reg]] = val;
|
cpu->regs_16[cpu_reg16_to_idx[reg]] = val;
|
||||||
|
lr3
|
||||||
}
|
}
|
||||||
|
|
||||||
void lr35902_set_reg_8(struct lr35902_state *cpu, lr35902_regs_8 reg,
|
void lr35902_set_reg_8(struct lr35902_state *cpu, lr35902_regs_8 reg,
|
||||||
|
|||||||
Reference in New Issue
Block a user