Previous 199869 Revisions Next

r36604 Tuesday 24th March, 2015 at 15:41:00 UTC by David Haywood
notes (nw)
[src/mame/drivers]ttchamp.c

trunk/src/mame/drivers/ttchamp.c
r245115r245116
1/* Table Tennis Champions ?
1/* Table Tennis Champions
2   (c) 1995 Gamart
23
34 ___________________________________________________
45|        __     _________ __________   __________  |
r245115r245116
4546ttennis4/5 graphics
4647*there is a pic16c84 that i cannot dump because my programmer doesn't support it.
4748
48Dumped by tirino73 >isolani (at) interfree.it<
49Dumped by tirino73
4950
5051
5152
r245115r245116
5455  including the blitter (seems to be doubled up hardware tho, twice as many layers?)
5556- need to work out how it selects between upper/lower
5657  program roms as blitter source
57- PIC is probably for sound
58- PIC is not for sound, what is is for?
59- eeprom? (I don't see one, maybe PIC is used for settings?)
5860- more than one layer
5961- layer clearing
6062
r245115r245116
8082   DECLARE_WRITE16_MEMBER(paldat_w);
8183
8284   DECLARE_WRITE16_MEMBER(port10_w);
85
86   DECLARE_WRITE16_MEMBER(port20_w);
87   DECLARE_WRITE16_MEMBER(port62_w);
88   
89   DECLARE_READ16_MEMBER(port1e_r);
90
91
8392   UINT16 m_port10;
8493
8594   DECLARE_DRIVER_INIT(ttchamp);
r245115r245116
190199
191200WRITE16_MEMBER(ttchamp_state::paldat_w)
192201{
193   m_palette->set_pen_color(m_paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10));
202   // maybe 4 layers of 0x100 each?
203   // middle palettes seem to have special meaning tho, maybe blending? it's a darker copy ingame, and red/blue shades on char select
204   // based on screenshot references the highlighted player portraits should be appear in shades of red/blue
205
206   // 0x8000 of offset is sometimes set
207   m_palette->set_pen_color(m_paloff & 0x3ff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10));
194208}
195209
196210
r245115r245116
249263
250264   if (m_spritesinit == 1)
251265   {
252   //   printf("spider_blitter_w %08x %04x %04x (init?) (base?)\n", offset * 2, data, mem_mask);
266   //   printf("%06x: spider_blitter_w %08x %04x %04x (init?) (base?)\n", space.device().safe_pc(), offset * 2, data, mem_mask);
253267
254268      m_spritesinit = 2;
255269      m_spritesaddr = offset;
256270   }
257271   else if (m_spritesinit == 2)
258272   {
259   //   printf("spider_blitter_w %08x %04x %04x (init2) (width?)\n", offset * 2, data, mem_mask);
273   //   printf("%06x: spider_blitter_w %08x %04x %04x (init2) (width?)\n", space.device().safe_pc(), offset * 2, data, mem_mask);
260274      m_spriteswidth = offset & 0xff;
261275      if (m_spriteswidth == 0)
262276         m_spriteswidth = 80;
r245115r245116
274288      {
275289         COMBINE_DATA(&vram[offset&0x7fff]);
276290      }
277      else if (offset < 0x40000 / 2)
291      else if ((offset >= 0x30000 / 2) && (offset < 0x40000 / 2))
278292      {
279         // 0x30000-0x3ffff and 0x40000-0x4ffff seem to be used here?
293         // 0x30000-0x3ffff used, on Spider it's 0x20000-0x2ffff
280294         offset &= 0x7fff;
281295
282296         UINT8 *src = m_rom8;
r245115r245116
284298         if (m_port10 & 2) // NO, wrong for the portraits
285299            src += 0x100000;
286300
287      //   printf("spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr);
301      //   printf("%06x: spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", space.device().safe_pc(), offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr);
288302         offset &= 0x7fff;
289303
290304         for (int i = 0; i < m_spriteswidth; i++)
r245115r245116
311325      }
312326      else
313327      {
314         logerror("spider_blitter_w unhandled RAM access %08x %04x %04x\n", offset * 2, data, mem_mask);
328         // sometimes happens, why? special meanings? wrong interpretation of something else?
329         printf("%06x: spider_blitter_w unhandled RAM access %08x %04x %04x\n", space.device().safe_pc(), offset * 2, data, mem_mask);
315330      }
316331   }
317332}
318333
334
335
336static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state )
337   AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w)
338ADDRESS_MAP_END
339
340READ16_MEMBER(ttchamp_state::port1e_r)
341{
342   return 0xff;
343}
344
319345READ16_MEMBER(ttchamp_state::ttchamp_blit_start_r)
320346{
321347   m_spritesinit = 1;
322348   return 0xff;
323349}
324350
325static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state )
326   AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w)
327ADDRESS_MAP_END
328
329351WRITE16_MEMBER(ttchamp_state::port10_w)
330352{
331353   COMBINE_DATA(&m_port10);
332354}
333355
356WRITE16_MEMBER(ttchamp_state::port20_w)
357{
358   printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask);
359}
334360
361WRITE16_MEMBER(ttchamp_state::port62_w)
362{
363   printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask);
364}
365
335366static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16, ttchamp_state )
336//   AM_RANGE(0x0000, 0x0001) AM_WRITENOP
367   AM_RANGE(0x0000, 0x0001) AM_WRITENOP // startup only
337368
338369   AM_RANGE(0x0002, 0x0003) AM_READ_PORT("SYSTEM")
339370   AM_RANGE(0x0004, 0x0005) AM_READ_PORT("P1_P2")
340371
341372   AM_RANGE(0x0006, 0x0007) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
342373
343   AM_RANGE(0x0018, 0x0019) AM_READ(ttchamp_blit_start_r)
344   AM_RANGE(0x001e, 0x001f) AM_READNOP // read before each line is blit
374   AM_RANGE(0x0018, 0x0019) AM_READ(ttchamp_blit_start_r) // read before using bus write offset as blit parameters
375   AM_RANGE(0x001e, 0x001f) AM_READ(port1e_r) // read before some blit operations (but not all)
345376
346377   AM_RANGE(0x0008, 0x0009) AM_WRITE(paldat_w)
347   AM_RANGE(0x000a, 0x000b) AM_WRITE(paloff_w)
378   AM_RANGE(0x000a, 0x000b) AM_WRITE(paloff_w) // bit 0x8000 sometimes gets set, why?
348379
349380   AM_RANGE(0x0010, 0x0011) AM_WRITE(port10_w)
350381
351//   AM_RANGE(0x0020, 0x0021) AM_WRITENOP
382   AM_RANGE(0x0020, 0x0021) AM_WRITE(port20_w)
352383
353//   AM_RANGE(0x0034, 0x0035) AM_READ(peno_rand) AM_WRITENOP
384//   AM_RANGE(0x0034, 0x0035) AM_READ(peno_rand) AM_WRITENOP // eeprom (PIC?) / settings?
385
386   AM_RANGE(0x0062, 0x0063) AM_WRITE(port62_w)
387
354388ADDRESS_MAP_END
355389
356390
r245115r245116
441475   MCFG_SCREEN_UPDATE_DRIVER(ttchamp_state, screen_update_ttchamp)
442476   MCFG_SCREEN_PALETTE("palette")
443477
444   MCFG_PALETTE_ADD("palette", 0x8000)
478   MCFG_PALETTE_ADD("palette", 0x400)
445479
446480   MCFG_SPEAKER_STANDARD_MONO("mono")
447481


Previous 199869 Revisions Next


© 1997-2024 The MAME Team