trunk/src/mame/drivers/headonb.c
| r0 | r19368 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Italian bootleg of Head On, by EFG Sanremo (late 70s to early 80s). |
| 4 | The game title is unknown. Someone wrote FOOL RACE on a piece of tape |
| 5 | on the pcb, but that's not really credible. |
| 6 | |
| 7 | It's on much cheaper hardware than the original: 8080 instead of Z80, |
| 8 | and less RAM needed with the gfx tiles being on ROM. |
| 9 | |
| 10 | TODO: |
| 11 | - Sound is unknown, probably simple and discrete |
| 12 | - wrong coin handling, it writes to port $01 to reset coin status? |
| 13 | - other unknown writes |
| 14 | - dipswitch settings |
| 15 | |
| 16 | ***************************************************************************/ |
| 17 | |
| 18 | #include "emu.h" |
| 19 | #include "cpu/i8085/i8085.h" |
| 20 | |
| 21 | |
| 22 | class headonb_state : public driver_device |
| 23 | { |
| 24 | public: |
| 25 | headonb_state(const machine_config &mconfig, device_type type, const char *tag) |
| 26 | : driver_device(mconfig, type, tag), |
| 27 | m_video_ram(*this, "video_ram") |
| 28 | { } |
| 29 | |
| 30 | required_shared_ptr<UINT8> m_video_ram; |
| 31 | |
| 32 | tilemap_t *m_tilemap; |
| 33 | |
| 34 | DECLARE_WRITE8_MEMBER(headonb_video_ram_w); |
| 35 | |
| 36 | virtual void palette_init(); |
| 37 | virtual void video_start(); |
| 38 | UINT32 screen_update_headonb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 39 | TILE_GET_INFO_MEMBER(get_headonb_tile_info); |
| 40 | }; |
| 41 | |
| 42 | |
| 43 | /*************************************************************************** |
| 44 | |
| 45 | Video |
| 46 | |
| 47 | ***************************************************************************/ |
| 48 | |
| 49 | void headonb_state::palette_init() |
| 50 | { |
| 51 | palette_set_color(machine(), 0, RGB_BLACK); |
| 52 | palette_set_color(machine(), 1, RGB_WHITE); |
| 53 | } |
| 54 | |
| 55 | TILE_GET_INFO_MEMBER(headonb_state::get_headonb_tile_info) |
| 56 | { |
| 57 | UINT8 code = m_video_ram[tile_index]; |
| 58 | SET_TILE_INFO_MEMBER(0, code, 0, 0); |
| 59 | } |
| 60 | |
| 61 | void headonb_state::video_start() |
| 62 | { |
| 63 | m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(headonb_state::get_headonb_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); |
| 64 | } |
| 65 | |
| 66 | UINT32 headonb_state::screen_update_headonb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 67 | { |
| 68 | m_tilemap->draw(bitmap, cliprect, 0, 0); |
| 69 | return 0; |
| 70 | } |
| 71 | |
| 72 | |
| 73 | /*************************************************************************** |
| 74 | |
| 75 | I/O |
| 76 | |
| 77 | ***************************************************************************/ |
| 78 | |
| 79 | WRITE8_MEMBER(headonb_state::headonb_video_ram_w) |
| 80 | { |
| 81 | m_video_ram[offset] = data; |
| 82 | m_tilemap->mark_tile_dirty(offset); |
| 83 | } |
| 84 | |
| 85 | static ADDRESS_MAP_START( headonb_map, AS_PROGRAM, 8, headonb_state ) |
| 86 | AM_RANGE(0x0000, 0x3fff) AM_ROM AM_MIRROR(0x4000) |
| 87 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(headonb_video_ram_w) AM_SHARE("video_ram") |
| 88 | AM_RANGE(0xff00, 0xffff) AM_RAM |
| 89 | ADDRESS_MAP_END |
| 90 | |
| 91 | static ADDRESS_MAP_START( headonb_io_map, AS_IO, 8, headonb_state ) |
| 92 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN0") |
| 93 | AM_RANGE(0x04, 0x04) AM_READ_PORT("IN1") |
| 94 | ADDRESS_MAP_END |
| 95 | |
| 96 | |
| 97 | /*************************************************************************** |
| 98 | |
| 99 | Inputs |
| 100 | |
| 101 | ***************************************************************************/ |
| 102 | |
| 103 | static INPUT_PORTS_START( headonb ) |
| 104 | PORT_START("IN0") |
| 105 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) |
| 106 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) |
| 107 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) |
| 108 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) |
| 109 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 110 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) |
| 111 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // must be low? |
| 112 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) // wrong |
| 113 | |
| 114 | PORT_START("IN1") |
| 115 | PORT_DIPUNKNOWN( 0x01, 0x01 ) |
| 116 | PORT_DIPUNKNOWN( 0x02, 0x02 ) |
| 117 | PORT_DIPUNKNOWN( 0x04, 0x04 ) |
| 118 | PORT_DIPUNKNOWN( 0x08, 0x08 ) |
| 119 | PORT_DIPUNKNOWN( 0x10, 0x10 ) |
| 120 | PORT_DIPUNKNOWN( 0x20, 0x20 ) |
| 121 | PORT_DIPUNKNOWN( 0x40, 0x40 ) |
| 122 | PORT_DIPUNKNOWN( 0x80, 0x80 ) |
| 123 | INPUT_PORTS_END |
| 124 | |
| 125 | |
| 126 | /*************************************************************************** |
| 127 | |
| 128 | Machine Config |
| 129 | |
| 130 | ***************************************************************************/ |
| 131 | |
| 132 | static const gfx_layout headonb_charlayout = |
| 133 | { |
| 134 | 8,8, |
| 135 | RGN_FRAC(1,1), |
| 136 | 1, |
| 137 | { 0 }, |
| 138 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 139 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 140 | 8*8 |
| 141 | }; |
| 142 | |
| 143 | static GFXDECODE_START( headonb ) |
| 144 | GFXDECODE_ENTRY( "gfx1", 0, headonb_charlayout, 0, 1 ) |
| 145 | GFXDECODE_END |
| 146 | |
| 147 | static MACHINE_CONFIG_START( headonb, headonb_state ) |
| 148 | |
| 149 | /* basic machine hardware */ |
| 150 | MCFG_CPU_ADD("maincpu", I8080A, XTAL_20MHz / 10) // divider guessed |
| 151 | MCFG_CPU_PROGRAM_MAP(headonb_map) |
| 152 | MCFG_CPU_IO_MAP(headonb_io_map) |
| 153 | MCFG_CPU_VBLANK_INT_DRIVER("screen", headonb_state, irq0_line_hold) // where is irqack? |
| 154 | |
| 155 | /* video hardware */ |
| 156 | MCFG_SCREEN_ADD("screen", RASTER) |
| 157 | MCFG_SCREEN_REFRESH_RATE(60) |
| 158 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 159 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 160 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) |
| 161 | |
| 162 | MCFG_SCREEN_UPDATE_DRIVER(headonb_state, screen_update_headonb) |
| 163 | |
| 164 | MCFG_GFXDECODE(headonb) |
| 165 | MCFG_PALETTE_LENGTH(2) |
| 166 | |
| 167 | /* sound hardware */ |
| 168 | // TODO |
| 169 | MACHINE_CONFIG_END |
| 170 | |
| 171 | |
| 172 | /*************************************************************************** |
| 173 | |
| 174 | Game drivers |
| 175 | |
| 176 | ***************************************************************************/ |
| 177 | |
| 178 | ROM_START( headonb ) |
| 179 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 180 | ROM_LOAD( "1.bin", 0x0000, 0x0400, CRC(11586f44) SHA1(95426bbae19e152c103ac589e62e5f7c803a9bd0) ) |
| 181 | ROM_LOAD( "2.bin", 0x0400, 0x0400, CRC(c3449b99) SHA1(68f0af22c9f3ca971ac7fd5909bb7991d3a0474a) ) |
| 182 | ROM_LOAD( "3.bin", 0x0800, 0x0400, CRC(9c80b99e) SHA1(4443151df7b2833a7534451fbebf89650266c01e) ) |
| 183 | ROM_LOAD( "4.bin", 0x0c00, 0x0400, CRC(ed5ecc4e) SHA1(2f30e3090ff303c4198aa94f97d571ccc3b2b42e) ) |
| 184 | ROM_LOAD( "5.bin", 0x2000, 0x0400, CRC(13cdb6da) SHA1(c58c262e7e880ef199d22d538bfb865eb03e0386) ) |
| 185 | ROM_LOAD( "6.bin", 0x2400, 0x0400, CRC(e498d21b) SHA1(6f7beb44ce69f448540f594b231a9d9f673916dc) ) |
| 186 | ROM_LOAD( "7.bin", 0x2800, 0x0400, CRC(ce2ef8d9) SHA1(87cdddf78b05078338de1711ba7ee17f7faa76c5) ) |
| 187 | ROM_LOAD( "8.bin", 0x2c00, 0x0400, CRC(85f216e0) SHA1(629a512b25d17a23be4ca92f43c29e6b969d690f) ) |
| 188 | |
| 189 | ROM_REGION( 0x0800, "gfx1", 0 ) |
| 190 | ROM_LOAD( "10.bin", 0x0000, 0x0400, CRC(198f4671) SHA1(129b4575c4148b4aef16c0dd047f4d62fa6a3b17) ) |
| 191 | ROM_LOAD( "9.bin", 0x0400, 0x0400, CRC(2b4d3afe) SHA1(f5f49c6b1b9b44f8922825cbbc563549c8eab97b) ) |
| 192 | ROM_END |
| 193 | |
| 194 | |
| 195 | GAME( 1979, headonb, 0, headonb, headonb, driver_device, 0, ROT0, "bootleg (EFG Sanremo)", "Head On (bootleg on dedicated hardware)", GAME_NO_SOUND ) |