wip
This commit is contained in:
parent
d53f1cbfe0
commit
9b918d43ce
16
vm/bus.h
Normal file
16
vm/bus.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef VM_BUS_H
|
||||
# define VM_BUS_H 1
|
||||
|
||||
# include <stddef.h>
|
||||
# include <stdint.h>
|
||||
|
||||
typedef int (*BusRead)(uint32_t addr, void *data, size_t sz);
|
||||
typedef int (*BusWrite)(uint32_t addr, const void *data, size_t sz);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BusRead read;
|
||||
BusWrite write;
|
||||
} Bus;
|
||||
|
||||
#endif /* !VM_BUS_H */
|
7
vm/cpu.c
Normal file
7
vm/cpu.c
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include "cpu.h"
|
||||
|
||||
void
|
||||
cpu_execute(Cpu *cpu)
|
||||
{
|
||||
uint8_t opcode;
|
||||
}
|
16
vm/cpu.h
Normal file
16
vm/cpu.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef VM_CPU_H
|
||||
# define VM_CPU_H 1
|
||||
|
||||
# include <stdint.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t PC;
|
||||
uint32_t A;
|
||||
uint32_t X;
|
||||
uint32_t Y;
|
||||
uint8_t SR;
|
||||
uint32_t SP;
|
||||
} Cpu;
|
||||
|
||||
#endif /* !VM_CPU_H */
|
|
@ -1,5 +1,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "config.h"
|
||||
|
||||
static const char *prg_name;
|
||||
|
||||
|
@ -9,6 +10,12 @@ usage(void)
|
|||
printf("Usage: %s [-hV] [-b bios]\n");
|
||||
}
|
||||
|
||||
void
|
||||
version(void)
|
||||
{
|
||||
printf("%S v%s\n", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue