mirror of
https://github.com/rkujawa/rk65c02.git
synced 2025-04-22 21:37:20 +00:00
Split ROM starting function into separate file.
It will also be used for other test programs than test_emulation.
This commit is contained in:
parent
80b6848108
commit
2ec6cb67ae
@ -3,16 +3,17 @@ LDFLAGS=-latf-c
|
||||
RK6502LIB=../src/librk65c02.a
|
||||
VASM=vasm6502_std
|
||||
VASMFLAGS=-Fbin -c02
|
||||
UTILS=utils.o
|
||||
|
||||
TESTS=test_bus test_emulation
|
||||
TESTROMS:=$(addsuffix .rom,$(basename $(wildcard *.s)))
|
||||
|
||||
all : $(TESTS) $(TESTROMS)
|
||||
|
||||
test_bus : test_bus.o $(RK6502LIB)
|
||||
test_bus : test_bus.o $(UTILS) $(RK6502LIB)
|
||||
$(CC) -o $@ $(LDFLAGS) $< $(RK6502LIB)
|
||||
|
||||
test_emulation : test_emulation.o $(RK6502LIB)
|
||||
test_emulation : test_emulation.o $(UTILS) $(RK6502LIB)
|
||||
$(CC) -o $@ $(LDFLAGS) $< $(RK6502LIB)
|
||||
|
||||
%.rom : %.s
|
||||
|
@ -6,21 +6,7 @@
|
||||
|
||||
#include "bus.h"
|
||||
#include "rk65c02.h"
|
||||
|
||||
#define ROM_LOAD_ADDR 0xC000
|
||||
|
||||
bool rom_start(rk65c02emu_t *, const char *);
|
||||
|
||||
bool
|
||||
rom_start(rk65c02emu_t *e, const char *name)
|
||||
{
|
||||
e->regs.PC = ROM_LOAD_ADDR;
|
||||
if(!bus_load_file(e->bus, ROM_LOAD_ADDR, name))
|
||||
return false;
|
||||
rk65c02_start(e);
|
||||
|
||||
return true;
|
||||
}
|
||||
#include "utils.h"
|
||||
|
||||
ATF_TC_WITHOUT_HEAD(emul_bit);
|
||||
ATF_TC_BODY(emul_bit, tc)
|
||||
|
16
test/utils.c
Normal file
16
test/utils.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include "bus.h"
|
||||
#include "rk65c02.h"
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
bool
|
||||
rom_start(rk65c02emu_t *e, const char *name)
|
||||
{
|
||||
e->regs.PC = ROM_LOAD_ADDR;
|
||||
if(!bus_load_file(e->bus, ROM_LOAD_ADDR, name))
|
||||
return false;
|
||||
rk65c02_start(e);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
7
test/utils.h
Normal file
7
test/utils.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef _UTILS_H_
|
||||
#define _UTILS_H_
|
||||
|
||||
#define ROM_LOAD_ADDR 0xC000
|
||||
|
||||
bool rom_start(rk65c02emu_t *, const char *);
|
||||
#endif /* _UTILS_H_ */
|
Loading…
x
Reference in New Issue
Block a user