forked from CodeAsm/M2000
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZ80IO.h
42 lines (37 loc) · 2.45 KB
/
Z80IO.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*** Z80Em: Portable Z80 emulator *******************************************/
/*** ***/
/*** Z80IO.h ***/
/*** ***/
/*** This file contains the prototypes for the functions accessing memory ***/
/*** and I/O in M2000, the portable P2000 emulator ***/
/*** ***/
/*** Copyright (C) Marcel de Kogel 1996,1997 ***/
/*** You are not allowed to distribute this software commercially ***/
/*** Please, notify me, if you make any changes to this file ***/
/****************************************************************************/
/****************************************************************************/
/* Input a byte from given I/O port */
/****************************************************************************/
byte Z80_In (byte Port);
/****************************************************************************/
/* Output a byte to given I/O port */
/****************************************************************************/
void Z80_Out (byte Port,byte Value);
/****************************************************************************/
/* Read a byte from given memory location */
/****************************************************************************/
extern byte *ReadPage[256];
#define Z80_RDMEM(a) ReadPage[(a)>>8][(a)&0xFF]
/****************************************************************************/
/* Write a byte to given memory location */
/****************************************************************************/
extern byte *WritePage[256];
#define Z80_WRMEM(a,v) WritePage[(a)>>8][(a)&0xFF]=v
/****************************************************************************/
/* Since the P2000 doesn't use memory mapped I/O nor opcode encryption, we */
/* can simply do with the macro definitions below */
/****************************************************************************/
#define Z80_RDOP(A) Z80_RDMEM(A)
#define Z80_RDOP_ARG(A) Z80_RDMEM(A)
#define Z80_RDSTACK(A) Z80_RDMEM(A)
#define Z80_WRSTACK(A,V) Z80_WRMEM(A,V)