Added palette fading effect on macrossp.c driver;

Added a speed-up hack for quizmoon (disabled by default);
This commit is contained in:
Angelo Salese 2008-10-27 17:49:09 +00:00
parent eb91a91308
commit 59eaabfd5f

View File

@ -15,8 +15,7 @@ TODO:
- Priorities (Sprites & Backgrounds) - see quizmoon attract mode
- sprite/tilemap priorities might not be 100% correct
- Sound
- palette fade on macrossp Banpresto logo screen (and black on some screen
transitions). quizmoon doesn't use that register.
- optimize palette fading in macrossp.quizmoon doesn't use that register.
- All Other Unused Reads / Writes
- Correct unknown ports if/as needed
- Clean Up
@ -369,6 +368,38 @@ static READ16_HANDLER( macrossp_soundcmd_r )
return soundlatch_word_r(machine,offset,mem_mask);
}
static INT32 fade_effect,old_fade;
static void update_colors(running_machine *machine)
{
static int i,r,g,b;
for(i=0;i<0x1000;i++)
{
b = ((paletteram32[i] & 0x0000ff00) >> 8);
if(fade_effect > b) { b = 0; }
else { b-=fade_effect; }
g = ((paletteram32[i] & 0x00ff0000) >>16);
if(fade_effect > g) { g = 0; }
else { g-=fade_effect; }
r = ((paletteram32[i] & 0xff000000) >>24);
if(fade_effect > r) { r = 0; }
else { r-=fade_effect; }
palette_set_color(machine,i,MAKE_RGB(r,g,b));
}
}
static WRITE32_HANDLER( macrossp_palette_fade_w )
{
fade_effect = ((data & 0xff00) >> 8) - 0x28;//it writes two times,first with a -0x28 then with the proper data
// popmessage("%02x",fade_effect);
if(old_fade != fade_effect)
{
old_fade = fade_effect;
update_colors(machine);
}
}
/*** MEMORY MAPS *************************************************************/
@ -416,11 +447,11 @@ static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0xa00000, 0xa03fff) AM_WRITE(paletteram32_macrossp_w) AM_BASE(&paletteram32)
AM_RANGE(0xb00004, 0xb00007) AM_WRITE(SMH_NOP) // ????
AM_RANGE(0xb00008, 0xb0000b) AM_WRITE(SMH_NOP) // ????
// AM_RANGE(0xb0000c, 0xb0000f) AM_WRITE(SMH_NOP)
AM_RANGE(0xb00010, 0xb00013) AM_WRITE(SMH_RAM) // macrossp palette fade
// AM_RANGE(0xb00020, 0xb00023) AM_WRITE(SMH_NOP)
AM_RANGE(0xb00004, 0xb00007) AM_WRITE(SMH_NOP) // irq related?
AM_RANGE(0xb00008, 0xb0000b) AM_WRITE(SMH_NOP) // irq related?
AM_RANGE(0xb0000c, 0xb0000f) AM_WRITE(SMH_NOP)
AM_RANGE(0xb00010, 0xb00013) AM_WRITE(macrossp_palette_fade_w) // macrossp palette fade
AM_RANGE(0xb00020, 0xb00023) AM_WRITE(SMH_NOP)
AM_RANGE(0xc00000, 0xc00003) AM_WRITE(macrossp_soundcmd_w)
@ -750,6 +781,14 @@ PC :00018110 018110: beq 18104
if (activecpu_get_pc()==0x001810A) cpu_spinuntil_int();
}
#ifdef UNUSED_FUNCTION
static WRITE32_HANDLER( quizmoon_speedup_w )
{
COMBINE_DATA(&macrossp_mainram[0x00020/4]);
if (activecpu_get_pc()==0x1cc) cpu_spinuntil_int();
}
#endif
static DRIVER_INIT( macrossp )
{
memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf10158, 0xf1015b, 0, 0, macrossp_speedup_w );
@ -757,6 +796,9 @@ static DRIVER_INIT( macrossp )
static DRIVER_INIT( quizmoon )
{
#ifdef UNUSED_FUNCTION
memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00020, 0xf00023, 0, 0, quizmoon_speedup_w );
#endif
}
GAME( 1996, macrossp, 0, macrossp, macrossp, macrossp, ROT270, "Banpresto", "Macross Plus", GAME_IMPERFECT_GRAPHICS )