minimacplus/main.c

28 lines
461 B
C

#include <stdio.h>
#include <stdlib.h>
#include "emu.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "config.h"
static void *loadRom(char *file) {
int i;
char *ret=malloc(TME_ROMSIZE);
int f=open(file, O_RDONLY);
i=read(f, ret, TME_ROMSIZE);
if (i!=TME_ROMSIZE) {
perror("reading rom");
exit(1);
}
return ret;
}
int main(int argc, char **argv) {
void *rom=loadRom("rom.bin");
tmeStartEmu(rom);
}