trunk/src/mame/drivers/ace.c
| r31302 | r31303 | |
| 40 | 40 | #include "emu.h" |
| 41 | 41 | #include "cpu/i8085/i8085.h" |
| 42 | 42 | |
| 43 | #include "ace.lh" |
| 44 | |
| 43 | 45 | #define MASTER_CLOCK XTAL_18MHz |
| 44 | 46 | |
| 45 | 47 | |
| r31302 | r31303 | |
| 62 | 64 | required_shared_ptr<UINT8> m_scoreram; |
| 63 | 65 | required_shared_ptr<UINT8> m_ram2; |
| 64 | 66 | required_shared_ptr<UINT8> m_characterram; |
| 67 | required_device<gfxdecode_device> m_gfxdecode; |
| 68 | required_device<palette_device> m_palette; |
| 65 | 69 | |
| 66 | 70 | /* input-related */ |
| 67 | 71 | int m_objpos[8]; |
| 72 | |
| 68 | 73 | DECLARE_WRITE8_MEMBER(ace_objpos_w); |
| 69 | 74 | DECLARE_WRITE8_MEMBER(ace_characterram_w); |
| 70 | 75 | DECLARE_WRITE8_MEMBER(ace_scoreram_w); |
| r31302 | r31303 | |
| 74 | 79 | virtual void video_start(); |
| 75 | 80 | UINT32 screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 76 | 81 | void ace_postload(); |
| 77 | | required_device<gfxdecode_device> m_gfxdecode; |
| 78 | | required_device<palette_device> m_palette; |
| 79 | 82 | }; |
| 80 | 83 | |
| 81 | 84 | |
| r31302 | r31303 | |
| 94 | 97 | |
| 95 | 98 | UINT32 aceal_state::screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 96 | 99 | { |
| 97 | | int offs; |
| 98 | | |
| 99 | | /* first of all, fill the screen with the background color */ |
| 100 | 100 | bitmap.fill(0, cliprect); |
| 101 | 101 | |
| 102 | | m_gfxdecode->gfx(1)->opaque(bitmap,cliprect, |
| 103 | | 0, |
| 104 | | 0, |
| 105 | | 0, 0, |
| 106 | | m_objpos[0], m_objpos[1]); |
| 102 | m_gfxdecode->gfx(1)->opaque(bitmap, cliprect, 0, 0, 0, 0, m_objpos[0], m_objpos[1]); |
| 103 | m_gfxdecode->gfx(2)->opaque(bitmap, cliprect, 0, 0, 0, 0, m_objpos[2], m_objpos[3]); |
| 104 | m_gfxdecode->gfx(3)->opaque(bitmap, cliprect, 0, 0, 0, 0, m_objpos[4], m_objpos[5]); |
| 107 | 105 | |
| 108 | | m_gfxdecode->gfx(2)->opaque(bitmap,cliprect, |
| 109 | | 0, |
| 110 | | 0, |
| 111 | | 0, 0, |
| 112 | | m_objpos[2], m_objpos[3]); |
| 106 | for (int offs = 0; offs < 8; offs++) |
| 107 | m_gfxdecode->gfx(4)->opaque(bitmap, cliprect, offs, 0, 0, 0, 10 * 8 + offs * 16, 256 - 16); |
| 113 | 108 | |
| 114 | | m_gfxdecode->gfx(3)->opaque(bitmap,cliprect, |
| 115 | | 0, |
| 116 | | 0, |
| 117 | | 0, 0, |
| 118 | | m_objpos[4], m_objpos[5]); |
| 119 | | |
| 120 | | for (offs = 0; offs < 8; offs++) |
| 121 | | { |
| 122 | | m_gfxdecode->gfx(4)->opaque(bitmap,/* ?? */ |
| 123 | | cliprect, |
| 124 | | offs, |
| 125 | | 0, |
| 126 | | 0, 0, |
| 127 | | 10 * 8 + offs * 16, 256 - 16); |
| 128 | | } |
| 129 | 109 | return 0; |
| 130 | 110 | } |
| 131 | 111 | |
| r31302 | r31303 | |
| 135 | 115 | if (m_characterram[offset] != data) |
| 136 | 116 | { |
| 137 | 117 | if (data & ~0x07) |
| 138 | | { |
| 139 | 118 | logerror("write to %04x data = %02x\n", 0x8000 + offset, data); |
| 140 | | popmessage("write to %04x data = %02x\n", 0x8000 + offset, data); |
| 141 | | } |
| 119 | |
| 142 | 120 | m_characterram[offset] = data; |
| 143 | 121 | m_gfxdecode->gfx(1)->mark_dirty(0); |
| 144 | 122 | m_gfxdecode->gfx(2)->mark_dirty(0); |
| r31302 | r31303 | |
| 163 | 141 | /* 1x3622 - ROM 512x4 - doesn't seem to be used ????????????*/ |
| 164 | 142 | |
| 165 | 143 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, aceal_state ) |
| 166 | | |
| 167 | 144 | AM_RANGE(0x0000, 0x09ff) AM_ROM |
| 168 | 145 | |
| 169 | 146 | AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(ace_scoreram_w) AM_SHARE("scoreram") /* 2x2101 */ |
| r31302 | r31303 | |
| 206 | 183 | AM_RANGE(0xc024, 0xc024) AM_READ(unk_r) |
| 207 | 184 | AM_RANGE(0xc025, 0xc025) AM_READ(unk_r) |
| 208 | 185 | AM_RANGE(0xc026, 0xc026) AM_READ(unk_r) |
| 209 | | |
| 210 | 186 | ADDRESS_MAP_END |
| 211 | 187 | |
| 212 | 188 | |
| r31302 | r31303 | |
| 310 | 286 | }; |
| 311 | 287 | |
| 312 | 288 | static GFXDECODE_START( ace ) |
| 313 | | GFXDECODE_ENTRY( "gfx1", 0 , charlayout, 0, 2 ) |
| 314 | | GFXDECODE_ENTRY( NULL , 0x8000, charlayout0, 0, 2 ) /* the game dynamically modifies this */ |
| 315 | | GFXDECODE_ENTRY( NULL , 0x8000, charlayout1, 0, 2 ) /* the game dynamically modifies this */ |
| 316 | | GFXDECODE_ENTRY( NULL , 0x8000, charlayout2, 0, 2 ) /* the game dynamically modifies this */ |
| 317 | | GFXDECODE_ENTRY( NULL , 0x8000, scorelayout, 0, 2 ) /* the game dynamically modifies this */ |
| 289 | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 2 ) |
| 290 | GFXDECODE_ENTRY( NULL, 0x8000, charlayout0, 0, 2 ) /* the game dynamically modifies this */ |
| 291 | GFXDECODE_ENTRY( NULL, 0x8000, charlayout1, 0, 2 ) /* the game dynamically modifies this */ |
| 292 | GFXDECODE_ENTRY( NULL, 0x8000, charlayout2, 0, 2 ) /* the game dynamically modifies this */ |
| 293 | GFXDECODE_ENTRY( NULL, 0x8000, scorelayout, 0, 2 ) /* the game dynamically modifies this */ |
| 318 | 294 | GFXDECODE_END |
| 319 | 295 | |
| 320 | 296 | void aceal_state::ace_postload() |
| r31302 | r31303 | |
| 333 | 309 | |
| 334 | 310 | void aceal_state::machine_reset() |
| 335 | 311 | { |
| 336 | | int i; |
| 337 | | |
| 338 | | for (i = 0; i < 8; i++) |
| 312 | for (int i = 0; i < 8; i++) |
| 339 | 313 | m_objpos[i] = 0; |
| 340 | 314 | } |
| 341 | 315 | |
| 342 | 316 | static MACHINE_CONFIG_START( ace, aceal_state ) |
| 343 | 317 | |
| 344 | 318 | /* basic machine hardware */ |
| 345 | | MCFG_CPU_ADD("maincpu", I8080, MASTER_CLOCK/9) /* 2 MHz ? */ |
| 319 | MCFG_CPU_ADD("maincpu", I8080, MASTER_CLOCK/9) /* 2 MHz ? */ |
| 346 | 320 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 347 | 321 | |
| 348 | 322 | /* video hardware */ |
| r31302 | r31303 | |
| 381 | 355 | ROM_END |
| 382 | 356 | |
| 383 | 357 | |
| 384 | | GAME( 1976, ace, 0, ace, ace, driver_device, 0, ROT0, "Allied Leisure", "Ace", GAME_SUPPORTS_SAVE | GAME_NO_SOUND ) |
| 358 | GAMEL(1976, ace, 0, ace, ace, driver_device, 0, ROT0, "Allied Leisure", "Ace", GAME_SUPPORTS_SAVE | GAME_NO_SOUND, layout_ace ) |