summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/i8x41/i8x41.h
blob: 41830aa726684d55adc31482c1cf40d4fb783aa3 (plain) (blame)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*****************************************************************************
 *
 *   i8x41.h
 *   Portable UPI-41/8041/8741/8042/8742 emulator interface
 *
 *   Copyright Juergen Buchmueller, all rights reserved.
 *
 *   - This source code is released as freeware for non-commercial purposes.
 *   - You are free to use and redistribute this code in modified or
 *     unmodified form, provided you list me in the credits.
 *   - If you modify this source code, you must add a notice to each modified
 *     source file that it has been changed.  If you're a nice person, you
 *     will clearly mark each change too.  :)
 *   - If you wish to use this for commercial purposes, please contact me at
 *     pullmoll@t-online.de
 *   - The author of this copywritten work reserves the right to change the
 *     terms of its usage and license at any time, including retroactively
 *   - This entire notice must remain in the source code.
 *
 *   TLP (10-Jan-2003)
 *     Added output ports registers to the debug viewer
 *     Added the Clock Divider
 *
 *****************************************************************************/

#ifndef _I8X41_H
#define _I8X41_H

#include "cpuintrf.h"


/* The i8x41/i8x42 input clock is divided by 15 */
#define I8X41_CLOCK_DIVIDER		15

/* Note:
 * I8X41_DATA is A0 = 0 and R/W
 * I8X41_CMND is A0 = 1 and W only
 * I8X41_STAT is A0 = 1 and R only
 */

typedef enum {
	TYPE_I8X41,
	TYPE_I8X42
} i8x41_type;

typedef struct {
	i8x41_type	type;
} i8x41_config;

/****************************************************************************
 *  Interrupt constants
 */

#define I8X41_INT_IBF	0	/* input buffer full interrupt */
#define I8X41_INT_TEST1 1	/* test1 line (also counter interrupt; taken on cntr overflow) */


/****************************************************************************
 *  Use these in the I/O port fields of your driver for the test lines - i.e,
 *    { I8X41_t0,   I8X41_t0,   i8041_test0_r },
 *    { I8X41_t1,   I8X41_t1,   i8041_test1_r },
 *    { I8X41_ps,   I8X41_ps,   i8041_port_strobe_w },
 */

#define I8X41_p1		0x01
#define I8X41_p2		0x02
#define I8X41_t0		0x80	/* TEST0 input port handle */
#define I8X41_t1		0x81	/* TEST1 input port handle */
#define I8X41_ps		0x82	/* Prog pin strobe for expanded port sync */


/****************************************************************************
 *  The i8x41/i8x42 have 128/256 bytes of internal memory respectively
 */

#define I8X41_intRAM_MASK		0x7f
#define I8X42_intRAM_MASK		0xff


enum {
	I8X41_PC=1, I8X41_SP, I8X41_PSW, I8X41_T, I8X41_DATA, I8X41_DATA_DASM,
	I8X41_CMND, I8X41_CMND_DASM, I8X41_STAT, I8X41_P1, I8X41_P2,I8X41_A,
	I8X41_R0, I8X41_R1, I8X41_R2, I8X41_R3, I8X41_R4, I8X41_R5, I8X41_R6, I8X41_R7
};



/****************************************************************************
 *  Public Functions
 */

extern void i8x41_get_info(UINT32 state, cpuinfo *info);

extern offs_t i8x41_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);

#endif /* _I8X41_H */