trunk/src/mame/drivers/unkhorse.c
| r245317 | r245318 | |
| 30 | 30 | public: |
| 31 | 31 | horse_state(const machine_config &mconfig, device_type type, const char *tag) |
| 32 | 32 | : driver_device(mconfig, type, tag), |
| 33 | m_maincpu(*this, "maincpu"), |
| 34 | m_dac(*this, "dac"), |
| 33 | 35 | m_video_ram(*this, "video_ram"), |
| 34 | | m_color_ram(*this, "color_ram"), |
| 35 | | m_maincpu(*this, "maincpu"), |
| 36 | | m_dac(*this, "dac") { } |
| 36 | m_color_ram(*this, "color_ram") { } |
| 37 | 37 | |
| 38 | required_device<cpu_device> m_maincpu; |
| 39 | required_device<dac_device> m_dac; |
| 40 | |
| 38 | 41 | required_shared_ptr<UINT8> m_video_ram; |
| 39 | 42 | required_shared_ptr<UINT8> m_color_ram; |
| 43 | |
| 40 | 44 | UINT8 m_output; |
| 41 | | DECLARE_READ8_MEMBER(horse_input_r); |
| 42 | | DECLARE_WRITE8_MEMBER(horse_output_w); |
| 43 | | DECLARE_WRITE_LINE_MEMBER(horse_timer_out); |
| 45 | |
| 46 | DECLARE_READ8_MEMBER(input_r); |
| 47 | DECLARE_WRITE8_MEMBER(output_w); |
| 48 | DECLARE_WRITE_LINE_MEMBER(timer_out); |
| 49 | |
| 50 | virtual void machine_start(); |
| 44 | 51 | DECLARE_PALETTE_INIT(horse); |
| 45 | | UINT32 screen_update_horse(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 46 | | INTERRUPT_GEN_MEMBER(horse_interrupt); |
| 47 | | required_device<cpu_device> m_maincpu; |
| 48 | | required_device<dac_device> m_dac; |
| 52 | |
| 53 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 54 | |
| 55 | INTERRUPT_GEN_MEMBER(interrupt); |
| 49 | 56 | }; |
| 50 | 57 | |
| 51 | 58 | |
| 59 | void horse_state::machine_start() |
| 60 | { |
| 61 | save_item(NAME(m_output)); |
| 62 | } |
| 63 | |
| 52 | 64 | /*************************************************************************** |
| 53 | 65 | |
| 54 | 66 | Video |
| r245317 | r245318 | |
| 62 | 74 | palette.set_pen_color(i, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0)); |
| 63 | 75 | } |
| 64 | 76 | |
| 65 | | UINT32 horse_state::screen_update_horse(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 77 | UINT32 horse_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 66 | 78 | { |
| 67 | 79 | for (int y = cliprect.min_y; y <= cliprect.max_y; y++) |
| 68 | 80 | { |
| r245317 | r245318 | |
| 98 | 110 | ADDRESS_MAP_END |
| 99 | 111 | |
| 100 | 112 | |
| 101 | | READ8_MEMBER(horse_state::horse_input_r) |
| 113 | READ8_MEMBER(horse_state::input_r) |
| 102 | 114 | { |
| 103 | 115 | switch (m_output >> 6 & 3) |
| 104 | 116 | { |
| r245317 | r245318 | |
| 111 | 123 | return 0xff; |
| 112 | 124 | } |
| 113 | 125 | |
| 114 | | WRITE8_MEMBER(horse_state::horse_output_w) |
| 126 | WRITE8_MEMBER(horse_state::output_w) |
| 115 | 127 | { |
| 116 | 128 | m_output = data; |
| 117 | 129 | |
| r245317 | r245318 | |
| 120 | 132 | // other bits: ? |
| 121 | 133 | } |
| 122 | 134 | |
| 123 | | WRITE_LINE_MEMBER(horse_state::horse_timer_out) |
| 135 | WRITE_LINE_MEMBER(horse_state::timer_out) |
| 124 | 136 | { |
| 125 | 137 | m_dac->write_signed8(state ? 0x7f : 0); |
| 126 | 138 | } |
| r245317 | r245318 | |
| 182 | 194 | |
| 183 | 195 | ***************************************************************************/ |
| 184 | 196 | |
| 185 | | INTERRUPT_GEN_MEMBER(horse_state::horse_interrupt) |
| 197 | INTERRUPT_GEN_MEMBER(horse_state::interrupt) |
| 186 | 198 | { |
| 187 | 199 | device.execute().set_input_line(I8085_RST75_LINE, ASSERT_LINE); |
| 188 | 200 | device.execute().set_input_line(I8085_RST75_LINE, CLEAR_LINE); |
| r245317 | r245318 | |
| 194 | 206 | MCFG_CPU_ADD("maincpu", I8085A, XTAL_12MHz / 2) |
| 195 | 207 | MCFG_CPU_PROGRAM_MAP(horse_map) |
| 196 | 208 | MCFG_CPU_IO_MAP(horse_io_map) |
| 197 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", horse_state, horse_interrupt) |
| 209 | MCFG_CPU_VBLANK_INT_DRIVER("screen", horse_state, interrupt) |
| 198 | 210 | |
| 199 | 211 | MCFG_DEVICE_ADD("i8155", I8155, XTAL_12MHz / 2) |
| 200 | | MCFG_I8155_IN_PORTA_CB(READ8(horse_state, horse_input_r)) |
| 201 | | MCFG_I8155_OUT_PORTB_CB(WRITE8(horse_state, horse_output_w)) |
| 212 | MCFG_I8155_IN_PORTA_CB(READ8(horse_state, input_r)) |
| 213 | MCFG_I8155_OUT_PORTB_CB(WRITE8(horse_state, output_w)) |
| 202 | 214 | //port C output (but unused) |
| 203 | | MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE(horse_state, horse_timer_out)) |
| 215 | MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE(horse_state, timer_out)) |
| 204 | 216 | |
| 205 | 217 | /* video hardware */ |
| 206 | 218 | MCFG_SCREEN_ADD("screen", RASTER) |
| r245317 | r245318 | |
| 208 | 220 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 209 | 221 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 210 | 222 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) |
| 211 | | MCFG_SCREEN_UPDATE_DRIVER(horse_state, screen_update_horse) |
| 223 | MCFG_SCREEN_UPDATE_DRIVER(horse_state, screen_update) |
| 212 | 224 | MCFG_SCREEN_PALETTE("palette") |
| 213 | 225 | |
| 214 | 226 | MCFG_PALETTE_ADD("palette", 8) |
| r245317 | r245318 | |
| 240 | 252 | ROM_END |
| 241 | 253 | |
| 242 | 254 | |
| 243 | | GAME( 1981?, unkhorse, 0, horse, horse, driver_device, 0, ROT270, "<unknown>", "unknown Japanese horse gambling game", 0 ) // copyright not shown, datecodes on pcb suggests early-1981 |
| 255 | GAME( 1981?, unkhorse, 0, horse, horse, driver_device, 0, ROT270, "<unknown>", "unknown Japanese horse gambling game", GAME_SUPPORTS_SAVE ) // copyright not shown, datecodes on pcb suggests early-1981 |