mystwarr: small cleanup

This commit is contained in:
hap 2025-03-01 19:12:42 +01:00
parent c6cbbc92d7
commit be62159ab8
3 changed files with 77 additions and 84 deletions

View File

@ -143,6 +143,7 @@ we have no way of knowing which is the later/corrected version.
#include "machine/eepromser.h"
#include "sound/k054539.h"
#include "sound/okim6295.h"
#include "speaker.h"
@ -167,7 +168,6 @@ void mystwarr_state::mweeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask)
}
//logerror("unknown LSB write %x to eeprom\n", data);
}
uint16_t mystwarr_state::dddeeprom_r(offs_t offset, uint16_t mem_mask)
@ -259,7 +259,6 @@ void mystwarr_state::irq_ack_w(offs_t offset, uint16_t data, uint16_t mem_mask)
m_mw_irq_control = data & 0xff;
//if ((data &0xf0) != 0xd0) logerror("Unknown write to IRQ reg: %x\n", data);
}
}
@ -440,7 +439,6 @@ void mystwarr_state::k053247_martchmp_word_w(offs_t offset, uint16_t data, uint1
else
{
offset = (offset & 0x0007) | ((offset & 0x1fe0) >> 2);
m_k055673->k053247_word_w(offset,data,mem_mask);
}
}
@ -886,25 +884,21 @@ MACHINE_START_MEMBER(mystwarr_state,mystwarr)
MACHINE_RESET_MEMBER(mystwarr_state,mystwarr)
{
int i;
// soften chorus(chip 0 channel 0-3), boost voice(chip 0 channel 4-7)
for (i=0; i<=3; i++)
for (int i = 0; i <= 3; i++)
{
m_k054539_1->set_gain(i, 0.8);
m_k054539_1->set_gain(i+4, 2.0);
}
// soften percussions(chip 1 channel 0-7)
for (i=0; i<=7; i++) m_k054539_2->set_gain(i, 0.5);
for (int i = 0; i <= 7; i++) m_k054539_2->set_gain(i, 0.5);
}
MACHINE_RESET_MEMBER(mystwarr_state,dadandrn)
{
int i;
// boost voice(chip 0 channel 4-7)
for (i=4; i<=7; i++) m_k054539_1->set_gain(i, 2.0);
for (int i = 4; i <= 7; i++) m_k054539_1->set_gain(i, 2.0);
}
MACHINE_START_MEMBER(mystwarr_state,viostormbl)
@ -927,10 +921,8 @@ MACHINE_RESET_MEMBER(mystwarr_state,viostorm)
MACHINE_RESET_MEMBER(mystwarr_state,metamrph)
{
int i;
// boost voice(chip 0 channel 4-7) and soften other channels
for (i=0; i<=3; i++)
for (int i = 0; i <= 3; i++)
{
m_k054539_1->set_gain(i, 0.8);
m_k054539_1->set_gain(i+4, 1.8);
@ -941,18 +933,14 @@ MACHINE_RESET_MEMBER(mystwarr_state,metamrph)
MACHINE_RESET_MEMBER(mystwarr_state,martchmp)
{
int i;
// boost voice(chip 0 channel 4-7)
for (i=4; i<=7; i++) m_k054539_1->set_gain(i, 1.4);
for (int i = 4; i <= 7; i++) m_k054539_1->set_gain(i, 1.4);
}
MACHINE_RESET_MEMBER(mystwarr_state,gaiapols)
{
int i;
// boost voice(chip 0 channel 5-7)
for (i=5; i<=7; i++) m_k054539_1->set_gain(i, 2.0);
for (int i = 5; i <= 7; i++) m_k054539_1->set_gain(i, 2.0);
}

View File

@ -59,7 +59,15 @@ void mystwarr_state::decode_tiles()
// Mystic Warriors requires tile based blending.
K056832_CB_MEMBER(mystwarr_state::mystwarr_tile_callback)
{
if (layer == 1) {if ((*code & 0xff00) + (*color) == 0x4101) m_cbparam++; else m_cbparam--;} //* water hack (TEMPORARY)
if (layer == 1)
{
//* water hack (TEMPORARY)
if ((*code & 0xff00) + (*color) == 0x4101)
m_cbparam++;
else
m_cbparam--;
}
*color = m_layer_colorbase[layer] | (*color >> 1 & 0x1e);
}
@ -77,10 +85,10 @@ K056832_CB_MEMBER(mystwarr_state::game4bpp_tile_callback)
K055673_CB_MEMBER(mystwarr_state::mystwarr_sprite_callback)
{
*priority_mask = *color & 0x00e0;
*priority_mask = *color & 0xe0;
const int effect_attributes = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending
*color = m_sprite_colorbase | (*color & 0x001f) | effect_attributes;
const int effect = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending
*color = m_sprite_colorbase | (*color & 0x1f) | effect;
}
K055673_CB_MEMBER(mystwarr_state::metamrph_sprite_callback)
@ -88,16 +96,14 @@ K055673_CB_MEMBER(mystwarr_state::metamrph_sprite_callback)
*priority_mask = (*color & 0xe0) >> 2;
const int shadow = (*color >> 10) & 0b11;
const int effect_attributes = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending
*color = (*color & 0x1f) | m_sprite_colorbase | effect_attributes | ((shadow == 0b11) ? K055555_SKIPSHADOW : 0);
const int effect = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending
*color = m_sprite_colorbase | (*color & 0x1f) | effect | ((shadow == 0b11) ? K055555_SKIPSHADOW : 0);
}
K055673_CB_MEMBER(mystwarr_state::gaiapols_sprite_callback)
{
int c = *color;
*color = m_sprite_colorbase | (c>>4 & 0x20) | (c & 0x001f);
*priority_mask = c & 0x00e0;
*priority_mask = *color & 0xe0;
*color = m_sprite_colorbase | (*color >> 4 & 0x20) | (*color & 0x1f);
}
K055673_CB_MEMBER(mystwarr_state::martchmp_sprite_callback)
@ -160,13 +166,11 @@ VIDEO_START_MEMBER(mystwarr_state, gaiapols)
TILE_GET_INFO_MEMBER(mystwarr_state::get_ult_936_tile_info)
{
int tileno, colour;
uint8_t *ROM = memregion("gfx4")->base();
uint8_t *dat1 = ROM, *dat2 = ROM + 0x40000;
tileno = dat2[tile_index] | ((dat1[tile_index]&0x1f)<<8);
colour = m_sub1_colorbase;
int tileno = dat2[tile_index] | ((dat1[tile_index] & 0x1f) << 8);
int colour = m_sub1_colorbase;
tileinfo.set(0, tileno, colour, (dat1[tile_index] & 0x40) ? TILE_FLIPX : 0);
}
@ -258,13 +262,17 @@ VIDEO_START_MEMBER(mystwarr_state, martchmp)
uint32_t mystwarr_state::screen_update_mystwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int i, old, blendmode=0;
int blendmode = 0;
if (m_cbparam<0) m_cbparam=0; else if (m_cbparam>=32) blendmode=(1<<16|GXMIX_BLEND_FORCE)<<2; //* water hack (TEMPORARY)
//* water hack (TEMPORARY)
if (m_cbparam < 0)
m_cbparam = 0;
else if (m_cbparam >= 32)
blendmode = (1 << 16 | GXMIX_BLEND_FORCE) << 2;
for (i = 0; i < 4; i++)
for (int i = 0; i < 4; i++)
{
old = m_layer_colorbase[i];
int old = m_layer_colorbase[i];
m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i) << 4;
if (old != m_layer_colorbase[i]) m_k056832->mark_plane_dirty(i);
}
@ -277,11 +285,9 @@ uint32_t mystwarr_state::screen_update_mystwarr(screen_device &screen, bitmap_rg
uint32_t mystwarr_state::screen_update_metamrph(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int i, old;
for (i = 0; i < 4; i++)
for (int i = 0; i < 4; i++)
{
old = m_layer_colorbase[i];
int old = m_layer_colorbase[i];
m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i) << 4;
if (old != m_layer_colorbase[i]) m_k056832->mark_plane_dirty(i);
}
@ -294,11 +300,9 @@ uint32_t mystwarr_state::screen_update_metamrph(screen_device &screen, bitmap_rg
uint32_t mystwarr_state::screen_update_martchmp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int i, old, blendmode;
for (i = 0; i < 4; i++)
for (int i = 0; i < 4; i++)
{
old = m_layer_colorbase[i];
int old = m_layer_colorbase[i];
m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i) << 4;
if (old != m_layer_colorbase[i]) m_k056832->mark_plane_dirty(i);
}
@ -309,7 +313,7 @@ uint32_t mystwarr_state::screen_update_martchmp(screen_device &screen, bitmap_rg
m_oinprion = m_k055555->K055555_read_register(K55_OINPRI_ON);
// not quite right
blendmode = (m_oinprion==0xef && m_k054338->register_r(K338_REG_PBLEND)) ? ((1<<16|GXMIX_BLEND_FORCE)<<2) : 0;
int blendmode = (m_oinprion == 0xef && m_k054338->register_r(K338_REG_PBLEND)) ? ((1 << 16 | GXMIX_BLEND_FORCE) << 2) : 0;
konamigx_mixer(screen, bitmap, cliprect, nullptr, 0, nullptr, 0, blendmode, nullptr, 0);
return 0;

View File

@ -45,6 +45,7 @@ Mephisto Explorer:
- PCB label: 51CT09-01001L
- Hitachi H8/3212 MCU (QFP), 10MHz XTAL, same ROM contents as Barracuda
- LCD layout is slightly different, symbols are on the right side
- no board edge LEDs, LCD backlight via P51
H8/323 A13 MCU is used in:
- Saitek GK 2000 (1992 version, 86071220X12)