Added preliminary cursor drawing, disabled as default, nw

This commit is contained in:
Angelo Salese 2014-04-02 03:56:19 +00:00
parent 373f4d57e8
commit f0503916e5
3 changed files with 55 additions and 4 deletions

View File

@ -81,6 +81,7 @@ public:
UINT8 m_i2c_clk;
INT16 m_memc_pages[0x2000]; // the logical RAM area is 32 megs, and the smallest page size is 4k
UINT32 m_vidc_regs[256];
UINT8 m_cursor_vram[0x200];
UINT8 m_ioc_regs[0x80/4];
UINT8 m_vidc_bpp_mode;
UINT8 m_vidc_interlace;
@ -120,7 +121,7 @@ private:
UINT32 m_memc_pagesize;
int m_memc_latchrom;
UINT32 m_ioc_timercnt[4], m_ioc_timerout[4];
UINT32 m_vidc_vidstart, m_vidc_vidend, m_vidc_vidinit, m_vidc_vidcur;
UINT32 m_vidc_vidstart, m_vidc_vidend, m_vidc_vidinit, m_vidc_vidcur,m_vidc_cinit;
UINT32 m_vidc_sndstart, m_vidc_sndend, m_vidc_sndcur;
UINT8 m_video_dma_on,m_audio_dma_on;
UINT8 m_vidc_pixel_clk;

View File

@ -116,12 +116,18 @@ void archimedes_state::vidc_video_tick()
address_space &space = m_maincpu->space(AS_PROGRAM);
static UINT8 *vram = m_region_vram->base();
UINT32 size;
UINT32 m_vidc_ccur;
size = m_vidc_vidend-m_vidc_vidstart+0x10;
for(m_vidc_vidcur = 0;m_vidc_vidcur < size;m_vidc_vidcur++)
vram[m_vidc_vidcur] = (space.read_byte(m_vidc_vidstart+m_vidc_vidcur));
size = m_vidc_vidend-m_vidc_vidstart+0x10;
for(m_vidc_ccur = 0;m_vidc_ccur < 0x200;m_vidc_ccur++)
m_cursor_vram[m_vidc_ccur] = (space.read_byte(m_vidc_cinit+m_vidc_ccur));
if(m_video_dma_on)
m_vid_timer->adjust(m_screen->time_until_pos(m_vidc_regs[0xb4]));
else
@ -943,6 +949,11 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_w)
//printf("MEMC: VIDEND %08x\n",m_vidc_vidend);
break;
case 3: /* cursor init */
m_vidc_cinit = 0x2000000 | (((data>>2)&0x7fff)*16);
//printf("MEMC: CURSOR %08x\n",((data>>2)&0x7fff)*16);
break;
case 4: /* sound start */
//logerror("MEMC: SNDSTART %08x\n",data);
archimedes_clear_irq_b(ARCHIMEDES_IRQB_SOUND_EMPTY);

View File

@ -85,9 +85,6 @@ UINT32 archimedes_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm
{
pen = vram[count];
res_x = x+xstart;
res_y = (y+ystart)*(m_vidc_interlace+1);
for(xi=0;xi<2;xi++)
{
res_x = x+xi+xstart;
@ -145,7 +142,49 @@ UINT32 archimedes_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm
popmessage("Unemulated bpp mode %02x, contact MAME/MESSdev",m_vidc_bpp_mode);
break;
}
if(0)
{
count = 0;
for(y=0;y<16;y++)
{
for(x=0;x<32;x+=4)
{
for(xi=0;xi<4;xi++)
{
UINT8 cursor_dot;
pen = m_cursor_vram[count];
res_x = x+xi+xstart;
res_y = (y+ystart)*(m_vidc_interlace+1);
cursor_dot = ((pen>>(xi*2))&0x3);
if(cursor_dot)
{
if(m_vidc_interlace)
{
if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
bitmap.pix32(res_y, res_x) = m_palette->pen(cursor_dot+0x10);
if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y+1) <= yend)
bitmap.pix32(res_y+1, res_x) = m_palette->pen(cursor_dot+0x10);
}
else
{
if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
bitmap.pix32(res_y, res_x) = m_palette->pen(cursor_dot+0x10);
}
}
}
count++;
}
}
}
}
return 0;
}