trunk/src/mame/drivers/ttchamp.c
r245115 | r245116 | |
1 | | /* Table Tennis Champions ? |
| 1 | /* Table Tennis Champions |
| 2 | (c) 1995 Gamart |
2 | 3 | |
3 | 4 | ___________________________________________________ |
4 | 5 | | __ _________ __________ __________ | |
r245115 | r245116 | |
45 | 46 | ttennis4/5 graphics |
46 | 47 | *there is a pic16c84 that i cannot dump because my programmer doesn't support it. |
47 | 48 | |
48 | | Dumped by tirino73 >isolani (at) interfree.it< |
| 49 | Dumped by tirino73 |
49 | 50 | |
50 | 51 | |
51 | 52 | |
r245115 | r245116 | |
54 | 55 | including the blitter (seems to be doubled up hardware tho, twice as many layers?) |
55 | 56 | - need to work out how it selects between upper/lower |
56 | 57 | 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?) |
58 | 60 | - more than one layer |
59 | 61 | - layer clearing |
60 | 62 | |
r245115 | r245116 | |
80 | 82 | DECLARE_WRITE16_MEMBER(paldat_w); |
81 | 83 | |
82 | 84 | 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 | |
83 | 92 | UINT16 m_port10; |
84 | 93 | |
85 | 94 | DECLARE_DRIVER_INIT(ttchamp); |
r245115 | r245116 | |
190 | 199 | |
191 | 200 | WRITE16_MEMBER(ttchamp_state::paldat_w) |
192 | 201 | { |
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)); |
194 | 208 | } |
195 | 209 | |
196 | 210 | |
r245115 | r245116 | |
249 | 263 | |
250 | 264 | if (m_spritesinit == 1) |
251 | 265 | { |
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); |
253 | 267 | |
254 | 268 | m_spritesinit = 2; |
255 | 269 | m_spritesaddr = offset; |
256 | 270 | } |
257 | 271 | else if (m_spritesinit == 2) |
258 | 272 | { |
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); |
260 | 274 | m_spriteswidth = offset & 0xff; |
261 | 275 | if (m_spriteswidth == 0) |
262 | 276 | m_spriteswidth = 80; |
r245115 | r245116 | |
274 | 288 | { |
275 | 289 | COMBINE_DATA(&vram[offset&0x7fff]); |
276 | 290 | } |
277 | | else if (offset < 0x40000 / 2) |
| 291 | else if ((offset >= 0x30000 / 2) && (offset < 0x40000 / 2)) |
278 | 292 | { |
279 | | // 0x30000-0x3ffff and 0x40000-0x4ffff seem to be used here? |
| 293 | // 0x30000-0x3ffff used, on Spider it's 0x20000-0x2ffff |
280 | 294 | offset &= 0x7fff; |
281 | 295 | |
282 | 296 | UINT8 *src = m_rom8; |
r245115 | r245116 | |
284 | 298 | if (m_port10 & 2) // NO, wrong for the portraits |
285 | 299 | src += 0x100000; |
286 | 300 | |
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); |
288 | 302 | offset &= 0x7fff; |
289 | 303 | |
290 | 304 | for (int i = 0; i < m_spriteswidth; i++) |
r245115 | r245116 | |
311 | 325 | } |
312 | 326 | else |
313 | 327 | { |
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); |
315 | 330 | } |
316 | 331 | } |
317 | 332 | } |
318 | 333 | |
| 334 | |
| 335 | |
| 336 | static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state ) |
| 337 | AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w) |
| 338 | ADDRESS_MAP_END |
| 339 | |
| 340 | READ16_MEMBER(ttchamp_state::port1e_r) |
| 341 | { |
| 342 | return 0xff; |
| 343 | } |
| 344 | |
319 | 345 | READ16_MEMBER(ttchamp_state::ttchamp_blit_start_r) |
320 | 346 | { |
321 | 347 | m_spritesinit = 1; |
322 | 348 | return 0xff; |
323 | 349 | } |
324 | 350 | |
325 | | static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state ) |
326 | | AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w) |
327 | | ADDRESS_MAP_END |
328 | | |
329 | 351 | WRITE16_MEMBER(ttchamp_state::port10_w) |
330 | 352 | { |
331 | 353 | COMBINE_DATA(&m_port10); |
332 | 354 | } |
333 | 355 | |
| 356 | WRITE16_MEMBER(ttchamp_state::port20_w) |
| 357 | { |
| 358 | printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); |
| 359 | } |
334 | 360 | |
| 361 | WRITE16_MEMBER(ttchamp_state::port62_w) |
| 362 | { |
| 363 | printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); |
| 364 | } |
| 365 | |
335 | 366 | static 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 |
337 | 368 | |
338 | 369 | AM_RANGE(0x0002, 0x0003) AM_READ_PORT("SYSTEM") |
339 | 370 | AM_RANGE(0x0004, 0x0005) AM_READ_PORT("P1_P2") |
340 | 371 | |
341 | 372 | AM_RANGE(0x0006, 0x0007) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
342 | 373 | |
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) |
345 | 376 | |
346 | 377 | 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? |
348 | 379 | |
349 | 380 | AM_RANGE(0x0010, 0x0011) AM_WRITE(port10_w) |
350 | 381 | |
351 | | // AM_RANGE(0x0020, 0x0021) AM_WRITENOP |
| 382 | AM_RANGE(0x0020, 0x0021) AM_WRITE(port20_w) |
352 | 383 | |
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 | |
354 | 388 | ADDRESS_MAP_END |
355 | 389 | |
356 | 390 | |
r245115 | r245116 | |
441 | 475 | MCFG_SCREEN_UPDATE_DRIVER(ttchamp_state, screen_update_ttchamp) |
442 | 476 | MCFG_SCREEN_PALETTE("palette") |
443 | 477 | |
444 | | MCFG_PALETTE_ADD("palette", 0x8000) |
| 478 | MCFG_PALETTE_ADD("palette", 0x400) |
445 | 479 | |
446 | 480 | MCFG_SPEAKER_STANDARD_MONO("mono") |
447 | 481 | |