src/mess/drivers/osbexec.c
| r0 | r9814 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Osborne Executive driver file |
| 4 | |
| 5 | |
| 6 | ***************************************************************************/ |
| 7 | |
| 8 | #include "emu.h" |
| 9 | #include "cpu/z80/z80.h" |
| 10 | #include "cpu/z80/z80daisy.h" |
| 11 | #include "devices/flopdrv.h" |
| 12 | #include "formats/basicdsk.h" |
| 13 | #include "sound/speaker.h" |
| 14 | #include "machine/wd17xx.h" |
| 15 | #include "machine/6821pia.h" |
| 16 | #include "machine/pit8253.h" |
| 17 | #include "devices/messram.h" |
| 18 | #include "includes/osbexec.h" |
| 19 | |
| 20 | |
| 21 | #define MAIN_CLOCK 23961600 |
| 22 | |
| 23 | |
| 24 | static ADDRESS_MAP_START( osbexec_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 25 | AM_RANGE( 0x0000, 0x1FFF ) AM_ROM |
| 26 | ADDRESS_MAP_END |
| 27 | |
| 28 | |
| 29 | static ADDRESS_MAP_START( osbexec_io, ADDRESS_SPACE_IO, 8 ) |
| 30 | ADDRESS_MAP_UNMAP_HIGH |
| 31 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 32 | /* 0x00 - 0x01/0x03 - 6821 PIA @UD12 */ |
| 33 | /* 0x04 - 0x07 - 8253 @UD1 */ |
| 34 | /* 0x08 - 0x0B - MB8877 @UB17 */ |
| 35 | /* 0x0c - 0x0f - SIO @UD4 */ |
| 36 | /* 0x10 - 0x13 - 6821 PIA @UD8 */ |
| 37 | /* 0x14 - 0x17 - kbd */ |
| 38 | /* 0x18 - 0x1b - "RTC" */ |
| 39 | /* ?? - vid ? */ |
| 40 | ADDRESS_MAP_END |
| 41 | |
| 42 | |
| 43 | static INPUT_PORTS_START( osbexec ) |
| 44 | PORT_START("ROW0") |
| 45 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('[') PORT_CHAR(']') |
| 46 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('\'') PORT_CHAR('"') |
| 47 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 48 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 49 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 50 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_SHIFT_2) |
| 51 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') |
| 52 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) |
| 53 | |
| 54 | PORT_START("ROW1") |
| 55 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| 56 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') |
| 57 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') |
| 58 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 59 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 60 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 61 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') |
| 62 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 63 | |
| 64 | PORT_START("ROW2") |
| 65 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') |
| 66 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 67 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') |
| 68 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 69 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 70 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') |
| 71 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 72 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 73 | |
| 74 | PORT_START("ROW3") |
| 75 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') |
| 76 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') |
| 77 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 78 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') |
| 79 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') |
| 80 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| 81 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') |
| 82 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 83 | |
| 84 | PORT_START("ROW4") |
| 85 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 86 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 87 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 88 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') |
| 89 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') |
| 90 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| 91 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') |
| 92 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') |
| 93 | |
| 94 | PORT_START("ROW5") |
| 95 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 96 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 97 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 98 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') |
| 99 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 100 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') |
| 101 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') |
| 102 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') |
| 103 | |
| 104 | PORT_START("ROW6") |
| 105 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') |
| 106 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 107 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('\\') PORT_CHAR('|') |
| 108 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 109 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 110 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') |
| 111 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 112 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 113 | |
| 114 | PORT_START("ROW7") |
| 115 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 116 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 117 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 118 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 119 | PORT_DIPNAME( 0x08, 0, "Alpha Lock" ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) |
| 120 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 121 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 122 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 123 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 124 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 125 | INPUT_PORTS_END |
| 126 | |
| 127 | |
| 128 | static PALETTE_INIT( osbexec ) |
| 129 | { |
| 130 | palette_set_color_rgb( machine, 0, 0, 0, 0 ); /* Black */ |
| 131 | palette_set_color_rgb( machine, 1, 0, 255, 0 ); /* Full */ |
| 132 | palette_set_color_rgb( machine, 2, 0, 128, 0 ); /* Dimmed */ |
| 133 | } |
| 134 | |
| 135 | |
| 136 | /* |
| 137 | * The Osborne Executive supports the following disc formats: (TODO: Verify) |
| 138 | * - Osborne single density: 40 tracks, 10 sectors per track, 256-byte sectors (100 KByte) |
| 139 | * - Osborne double density: 40 tracks, 5 sectors per track, 1024-byte sectors (200 KByte) |
| 140 | * - IBM Personal Computer: 40 tracks, 8 sectors per track, 512-byte sectors (160 KByte) |
| 141 | * - Xerox 820 Computer: 40 tracks, 18 sectors per track, 128-byte sectors (90 KByte) |
| 142 | * - DEC 1820 double density: 40 tracks, 9 sectors per track, 512-byte sectors (180 KByte) |
| 143 | * |
| 144 | */ |
| 145 | static FLOPPY_OPTIONS_START(osbexec ) |
| 146 | FLOPPY_OPTION( osd, "img", "Osborne single density", basicdsk_identify_default, basicdsk_construct_default, |
| 147 | HEADS([1]) |
| 148 | TRACKS([40]) |
| 149 | SECTORS([10]) |
| 150 | SECTOR_LENGTH([256]) |
| 151 | FIRST_SECTOR_ID([1])) |
| 152 | FLOPPY_OPTION( odd, "img", "Osborne double density", basicdsk_identify_default, basicdsk_construct_default, |
| 153 | HEADS([1]) |
| 154 | TRACKS([40]) |
| 155 | SECTORS([5]) |
| 156 | SECTOR_LENGTH([1024]) |
| 157 | FIRST_SECTOR_ID([1])) |
| 158 | FLOPPY_OPTION( ibm, "img", "IBM Personal Computer", basicdsk_identify_default, basicdsk_construct_default, |
| 159 | HEADS([1]) |
| 160 | TRACKS([40]) |
| 161 | SECTORS([8]) |
| 162 | SECTOR_LENGTH([512]) |
| 163 | FIRST_SECTOR_ID([1])) |
| 164 | FLOPPY_OPTION( xerox, "img", "Xerox 820 Computer", basicdsk_identify_default, basicdsk_construct_default, |
| 165 | HEADS([1]) |
| 166 | TRACKS([40]) |
| 167 | SECTORS([18]) |
| 168 | SECTOR_LENGTH([128]) |
| 169 | FIRST_SECTOR_ID([1])) |
| 170 | FLOPPY_OPTION( dec, "img", "DEC 1820 double density", basicdsk_identify_default, basicdsk_construct_default, |
| 171 | HEADS([1]) |
| 172 | TRACKS([40]) |
| 173 | SECTORS([9]) |
| 174 | SECTOR_LENGTH([512]) |
| 175 | FIRST_SECTOR_ID([1])) |
| 176 | FLOPPY_OPTIONS_END |
| 177 | |
| 178 | |
| 179 | static const floppy_config osbexec_floppy_config = |
| 180 | { |
| 181 | DEVCB_NULL, |
| 182 | DEVCB_NULL, |
| 183 | DEVCB_NULL, |
| 184 | DEVCB_NULL, |
| 185 | DEVCB_NULL, |
| 186 | FLOPPY_STANDARD_5_25_SSDD_40, |
| 187 | FLOPPY_OPTIONS_NAME(osbexec), |
| 188 | NULL |
| 189 | }; |
| 190 | |
| 191 | |
| 192 | static DRIVER_INIT( osbexec ) |
| 193 | { |
| 194 | } |
| 195 | |
| 196 | |
| 197 | static MACHINE_RESET( osbexec ) |
| 198 | { |
| 199 | } |
| 200 | |
| 201 | |
| 202 | static MACHINE_CONFIG_START( osbexec, osbexec_state ) |
| 203 | MDRV_CPU_ADD( "maincpu", Z80, MAIN_CLOCK/6 ) |
| 204 | MDRV_CPU_PROGRAM_MAP( osbexec_mem) |
| 205 | MDRV_CPU_IO_MAP( osbexec_io) |
| 206 | |
| 207 | MDRV_MACHINE_RESET( osbexec ) |
| 208 | |
| 209 | MDRV_SCREEN_ADD("screen", RASTER) |
| 210 | MDRV_SCREEN_FORMAT( BITMAP_FORMAT_INDEXED16 ) |
| 211 | MDRV_SCREEN_RAW_PARAMS( MAIN_CLOCK/4, 512, 0, 416, 260, 0, 240 ) /* Most likely not correct */ |
| 212 | MDRV_VIDEO_START( generic_bitmapped ) |
| 213 | MDRV_VIDEO_UPDATE( generic_bitmapped ) |
| 214 | MDRV_PALETTE_LENGTH( 3 ) |
| 215 | MDRV_PALETTE_INIT( osbexec ) |
| 216 | |
| 217 | MDRV_SPEAKER_STANDARD_MONO( "mono" ) |
| 218 | MDRV_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 219 | MDRV_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 ) |
| 220 | |
| 221 | // MDRV_PIT8253_ADD( "pit", osbexec_pit_config ) |
| 222 | |
| 223 | // MDRV_PIA6821_ADD( "pia_0", osbexec_pia0_config ) |
| 224 | // MDRV_PIA6821_ADD( "pia_1", osbexec_pia1_config ) |
| 225 | |
| 226 | // MDRV_Z80SIO0_ADD( "sio", MAIN_CLOCK/6, osbexec_sio_config ) |
| 227 | |
| 228 | MDRV_MB8877_ADD("mb8877", default_wd17xx_interface_2_drives ) |
| 229 | |
| 230 | MDRV_FLOPPY_2_DRIVES_ADD(osbexec_floppy_config) |
| 231 | |
| 232 | /* internal ram */ |
| 233 | MDRV_RAM_ADD("messram") |
| 234 | MDRV_RAM_DEFAULT_SIZE("68K") /* 64KB Main RAM and 4Kbit video attribute RAM */ |
| 235 | MACHINE_CONFIG_END |
| 236 | |
| 237 | |
| 238 | ROM_START( osbexec ) |
| 239 | ROM_REGION(0x2000, "maincpu", 0) |
| 240 | ROM_LOAD( "execv12.ud18", 0x0000, 0x2000, CRC(70798c2f) SHA1(2145a72da563bed1d6d455c77e48cc011a5f1153) ) /* Checksum C6B2 */ |
| 241 | ROM_END |
| 242 | |
| 243 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 244 | COMP( 1982, osbexec, 0, 0, osbexec, osbexec, osbexec, "Osborne", "Executive", 0 ) |