Skip to content

Commit 9d21990

Browse files
authored
konami/tp84.cpp: Cleanup: (#13310)
* Enlarged sound CPU ROM region to match size mapped in CPU address space. * Cleaned up graphics decoding layout. * Zero-fill empty ROM areas.
1 parent db93342 commit 9d21990

File tree

1 file changed

+24
-28
lines changed

1 file changed

+24
-28
lines changed

src/mame/konami/tp84.cpp

+24-28
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ void tp84_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
305305

306306
int const code = m_spriteram[offs + 1];
307307
int const color = palette_base | (m_spriteram[offs + 2] & 0x0f);
308-
int const flip_x = ~m_spriteram[offs + 2] & 0x40;
309-
int const flip_y = m_spriteram[offs + 2] & 0x80;
308+
int const flip_x = BIT(~m_spriteram[offs + 2], 6);
309+
int const flip_y = BIT( m_spriteram[offs + 2], 7);
310310

311311
m_gfxdecode->gfx(1)->transmask(bitmap, cliprect, code, color, flip_x, flip_y, x, y,
312312
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, palette_base));
@@ -405,28 +405,26 @@ uint8_t tp84_state::sh_timer_r()
405405

406406
void tp84_state::filter_w(offs_t offset, uint8_t data)
407407
{
408-
int C;
409-
410408
// 76489 #0
411-
C = 0;
412-
if (offset & 0x008) C += 47000; // 47000pF = 0.047uF
413-
if (offset & 0x010) C += 470000; // 470000pF = 0.47uF
409+
int C = 0;
410+
if (BIT(offset, 3)) C += 47000; // 47000pF = 0.047uF
411+
if (BIT(offset, 4)) C += 470000; // 470000pF = 0.47uF
414412
m_filter[0]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, CAP_P(C));
415413

416414
// 76489 #1 (optional)
417415
C = 0;
418-
if (offset & 0x020) C += 47000; // 47000pF = 0.047uF
419-
if (offset & 0x040) C += 470000; // 470000pF = 0.47uF
416+
if (BIT(offset, 5)) C += 47000; // 47000pF = 0.047uF
417+
if (BIT(offset, 6)) C += 470000; // 470000pF = 0.47uF
420418
//m_filter[1]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, CAP_P(C));
421419

422420
// 76489 #2
423421
C = 0;
424-
if (offset & 0x080) C += 470000; // 470000pF = 0.47uF
422+
if (BIT(offset, 7)) C += 470000; // 470000pF = 0.47uF
425423
m_filter[1]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, CAP_P(C));
426424

427425
// 76489 #3
428426
C = 0;
429-
if (offset & 0x100) C += 470000; // 470000pF = 0.47uF
427+
if (BIT(offset, 8)) C += 470000; // 470000pF = 0.47uF
430428
m_filter[2]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 1000, CAP_P(C));
431429
}
432430

@@ -454,7 +452,7 @@ void tp84_state::tp84_cpu1_map(address_map &map)
454452
map(0x4400, 0x47ff).ram().share(m_fg_videoram);
455453
map(0x4800, 0x4bff).ram().share(m_bg_colorram);
456454
map(0x4c00, 0x4fff).ram().share(m_fg_colorram);
457-
map(0x5000, 0x57ff).ram().share("cpu1_2");
455+
map(0x5000, 0x57ff).ram().share("sharedram");
458456
map(0x8000, 0xffff).rom();
459457
}
460458

@@ -464,7 +462,7 @@ void tp84_state::tp84b_cpu1_map(address_map &map)
464462
map(0x0400, 0x07ff).ram().share(m_fg_videoram);
465463
map(0x0800, 0x0bff).ram().share(m_bg_colorram);
466464
map(0x0c00, 0x0fff).ram().share(m_fg_colorram);
467-
map(0x1000, 0x17ff).ram().share("cpu1_2");
465+
map(0x1000, 0x17ff).ram().share("sharedram");
468466
map(0x1800, 0x1800).w("watchdog", FUNC(watchdog_timer_device::reset_w));
469467
map(0x1a00, 0x1a00).portr("SYSTEM").writeonly().share(m_palette_bank);
470468
map(0x1a20, 0x1a20).portr("P1");
@@ -495,7 +493,7 @@ void tp84_state::cpu2_map(address_map &map)
495493
map(0x4000, 0x4000).w(FUNC(tp84_state::sub_irq_mask_w));
496494
map(0x6000, 0x679f).ram();
497495
map(0x67a0, 0x67ff).ram().w(FUNC(tp84_state::spriteram_w)).share(m_spriteram);
498-
map(0x8000, 0x87ff).ram().share("cpu1_2");
496+
map(0x8000, 0x87ff).ram().share("sharedram");
499497
map(0xe000, 0xffff).rom();
500498
}
501499

@@ -571,9 +569,9 @@ static const gfx_layout charlayout =
571569
RGN_FRAC(1,1),
572570
2,
573571
{ 4, 0 },
574-
{ 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3 },
575-
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
576-
16*8
572+
{ STEP4(0,1), STEP4(8*8,1) },
573+
{ STEP8(0,8) },
574+
8*8*2
577575
};
578576

