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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
/***************************************************************************
MITS Altair 8800b Turnkey
04/12/2009 Initial driver by Miodrag Milanovic
Commands:
All commands must be in uppercase. Address and data is
specified in Octal format (not hex).
Press space to input your command line (not return).
D - Memory Dump
J - Jump to address
M - Modify memory
****************************************************************************/
#include "emu.h"
#include "cpu/i8085/i8085.h"
#include "machine/terminal.h"
#include "imagedev/snapquik.h"
class altair_state : public driver_device
{
public:
altair_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_terminal(*this, TERMINAL_TAG),
m_ram(*this, "ram"){ }
required_device<cpu_device> m_maincpu;
required_device<generic_terminal_device> m_terminal;
DECLARE_READ8_MEMBER(sio_status_r);
DECLARE_READ8_MEMBER(sio_data_r);
DECLARE_READ8_MEMBER(sio_key_status_r);
DECLARE_WRITE8_MEMBER(sio_command_w);
DECLARE_WRITE8_MEMBER(kbd_put);
UINT8 m_term_data;
required_shared_ptr<UINT8> m_ram;
virtual void machine_reset();
DECLARE_QUICKLOAD_LOAD_MEMBER(altair);
};
READ8_MEMBER(altair_state::sio_status_r)
{
return (m_term_data) ? 1 : 2;
}
WRITE8_MEMBER(altair_state::sio_command_w)
{
}
READ8_MEMBER(altair_state::sio_data_r)
{
UINT8 ret = m_term_data;
m_term_data = 0;
return ret;
}
READ8_MEMBER(altair_state::sio_key_status_r)
{
return (m_term_data) ? 0x40 : 0x01;
}
static ADDRESS_MAP_START(altair_mem, AS_PROGRAM, 8, altair_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE( 0x0000, 0xfcff ) AM_RAM AM_SHARE("ram")
AM_RANGE( 0xfd00, 0xfdff ) AM_ROM
AM_RANGE( 0xff00, 0xffff ) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START(altair_io, AS_IO, 8, altair_state)
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE( 0x00, 0x00 ) AM_READ(sio_key_status_r)
AM_RANGE( 0x01, 0x01 ) AM_MIRROR(0x10) AM_READ(sio_data_r) AM_DEVWRITE(TERMINAL_TAG, generic_terminal_device, write)
AM_RANGE( 0x10, 0x10 ) AM_READWRITE(sio_status_r,sio_command_w)
ADDRESS_MAP_END
/* Input ports */
static INPUT_PORTS_START( altair )
INPUT_PORTS_END
QUICKLOAD_LOAD_MEMBER( altair_state,altair)
{
int quick_length;
int read_;
quick_length = image.length();
if (quick_length >= 0xfd00)
return IMAGE_INIT_FAIL;
read_ = image.fread(m_ram, quick_length);
if (read_ != quick_length)
return IMAGE_INIT_FAIL;
return IMAGE_INIT_PASS;
}
void altair_state::machine_reset()
{
// Set startup addess done by turn-key
m_maincpu->set_state_int(I8085_PC, 0xFD00);
m_term_data = 0;
}
WRITE8_MEMBER( altair_state::kbd_put )
{
m_term_data = data;
}
static GENERIC_TERMINAL_INTERFACE( terminal_intf )
{
DEVCB_DRIVER_MEMBER(altair_state, kbd_put)
};
static MACHINE_CONFIG_START( altair, altair_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", I8080, XTAL_2MHz)
MCFG_CPU_PROGRAM_MAP(altair_mem)
MCFG_CPU_IO_MAP(altair_io)
/* video hardware */
MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
/* quickload */
MCFG_QUICKLOAD_ADD("quickload", altair_state, altair, "bin", 0)
MACHINE_CONFIG_END
/* ROM definition */
ROM_START( al8800bt )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "turnmon.bin", 0xfd00, 0x0100, CRC(5c629294) SHA1(125c76216954b681721fff84a3aca05094b21a28))
ROM_LOAD( "88dskrom.bin", 0xff00, 0x0100, CRC(7c5232f3) SHA1(24f940ad70ad2829e1bc800c6790b6e993e6ebf6))
ROM_END
/* Driver */
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
COMP( 1975, al8800bt, 0, 0, altair, altair, driver_device, 0, "MITS", "Altair 8800bt", GAME_NOT_WORKING | GAME_NO_SOUND_HW)
|