Prepare the structure for upcoming actual i8080 emulation (#16)

This commit is contained in:
Cacodemon345
2022-09-09 02:28:51 +06:00
committed by GitHub
parent c2cc656103
commit 13f5a2794f
3 changed files with 61 additions and 1 deletions

20
src/cpu/8080.c Normal file
View File

@@ -0,0 +1,20 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* 8080 CPU emulation.
*
* Authors: Cacodemon345
*
* Copyright 2022 Cacodemon345
*/
#include <stdint.h>
#include <86box/i8080.h>
/* Actually implement i8080 emulation. */

View File

@@ -14,7 +14,7 @@
# #
add_library(cpu OBJECT cpu.c cpu_table.c fpu.c x86.c 808x.c 386.c 386_common.c add_library(cpu OBJECT cpu.c cpu_table.c fpu.c x86.c 808x.c 386.c 386_common.c
386_dynarec.c x86seg.c x87.c x87_timings.c) 386_dynarec.c x86seg.c x87.c x87_timings.c 8080.c)
if(AMD_K5) if(AMD_K5)
target_compile_definitions(cpu PRIVATE USE_AMD_K5) target_compile_definitions(cpu PRIVATE USE_AMD_K5)

40
src/include/86box/i8080.h Normal file
View File

@@ -0,0 +1,40 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* 8080 CPU emulation (header).
*
* Authors: Cacodemon345
*
* Copyright 2022 Cacodemon345
*/
#include <stdint.h>
typedef struct i8080
{
union {
uint16_t af; /* Intended in case we also go for μPD9002 emulation, which also has a Z80 emulation mode. */
uint8_t a, flags;
};
union
{
uint16_t bc;
uint8_t b, c;
};
union
{
uint16_t de;
uint8_t d, e;
};
union
{
uint16_t hl;
uint8_t h, l;
};
uint16_t pc, sp;
} i8080;