trunk/src/mess/drivers/osi.c
| r20490 | r20491 | |
| 261 | 261 | |
| 262 | 262 | READ8_MEMBER( sb2m600_state::keyboard_r ) |
| 263 | 263 | { |
| 264 | | if (ioport("Reset")->read()) |
| 265 | | machine().device(M6502_TAG)->reset(); |
| 264 | if (m_io_reset->read()) |
| 265 | m_maincpu->reset(); |
| 266 | 266 | |
| 267 | | static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" }; |
| 268 | | |
| 269 | 267 | UINT8 data = 0xff; |
| 270 | | int bit; |
| 271 | 268 | |
| 272 | | for (bit = 0; bit < 8; bit++) |
| 273 | | { |
| 274 | | if (!BIT(m_keylatch, bit)) data &= ioport(keynames[bit])->read(); |
| 275 | | } |
| 269 | if (!BIT(m_keylatch, 0)) |
| 270 | data &= m_io_row0->read(); |
| 271 | if (!BIT(m_keylatch, 1)) |
| 272 | data &= m_io_row1->read(); |
| 273 | if (!BIT(m_keylatch, 2)) |
| 274 | data &= m_io_row2->read(); |
| 275 | if (!BIT(m_keylatch, 3)) |
| 276 | data &= m_io_row3->read(); |
| 277 | if (!BIT(m_keylatch, 4)) |
| 278 | data &= m_io_row4->read(); |
| 279 | if (!BIT(m_keylatch, 5)) |
| 280 | data &= m_io_row5->read(); |
| 281 | if (!BIT(m_keylatch, 6)) |
| 282 | data &= m_io_row6->read(); |
| 283 | if (!BIT(m_keylatch, 7)) |
| 284 | data &= m_io_row7->read(); |
| 276 | 285 | |
| 277 | 286 | return data; |
| 278 | 287 | } |
| r20490 | r20491 | |
| 281 | 290 | { |
| 282 | 291 | m_keylatch = data; |
| 283 | 292 | |
| 284 | | if (ioport("Sound")->read()) |
| 293 | if (m_io_sound->read()) |
| 285 | 294 | discrete_sound_w(m_discrete, space, NODE_01, (data >> 2) & 0x0f); |
| 286 | 295 | } |
| 287 | 296 | |
trunk/src/mess/includes/osi.h
| r20490 | r20491 | |
| 30 | 30 | public: |
| 31 | 31 | sb2m600_state(const machine_config &mconfig, device_type type, const char *tag) |
| 32 | 32 | : driver_device(mconfig, type, tag), |
| 33 | | m_maincpu(*this, M6502_TAG), |
| 34 | | m_cassette(*this, CASSETTE_TAG), |
| 35 | | m_discrete(*this, DISCRETE_TAG), |
| 36 | | m_ram(*this, RAM_TAG), |
| 37 | | m_video_ram(*this, "video_ram"), |
| 38 | | m_color_ram(*this, "color_ram") |
| 33 | m_maincpu(*this, M6502_TAG), |
| 34 | m_cassette(*this, CASSETTE_TAG), |
| 35 | m_discrete(*this, DISCRETE_TAG), |
| 36 | m_ram(*this, RAM_TAG), |
| 37 | m_video_ram(*this, "video_ram"), |
| 38 | m_color_ram(*this, "color_ram"), |
| 39 | m_io_row0(*this, "ROW0"), |
| 40 | m_io_row1(*this, "ROW1"), |
| 41 | m_io_row2(*this, "ROW2"), |
| 42 | m_io_row3(*this, "ROW3"), |
| 43 | m_io_row4(*this, "ROW4"), |
| 44 | m_io_row5(*this, "ROW5"), |
| 45 | m_io_row6(*this, "ROW6"), |
| 46 | m_io_row7(*this, "ROW7"), |
| 47 | m_io_sound(*this, "Sound"), |
| 48 | m_io_reset(*this, "Reset") |
| 39 | 49 | { } |
| 40 | 50 | |
| 41 | | required_device<cpu_device> m_maincpu; |
| 42 | | required_device<cassette_image_device> m_cassette; |
| 43 | | optional_device<discrete_sound_device> m_discrete; |
| 44 | | required_device<ram_device> m_ram; |
| 45 | | |
| 46 | 51 | virtual void machine_start(); |
| 47 | | |
| 48 | 52 | virtual void video_start(); |
| 49 | 53 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 50 | | |
| 51 | 54 | DECLARE_READ8_MEMBER( keyboard_r ); |
| 52 | 55 | DECLARE_WRITE8_MEMBER( keyboard_w ); |
| 53 | 56 | DECLARE_WRITE8_MEMBER( ctrl_w ); |
| r20490 | r20491 | |
| 60 | 63 | /* video state */ |
| 61 | 64 | int m_32; |
| 62 | 65 | int m_coloren; |
| 63 | | required_shared_ptr<UINT8> m_video_ram; |
| 64 | | optional_shared_ptr<UINT8> m_color_ram; |
| 66 | UINT8 *m_p_chargen; |
| 65 | 67 | |
| 66 | 68 | /* floppy state */ |
| 67 | 69 | int m_fdc_index; |
| 68 | 70 | TIMER_CALLBACK_MEMBER(setup_beep); |
| 69 | 71 | DECLARE_WRITE_LINE_MEMBER(osi470_index_callback); |
| 72 | |
| 73 | required_device<cpu_device> m_maincpu; |
| 74 | required_device<cassette_image_device> m_cassette; |
| 75 | optional_device<discrete_sound_device> m_discrete; |
| 76 | required_device<ram_device> m_ram; |
| 77 | required_shared_ptr<UINT8> m_video_ram; |
| 78 | optional_shared_ptr<UINT8> m_color_ram; |
| 79 | required_ioport m_io_row0; |
| 80 | required_ioport m_io_row1; |
| 81 | required_ioport m_io_row2; |
| 82 | required_ioport m_io_row3; |
| 83 | required_ioport m_io_row4; |
| 84 | required_ioport m_io_row5; |
| 85 | required_ioport m_io_row6; |
| 86 | required_ioport m_io_row7; |
| 87 | required_ioport m_io_sound; |
| 88 | required_ioport m_io_reset; |
| 70 | 89 | }; |
| 71 | 90 | |
| 72 | 91 | class c1p_state : public sb2m600_state |
trunk/src/mess/video/osi.c
| r20490 | r20491 | |
| 23 | 23 | |
| 24 | 24 | void sb2m600_state::video_start() |
| 25 | 25 | { |
| 26 | m_p_chargen = memregion("chargen")->base(); |
| 26 | 27 | UINT16 addr; |
| 27 | 28 | |
| 28 | 29 | /* randomize video memory contents */ |
| 29 | 30 | for (addr = 0; addr < OSI600_VIDEORAM_SIZE; addr++) |
| 30 | | { |
| 31 | 31 | m_video_ram[addr] = machine().rand() & 0xff; |
| 32 | | } |
| 33 | 32 | |
| 34 | 33 | /* randomize color memory contents */ |
| 35 | 34 | if (m_color_ram) |
| 36 | | { |
| 37 | 35 | for (addr = 0; addr < OSI630_COLORRAM_SIZE; addr++) |
| 38 | | { |
| 39 | 36 | m_color_ram[addr] = machine().rand() & 0x0f; |
| 40 | | } |
| 41 | | } |
| 42 | 37 | } |
| 43 | 38 | |
| 44 | 39 | /* Video Update */ |
| r20490 | r20491 | |
| 59 | 54 | { |
| 60 | 55 | UINT8 videoram_data = m_video_ram[videoram_addr]; |
| 61 | 56 | UINT16 charrom_addr = ((videoram_data << 3) | line) & 0x7ff; |
| 62 | | UINT8 charrom_data = memregion("chargen")->base()[charrom_addr]; |
| 57 | UINT8 charrom_data = m_p_chargen[charrom_addr]; |
| 63 | 58 | |
| 64 | 59 | for (bit = 0; bit < 8; bit++) |
| 65 | 60 | { |
| 66 | | int color = BIT(charrom_data, 7); |
| 61 | bool color = BIT(charrom_data, 7); |
| 67 | 62 | |
| 68 | 63 | if (m_coloren) |
| 69 | 64 | { |
| r20490 | r20491 | |
| 92 | 87 | { |
| 93 | 88 | UINT8 videoram_data = m_video_ram[videoram_addr]; |
| 94 | 89 | UINT16 charrom_addr = ((videoram_data << 3) | line) & 0x7ff; |
| 95 | | UINT8 charrom_data = memregion("chargen")->base()[charrom_addr]; |
| 90 | UINT8 charrom_data = m_p_chargen[charrom_addr]; |
| 96 | 91 | |
| 97 | 92 | for (bit = 0; bit < 8; bit++) |
| 98 | 93 | { |
| 99 | | int color = BIT(charrom_data, 7); |
| 94 | bool color = BIT(charrom_data, 7); |
| 100 | 95 | |
| 101 | 96 | if (m_coloren) |
| 102 | 97 | { |
| r20490 | r20491 | |
| 132 | 127 | { |
| 133 | 128 | UINT8 videoram_data = m_video_ram[videoram_addr++]; |
| 134 | 129 | UINT16 charrom_addr = ((videoram_data << 3) | line) & 0x7ff; |
| 135 | | UINT8 charrom_data = memregion("chargen")->base()[charrom_addr]; |
| 130 | UINT8 charrom_data = m_p_chargen[charrom_addr]; |
| 136 | 131 | |
| 137 | 132 | for (bit = 0; bit < 8; bit++) |
| 138 | 133 | { |