mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Port from MESS, nw
This commit is contained in:
parent
547038933a
commit
74eb7e86e1
@ -57,6 +57,7 @@ public:
|
||||
UINT8 *gfx_decode;
|
||||
UINT16 lopr;
|
||||
UINT16 copr;
|
||||
UINT16 ewdr;
|
||||
|
||||
int local_x;
|
||||
int local_y;
|
||||
|
@ -321,7 +321,9 @@ static void cd_free_block(blockT *blktofree)
|
||||
CDROM_LOG(("cd_free_block: %x\n", (UINT32)(FPTR)blktofree))
|
||||
|
||||
if(blktofree == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < 200; i++)
|
||||
{
|
||||
@ -685,14 +687,18 @@ static void cd_writeWord(running_machine &machine, UINT32 addr, UINT16 data)
|
||||
// CR1 & 4 = don't confirm mode 2 subheader
|
||||
// CR1 & 8 = retry reading mode 2 sectors
|
||||
// CR1 & 10 = force single-speed
|
||||
// CR1 & 80 = no change flag (done by Assault Suit Leynos 2)
|
||||
CDROM_LOG(("%s:CD: Initialize CD system\n", machine.describe_context()))
|
||||
hirqreg &= 0xffe5;
|
||||
if((cr1 & 0x80) == 0x00)
|
||||
{
|
||||
cd_stat = CD_STAT_PAUSE;
|
||||
cd_curfad = 150;
|
||||
fadstoplay = 0;
|
||||
in_buffer = 0;
|
||||
buffull = 0;
|
||||
hirqreg &= 0xffe5;
|
||||
}
|
||||
hirqreg |= (CMOK|ESEL);
|
||||
cd_stat = CD_STAT_PAUSE;
|
||||
cd_curfad = 150;
|
||||
fadstoplay = 0;
|
||||
in_buffer = 0;
|
||||
buffull = 0;
|
||||
cr_standard_return(cd_stat);
|
||||
break;
|
||||
|
||||
@ -1049,12 +1055,14 @@ static void cd_writeWord(running_machine &machine, UINT32 addr, UINT16 data)
|
||||
break;
|
||||
|
||||
case 0x4800: // Reset Selector
|
||||
{
|
||||
int i,j;
|
||||
|
||||
CDROM_LOG(("%s:CD: Reset Selector\n", machine.describe_context()))
|
||||
|
||||
if((cr1 & 0xff) == 0x00)
|
||||
{
|
||||
UINT8 bufnum = cr3>>8;
|
||||
int i;
|
||||
|
||||
if(bufnum < MAX_FILTERS)
|
||||
{
|
||||
@ -1078,9 +1086,59 @@ static void cd_writeWord(running_machine &machine, UINT32 addr, UINT16 data)
|
||||
return;
|
||||
}
|
||||
|
||||
// ...
|
||||
/* reset false filter output conditions */
|
||||
if(cr1 & 0x80)
|
||||
{
|
||||
for(i=0;i<MAX_FILTERS;i++)
|
||||
filters[i].condfalse = 0xff;
|
||||
}
|
||||
|
||||
/* reset true filter output conditions */
|
||||
if(cr1 & 0x40)
|
||||
{
|
||||
for(i=0;i<MAX_FILTERS;i++)
|
||||
filters[i].condtrue = i;
|
||||
}
|
||||
|
||||
/* reset filter conditions*/
|
||||
if(cr1 & 0x10)
|
||||
{
|
||||
for(i=0;i<MAX_FILTERS;i++)
|
||||
{
|
||||
filters[i].fad = 0;
|
||||
filters[i].range = 0xffffffff;
|
||||
filters[i].mode = 0;
|
||||
filters[i].chan = 0;
|
||||
filters[i].smmask = 0;
|
||||
filters[i].cimask = 0;
|
||||
filters[i].fid = 0;
|
||||
filters[i].smval = 0;
|
||||
filters[i].cival = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* reset partition buffer data */
|
||||
if(cr1 & 0x4)
|
||||
{
|
||||
for(i=0;i<MAX_FILTERS;i++)
|
||||
{
|
||||
for (j = 0; j < MAX_BLOCKS; j++)
|
||||
{
|
||||
cd_free_block(partitions[i].blocks[j]);
|
||||
partitions[i].blocks[j] = (blockT *)NULL;
|
||||
partitions[i].bnum[j] = 0xff;
|
||||
}
|
||||
|
||||
partitions[i].size = -1;
|
||||
partitions[i].numblks = 0;
|
||||
}
|
||||
|
||||
buffull = sectorstore = 0;
|
||||
}
|
||||
|
||||
hirqreg |= (CMOK|ESEL);
|
||||
cr_standard_return(cd_stat);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x5000: // get Buffer Size
|
||||
|
@ -204,7 +204,7 @@ static void stv_clear_framebuffer( running_machine &machine, int which_framebuff
|
||||
saturn_state *state = machine.driver_data<saturn_state>();
|
||||
|
||||
if ( VDP1_LOG ) logerror( "Clearing %d framebuffer\n", state->m_vdp1.framebuffer_current_draw );
|
||||
memset( state->m_vdp1.framebuffer[ which_framebuffer ], 0, 1024 * 256 * sizeof(UINT16) * 2 );
|
||||
memset( state->m_vdp1.framebuffer[ which_framebuffer ], state->m_vdp1.ewdr, 1024 * 256 * sizeof(UINT16) * 2 );
|
||||
}
|
||||
|
||||
|
||||
@ -226,7 +226,6 @@ static void stv_prepare_framebuffers( running_machine &machine )
|
||||
state->m_vdp1.framebuffer_draw_lines[i] = &state->m_vdp1.framebuffer[0][0];
|
||||
state->m_vdp1.framebuffer_display_lines[i] = &state->m_vdp1.framebuffer[1][0];
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -313,9 +312,7 @@ WRITE16_HANDLER( saturn_vdp1_regs_w )
|
||||
case 0x06/2:
|
||||
if ( VDP1_LOG ) logerror( "VDP1: Erase data set %08X\n", data );
|
||||
|
||||
if(data && data != 0x8000)
|
||||
popmessage("EWDR set %08x, contact MAMEdev",STV_VDP1_EWDR);
|
||||
|
||||
state->m_vdp1.ewdr = STV_VDP1_EWDR;
|
||||
break;
|
||||
case 0x08/2:
|
||||
if ( VDP1_LOG ) logerror( "VDP1: Erase upper-left coord set: %08X\n", data );
|
||||
|
@ -3028,7 +3028,7 @@ static void stv_vdp2_draw_basic_bitmap(running_machine &machine, bitmap_t *bitma
|
||||
gfxdatalow = gfxdata + stv2_current_tilemap.bitmap_map * 0x20000;
|
||||
gfxdata+=(
|
||||
(stv2_current_tilemap.scrollx & (xlinesize-1)) +
|
||||
((stv2_current_tilemap.scrolly) * (xlinesize)) + /* TODO: mask ysize, check me! */
|
||||
((stv2_current_tilemap.scrolly & (ysize-1)) * (xlinesize)) + /* TODO: mask ysize, check me! */
|
||||
(stv2_current_tilemap.bitmap_map * 0x20000)
|
||||
);
|
||||
gfxdatahigh = gfxdatalow + xlinesize*ysize;
|
||||
@ -4172,7 +4172,7 @@ static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, c
|
||||
return;
|
||||
}
|
||||
|
||||
// window_applied =
|
||||
// window_applied =
|
||||
stv_vdp2_apply_window_on_layer(machine,&mycliprect);
|
||||
|
||||
if (stv2_current_tilemap.bitmap_enable) // this layer is a bitmap
|
||||
|
Loading…
Reference in New Issue
Block a user