mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-11-18 21:07:00 +00:00
9122615df4
Adjust bus tests to this change.
41 lines
724 B
C
41 lines
724 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <limits.h>
|
|
#include <atf-c.h>
|
|
|
|
#include "bus.h"
|
|
#include "rk65c02.h"
|
|
|
|
#include "utils.h"
|
|
|
|
const char *
|
|
rom_path(const char *name, const atf_tc_t *tc)
|
|
{
|
|
char *rompath;
|
|
const char *srcdir;
|
|
|
|
rompath = malloc(PATH_MAX);
|
|
srcdir = atf_tc_get_config_var(tc, "srcdir");
|
|
|
|
strcpy(rompath, srcdir);
|
|
strcat(rompath, "/");
|
|
strcat(rompath, name);
|
|
|
|
return rompath;
|
|
}
|
|
|
|
bool
|
|
rom_start(rk65c02emu_t *e, const char *name, const atf_tc_t *tc)
|
|
{
|
|
const char *path;
|
|
|
|
path = rom_path(name, tc);
|
|
printf("%s\n", path);
|
|
e->regs.PC = ROM_LOAD_ADDR;
|
|
if(!bus_load_file(e->bus, ROM_LOAD_ADDR, path))
|
|
return false;
|
|
rk65c02_start(e);
|
|
|
|
return true;
|
|
}
|