579577
static const gfx_layout spritelayout =
@@ -582,11 +580,9 @@ static const gfx_layout spritelayout =
582580
RGN_FRAC(1,2),
583581
4,
584582
{ RGN_FRAC(1,2)+4, RGN_FRAC(1,2)+0, 4 ,0 },
585-
{ 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3,
586-
16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 },
587-
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
588-
32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
589-
64*8
583+
{ STEP4(0,1), STEP4(8*8*1,1), STEP4(8*8*2,1), STEP4(8*8*3,1) },
584+
{ STEP8(0,8), STEP8(8*8*4,8) },
585+
16*16*2
590586
};
591587

592588
static GFXDECODE_START( gfx_tp84 )
@@ -660,7 +656,7 @@ void tp84_state::tp84b(machine_config &config)
660656
***************************************************************************/
661657

662658
ROM_START( tp84 )
663-
ROM_REGION( 0x10000, "cpu1", 0 )
659+
ROM_REGION( 0x10000, "cpu1", ROMREGION_ERASE00 )
664660
ROM_LOAD( "388_f04.7j", 0x8000, 0x2000, CRC(605f61c7) SHA1(6848ef35ec7f92cccefb0fb2de42c4b0e9ec476f) )
665661
ROM_LOAD( "388_05.8j", 0xa000, 0x2000, CRC(4b4629a4) SHA1(f3bb1ee66c9e47d050370ac9ca74f3020cb9cfa3) )
666662
ROM_LOAD( "388_f06.9j", 0xc000, 0x2000, CRC(dbd5333b) SHA1(65dee1fd4c940a5423d57cb55a7f2ad89c59c5c6) )
@@ -669,7 +665,7 @@ ROM_START( tp84 )
669665
ROM_REGION( 0x10000, "sub", 0 )
670666
ROM_LOAD( "388_f08.10d", 0xe000, 0x2000, CRC(36462ff1) SHA1(118a1b46ee01a583e6cf39af59b073321c76dbff) ) // E08?
671667

672-
ROM_REGION( 0x10000, "audiocpu", 0 )
668+
ROM_REGION( 0x4000, "audiocpu", ROMREGION_ERASE00 )
673669
ROM_LOAD( "388j13.6a", 0x0000, 0x2000, CRC(c44414da) SHA1(981289f5bdf7dc1348f4ca547ac933ef503b6588) )
674670

675671
ROM_REGION( 0x4000, "tiles", 0 )
@@ -691,7 +687,7 @@ ROM_START( tp84 )
691687
ROM_END
692688

693689
ROM_START( tp84a )
694-
ROM_REGION( 0x10000, "cpu1", 0 )
690+
ROM_REGION( 0x10000, "cpu1", ROMREGION_ERASE00 )
695691
ROM_LOAD( "388_f04.7j", 0x8000, 0x2000, CRC(605f61c7) SHA1(6848ef35ec7f92cccefb0fb2de42c4b0e9ec476f) )
696692
ROM_LOAD( "388_f05.8j", 0xa000, 0x2000, CRC(e97d5093) SHA1(c76c119574d19d2ac10e6987150744542803ef5b) )
697693
ROM_LOAD( "388_f06.9j", 0xc000, 0x2000, CRC(dbd5333b) SHA1(65dee1fd4c940a5423d57cb55a7f2ad89c59c5c6) )
@@ -700,7 +696,7 @@ ROM_START( tp84a )
700696
ROM_REGION( 0x10000, "sub", 0 )
701697
ROM_LOAD( "388_f08.10d", 0xe000, 0x2000, CRC(36462ff1) SHA1(118a1b46ee01a583e6cf39af59b073321c76dbff) ) // E08?
702698

703-
ROM_REGION( 0x10000, "audiocpu", 0 )
699+
ROM_REGION( 0x4000, "audiocpu", ROMREGION_ERASE00 )
704700
ROM_LOAD( "388j13.6a", 0x0000, 0x2000, CRC(c44414da) SHA1(981289f5bdf7dc1348f4ca547ac933ef503b6588) )
705701

706702
ROM_REGION( 0x4000, "tiles", 0 )
@@ -722,15 +718,15 @@ ROM_START( tp84a )
722718
ROM_END
723719

724720
ROM_START( tp84b )
725-
ROM_REGION( 0x10000, "cpu1", 0 )
721+
ROM_REGION( 0x10000, "cpu1", ROMREGION_ERASE00 )
726722
// 0x6000 - 0x7fff space for diagnostic ROM
727723
ROM_LOAD( "388j05.8j", 0x8000, 0x4000, CRC(a59e2fda) SHA1(7d776d5d3fcfbe81d42580cfe93614dc4618a440) )
728724
ROM_LOAD( "388j07.10j", 0xc000, 0x4000, CRC(d25d18e6) SHA1(043f515cc66f6af004be81d6a6b5a92b553107ff) )
729725

730726
ROM_REGION( 0x10000, "sub", 0 )
731727
ROM_LOAD( "388j08.10d", 0xe000, 0x2000, CRC(2aea6b42) SHA1(58c3b4852f22a766f440b98904b73c00a31eae01) )
732728

733-
ROM_REGION( 0x10000, "audiocpu", 0 )
729+
ROM_REGION( 0x4000, "audiocpu", ROMREGION_ERASE00 )
734730
ROM_LOAD( "388j13.6a", 0x0000, 0x2000, CRC(c44414da) SHA1(981289f5bdf7dc1348f4ca547ac933ef503b6588) )
735731

736732
ROM_REGION( 0x4000, "tiles", 0 )

0 commit comments

Comments
 (0)