2017-03-03 07:47:14 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "emu.h"
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
2017-03-08 12:29:10 +00:00
|
|
|
#include "tmeconfig.h"
|
2017-03-03 07:47:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void *loadRom(char *file) {
|
2017-03-04 14:06:00 +00:00
|
|
|
int i;
|
2017-03-03 07:47:14 +00:00
|
|
|
char *ret=malloc(TME_ROMSIZE);
|
|
|
|
int f=open(file, O_RDONLY);
|
2017-03-04 14:06:00 +00:00
|
|
|
i=read(f, ret, TME_ROMSIZE);
|
|
|
|
if (i!=TME_ROMSIZE) {
|
|
|
|
perror("reading rom");
|
|
|
|
exit(1);
|
|
|
|
}
|
2017-03-03 07:47:14 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
void *rom=loadRom("rom.bin");
|
2017-03-08 12:29:10 +00:00
|
|
|
void *ram=malloc(TME_RAMSIZE);
|
|
|
|
tmeStartEmu(ram, rom);
|
2017-03-03 07:47:14 +00:00
|
|
|
}
|