N64 changes

PI transfers round down/truncate last bit
SI transfers signal busy while waiting for delay
Initial work to seperate VI from RDP as the actual hardware has no direct communication between them
Stop ERET instruction spamming the error log
Stop screen update from spamming the error log for using MCFG_SCREEN_VBLANK_TIME.  The value set was also complete nonsense.
This commit is contained in:
Happy 2015-09-23 13:21:25 -06:00
parent 7c3674f16b
commit 899f15f78d
5 changed files with 16 additions and 33 deletions

View File

@ -1517,7 +1517,7 @@ void mips3_device::handle_cop0(UINT32 op)
break;
case 0x10: /* RFE */ invalid_instruction(op); break;
case 0x18: /* ERET */ logerror("ERET\n"); m_core->pc = m_core->cpr[0][COP0_EPC]; SR &= ~SR_EXL; check_irqs(); m_lld_value ^= 0xffffffff; m_ll_value ^= 0xffffffff; break;
case 0x18: /* ERET logerror("ERET\n"); */ m_core->pc = m_core->cpr[0][COP0_EPC]; SR &= ~SR_EXL; check_irqs(); m_lld_value ^= 0xffffffff; m_ll_value ^= 0xffffffff; break;
case 0x20: /* WAIT */ break;
default: invalid_instruction(op); break;
}

View File

@ -1434,10 +1434,6 @@ void n64_periphs::pi_dma_tick()
{
UINT32 dma_length = pi_wr_len + 1;
//logerror("PI Write, %X, %X, %X\n", pi_cart_addr, pi_dram_addr, pi_wr_len);
if (dma_length & 1)
{
dma_length = (dma_length + 1) & ~1;
}
if (pi_dram_addr != 0xffffffff)
{
@ -1454,10 +1450,6 @@ void n64_periphs::pi_dma_tick()
{
UINT32 dma_length = pi_rd_len + 1;
//logerror("PI Read, %X, %X, %X\n", pi_cart_addr, pi_dram_addr, pi_rd_len);
if (dma_length & 1)
{
dma_length = (dma_length + 1) & ~1;
}
if (pi_dram_addr != 0xffffffff)
{
@ -2093,6 +2085,7 @@ TIMER_CALLBACK_MEMBER(n64_periphs::si_dma_callback)
void n64_periphs::si_dma_tick()
{
si_dma_timer->adjust(attotime::never);
si_status = 0;
si_status |= 0x1000;
signal_rcp_interrupt(SI_INTERRUPT);
}
@ -2136,8 +2129,8 @@ void n64_periphs::pif_dma(int direction)
*dst++ = d;
}
}
si_dma_timer->adjust(attotime::from_hz(500));
si_status |= 1;
si_dma_timer->adjust(attotime::from_hz(1000));
//si_status |= 0x1000;
//signal_rcp_interrupt(SI_INTERRUPT);
}
@ -2180,7 +2173,7 @@ WRITE32_MEMBER( n64_periphs::si_reg_w )
break;
case 0x18/4: // SI_STATUS_REG
si_status &= ~0x1000;
si_status = 0;
clear_rcp_interrupt(SI_INTERRUPT);
break;

View File

@ -2114,7 +2114,7 @@ void n64_rdp::draw_triangle(bool shade, bool texture, bool zbuffer, bool rect)
{
render_spans(yh >> 2, yl >> 2, tilenum, flip ? true : false, spans, rect, object);
}
m_aux_buf_ptr = 0; // Spans can be reused once render completes
//wait("draw_triangle");
}
@ -3142,14 +3142,9 @@ void n64_state::video_start()
}
}
void screen_eof_n64(screen_device &screen, bool state)
{
}
UINT32 n64_state::screen_update_n64(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
n64_periphs* n64 = machine().device<n64_periphs>("rcp");
m_rdp->m_visarea = screen.visible_area();
//UINT16* frame_buffer = (UINT16*)&rdram[(n64->vi_origin & 0xffffff) >> 2];
//UINT8* cvg_buffer = &m_rdp.m_hidden_bits[((n64->vi_origin & 0xffffff) >> 2) >> 1];
@ -3189,12 +3184,9 @@ UINT32 n64_state::screen_update_n64(screen_device &screen, bitmap_rgb32 &bitmap,
}
*/
m_rdp->wait();
m_rdp->m_aux_buf_ptr = 0;
if (n64->vi_blank)
{
bitmap.fill(0, m_rdp->m_visarea);
bitmap.fill(0, screen.visible_area());
return 0;
}
@ -3205,14 +3197,14 @@ UINT32 n64_state::screen_update_n64(screen_device &screen, bitmap_rgb32 &bitmap,
void n64_state::screen_eof_n64(screen_device &screen, bool state)
{
m_rdp->wait();
m_rdp->m_aux_buf_ptr = 0;
}
void n64_rdp::render_spans(INT32 start, INT32 end, INT32 tilenum, bool flip, extent_t* spans, bool rect, rdp_poly_state* object)
{
const INT32 clipy1 = m_scissor.m_yh;
const INT32 clipy2 = m_scissor.m_yl;
const rectangle clip(m_scissor.m_xh, m_scissor.m_xl, m_scissor.m_yh, m_scissor.m_yl);
INT32 offset = 0;
if (clipy2 <= 0)
@ -3253,22 +3245,22 @@ void n64_rdp::render_spans(INT32 start, INT32 end, INT32 tilenum, bool flip, ext
switch(m_other_modes.cycle_type)
{
case CYCLE_TYPE_1:
render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_1cycle), this), start, (end - start) + 1, spans + offset);
render_triangle_custom(clip, render_delegate(FUNC(n64_rdp::span_draw_1cycle), this), start, (end - start) + 1, spans + offset);
break;
case CYCLE_TYPE_2:
render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_2cycle), this), start, (end - start) + 1, spans + offset);
render_triangle_custom(clip, render_delegate(FUNC(n64_rdp::span_draw_2cycle), this), start, (end - start) + 1, spans + offset);
break;
case CYCLE_TYPE_COPY:
render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_copy), this), start, (end - start) + 1, spans + offset);
render_triangle_custom(clip, render_delegate(FUNC(n64_rdp::span_draw_copy), this), start, (end - start) + 1, spans + offset);
break;
case CYCLE_TYPE_FILL:
render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_fill), this), start, (end - start) + 1, spans + offset);
render_triangle_custom(clip, render_delegate(FUNC(n64_rdp::span_draw_fill), this), start, (end - start) + 1, spans + offset);
break;
}
//wait();
wait("render spans");
}
void n64_rdp::rgbaz_clip(INT32 sr, INT32 sg, INT32 sb, INT32 sa, INT32* sz, rdp_span_aux* userdata)

View File

@ -308,11 +308,9 @@ public:
UINT16 m_dzpix_normalize[0x10000];
rectangle_t m_scissor;
rectangle_t m_scissor;
span_base_t m_span_base;
rectangle m_visarea;
void draw_triangle(bool shade, bool texture, bool zbuffer, bool rect);
void* m_aux_buf;

View File

@ -412,7 +412,7 @@ static MACHINE_CONFIG_START( n64, n64_mess_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
//MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(640, 525)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479)
MCFG_SCREEN_UPDATE_DRIVER(n64_state, screen_update_n64)