summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Happy <Happy-yappH@users.noreply.github.com>2015-10-05 09:02:10 -0600
committer Happy <Happy-yappH@users.noreply.github.com>2015-10-05 09:02:10 -0600
commit92ac15aecbb98377ef64c644051ba420e44f1d8a (patch)
treed8568e7bd6cef846a151a6395bf26ac0e811def0
parent60df6df7f3d515b36fa6659844ebd217283cf25f (diff)
Fix reversion for PI. PI transfers round length up, not down.
Add field for VI interlaced modes. Display of interlaced video still needs work.
-rw-r--r--src/mame/includes/n64.h1
-rw-r--r--src/mame/machine/n64.c10
-rw-r--r--src/mame/video/n64.c9
3 files changed, 13 insertions, 7 deletions
diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h
index 60f9b18283a..46f941beb3c 100644
--- a/src/mame/includes/n64.h
+++ b/src/mame/includes/n64.h
@@ -117,6 +117,7 @@ public:
UINT32 vi_leap;
UINT32 vi_intr;
UINT32 vi_vburst;
+ UINT8 field;
/* nvram-specific for MESS */
device_t *m_nvram_image;
diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c
index 51eaee3e196..bcdba51e104 100644
--- a/src/mame/machine/n64.c
+++ b/src/mame/machine/n64.c
@@ -1057,10 +1057,6 @@ void n64_periphs::vi_recalculate_resolution()
if (height > 480)
height = 480;
- if(vi_control & 0x40) /* Interlace */
- {
- }
-
visarea.max_x = width - 1;
visarea.max_y = height - 1;
m_screen->configure((vi_hsync & 0x00000fff)>>2, (vi_vsync & 0x00000fff), visarea, period);
@@ -1088,7 +1084,7 @@ READ32_MEMBER( n64_periphs::vi_reg_r )
break;
case 0x10/4: // VI_CURRENT_REG
- ret = (m_screen->vpos() & 0x3FE); // << 1);
+ ret = (m_screen->vpos() & 0x3FE) + field; // << 1);
break;
case 0x14/4: // VI_BURST_REG
@@ -1461,7 +1457,7 @@ void n64_periphs::pi_dma_tick()
if(pi_dma_dir == 1)
{
- UINT32 dma_length = pi_wr_len + 1;
+ UINT32 dma_length = pi_wr_len + 1 + 1; //Round Up Nearest 2
//logerror("PI Write, %X, %X, %X\n", pi_cart_addr, pi_dram_addr, pi_wr_len);
if (pi_dram_addr != 0xffffffff)
@@ -1477,7 +1473,7 @@ void n64_periphs::pi_dma_tick()
}
else
{
- UINT32 dma_length = pi_rd_len + 1;
+ UINT32 dma_length = pi_rd_len + 1 + 1; //Round Up Nearest 2
//logerror("PI Read, %X, %X, %X\n", pi_cart_addr, pi_dram_addr, pi_rd_len);
if (pi_dram_addr != 0xffffffff)
diff --git a/src/mame/video/n64.c b/src/mame/video/n64.c
index cf4065c5d36..786f09f2f24 100644
--- a/src/mame/video/n64.c
+++ b/src/mame/video/n64.c
@@ -168,6 +168,15 @@ void n64_state::screen_eof_n64(screen_device &screen, bool state)
void n64_periphs::video_update(bitmap_rgb32 &bitmap)
{
+ if(vi_control & 0x40) /* Interlace */
+ {
+ field ^= 1;
+ }
+ else
+ {
+ field = 1;
+ }
+
switch(vi_control & 0x3)
{
case PIXEL_SIZE_16BIT: