src/mess/drivers/okean240.c
| r11991 | r11992 | |
| 33 | 33 | be useful to have the 2 screens side-by-side. Unfortunately they will not |
| 34 | 34 | co-exist, instead causing a crash at start ("Mandatory artwork is missing"). |
| 35 | 35 | So, if you want to see the test rom results, you'll have to compile a modified |
| 36 | | driver (change the below line to 1). |
| 37 | | - All 'rand()' returns are only there to allow the tests to proceed. |
| 36 | driver (uncomment the define below). |
| 37 | - You need to press a key every so often. |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | ToDo: |
| 41 | 41 | - Add devices |
| 42 | 42 | - Find out if any unconnected keyboard entries are real keys |
| 43 | | - Colours (if it had colours) |
| 43 | - Colours? |
| 44 | - Sound? (perhaps port E4 bit 3) |
| 44 | 45 | - Add disks |
| 45 | | - Add cassette |
| 46 | - Cassette? |
| 47 | - Add memory banking (perhaps port C1) |
| 46 | 48 | |
| 47 | 49 | Usage of terminal: |
| 48 | 50 | - okean240 bios 0 - the keyboard |
| 49 | 51 | - okean240a bios 0 - not used |
| 50 | | - (either) bios 1 - the screen if compiled specially |
| 52 | - (either) bios 1 - the keyboard (part of the testing), & the screen if compiled specially |
| 51 | 53 | |
| 52 | 54 | ****************************************************************************/ |
| 53 | | #define OKEAN240_USING_TESTROM 0 |
| 55 | //#define OKEAN240_USING_TESTROM |
| 54 | 56 | |
| 55 | 57 | #define ADDRESS_MAP_MODERN |
| 56 | 58 | |
| r11991 | r11992 | |
| 74 | 76 | DECLARE_READ8_MEMBER(okean240_kbd_status_r); |
| 75 | 77 | DECLARE_READ8_MEMBER(okean240a_kbd_status_r); |
| 76 | 78 | DECLARE_READ8_MEMBER(term_status_r); |
| 79 | DECLARE_READ8_MEMBER(term_r); |
| 77 | 80 | DECLARE_READ8_MEMBER(okean240_keyboard_r); |
| 78 | 81 | DECLARE_WRITE8_MEMBER(okean240_keyboard_w); |
| 79 | 82 | DECLARE_READ8_MEMBER(okean240a_keyboard_r); |
| r11991 | r11992 | |
| 87 | 90 | virtual void video_start(); |
| 88 | 91 | }; |
| 89 | 92 | |
| 90 | | |
| 93 | // bios 0 requires bit 4 to change |
| 91 | 94 | READ8_MEMBER( okean240_state::okean240_kbd_status_r ) |
| 92 | 95 | { |
| 93 | 96 | if (m_term_data) |
| r11991 | r11992 | |
| 113 | 116 | return machine().rand() & 0x10; |
| 114 | 117 | } |
| 115 | 118 | |
| 119 | // for test rom |
| 116 | 120 | READ8_MEMBER( okean240_state::term_status_r ) |
| 117 | 121 | { |
| 118 | | return 1 | (machine().rand() & 2); |
| 122 | return (m_term_data) ? 3 : 1; |
| 119 | 123 | } |
| 120 | 124 | |
| 121 | 125 | READ8_MEMBER( okean240_state::okean240_keyboard_r ) |
| 122 | 126 | { |
| 123 | 127 | if (offset == 0) // port 40 (get ascii key value) |
| 124 | | { |
| 125 | | UINT8 ret = m_term_data; |
| 126 | | m_term_data = 0; |
| 127 | | return ret; |
| 128 | | } |
| 128 | return term_r(space, offset); |
| 129 | 129 | else |
| 130 | | if (offset == 1) // port 41 bit 1 (status bit used by test rom) |
| 130 | if (offset == 1) // port 41 bit 1 (test rom status bit) |
| 131 | 131 | { |
| 132 | 132 | return (machine().rand() & 2); |
| 133 | 133 | } |
| r11991 | r11992 | |
| 157 | 157 | return 0; |
| 158 | 158 | } |
| 159 | 159 | else |
| 160 | | if (offset == 1) // port 41 bits 6&7 (modifier keys), and bit 1 (unrelated status bit) |
| 160 | if (offset == 1) // port 41 bits 6&7 (modifier keys), and bit 1 (test rom status bit) |
| 161 | 161 | { |
| 162 | 162 | return (machine().rand() & 2) | input_port_read(machine(), "MODIFIERS"); |
| 163 | 163 | } |
| r11991 | r11992 | |
| 181 | 181 | // okean240a: port 42 bit 4 |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | // for test rom |
| 185 | READ8_MEMBER( okean240_state::term_r ) |
| 186 | { |
| 187 | UINT8 ret = m_term_data; |
| 188 | m_term_data = 0; |
| 189 | return ret; |
| 190 | } |
| 191 | |
| 184 | 192 | WRITE8_MEMBER( okean240_state::scroll_w ) |
| 185 | 193 | { |
| 186 | 194 | m_scroll = data; |
| r11991 | r11992 | |
| 199 | 207 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 200 | 208 | AM_RANGE(0x40, 0x42) AM_READWRITE(okean240_keyboard_r,okean240_keyboard_w) |
| 201 | 209 | AM_RANGE(0x80, 0x80) AM_READ(okean240_kbd_status_r) |
| 202 | | #if OKEAN240_USING_TESTROM |
| 210 | #ifdef OKEAN240_USING_TESTROM |
| 203 | 211 | AM_RANGE(0xa0, 0xa0) AM_DEVWRITE_LEGACY(TERMINAL_TAG, terminal_write) |
| 212 | #endif |
| 213 | AM_RANGE(0xa0, 0xa0) AM_READ(term_r) |
| 204 | 214 | AM_RANGE(0xa1, 0xa1) AM_READ(term_status_r) |
| 205 | | #endif |
| 206 | 215 | AM_RANGE(0xc0, 0xc0) AM_WRITE(scroll_w) |
| 207 | 216 | ADDRESS_MAP_END |
| 208 | 217 | |
| r11991 | r11992 | |
| 210 | 219 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 211 | 220 | AM_RANGE(0x40, 0x42) AM_READWRITE(okean240a_keyboard_r,okean240_keyboard_w) |
| 212 | 221 | AM_RANGE(0x80, 0x80) AM_READ(okean240a_kbd_status_r) |
| 213 | | #if OKEAN240_USING_TESTROM |
| 222 | #ifdef OKEAN240_USING_TESTROM |
| 214 | 223 | AM_RANGE(0xa0, 0xa0) AM_DEVWRITE_LEGACY(TERMINAL_TAG, terminal_write) |
| 224 | #endif |
| 225 | AM_RANGE(0xa0, 0xa0) AM_READ(term_r) |
| 215 | 226 | AM_RANGE(0xa1, 0xa1) AM_READ(term_status_r) |
| 216 | | #endif |
| 217 | 227 | AM_RANGE(0xc0, 0xc0) AM_WRITE(scroll_w) |
| 218 | 228 | // AM_RANGE(0x00, 0x1f)=ppa00.data |
| 219 | 229 | // AM_RANGE(0x20, 0x23)=dsk.data |
| r11991 | r11992 | |
| 374 | 384 | DEVCB_DRIVER_MEMBER(okean240_state, kbd_put) |
| 375 | 385 | }; |
| 376 | 386 | |
| 377 | | static GENERIC_TERMINAL_INTERFACE( okean240a_terminal_intf ) |
| 378 | | { |
| 379 | | DEVCB_NULL |
| 380 | | }; |
| 381 | | |
| 382 | 387 | DRIVER_INIT( okean240 ) |
| 383 | 388 | { |
| 384 | 389 | UINT8 *RAM = machine.region("maincpu")->base(); |
| r11991 | r11992 | |
| 389 | 394 | { |
| 390 | 395 | } |
| 391 | 396 | |
| 397 | #ifndef OKEAN240_USING_TESTROM |
| 392 | 398 | static SCREEN_UPDATE( okean240 ) |
| 393 | 399 | { |
| 394 | 400 | okean240_state *state = screen->machine().driver_data<okean240_state>(); |
| r11991 | r11992 | |
| 417 | 423 | } |
| 418 | 424 | return 0; |
| 419 | 425 | } |
| 426 | #endif |
| 420 | 427 | |
| 421 | 428 | /* F4 Character Displayer */ |
| 422 | 429 | static const gfx_layout okean240_charlayout = |
| r11991 | r11992 | |
| 447 | 454 | MCFG_CPU_IO_MAP(okean240_io) |
| 448 | 455 | |
| 449 | 456 | /* video hardware */ |
| 450 | | #if OKEAN240_USING_TESTROM |
| 457 | #ifdef OKEAN240_USING_TESTROM |
| 451 | 458 | MCFG_FRAGMENT_ADD( generic_terminal ) |
| 452 | 459 | #else |
| 453 | 460 | MCFG_SCREEN_ADD("screen", RASTER) |
| r11991 | r11992 | |
| 469 | 476 | MCFG_CPU_MODIFY("maincpu") |
| 470 | 477 | MCFG_CPU_IO_MAP(okean240a_io) |
| 471 | 478 | MCFG_GFXDECODE(okean240a) |
| 472 | | MCFG_GENERIC_TERMINAL_REMOVE(TERMINAL_TAG) |
| 473 | | //MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, okean240a_terminal_intf) |
| 474 | 479 | MACHINE_CONFIG_END |
| 475 | 480 | |
| 476 | 481 | /* ROM definition */ |