Previous 199869 Revisions Next

r36638 Wednesday 25th March, 2015 at 18:35:11 UTC by Angelo Salese
Fixed graphical bug during attract mode, therefore ...

new WORKING game
----------------
Table Tennis Championship [David Haywood, Angelo Salese]
[src/mame/drivers]rmhaihai.c ttchamp.c

trunk/src/mame/drivers/rmhaihai.c
r245149r245150
3939public:
4040   rmhaihai_state(const machine_config &mconfig, device_type type, const char *tag)
4141      : driver_device(mconfig, type, tag),
42      m_colorram(*this, "colorram"),
43      m_videoram(*this, "videoram"),
4244      m_maincpu(*this, "maincpu"),
4345      m_msm(*this, "msm"),
44      m_gfxdecode(*this, "gfxdecode"),
45      m_colorram(*this, "colorram"),
46      m_videoram(*this, "videoram") { }
46      m_gfxdecode(*this, "gfxdecode") { }
4747
48   required_device<cpu_device> m_maincpu;
49   required_device<msm5205_device> m_msm;
50   required_device<gfxdecode_device> m_gfxdecode;
51
48   int m_gfxbank;
5249   required_shared_ptr<UINT8> m_colorram;
5350   required_shared_ptr<UINT8> m_videoram;
54
5551   tilemap_t *m_bg_tilemap;
5652   int m_keyboard_cmd;
57   int m_gfxbank;
58
5953   DECLARE_WRITE8_MEMBER(rmhaihai_videoram_w);
6054   DECLARE_WRITE8_MEMBER(rmhaihai_colorram_w);
6155   DECLARE_READ8_MEMBER(keyboard_r);
r245149r245150
6458   DECLARE_WRITE8_MEMBER(ctrl_w);
6559   DECLARE_WRITE8_MEMBER(themj_rombank_w);
6660   DECLARE_WRITE8_MEMBER(adpcm_w);
67
6861   DECLARE_DRIVER_INIT(rmhaihai);
62   TILE_GET_INFO_MEMBER(get_bg_tile_info);
6963   virtual void video_start();
70   DECLARE_MACHINE_START(themj);
7164   DECLARE_MACHINE_RESET(themj);
72
73   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
74   
75   TILE_GET_INFO_MEMBER(get_bg_tile_info);
65   UINT32 screen_update_rmhaihai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
66   required_device<cpu_device> m_maincpu;
67   required_device<msm5205_device> m_msm;
68   required_device<gfxdecode_device> m_gfxdecode;
7669};
7770
7871
r245149r245150
10295{
10396   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(rmhaihai_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
10497      8, 8, 64, 32);
105     
106   save_item(NAME(m_keyboard_cmd));
107   save_item(NAME(m_gfxbank));
10898}
10999
110UINT32 rmhaihai_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
100UINT32 rmhaihai_state::screen_update_rmhaihai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
111101{
112102   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
113103   return 0;
r245149r245150
200190
201191WRITE8_MEMBER(rmhaihai_state::themj_rombank_w)
202192{
203   logerror("banksw %d\n", data & 0x03);
204   membank("bank1")->set_entry(data & 0x03);
205   membank("bank2")->set_entry(data & 0x03);
193   UINT8 *rom = memregion("maincpu")->base() + 0x10000;
194   int bank = data & 0x03;
195logerror("banksw %d\n",bank);
196   membank("bank1")->set_base(rom + bank*0x4000);
197   membank("bank2")->set_base(rom + bank*0x4000 + 0x2000);
206198}
207199
208MACHINE_START_MEMBER(rmhaihai_state,themj)
209{
210   membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
211   membank("bank2")->configure_entries(0, 4, memregion("maincpu")->base() + 0x12000, 0x4000);
212}
213
214200MACHINE_RESET_MEMBER(rmhaihai_state,themj)
215201{
216   membank("bank1")->set_entry(0);
217   membank("bank2")->set_entry(0);
202   themj_rombank_w(m_maincpu->space(AS_IO), 0, 0);
218203}
219204
220205
r245149r245150
480465   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
481466   MCFG_SCREEN_SIZE(64*8, 32*8)
482467   MCFG_SCREEN_VISIBLE_AREA(4*8, 60*8-1, 2*8, 30*8-1)
483   MCFG_SCREEN_UPDATE_DRIVER(rmhaihai_state, screen_update)
468   MCFG_SCREEN_UPDATE_DRIVER(rmhaihai_state, screen_update_rmhaihai)
484469   MCFG_SCREEN_PALETTE("palette")
485470
486471   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rmhaihai)
r245149r245150
518503   MCFG_CPU_PROGRAM_MAP(themj_map)
519504   MCFG_CPU_IO_MAP(themj_io_map)
520505
521   MCFG_MACHINE_START_OVERRIDE(rmhaihai_state,themj)
522506   MCFG_MACHINE_RESET_OVERRIDE(rmhaihai_state,themj)
523507
524508   /* video hardware */
r245149r245150
694678}
695679
696680
697GAME( 1985, rmhaihai, 0,        rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba",  "Real Mahjong Haihai (Japan)", GAME_SUPPORTS_SAVE )
698GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, rmhaihai, ROT0, "Alba",  "Real Mahjong Haihai [BET] (Japan)", GAME_SUPPORTS_SAVE )
699GAME( 1986, rmhaijin, 0,        rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba",  "Real Mahjong Haihai Jinji Idou Hen (Japan)", GAME_SUPPORTS_SAVE )
700GAME( 1986, rmhaisei, 0,        rmhaisei, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", GAME_SUPPORTS_SAVE )
701GAME( 1987, themj,    0,        themj,    rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", GAME_SUPPORTS_SAVE )
681GAME( 1985, rmhaihai, 0,        rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba",  "Real Mahjong Haihai (Japan)", 0 )
682GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, rmhaihai, ROT0, "Alba",  "Real Mahjong Haihai [BET] (Japan)", 0 )
683GAME( 1986, rmhaijin, 0,        rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba",  "Real Mahjong Haihai Jinji Idou Hen (Japan)", 0 )
684GAME( 1986, rmhaisei, 0,        rmhaisei, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", 0 )
685GAME( 1987, themj,    0,        themj,    rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", 0 )
trunk/src/mame/drivers/ttchamp.c
r245149r245150
5353
5454- works in a very similar way to 'Spider' (twins.c)
5555  including the blitter (seems to be doubled up hardware tho, twice as many layers?)
56- need to work out how it selects between upper/lower
57  program roms as blitter source
5856- PIC is not for sound, what is is for?
5957- eeprom? (I don't see one, maybe PIC is used for settings?)
60- more than one layer
61- layer clearing
58- Convert this to a blitter device, and share it with twins.c
59- A bunch of spurious RAM writes to ROM area (genuine bug? left-overs?)
6260
61
6362*/
6463
6564#include "emu.h"
r245149r245150
335334
336335         for (int i = 0; i < m_spriteswidth; i++)
337336         {
338            if ((m_port10 & 0xf) == 0x01) // this is set when moving objects are cleared, although not screen clears?
337            if (m_port10 & 0x30) // this is set when moving objects are cleared, although not screen clears?
339338            {
340               vram[offset] = 0x0000;
339               /* guess: assume that bit 4 is for layer 0 and bit 5 for layer 1
340                  (according to 0x21 setted at the "Clubs League" color fade-out)
341               */
342               if(m_port10 & 0x10)
343                  m_videoram0[offset] = 0x0000;
344               if(m_port10 & 0x20)
345                  m_videoram2[offset] = 0x0000;
346
341347               offset++;
342348            }
343349            else
344350            {
345351               UINT8 data;
346
352                             
347353               data = (src[(m_spritesaddr * 2) + 1]);
348354               //data |= vram[offset] >> 8;
349355
r245149r245150
352358                  vram[offset] = (vram[offset] & 0x00ff) | data << 8;
353359
354360               data = src[(m_spritesaddr * 2)];
355               //data |= vram[offset] & 0xff;
356361
357362               if (data || (m_port10 & 2) == 0)
358363                  vram[offset] = (vram[offset] & 0xff00) | data;
r245149r245150
392397   return 0xff;
393398}
394399
400/* blitter mode select */
395401WRITE16_MEMBER(ttchamp_state::port10_w)
396402{
397   UINT8 res;
403   /*
404    --xx ---- fill enable
405    ---- --x- opacity enable (Gamart logo)
406    ---- ---x layer select
407   */
398408   COMBINE_DATA(&m_port10);
399
400   res = m_port10 & 0xf0;
401   /* Assume that both bits clears layers. */
402   if(res == 0x30)
403   {
404      for (int i = 0; i < 0x8000; i++)
405      {
406         m_videoram0[i] = 0x0000;
407         m_videoram2[i] = 0x0000;
408      }
409   }
410   else if(res != 0)
411      printf("Check me, i/o 0x10 used with %02x\n",res);
412409}
413410
414411/* selects upper bank for the blitter */
415412WRITE16_MEMBER(ttchamp_state::port20_w)
416413{
417   printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask);
414   //printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask);
418415   m_rombank = 1;
419416}
420417
421418/* selects lower bank for the blitter */
422419WRITE16_MEMBER(ttchamp_state::port62_w)
423420{
424   printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask);
421   //printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask);
425422   m_rombank = 0;
426423}
427424
r245149r245150
581578//  membank("bank2")->set_base(&ROM1[0x180000]);
582579}
583580
584GAME( 1995, ttchamp, 0,        ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0,  "Gamart",                               "Table Tennis Champions", GAME_NOT_WORKING ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam'
585GAME( 1995, ttchampa,ttchamp,  ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0,  "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", GAME_NOT_WORKING ) // this only has Palencia Elektronik advertising boards
581GAME( 1995, ttchamp, 0,        ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0,  "Gamart",                               "Table Tennis Champions", 0 ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam'
582GAME( 1995, ttchampa,ttchamp,  ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0,  "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", 0 ) // this only has Palencia Elektronik advertising boards


Previous 199869 Revisions Next


© 1997-2024 The MAME Team