src/mess/machine/osborne1.c
| r0 | r1193 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | ***************************************************************************/ |
| 4 | |
| 5 | #include "driver.h" |
| 6 | #include "cpu/z80/z80.h" |
| 7 | #include "machine/6821pia.h" |
| 8 | #include "machine/6850acia.h" |
| 9 | #include "includes/osborne1.h" |
| 10 | |
| 11 | static struct osborne1 { |
| 12 | UINT8 bank2_enabled; |
| 13 | UINT8 bank3_enabled; |
| 14 | UINT8 *bank4_ptr; |
| 15 | UINT8 *empty_4K; |
| 16 | /* video related */ |
| 17 | UINT8 start_x; |
| 18 | UINT8 start_y; |
| 19 | /* other outputs from the video pia */ |
| 20 | UINT8 d0en; |
| 21 | UINT8 beep; |
| 22 | UINT8 drive1; |
| 23 | UINT8 drive2; |
| 24 | } osborne1; |
| 25 | |
| 26 | WRITE8_HANDLER( osborne1_0000_w ) { |
| 27 | /* Check whether regular RAM is enabled */ |
| 28 | if ( ! osborne1.bank2_enabled ) { |
| 29 | mess_ram[ offset ] = data; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | WRITE8_HANDLER( osborne1_1000_w ) { |
| 34 | /* Check whether regular RAM is enabled */ |
| 35 | if ( ! osborne1.bank2_enabled ) { |
| 36 | mess_ram[ 0x1000 + offset ] = data; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | READ8_HANDLER( osborne1_2000_r ) { |
| 41 | UINT8 data = 0xFF; |
| 42 | |
| 43 | /* Check whether regular RAM is enabled */ |
| 44 | if ( ! osborne1.bank2_enabled ) { |
| 45 | return mess_ram[ 0x2000 + offset ]; |
| 46 | } |
| 47 | switch( offset & 0x0F00 ) { |
| 48 | case 0x100: /* Floppy */ |
| 49 | break; |
| 50 | case 0x200: /* Keyboard */ |
| 51 | /* Row 0 */ |
| 52 | if ( offset & 0x01 ) data &= readinputport(0); |
| 53 | /* Row 1 */ |
| 54 | if ( offset & 0x02 ) data &= readinputport(1); |
| 55 | /* Row 2 */ |
| 56 | if ( offset & 0x04 ) data &= readinputport(2); |
| 57 | /* Row 3 */ |
| 58 | if ( offset & 0x08 ) data &= readinputport(3); |
| 59 | /* Row 4 */ |
| 60 | if ( offset & 0x10 ) data &= readinputport(4); |
| 61 | /* Row 5 */ |
| 62 | if ( offset & 0x20 ) data &= readinputport(5); |
| 63 | /* Row 6 */ |
| 64 | if ( offset & 0x40 ) data &= readinputport(6); |
| 65 | /* Row 7 */ |
| 66 | if ( offset & 0x80 ) data &= readinputport(7); |
| 67 | break; |
| 68 | case 0x900: /* IEEE488 PIA */ |
| 69 | data = pia_0_r( offset & 0x03 ); |
| 70 | break; |
| 71 | case 0xA00: /* Serial */ |
| 72 | break; |
| 73 | case 0xC00: /* Video PIA */ |
| 74 | data = pia_1_r( offset & 0x03 ); |
| 75 | break; |
| 76 | } |
| 77 | return data; |
| 78 | } |
| 79 | |
| 80 | WRITE8_HANDLER( osborne1_2000_w ) { |
| 81 | /* Check whether regular RAM is enabled */ |
| 82 | if ( ! osborne1.bank2_enabled ) { |
| 83 | mess_ram[ 0x2000 + offset ] = data; |
| 84 | } |
| 85 | /* Handle writes to the I/O area */ |
| 86 | switch( offset & 0x0F00 ) { |
| 87 | case 0x100: /* Floppy */ |
| 88 | break; |
| 89 | case 0x900: /* IEEE488 PIA */ |
| 90 | pia_0_w( offset & 0x03, data ); |
| 91 | break; |
| 92 | case 0xA00: /* Serial */ |
| 93 | break; |
| 94 | case 0xC00: /* Video PIA */ |
| 95 | pia_1_w( offset & 0x03, data ); |
| 96 | break; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | WRITE8_HANDLER( osborne1_3000_w ) { |
| 101 | /* Check whether regular RAM is enabled */ |
| 102 | if ( ! osborne1.bank2_enabled ) { |
| 103 | mess_ram[ 0x3000 + offset ] = data; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | WRITE8_HANDLER( osborne1_videoram_w ) { |
| 108 | /* Check whether the video attribute section is enabled */ |
| 109 | if ( osborne1.bank3_enabled ) { |
| 110 | data |= 0x7F; |
| 111 | } |
| 112 | osborne1.bank4_ptr[offset] = data; |
| 113 | } |
| 114 | |
| 115 | WRITE8_HANDLER( osborne1_bankswitch_w ) { |
| 116 | switch( offset ) { |
| 117 | case 0x00: |
| 118 | osborne1.bank2_enabled = 1; |
| 119 | osborne1.bank3_enabled = 0; |
| 120 | break; |
| 121 | case 0x01: |
| 122 | osborne1.bank2_enabled = 0; |
| 123 | osborne1.bank3_enabled = 0; |
| 124 | break; |
| 125 | case 0x02: |
| 126 | osborne1.bank2_enabled = 1; |
| 127 | osborne1.bank3_enabled = 1; |
| 128 | break; |
| 129 | case 0x03: |
| 130 | osborne1.bank2_enabled = 1; |
| 131 | osborne1.bank3_enabled = 0; |
| 132 | break; |
| 133 | } |
| 134 | if ( osborne1.bank2_enabled ) { |
| 135 | memory_set_bankptr( 1, memory_region(REGION_CPU1) ); |
| 136 | memory_set_bankptr( 2, osborne1.empty_4K ); |
| 137 | memory_set_bankptr( 3, osborne1.empty_4K ); |
| 138 | } else { |
| 139 | memory_set_bankptr( 1, mess_ram ); |
| 140 | memory_set_bankptr( 2, mess_ram + 0x1000 ); |
| 141 | memory_set_bankptr( 3, mess_ram + 0x3000 ); |
| 142 | } |
| 143 | osborne1.bank4_ptr = mess_ram + ( ( osborne1.bank3_enabled ) ? 0x10000 : 0xF000 ); |
| 144 | memory_set_bankptr( 4, osborne1.bank4_ptr ); |
| 145 | } |
| 146 | |
| 147 | static const pia6821_interface osborne1_ieee_pia_config = { |
| 148 | NULL, /* in_a_func */ |
| 149 | NULL, /* in_b_func */ |
| 150 | NULL, /* in_ca1_func */ |
| 151 | NULL, /* in_cb1_func */ |
| 152 | NULL, /* in_ca2_func */ |
| 153 | NULL, /* in_cb2_func */ |
| 154 | NULL, /* out_a_func */ |
| 155 | NULL, /* out_b_func */ |
| 156 | NULL, /* out_ca2_func */ |
| 157 | NULL, /* out_cb2_func */ |
| 158 | NULL, /* irq_a_func */ |
| 159 | NULL /* irq_b_func */ |
| 160 | }; |
| 161 | |
| 162 | static WRITE8_HANDLER( video_pia_port_a_w ) { |
| 163 | osborne1.start_x = data >> 1; |
| 164 | osborne1.d0en = data & 0x01; |
| 165 | |
| 166 | logerror("Video pia port a write: %02X\n", data ); |
| 167 | } |
| 168 | |
| 169 | static WRITE8_HANDLER( video_pia_port_b_w ) { |
| 170 | osborne1.start_y = data & 0x1F; |
| 171 | osborne1.beep = data & 0x20; |
| 172 | osborne1.drive1 = data & 0x40; |
| 173 | osborne1.drive2 = data & 0x80; |
| 174 | |
| 175 | logerror("Video pia port b write: %02X\n", data ); |
| 176 | } |
| 177 | |
| 178 | static void video_pia_irq_a_func(int state) { |
| 179 | if ( state ) { |
| 180 | cpunum_set_input_line( 0, 0, ASSERT_LINE ); |
| 181 | } else { |
| 182 | cpunum_set_input_line( 0, 0, CLEAR_LINE ); |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | static const pia6821_interface osborne1_video_pia_config = { |
| 187 | NULL, /* in_a_func */ |
| 188 | NULL, /* in_b_func */ |
| 189 | NULL, /* in_ca1_func */ |
| 190 | NULL, /* in_cb1_func */ |
| 191 | NULL, /* in_ca2_func */ |
| 192 | NULL, /* in_cb2_func */ |
| 193 | video_pia_port_a_w, /* out_a_func */ |
| 194 | video_pia_port_b_w, /* out_b_func */ |
| 195 | NULL, /* out_ca2_func */ |
| 196 | NULL, /* out_cb2_func */ |
| 197 | video_pia_irq_a_func, /* irq_a_func */ |
| 198 | NULL /* irq_b_func */ |
| 199 | }; |
| 200 | |
| 201 | //static struct aica6850_interface osborne1_6850_config = { |
| 202 | // 10, /* tx_clock */ |
| 203 | // 10, /* rx_clock */ |
| 204 | // NULL, /* rx_pin */ |
| 205 | // NULL, /* tx_pin */ |
| 206 | // NULL, /* cts_pin */ |
| 207 | // NULL, /* rts_pin */ |
| 208 | // NULL, /* dcd_pin */ |
| 209 | // NULL /* int_callback */ |
| 210 | //}; |
| 211 | |
| 212 | MACHINE_RESET( osborne1 ) { |
| 213 | /* Initialize memory configuration */ |
| 214 | osborne1_bankswitch_w( 0x00, 0 ); |
| 215 | } |
| 216 | |
| 217 | DRIVER_INIT( osborne1 ) { |
| 218 | osborne1.empty_4K = auto_malloc( 0x1000 ); |
| 219 | memset( osborne1.empty_4K, 0xFF, 0x1000 ); |
| 220 | |
| 221 | /* configure the 6821 PIAs */ |
| 222 | pia_config( 0, &osborne1_ieee_pia_config ); |
| 223 | pia_config( 1, &osborne1_video_pia_config ); |
| 224 | |
| 225 | /* Configure the 6850 ACIA */ |
| 226 | // acia6850_config( 0, &osborne1_6850_config ); |
| 227 | } |
| 228 | |
| 229 | VIDEO_UPDATE( osborne1 ) { |
| 230 | UINT8 *charrom = memory_region(REGION_GFX1); |
| 231 | UINT16 address = osborne1.start_y * 128 + osborne1.start_x; |
| 232 | int x, y; |
| 233 | |
| 234 | for ( y = 0; y < 24; y++ ) { |
| 235 | for ( x = 0; x < 52; x++ ) { |
| 236 | UINT8 character = mess_ram[ 0xF000 + ( ( address + x ) & 0xFFF ) ]; |
| 237 | UINT8 underline = character & 0x80; |
| 238 | UINT8 dim = mess_ram[ 0x10000 + ( ( address + x ) & 0xFFF ) ]; |
| 239 | int line; |
| 240 | |
| 241 | character = character & 0x7F; |
| 242 | for ( line = 0; line < 10; line++ ) { |
| 243 | UINT16 *p = BITMAP_ADDR16( bitmap, y * 10 + line, x * 8 ); |
| 244 | int bits = charrom[ line * 128 + character ]; |
| 245 | int bit; |
| 246 | |
| 247 | if ( underline && line == 9 ) { |
| 248 | bits = 0xFF; |
| 249 | } |
| 250 | for ( bit = 0; bit < 8; bit++ ) { |
| 251 | p[bit] = ( bits & 0x80 ) ? ( dim ? 2 : 1 ) : 0; |
| 252 | bits = bits << 1; |
| 253 | } |
| 254 | } |
| 255 | } |
| 256 | address += 128; |
| 257 | } |
| 258 | return 0; |
| 259 | } |
| 260 | |
src/mess/drivers/osborne1.c
| r0 | r1193 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Osborne-1 driver file |
| 4 | |
| 5 | The Osborne-1 memory is divided into 3 "banks". |
| 6 | |
| 7 | Bank 1 simply consists of 64KB of RAM. The upper 4KB is used for the lower 8 |
| 8 | bit of video RAM entries. |
| 9 | |
| 10 | Bank 2 holds the BIOS ROM and I/O area. Only addresses 0000-3FFF are used |
| 11 | by bank 2. Bank 2 is divided as follows: |
| 12 | 3000-3FFF Unused |
| 13 | 2C00-2C03 Video PIA |
| 14 | 2A00-2A01 Serial interface |
| 15 | 2900-2903 488 PIA |
| 16 | 2201-2280 Keyboard |
| 17 | 2100-2103 Floppy |
| 18 | 1000-1FFF Unused |
| 19 | 0000-0FFF BIOS ROM |
| 20 | |
| 21 | Bank 3 has the ninth bit needed to complete the full Video RAM. These bits |
| 22 | are stored at F000-FFFF. Only the highest bit is used. |
| 23 | |
| 24 | On bootup bank 2 is active. |
| 25 | |
| 26 | The actual banking is done through I/O ports 00-03. |
| 27 | 00 - Have both bank 2 and bank 1 active. This seems to be the power up default. |
| 28 | 01 - Only have bank 1 active. |
| 29 | 02 - Have both bank 2 and bank 3 active. (Not 100% sure, also bank 1 from 4000-EFFF?) |
| 30 | 03 - Have both bank 2 and bank 1 active. |
| 31 | |
| 32 | ***************************************************************************/ |
| 33 | |
| 34 | #include "driver.h" |
| 35 | #include "cpu/z80/z80.h" |
| 36 | #include "inputx.h" |
| 37 | #include "includes/osborne1.h" |
| 38 | |
| 39 | #define MAIN_CLOCK 15974400 |
| 40 | |
| 41 | static ADDRESS_MAP_START( osborne1_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 42 | AM_RANGE( 0x0000, 0x0FFF ) AM_READWRITE( MRA8_BANK1, osborne1_0000_w ) |
| 43 | AM_RANGE( 0x1000, 0x1FFF ) AM_READWRITE( MRA8_BANK2, osborne1_1000_w ) |
| 44 | AM_RANGE( 0x2000, 0x2FFF ) AM_READWRITE( osborne1_2000_r, osborne1_2000_w ) |
| 45 | AM_RANGE( 0x3000, 0x3FFF ) AM_READWRITE( MRA8_BANK3, osborne1_3000_w ) |
| 46 | AM_RANGE( 0x4000, 0xEFFF ) AM_RAM |
| 47 | AM_RANGE( 0xF000, 0xFFFF ) AM_READWRITE( MRA8_BANK4, osborne1_videoram_w ) |
| 48 | ADDRESS_MAP_END |
| 49 | |
| 50 | static ADDRESS_MAP_START( osborne1_io, ADDRESS_SPACE_IO, 8 ) |
| 51 | ADDRESS_MAP_FLAGS( AMEF_UNMAP(0xff) ) |
| 52 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 53 | AM_RANGE( 0x00, 0x03 ) AM_WRITE( osborne1_bankswitch_w ) |
| 54 | ADDRESS_MAP_END |
| 55 | |
| 56 | static INPUT_PORTS_START( osborne1 ) |
| 57 | PORT_START /* 0 */ |
| 58 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("|") PORT_CODE(KEYCODE_OPENBRACE) |
| 59 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\'") PORT_CODE(KEYCODE_QUOTE) |
| 60 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) |
| 61 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CODE(KEYCODE_LSHIFT) |
| 62 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 63 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) |
| 64 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) |
| 65 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) |
| 66 | PORT_START /* 1 */ |
| 67 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) |
| 68 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 69 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 70 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 71 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| 72 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 73 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 74 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 75 | PORT_START /* 2 */ |
| 76 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 77 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) |
| 78 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) |
| 79 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) |
| 80 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) |
| 81 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 82 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CURSOR LEFT") PORT_CODE(KEYCODE_LEFT) |
| 83 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CURSOR UP") PORT_CODE(KEYCODE_UP) |
| 84 | PORT_START /* 3 */ |
| 85 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) |
| 86 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) |
| 87 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) |
| 88 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) |
| 89 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) |
| 90 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) |
| 91 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) |
| 92 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) |
| 93 | PORT_START /* 4 */ |
| 94 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) |
| 95 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) |
| 96 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) |
| 97 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) |
| 98 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) |
| 99 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) |
| 100 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) |
| 101 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 102 | PORT_START /* 5 */ |
| 103 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) |
| 104 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) |
| 105 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) |
| 106 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) |
| 107 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) |
| 108 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) |
| 109 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) |
| 110 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) |
| 111 | PORT_START /* 6 */ |
| 112 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("= +") PORT_CODE(KEYCODE_EQUALS) |
| 113 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) |
| 114 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\\") PORT_CODE(KEYCODE_BACKSLASH) |
| 115 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(";") PORT_CODE(KEYCODE_COLON) |
| 116 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) |
| 117 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) |
| 118 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CURSOR DOWN") PORT_CODE(KEYCODE_DOWN) |
| 119 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CURSOR RIGHT") PORT_CODE(KEYCODE_RIGHT) |
| 120 | PORT_START /* 7 */ |
| 121 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 122 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 123 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 124 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 125 | PORT_DIPNAME(0x08, 0, "ALPHA LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 126 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 127 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 128 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 129 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 130 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 131 | INPUT_PORTS_END |
| 132 | |
| 133 | static PALETTE_INIT( osborne1 ) { |
| 134 | palette_set_color_rgb( machine, 0, 0, 0, 0 ); /* Black */ |
| 135 | palette_set_color_rgb( machine, 1, 255, 255, 255 ); /* White */ |
| 136 | palette_set_color_rgb( machine, 2, 128, 128, 128 ); /* Grey/Dimmed */ |
| 137 | } |
| 138 | |
| 139 | static MACHINE_DRIVER_START( osborne1 ) |
| 140 | MDRV_CPU_ADD_TAG( "main", Z80, MAIN_CLOCK/4 ) |
| 141 | MDRV_CPU_PROGRAM_MAP( osborne1_mem, 0 ) |
| 142 | MDRV_CPU_IO_MAP( osborne1_io, 0 ) |
| 143 | |
| 144 | MDRV_MACHINE_RESET( osborne1 ) |
| 145 | |
| 146 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) |
| 147 | MDRV_SCREEN_FORMAT( BITMAP_FORMAT_INDEXED16 ) |
| 148 | MDRV_SCREEN_ADD( "main",0 ) |
| 149 | MDRV_SCREEN_RAW_PARAMS( MAIN_CLOCK/2, 512, 0, 416, 260, 0, 240 ) |
| 150 | MDRV_VIDEO_START( generic_bitmapped ) |
| 151 | MDRV_VIDEO_UPDATE( osborne1 ) |
| 152 | MDRV_PALETTE_LENGTH( 3 ) |
| 153 | MDRV_PALETTE_INIT( osborne1 ) |
| 154 | |
| 155 | MACHINE_DRIVER_END |
| 156 | |
| 157 | ROM_START( osborne1 ) |
| 158 | ROM_REGION(0x1000, REGION_CPU1, 0) |
| 159 | ROM_SYSTEM_BIOS( 0, "ver144", "BIOS version 1.44" ) |
| 160 | ROMX_LOAD( "osb144.bin", 0x0000, 0x1000, CRC(c0596b14) SHA1(ee6a9cc9be3ddc5949d3379351c1d58a175ce9ac), ROM_BIOS(1) ) |
| 161 | ROM_SYSTEM_BIOS( 1, "verA", "BIOS version A" ) |
| 162 | ROMX_LOAD( "osba.bin", 0x0000, 0x1000, NO_DUMP, ROM_BIOS(2) ) |
| 163 | ROM_SYSTEM_BIOS( 2, "ver12", "BIOS version 1.2" ) |
| 164 | ROMX_LOAD( "osb12.bin", 0x0000, 0x1000, NO_DUMP, ROM_BIOS(3) ) |
| 165 | ROM_SYSTEM_BIOS( 3, "ver121", "BIOS version 1.2.1" ) |
| 166 | ROMX_LOAD( "osb121.bin", 0x0000, 0x1000, NO_DUMP, ROM_BIOS(4) ) |
| 167 | ROM_SYSTEM_BIOS( 4, "ver13", "BIOS version 1.3" ) |
| 168 | ROMX_LOAD( "osb13.bin", 0x0000, 0x1000, NO_DUMP, ROM_BIOS(5) ) |
| 169 | ROM_SYSTEM_BIOS( 5, "ver14", "BISO version 1.4" ) |
| 170 | ROMX_LOAD( "osb14.bin", 0x0000, 0x1000, NO_DUMP, ROM_BIOS(6) ) |
| 171 | ROM_SYSTEM_BIOS( 6, "ver143", "BIOS version 1.43" ) |
| 172 | ROMX_LOAD( "osb143.bin", 0x0000, 0x1000, NO_DUMP, ROM_BIOS(7) ) |
| 173 | ROM_REGION( 0x800, REGION_GFX1, 0 ) |
| 174 | ROM_LOAD( "osbchr.bin", 0x0000, 0x800, BAD_DUMP CRC(6c1eab0d) SHA1(b04459d377a70abc9155a5486003cb795342c801) ) |
| 175 | ROM_END |
| 176 | |
| 177 | SYSTEM_CONFIG_START( osborne1 ) |
| 178 | CONFIG_RAM_DEFAULT( 68 * 1024 ) /* 64KB Main RAM and 4Kbit video attribute RAM */ |
| 179 | SYSTEM_CONFIG_END |
| 180 | |
| 181 | COMPB( 1981, osborne1, 0, osborne1, 0, osborne1, osborne1, osborne1, osborne1, "Osborne", "Osborne-1", GAME_NOT_WORKING ) |
| 182 | |