namcos22: another small optimization (nw)

This commit is contained in:
hap 2018-10-02 18:33:21 +02:00
parent 4d21877432
commit 583f9ae37c
3 changed files with 13 additions and 19 deletions

View File

@ -2115,27 +2115,20 @@ void namcos22_state::point_write(offs_t offs, uint32_t data)
}
}
int32_t namcos22_state::point_read(int32_t addr)
int32_t namcos22_state::pointram_read(offs_t offs) // called from point_read
{
if (addr < 0)
return -1;
// point rom
else if (addr < m_pointrom_size)
return m_pointrom[addr];
// point ram, only used in ram test?
int32_t result = 0;
if (m_is_ss22)
{
if (addr >= 0xf80000 && addr < 0xfa0000)
result = m_pointram[addr - 0xf80000];
if (offs >= 0xf80000 && offs < 0xfa0000)
result = m_pointram[offs - 0xf80000];
else return -1;
}
else
{
if (addr >= 0xf00000 && addr < 0xf20000)
result = m_pointram[addr - 0xf00000];
if (offs >= 0xf00000 && offs < 0xf20000)
result = m_pointram[offs - 0xf00000];
else return -1;
}
@ -2163,12 +2156,12 @@ WRITE16_MEMBER(namcos22_state::point_hiword_w)
READ16_MEMBER(namcos22_state::point_loword_r)
{
return point_read(m_point_address & 0x00ffffff) & 0xffff;
return point_read(m_point_address) & 0xffff;
}
READ16_MEMBER(namcos22_state::point_hiword_ir)
{
return point_read(m_point_address++ & 0x00ffffff) >> 16 & 0xffff;
return point_read(m_point_address++) >> 16 & 0xffff;
}
@ -2219,7 +2212,7 @@ READ16_MEMBER(namcos22_state::pdp_begin_r)
/* read word from point ram */
srcAddr = pdp_polygonram_read(offs++); /* 32 bit PointRAM address */
dstAddr = pdp_polygonram_read(offs++); /* CommRAM address; receives 24 bit PointRAM data */
data = point_read(srcAddr & 0x00ffffff);
data = point_read(srcAddr);
pdp_polygonram_write(dstAddr, data);
break;
@ -2242,7 +2235,7 @@ READ16_MEMBER(namcos22_state::pdp_begin_r)
numWords = pdp_polygonram_read(offs++); /* block size */
while (numWords--)
{
data = point_read(srcAddr++ & 0x00ffffff);
data = point_read(srcAddr++);
pdp_polygonram_write(dstAddr++, data);
}
break;
@ -2265,7 +2258,7 @@ READ16_MEMBER(namcos22_state::pdp_begin_r)
numWords = pdp_polygonram_read(offs++);
while (numWords--)
{
data = point_read(srcAddr++ & 0x00ffffff);
data = point_read(srcAddr++);
point_write(dstAddr++, data);
}
break;

View File

@ -382,6 +382,8 @@ private:
uint32_t pdp_polygonram_read(offs_t offs);
void pdp_polygonram_write(offs_t offs, uint32_t data);
void point_write(offs_t offs, uint32_t data);
int32_t pointram_read(offs_t offs);
inline int32_t point_read(offs_t offs) { offs &= 0x00ffffff; return (offs < m_pointrom_size) ? m_pointrom[offs] : pointram_read(offs); }
void master_enable(bool enable);
void slave_enable(bool enable);
@ -402,7 +404,6 @@ private:
void slavesim_handle_233002(const int32_t *src);
void simulate_slavedsp(bitmap_rgb32 &bitmap);
int32_t point_read(int32_t addr);
void init_tables();
void update_mixer();
void update_palette();

View File

@ -23,7 +23,7 @@
* + cybrcomm/victlapw namco logo screen after attract demo
* + airco22b title logo after attract demo
* + aquajet namco logo/game over after ending
* - window clipping is wrong in acedrvrw, victlapw (see rear-view mirrors)
* - window clipping is wrong in acedrvrw, victlapw (see rear-view mirrors), and alpinr2b character selection screen
* - ridgerac waving flag title screen is missing, just an empty beach scenery instead
* - global offset is wrong in non-super22 servicemode video test, and above that, it flickers in acedrvrw, victlapw
* - dirtdash polys are broken at the start section of the mountain level, maybe bad rom?