mirror of
https://github.com/holub/mame
synced 2025-05-20 12:48:53 +03:00
315_5124.cpp : Updates
Implement internal PSG, Use shorter type values, Remove register_postload, Remove unnecessary arguments in handlers megaplay.cpp : Add notes megatech.cpp : Remove unnecessary handler, Add notes, nw segae.cpp : Minor MCFG removals, Add notes sms.cpp : Minor MCFG removals
This commit is contained in:
parent
b07f23632a
commit
5ad4e0e65c
@ -88,12 +88,12 @@ PAL frame timing
|
||||
#define BOTTOM_BORDER 4
|
||||
#define BOTTOM_BLANKING 5
|
||||
|
||||
static constexpr uint8_t ntsc_192[6] = { 3, 13, 27, 192, 24, 3 };
|
||||
static constexpr uint8_t ntsc_224[6] = { 3, 13, 11, 224, 8, 3 };
|
||||
static constexpr uint8_t ntsc_240[6] = { 3, 13, 3, 240, 0, 3 };
|
||||
static constexpr uint8_t pal_192[6] = { 3, 13, 54, 192, 48, 3 };
|
||||
static constexpr uint8_t pal_224[6] = { 3, 13, 38, 224, 32, 3 };
|
||||
static constexpr uint8_t pal_240[6] = { 3, 13, 30, 240, 24, 3 };
|
||||
static constexpr u8 ntsc_192[6] = { 3, 13, 27, 192, 24, 3 };
|
||||
static constexpr u8 ntsc_224[6] = { 3, 13, 11, 224, 8, 3 };
|
||||
static constexpr u8 ntsc_240[6] = { 3, 13, 3, 240, 0, 3 };
|
||||
static constexpr u8 pal_192[6] = { 3, 13, 54, 192, 48, 3 };
|
||||
static constexpr u8 pal_224[6] = { 3, 13, 38, 224, 32, 3 };
|
||||
static constexpr u8 pal_240[6] = { 3, 13, 30, 240, 24, 3 };
|
||||
|
||||
#define VINT_HPOS 0
|
||||
#define VINT_FLAG_HPOS 1
|
||||
@ -104,8 +104,8 @@ static constexpr uint8_t pal_240[6] = { 3, 13, 30, 240, 24, 3 };
|
||||
#define SPROVR_HPOS 6
|
||||
#define SPRCOL_BASEHPOS 7
|
||||
|
||||
static constexpr uint8_t line_315_5124[8] = { 24, 24, 26, 28 /* not verified */, 21, 23, 24, 59 };
|
||||
static constexpr uint8_t line_315_5377[8] = { 26, 26, 27, 28 /* not verified */, 24, 28, 26, 62 };
|
||||
static constexpr u8 line_315_5124[8] = { 24, 24, 26, 28 /* not verified */, 21, 23, 24, 59 };
|
||||
static constexpr u8 line_315_5377[8] = { 26, 26, 27, 28 /* not verified */, 24, 28, 26, 62 };
|
||||
|
||||
#define DISPLAY_DISABLED_HPOS 24 /* not verified, works if above 18 (for 'pstrike2') and below 25 (for 'fantdizzy') */
|
||||
#define DISPLAY_CB_HPOS 2 /* fixes 'roadrash' (SMS game) title scrolling, due to line counter reload timing */
|
||||
@ -168,16 +168,17 @@ void sega315_5124_device::sega315_5124(address_map &map)
|
||||
}
|
||||
|
||||
|
||||
sega315_5124_device::sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
sega315_5124_device::sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: sega315_5124_device(mconfig, SEGA315_5124, tag, owner, clock, SEGA315_5124_CRAM_SIZE, 0x00, 0x0f, 4, 8, line_315_5124)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, uint8_t reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const uint8_t *line_timing)
|
||||
sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 cram_size, u8 palette_offset, u8 reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const u8 *line_timing)
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
, device_memory_interface(mconfig, *this)
|
||||
, device_video_interface(mconfig, *this)
|
||||
, device_mixer_interface(mconfig, *this, 2)
|
||||
, m_cram_size(cram_size)
|
||||
, m_line_timing(line_timing)
|
||||
, m_palette_offset(palette_offset)
|
||||
@ -190,30 +191,31 @@ sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_t
|
||||
, m_pause_cb(*this)
|
||||
, m_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, address_map_constructor(), address_map_constructor(FUNC(sega315_5124_device::sega315_5124), this))
|
||||
, m_palette(*this, "palette")
|
||||
, m_snsnd(*this, "snsnd")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
sega315_5246_device::sega315_5246_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
sega315_5246_device::sega315_5246_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: sega315_5124_device(mconfig, SEGA315_5246, tag, owner, clock, SEGA315_5124_CRAM_SIZE, 0x00, 0x0f, 8, 8, line_315_5124)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
sega315_5246_device::sega315_5246_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, uint8_t reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const uint8_t *line_timing)
|
||||
sega315_5246_device::sega315_5246_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 cram_size, u8 palette_offset, u8 reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const u8 *line_timing)
|
||||
: sega315_5124_device(mconfig, type, tag, owner, clock, cram_size, palette_offset, reg_num_mask, max_sprite_zoom_hcount, max_sprite_zoom_vcount, line_timing)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Embedded mode 4 support of the 315-5313 VDP (see 315_5313.cpp), used by Sega Genesis/Mega Drive
|
||||
sega315_5313_mode4_device::sega315_5313_mode4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, uint8_t reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const uint8_t *line_timing)
|
||||
sega315_5313_mode4_device::sega315_5313_mode4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 cram_size, u8 palette_offset, u8 reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const u8 *line_timing)
|
||||
: sega315_5246_device(mconfig, type, tag, owner, clock, cram_size, palette_offset, reg_num_mask, max_sprite_zoom_hcount, max_sprite_zoom_vcount, line_timing)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
sega315_5377_device::sega315_5377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
sega315_5377_device::sega315_5377_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: sega315_5246_device(mconfig, SEGA315_5377, tag, owner, clock, SEGA315_5377_CRAM_SIZE, 0x10, 0x0f, 8, 8, line_315_5377)
|
||||
{
|
||||
}
|
||||
@ -328,7 +330,7 @@ void sega315_5124_device::set_frame_timing()
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER( sega315_5124_device::vcount_read )
|
||||
u8 sega315_5124_device::vcount_read()
|
||||
{
|
||||
const int active_scr_start = m_frame_timing[VERTICAL_SYNC] + m_frame_timing[TOP_BLANKING] + m_frame_timing[TOP_BORDER];
|
||||
int vpos = screen().vpos();
|
||||
@ -344,7 +346,7 @@ READ8_MEMBER( sega315_5124_device::vcount_read )
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER( sega315_5124_device::hcount_read )
|
||||
u8 sega315_5124_device::hcount_read()
|
||||
{
|
||||
return m_hcounter;
|
||||
}
|
||||
@ -592,10 +594,10 @@ void sega315_5124_device::process_line_timer()
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER( sega315_5124_device::data_read )
|
||||
u8 sega315_5124_device::data_read()
|
||||
{
|
||||
/* Return data buffer contents */
|
||||
const uint8_t temp = m_buffer;
|
||||
const u8 temp = m_buffer;
|
||||
|
||||
/* Clear pending write flag */
|
||||
m_pending_control_write = false;
|
||||
@ -653,9 +655,9 @@ void sega315_5124_device::check_pending_flags()
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER( sega315_5124_device::control_read )
|
||||
u8 sega315_5124_device::control_read()
|
||||
{
|
||||
uint8_t temp;
|
||||
u8 temp;
|
||||
|
||||
check_pending_flags();
|
||||
temp = m_status;
|
||||
@ -667,7 +669,7 @@ READ8_MEMBER( sega315_5124_device::control_read )
|
||||
|
||||
/* Clear status flags */
|
||||
m_hint_occurred = false;
|
||||
m_status = uint8_t(~(STATUS_VINT | STATUS_SPROVR | STATUS_SPRCOL));
|
||||
m_status = u8(~(STATUS_VINT | STATUS_SPROVR | STATUS_SPRCOL));
|
||||
|
||||
if (m_irq_state == 1)
|
||||
{
|
||||
@ -682,7 +684,7 @@ READ8_MEMBER( sega315_5124_device::control_read )
|
||||
}
|
||||
|
||||
|
||||
void sega315_5124_device::write_memory(uint8_t data)
|
||||
void sega315_5124_device::write_memory(u8 data)
|
||||
{
|
||||
switch (m_addrmode)
|
||||
{
|
||||
@ -702,7 +704,7 @@ void sega315_5124_device::write_memory(uint8_t data)
|
||||
}
|
||||
|
||||
|
||||
void sega315_5313_mode4_device::write_memory(uint8_t data)
|
||||
void sega315_5313_mode4_device::write_memory(u8 data)
|
||||
{
|
||||
switch (m_addrmode)
|
||||
{
|
||||
@ -720,7 +722,7 @@ void sega315_5313_mode4_device::write_memory(uint8_t data)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER( sega315_5124_device::data_write )
|
||||
void sega315_5124_device::data_write(u8 data)
|
||||
{
|
||||
/* Clear pending write flag */
|
||||
m_pending_control_write = false;
|
||||
@ -730,7 +732,7 @@ WRITE8_MEMBER( sega315_5124_device::data_write )
|
||||
}
|
||||
|
||||
|
||||
void sega315_5124_device::load_vram_addr(uint8_t data)
|
||||
void sega315_5124_device::load_vram_addr(u8 data)
|
||||
{
|
||||
// Seems like the latched data is passed straight through
|
||||
// to the address register when in the middle of doing a command.
|
||||
@ -742,7 +744,7 @@ void sega315_5124_device::load_vram_addr(uint8_t data)
|
||||
}
|
||||
|
||||
|
||||
void sega315_5313_mode4_device::load_vram_addr(uint8_t data)
|
||||
void sega315_5313_mode4_device::load_vram_addr(u8 data)
|
||||
{
|
||||
if (m_pending_control_write)
|
||||
m_control_write_data_latch = data;
|
||||
@ -751,7 +753,7 @@ void sega315_5313_mode4_device::load_vram_addr(uint8_t data)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER( sega315_5124_device::control_write )
|
||||
void sega315_5124_device::control_write(u8 data)
|
||||
{
|
||||
if (!m_pending_control_write)
|
||||
{
|
||||
@ -859,13 +861,13 @@ WRITE8_MEMBER( sega315_5124_device::control_write )
|
||||
}
|
||||
|
||||
|
||||
uint16_t sega315_5124_device::name_table_row_mode4(int row)
|
||||
u16 sega315_5124_device::name_table_row_mode4(int row)
|
||||
{
|
||||
return ((row >> 3) << 6) & (((m_reg[0x02] & 0x01) << 10) | ((m_reg[0x04] & 0x03) << 11) | 0x23ff);
|
||||
}
|
||||
|
||||
|
||||
uint16_t sega315_5246_device::name_table_row_mode4(int row)
|
||||
u16 sega315_5246_device::name_table_row_mode4(int row)
|
||||
{
|
||||
return (row >> 3) << 6;
|
||||
}
|
||||
@ -897,7 +899,7 @@ void sega315_5124_device::draw_leftmost_pixels_mode4(int *line_buffer, int *prio
|
||||
|
||||
// Load data of bit plane 1 for the selected tile.
|
||||
const int tmp_bit_plane_1 = space().read_byte((tile_selected << 5) + ((parse_line & 0x07) << 2) + 0x01);
|
||||
const uint8_t pen_bit_1 = BIT(tmp_bit_plane_1, 7 - pixel_x);
|
||||
const u8 pen_bit_1 = BIT(tmp_bit_plane_1, 7 - pixel_x);
|
||||
|
||||
for (int pixel_plot_x = 0; pixel_plot_x < fine_x_scroll; pixel_plot_x++)
|
||||
{
|
||||
@ -931,7 +933,7 @@ void sega315_5124_device::draw_scanline_mode4(int *line_buffer, int *priority_se
|
||||
const int fine_x_scroll = (x_scroll & 0x07);
|
||||
|
||||
int scroll_mod;
|
||||
uint16_t name_table_address;
|
||||
u16 name_table_address;
|
||||
if (m_y_pixels != 192)
|
||||
{
|
||||
name_table_address = ((m_reg[0x02] & 0x0c) << 10) | 0x0700;
|
||||
@ -953,7 +955,7 @@ void sega315_5124_device::draw_scanline_mode4(int *line_buffer, int *priority_se
|
||||
/* vertical scrolling when bit 7 of reg[0x00] is set */
|
||||
const int y_scroll = (BIT(m_reg[0x00], 7) && (tile_column > 23)) ? 0 : m_reg9copy;
|
||||
|
||||
const uint16_t tile_data = space().read_word(name_table_address + name_table_row_mode4((line + y_scroll) % scroll_mod) + table_column);
|
||||
const u16 tile_data = space().read_word(name_table_address + name_table_row_mode4((line + y_scroll) % scroll_mod) + table_column);
|
||||
|
||||
const int tile_selected = (tile_data & 0x01ff);
|
||||
const int priority_select = tile_data & PRIORITY_BIT;
|
||||
@ -978,12 +980,12 @@ void sega315_5124_device::draw_scanline_mode4(int *line_buffer, int *priority_se
|
||||
|
||||
for (int pixel_x = 0; pixel_x < 8; pixel_x++)
|
||||
{
|
||||
const uint8_t pen_bit_0 = BIT(bit_plane_0, 7 - pixel_x);
|
||||
const uint8_t pen_bit_1 = BIT(bit_plane_1, 7 - pixel_x);
|
||||
const uint8_t pen_bit_2 = BIT(bit_plane_2, 7 - pixel_x);
|
||||
const uint8_t pen_bit_3 = BIT(bit_plane_3, 7 - pixel_x);
|
||||
const u8 pen_bit_0 = BIT(bit_plane_0, 7 - pixel_x);
|
||||
const u8 pen_bit_1 = BIT(bit_plane_1, 7 - pixel_x);
|
||||
const u8 pen_bit_2 = BIT(bit_plane_2, 7 - pixel_x);
|
||||
const u8 pen_bit_3 = BIT(bit_plane_3, 7 - pixel_x);
|
||||
|
||||
uint8_t pen_selected = (pen_bit_3 << 3 | pen_bit_2 << 2 | pen_bit_1 << 1 | pen_bit_0);
|
||||
u8 pen_selected = (pen_bit_3 << 3 | pen_bit_2 << 2 | pen_bit_1 << 1 | pen_bit_0);
|
||||
if (palette_selected)
|
||||
pen_selected |= 0x10;
|
||||
|
||||
@ -1000,25 +1002,25 @@ void sega315_5124_device::draw_scanline_mode4(int *line_buffer, int *priority_se
|
||||
}
|
||||
|
||||
|
||||
uint16_t sega315_5124_device::sprite_attributes_addr_mode4(uint16_t base)
|
||||
u16 sega315_5124_device::sprite_attributes_addr_mode4(u16 base)
|
||||
{
|
||||
return base & ((BIT(m_reg[0x05], 0) << 7) | 0x3f7f);
|
||||
}
|
||||
|
||||
|
||||
uint16_t sega315_5246_device::sprite_attributes_addr_mode4(uint16_t base)
|
||||
u16 sega315_5246_device::sprite_attributes_addr_mode4(u16 base)
|
||||
{
|
||||
return base;
|
||||
}
|
||||
|
||||
|
||||
uint8_t sega315_5124_device::sprite_tile_mask_mode4(uint8_t tile_number)
|
||||
u8 sega315_5124_device::sprite_tile_mask_mode4(u8 tile_number)
|
||||
{
|
||||
return tile_number & (((m_reg[0x06] & 0x03) << 6) | 0x3f);
|
||||
}
|
||||
|
||||
|
||||
uint8_t sega315_5246_device::sprite_tile_mask_mode4(uint8_t tile_number)
|
||||
u8 sega315_5246_device::sprite_tile_mask_mode4(u8 tile_number)
|
||||
{
|
||||
return tile_number;
|
||||
}
|
||||
@ -1029,7 +1031,7 @@ void sega315_5124_device::sprite_count_overflow(int line, int sprite_index)
|
||||
/* Overflow is flagged only on active display and when VINT isn't active */
|
||||
if (!(m_status & STATUS_VINT) && line >= 0 && line < m_frame_timing[ACTIVE_DISPLAY_V])
|
||||
{
|
||||
uint8_t sprite_number_bits;
|
||||
u8 sprite_number_bits;
|
||||
m_pending_status |= STATUS_SPROVR;
|
||||
if (sprite_index < 14)
|
||||
sprite_number_bits = (sprite_index + 1) / 2;
|
||||
@ -1096,7 +1098,7 @@ void sega315_5124_device::select_sprites(int line)
|
||||
{
|
||||
const int sprite_x = space().read_byte(m_sprite_base + sprite_index + 1);
|
||||
int sprite_tile_selected = space().read_byte(m_sprite_base + sprite_index + 2);
|
||||
const uint8_t flags = space().read_byte(m_sprite_base + sprite_index + 3);
|
||||
const u8 flags = space().read_byte(m_sprite_base + sprite_index + 3);
|
||||
|
||||
int sprite_line = parse_line - sprite_y;
|
||||
|
||||
@ -1265,28 +1267,28 @@ void sega315_5124_device::draw_sprites_mode4(int *line_buffer, int *priority_sel
|
||||
|
||||
bool sprite_col_occurred = false;
|
||||
int sprite_col_x = 255;
|
||||
uint8_t collision_buffer[256] = { 0 };
|
||||
u8 collision_buffer[256] = { 0 };
|
||||
|
||||
// Draw sprite layer
|
||||
for (int sprite_buffer_index = m_sprite_count - 1; sprite_buffer_index >= 0; sprite_buffer_index--)
|
||||
{
|
||||
const int sprite_x = m_sprite_x[sprite_buffer_index];
|
||||
const int sprite_tile_selected = m_sprite_tile_selected[sprite_buffer_index];
|
||||
const uint16_t sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index];
|
||||
const u16 sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index];
|
||||
const int zoom_scale = sprite_buffer_index < m_max_sprite_zoom_hcount ? m_sprite_zoom_scale : 1;
|
||||
|
||||
const uint8_t bit_plane_0 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x00);
|
||||
const uint8_t bit_plane_1 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x01);
|
||||
const uint8_t bit_plane_2 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x02);
|
||||
const uint8_t bit_plane_3 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x03);
|
||||
const u8 bit_plane_0 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x00);
|
||||
const u8 bit_plane_1 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x01);
|
||||
const u8 bit_plane_2 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x02);
|
||||
const u8 bit_plane_3 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x03);
|
||||
|
||||
for (int pixel_x = 0; pixel_x < 8; pixel_x++)
|
||||
{
|
||||
const uint8_t pen_bit_0 = BIT(bit_plane_0, 7 - pixel_x);
|
||||
const uint8_t pen_bit_1 = BIT(bit_plane_1, 7 - pixel_x);
|
||||
const uint8_t pen_bit_2 = BIT(bit_plane_2, 7 - pixel_x);
|
||||
const uint8_t pen_bit_3 = BIT(bit_plane_3, 7 - pixel_x);
|
||||
const uint8_t pen_selected = (pen_bit_3 << 3 | pen_bit_2 << 2 | pen_bit_1 << 1 | pen_bit_0) | 0x10;
|
||||
const u8 pen_bit_0 = BIT(bit_plane_0, 7 - pixel_x);
|
||||
const u8 pen_bit_1 = BIT(bit_plane_1, 7 - pixel_x);
|
||||
const u8 pen_bit_2 = BIT(bit_plane_2, 7 - pixel_x);
|
||||
const u8 pen_bit_3 = BIT(bit_plane_3, 7 - pixel_x);
|
||||
const u8 pen_selected = (pen_bit_3 << 3 | pen_bit_2 << 2 | pen_bit_1 << 1 | pen_bit_0) | 0x10;
|
||||
|
||||
if (pen_selected == 0x10) // Transparent palette so skip draw
|
||||
continue;
|
||||
@ -1352,15 +1354,15 @@ void sega315_5124_device::draw_sprites_tms9918_mode(int *line_buffer, int line)
|
||||
|
||||
bool sprite_col_occurred = false;
|
||||
int sprite_col_x = 255;
|
||||
uint8_t collision_buffer[256] = { 0 };
|
||||
u8 collision_buffer[256] = { 0 };
|
||||
|
||||
/* Draw sprite layer */
|
||||
for (int sprite_buffer_index = m_sprite_count - 1; sprite_buffer_index >= 0; sprite_buffer_index--)
|
||||
{
|
||||
int sprite_x = m_sprite_x[sprite_buffer_index];
|
||||
int sprite_tile_selected = m_sprite_tile_selected[sprite_buffer_index];
|
||||
const uint16_t sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index];
|
||||
const uint8_t flags = m_sprite_flags[sprite_buffer_index];
|
||||
const u16 sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index];
|
||||
const u8 flags = m_sprite_flags[sprite_buffer_index];
|
||||
const int pen_selected = m_palette_offset + (flags & 0x0f);
|
||||
const int zoom_scale = sprite_buffer_index < m_max_sprite_zoom_hcount ? m_sprite_zoom_scale : 1;
|
||||
|
||||
@ -1375,7 +1377,7 @@ void sega315_5124_device::draw_sprites_tms9918_mode(int *line_buffer, int line)
|
||||
sprite_x += (zoom_scale > 1 ? 16 : 8);
|
||||
}
|
||||
|
||||
uint8_t pattern = space().read_byte(sprite_pattern_line + sprite_tile_selected * 8);
|
||||
u8 pattern = space().read_byte(sprite_pattern_line + sprite_tile_selected * 8);
|
||||
|
||||
for (int pixel_x = 0; pixel_x < 8; pixel_x++)
|
||||
{
|
||||
@ -1421,23 +1423,23 @@ void sega315_5124_device::draw_sprites_tms9918_mode(int *line_buffer, int line)
|
||||
// Display mode 2 (Graphics II Mode)
|
||||
void sega315_5124_device::draw_scanline_mode2(int *line_buffer, int line)
|
||||
{
|
||||
const uint16_t name_table_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32);
|
||||
const uint16_t color_base = ((m_reg[0x03] & 0x80) << 6);
|
||||
const u16 name_table_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32);
|
||||
const u16 color_base = ((m_reg[0x03] & 0x80) << 6);
|
||||
const int color_mask = ((m_reg[0x03] & 0x7f) << 3) | 0x07;
|
||||
const uint16_t pattern_base = ((m_reg[0x04] & 0x04) << 11);
|
||||
const u16 pattern_base = ((m_reg[0x04] & 0x04) << 11);
|
||||
const int pattern_mask = ((m_reg[0x04] & 0x03) << 8) | 0xff;
|
||||
const int pattern_offset = (line & 0xc0) << 2;
|
||||
|
||||
/* Draw background layer */
|
||||
for (int tile_column = 0; tile_column < 32; tile_column++)
|
||||
{
|
||||
const uint8_t name = space().read_byte(name_table_base + tile_column);
|
||||
const uint8_t pattern = space().read_byte(pattern_base + (((pattern_offset + name) & pattern_mask) * 8) + (line & 0x07) );
|
||||
const uint8_t colors = space().read_byte(color_base + (((pattern_offset + name) & color_mask) * 8) + (line & 0x07) );
|
||||
const u8 name = space().read_byte(name_table_base + tile_column);
|
||||
const u8 pattern = space().read_byte(pattern_base + (((pattern_offset + name) & pattern_mask) * 8) + (line & 0x07) );
|
||||
const u8 colors = space().read_byte(color_base + (((pattern_offset + name) & color_mask) * 8) + (line & 0x07) );
|
||||
|
||||
for (int pixel_x = 0; pixel_x < 8; pixel_x++)
|
||||
{
|
||||
uint8_t pen_selected;
|
||||
u8 pen_selected;
|
||||
const int pixel_plot_x = (tile_column << 3) + pixel_x;
|
||||
|
||||
if (BIT(pattern, 7 - pixel_x))
|
||||
@ -1462,16 +1464,16 @@ void sega315_5124_device::draw_scanline_mode2(int *line_buffer, int line)
|
||||
// Display mode 0 (Graphics I Mode)
|
||||
void sega315_5124_device::draw_scanline_mode0(int *line_buffer, int line)
|
||||
{
|
||||
const uint16_t name_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32);
|
||||
const uint16_t color_base = ((m_reg[0x03] << 6) & (VRAM_SIZE - 1));
|
||||
const uint16_t pattern_base = ((m_reg[0x04] << 11) & (VRAM_SIZE - 1));
|
||||
const u16 name_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32);
|
||||
const u16 color_base = ((m_reg[0x03] << 6) & (VRAM_SIZE - 1));
|
||||
const u16 pattern_base = ((m_reg[0x04] << 11) & (VRAM_SIZE - 1));
|
||||
|
||||
/* Draw background layer */
|
||||
for (int tile_column = 0; tile_column < 32; tile_column++)
|
||||
{
|
||||
const uint8_t name = space().read_byte(name_base + tile_column);
|
||||
const uint8_t pattern = space().read_byte(pattern_base + (name << 3) + (line & 0x07));
|
||||
const uint8_t colors = space().read_byte(color_base + (name >> 3));
|
||||
const u8 name = space().read_byte(name_base + tile_column);
|
||||
const u8 pattern = space().read_byte(pattern_base + (name << 3) + (line & 0x07));
|
||||
const u8 colors = space().read_byte(color_base + (name >> 3));
|
||||
|
||||
for (int pixel_x = 0; pixel_x < 8; pixel_x++)
|
||||
{
|
||||
@ -1496,8 +1498,8 @@ void sega315_5124_device::draw_scanline_mode0(int *line_buffer, int line)
|
||||
// Display mode 1 (Text Mode)
|
||||
void sega315_5124_device::draw_scanline_mode1(int *line_buffer, int line)
|
||||
{
|
||||
const uint16_t name_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32);
|
||||
const uint16_t pattern_base = ((m_reg[0x04] << 11) & (VRAM_SIZE - 1));
|
||||
const u16 name_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32);
|
||||
const u16 pattern_base = ((m_reg[0x04] << 11) & (VRAM_SIZE - 1));
|
||||
|
||||
for (int pixel_plot_x = 0; pixel_plot_x < 8; pixel_plot_x++)
|
||||
{
|
||||
@ -1507,8 +1509,8 @@ void sega315_5124_device::draw_scanline_mode1(int *line_buffer, int line)
|
||||
/* Draw background layer */
|
||||
for (int tile_column = 0; tile_column < 40; tile_column++)
|
||||
{
|
||||
const uint8_t name = space().read_byte(name_base + tile_column);
|
||||
const uint8_t pattern = space().read_byte(pattern_base + (name << 3) + (line & 0x07));
|
||||
const u8 name = space().read_byte(name_base + tile_column);
|
||||
const u8 pattern = space().read_byte(pattern_base + (name << 3) + (line & 0x07));
|
||||
|
||||
for (int pixel_x = 0; pixel_x < 6; pixel_x++)
|
||||
{
|
||||
@ -1536,14 +1538,14 @@ void sega315_5124_device::draw_scanline_mode1(int *line_buffer, int line)
|
||||
// Display mode 3 (Multicolor Mode)
|
||||
void sega315_5124_device::draw_scanline_mode3(int *line_buffer, int line)
|
||||
{
|
||||
const uint16_t name_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32);
|
||||
const uint16_t pattern_base = ((m_reg[0x04] << 11) & (VRAM_SIZE - 1));
|
||||
const u16 name_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32);
|
||||
const u16 pattern_base = ((m_reg[0x04] << 11) & (VRAM_SIZE - 1));
|
||||
|
||||
/* Draw background layer */
|
||||
for (int tile_column = 0; tile_column < 32; tile_column++)
|
||||
{
|
||||
const uint8_t name = space().read_byte(name_base + tile_column);
|
||||
const uint8_t pattern = space().read_byte(pattern_base + (name << 3) + (((line >> 3) & 3) << 1) + ((line & 4) >> 2));
|
||||
const u8 name = space().read_byte(name_base + tile_column);
|
||||
const u8 pattern = space().read_byte(pattern_base + (name << 3) + (((line >> 3) & 3) << 1) + ((line & 4) >> 2));
|
||||
|
||||
for (int pixel_x = 0; pixel_x < 8; pixel_x++)
|
||||
{
|
||||
@ -1635,8 +1637,8 @@ void sega315_5124_device::draw_scanline(int pixel_offset_x, int pixel_plot_y, in
|
||||
|
||||
void sega315_5124_device::blit_scanline(int *line_buffer, int *priority_selected, int pixel_offset_x, int pixel_plot_y, int line)
|
||||
{
|
||||
uint32_t *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x);
|
||||
uint8_t *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x);
|
||||
u32 *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x);
|
||||
u8 *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x);
|
||||
int x = 0;
|
||||
|
||||
if (m_vdp_mode == 4 && BIT(m_reg[0x00], 5))
|
||||
@ -1667,8 +1669,8 @@ void sega315_5377_device::blit_scanline(int *line_buffer, int *priority_selected
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x);
|
||||
uint8_t *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x);
|
||||
u32 *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x);
|
||||
u8 *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x);
|
||||
int x = 0;
|
||||
|
||||
/* border on left side of the GG active screen */
|
||||
@ -1756,9 +1758,9 @@ void sega315_5377_device::update_palette()
|
||||
}
|
||||
|
||||
|
||||
void sega315_5124_device::cram_write(uint8_t data)
|
||||
void sega315_5124_device::cram_write(u8 data)
|
||||
{
|
||||
uint16_t address = m_addr & m_cram_mask;
|
||||
u16 address = m_addr & m_cram_mask;
|
||||
if (data != m_CRAM[address])
|
||||
{
|
||||
m_CRAM[address] = data;
|
||||
@ -1767,7 +1769,7 @@ void sega315_5124_device::cram_write(uint8_t data)
|
||||
}
|
||||
|
||||
|
||||
void sega315_5377_device::cram_write(uint8_t data)
|
||||
void sega315_5377_device::cram_write(u8 data)
|
||||
{
|
||||
if (m_sega315_5124_compatibility_mode)
|
||||
{
|
||||
@ -1777,7 +1779,7 @@ void sega315_5377_device::cram_write(uint8_t data)
|
||||
{
|
||||
if (m_addr & 1)
|
||||
{
|
||||
uint16_t address = (m_addr & m_cram_mask) & ~1;
|
||||
u16 address = (m_addr & m_cram_mask) & ~1;
|
||||
if (m_buffer != m_CRAM[address] || data != m_CRAM[address + 1])
|
||||
{
|
||||
m_CRAM[address] = m_buffer;
|
||||
@ -1789,7 +1791,7 @@ void sega315_5377_device::cram_write(uint8_t data)
|
||||
}
|
||||
|
||||
|
||||
uint32_t sega315_5124_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
u32 sega315_5124_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
copybitmap(bitmap, m_tmpbitmap, 0, 0, 0, 0, cliprect);
|
||||
return 0;
|
||||
@ -1819,7 +1821,7 @@ void sega315_5313_mode4_device::stop_timers()
|
||||
DEVICE INTERFACE
|
||||
*****************************************************************************/
|
||||
|
||||
void sega315_5124_device::vdp_postload()
|
||||
void sega315_5124_device::device_post_load()
|
||||
{
|
||||
set_frame_timing();
|
||||
}
|
||||
@ -1886,8 +1888,6 @@ void sega315_5124_device::device_start()
|
||||
save_item(NAME(m_max_sprite_zoom_hcount));
|
||||
save_item(NAME(m_max_sprite_zoom_vcount));
|
||||
save_item(NAME(m_CRAM));
|
||||
|
||||
machine().save().register_postload(save_prepost_delegate(FUNC(sega315_5124_device::vdp_postload), this));
|
||||
}
|
||||
|
||||
|
||||
@ -1899,7 +1899,7 @@ void sega315_5124_device::device_reset()
|
||||
m_reg[0x02] = 0x0e;
|
||||
m_reg[0x0a] = 0xff;
|
||||
|
||||
m_status = m_pending_status = uint8_t(~(STATUS_VINT | STATUS_SPROVR | STATUS_SPRCOL));
|
||||
m_status = m_pending_status = u8(~(STATUS_VINT | STATUS_SPROVR | STATUS_SPRCOL));
|
||||
m_pending_sprcol_x = 0;
|
||||
m_pending_control_write = false;
|
||||
m_pending_hint = false;
|
||||
@ -1934,6 +1934,8 @@ void sega315_5124_device::device_reset()
|
||||
void sega315_5124_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
PALETTE(config, m_palette, FUNC(sega315_5124_device::sega315_5124_palette), SEGA315_5124_PALETTE_SIZE);
|
||||
|
||||
SEGAPSG(config, m_snsnd, DERIVED_CLOCK(1, 3)).add_route(ALL_OUTPUTS, *this, 1.0, AUTO_ALLOC_INPUT, 0);
|
||||
}
|
||||
|
||||
void sega315_5377_device::device_reset()
|
||||
@ -1949,6 +1951,11 @@ void sega315_5377_device::device_reset()
|
||||
void sega315_5377_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
sega315_5246_device::device_add_mconfig(config);
|
||||
|
||||
m_palette->set_entries(SEGA315_5377_PALETTE_SIZE);
|
||||
m_palette->set_init(FUNC(sega315_5377_device::sega315_5377_palette));
|
||||
|
||||
GAMEGEAR(config.replace(), m_snsnd, DERIVED_CLOCK(1, 3));
|
||||
m_snsnd->add_route(0, *this, 1.0, AUTO_ALLOC_INPUT, 0);
|
||||
m_snsnd->add_route(1, *this, 1.0, AUTO_ALLOC_INPUT, 1);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sound/sn76496.h"
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
|
||||
@ -28,7 +29,8 @@ DECLARE_DEVICE_TYPE(SEGA315_5377, sega315_5377_device) /* aka Gamegear (2 A
|
||||
|
||||
class sega315_5124_device : public device_t,
|
||||
public device_memory_interface,
|
||||
public device_video_interface
|
||||
public device_video_interface,
|
||||
public device_mixer_interface
|
||||
{
|
||||
public:
|
||||
static constexpr unsigned WIDTH = 342; /* 342 pixels */
|
||||
@ -51,7 +53,7 @@ public:
|
||||
|
||||
|
||||
// construction/destruction
|
||||
sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
void set_is_pal(bool is_pal) { m_is_pal = is_pal; }
|
||||
|
||||
@ -59,12 +61,14 @@ public:
|
||||
auto csync() { return m_csync_cb.bind(); }
|
||||
auto pause() { return m_pause_cb.bind(); }
|
||||
|
||||
DECLARE_READ8_MEMBER( data_read );
|
||||
DECLARE_WRITE8_MEMBER( data_write );
|
||||
DECLARE_READ8_MEMBER( control_read );
|
||||
DECLARE_WRITE8_MEMBER( control_write );
|
||||
DECLARE_READ8_MEMBER( vcount_read );
|
||||
DECLARE_READ8_MEMBER( hcount_read );
|
||||
void psg_w(u8 data) { m_snsnd->write(data); }
|
||||
void psg_stereo_w(u8 data) { m_snsnd->stereo_w(data); }
|
||||
u8 data_read();
|
||||
void data_write(u8 data);
|
||||
u8 control_read();
|
||||
void control_write(u8 data);
|
||||
u8 vcount_read();
|
||||
u8 hcount_read();
|
||||
|
||||
void hcount_latch() { hcount_latch_at_hpos(screen().hpos()); };
|
||||
void hcount_latch_at_hpos(int hpos);
|
||||
@ -73,7 +77,7 @@ public:
|
||||
bitmap_ind8 &get_y1_bitmap() { return m_y1_bitmap; };
|
||||
|
||||
/* update the screen */
|
||||
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
virtual void set_sega315_5124_compatibility_mode(bool sega315_5124_compatibility_mode) { }
|
||||
|
||||
@ -81,9 +85,10 @@ protected:
|
||||
static constexpr unsigned SEGA315_5377_CRAM_SIZE = 0x40; /* 32 colors x 2 bytes per color = 64 bytes */
|
||||
static constexpr unsigned SEGA315_5124_CRAM_SIZE = 0x20; /* 32 colors x 1 bytes per color = 32 bytes */
|
||||
|
||||
sega315_5124_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, uint8_t reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const uint8_t *line_timing);
|
||||
sega315_5124_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 cram_size, u8 palette_offset, u8 reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const u8 *line_timing);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_post_load() override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
@ -98,9 +103,9 @@ protected:
|
||||
void set_display_settings();
|
||||
void set_frame_timing();
|
||||
virtual void update_palette();
|
||||
virtual void write_memory(uint8_t data);
|
||||
virtual void cram_write(uint8_t data);
|
||||
virtual void load_vram_addr(uint8_t data);
|
||||
virtual void write_memory(u8 data);
|
||||
virtual void cram_write(u8 data);
|
||||
virtual void load_vram_addr(u8 data);
|
||||
virtual void select_display_mode();
|
||||
virtual void select_extended_res_mode4(bool M1, bool M2, bool M3);
|
||||
virtual void select_sprites(int line);
|
||||
@ -109,9 +114,9 @@ protected:
|
||||
virtual void draw_scanline(int pixel_offset_x, int pixel_plot_y, int line);
|
||||
virtual void blit_scanline(int *line_buffer, int *priority_selected, int pixel_offset_x, int pixel_plot_y, int line);
|
||||
virtual void draw_leftmost_pixels_mode4(int *line_buffer, int *priority_selected, int fine_x_scroll, int palette_selected, int tile_line);
|
||||
virtual uint16_t name_table_row_mode4(int row);
|
||||
virtual uint16_t sprite_attributes_addr_mode4(uint16_t base);
|
||||
virtual uint8_t sprite_tile_mask_mode4(uint8_t tile_number);
|
||||
virtual u16 name_table_row_mode4(int row);
|
||||
virtual u16 sprite_attributes_addr_mode4(u16 base);
|
||||
virtual u8 sprite_tile_mask_mode4(u8 tile_number);
|
||||
void process_line_timer();
|
||||
void draw_scanline_mode4(int *line_buffer, int *priority_selected, int line);
|
||||
void draw_sprites_mode4(int *line_buffer, int *priority_selected, int line);
|
||||
@ -122,44 +127,42 @@ protected:
|
||||
void draw_scanline_mode0(int *line_buffer, int line);
|
||||
void check_pending_flags();
|
||||
|
||||
void vdp_postload();
|
||||
|
||||
uint8_t m_reg[16]; /* All the registers */
|
||||
uint8_t m_status; /* Status register */
|
||||
uint8_t m_pending_status; /* Pending status flags */
|
||||
uint8_t m_reg8copy; /* Internal copy of register 8 (X-Scroll) */
|
||||
uint8_t m_reg9copy; /* Internal copy of register 9 (Y-Scroll) */
|
||||
uint8_t m_addrmode; /* Type of VDP action */
|
||||
uint16_t m_addr; /* Contents of internal VDP address register */
|
||||
const uint8_t m_cram_size; /* CRAM size */
|
||||
uint8_t m_cram_mask; /* Mask to switch between SMS and GG CRAM sizes */
|
||||
u8 m_reg[16]; /* All the registers */
|
||||
u8 m_status; /* Status register */
|
||||
u8 m_pending_status; /* Pending status flags */
|
||||
u8 m_reg8copy; /* Internal copy of register 8 (X-Scroll) */
|
||||
u8 m_reg9copy; /* Internal copy of register 9 (Y-Scroll) */
|
||||
u8 m_addrmode; /* Type of VDP action */
|
||||
u16 m_addr; /* Contents of internal VDP address register */
|
||||
const u8 m_cram_size; /* CRAM size */
|
||||
u8 m_cram_mask; /* Mask to switch between SMS and GG CRAM sizes */
|
||||
bool m_cram_dirty; /* Have there been any changes to the CRAM area */
|
||||
bool m_hint_occurred;
|
||||
bool m_pending_hint;
|
||||
bool m_pending_control_write;
|
||||
int m_pending_sprcol_x;
|
||||
uint8_t m_buffer;
|
||||
uint8_t m_control_write_data_latch;
|
||||
u8 m_buffer;
|
||||
u8 m_control_write_data_latch;
|
||||
bool m_sega315_5124_compatibility_mode; /* when true, GG VDP behaves as SMS VDP */
|
||||
int m_irq_state; /* The status of the IRQ line of the VDP */
|
||||
int m_vdp_mode; /* Current mode of the VDP: 0,1,2,3,4 */
|
||||
int m_y_pixels; /* 192, 224, 240 */
|
||||
int m_draw_time;
|
||||
uint8_t m_line_counter;
|
||||
uint8_t m_hcounter;
|
||||
uint8_t m_CRAM[SEGA315_5377_CRAM_SIZE]; /* CRAM */
|
||||
const uint8_t *m_frame_timing;
|
||||
const uint8_t *m_line_timing;
|
||||
u8 m_line_counter;
|
||||
u8 m_hcounter;
|
||||
u8 m_CRAM[SEGA315_5377_CRAM_SIZE]; /* CRAM */
|
||||
const u8 *m_frame_timing;
|
||||
const u8 *m_line_timing;
|
||||
bitmap_rgb32 m_tmpbitmap;
|
||||
bitmap_ind8 m_y1_bitmap;
|
||||
const uint8_t m_palette_offset;
|
||||
const uint8_t m_reg_num_mask;
|
||||
const u8 m_palette_offset;
|
||||
const u8 m_reg_num_mask;
|
||||
bool m_display_disabled;
|
||||
uint16_t m_sprite_base;
|
||||
uint16_t m_sprite_pattern_line[8];
|
||||
u16 m_sprite_base;
|
||||
u16 m_sprite_pattern_line[8];
|
||||
int m_sprite_tile_selected[8];
|
||||
int m_sprite_x[8];
|
||||
uint8_t m_sprite_flags[8];
|
||||
u8 m_sprite_flags[8];
|
||||
int m_sprite_count;
|
||||
int m_sprite_height;
|
||||
int m_sprite_zoom_scale;
|
||||
@ -192,20 +195,21 @@ protected:
|
||||
static constexpr device_timer_id TIMER_FLAGS = 7;
|
||||
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<sn76496_base_device> m_snsnd;
|
||||
};
|
||||
|
||||
|
||||
class sega315_5246_device : public sega315_5124_device
|
||||
{
|
||||
public:
|
||||
sega315_5246_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
sega315_5246_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
protected:
|
||||
sega315_5246_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, uint8_t reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const uint8_t *line_timing);
|
||||
sega315_5246_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 cram_size, u8 palette_offset, u8 reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const u8 *line_timing);
|
||||
|
||||
virtual uint16_t name_table_row_mode4(int row) override;
|
||||
virtual uint16_t sprite_attributes_addr_mode4(uint16_t base) override;
|
||||
virtual uint8_t sprite_tile_mask_mode4(uint8_t tile_number) override;
|
||||
virtual u16 name_table_row_mode4(int row) override;
|
||||
virtual u16 sprite_attributes_addr_mode4(u16 base) override;
|
||||
virtual u8 sprite_tile_mask_mode4(u8 tile_number) override;
|
||||
virtual void select_extended_res_mode4(bool M1, bool M2, bool M3) override;
|
||||
};
|
||||
|
||||
@ -213,18 +217,18 @@ protected:
|
||||
class sega315_5377_device : public sega315_5246_device
|
||||
{
|
||||
public:
|
||||
sega315_5377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
sega315_5377_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
virtual void set_sega315_5124_compatibility_mode(bool sega315_5124_compatibility_mode) override;
|
||||
|
||||
protected:
|
||||
sega315_5377_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, uint8_t reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const uint8_t *line_timing);
|
||||
sega315_5377_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 cram_size, u8 palette_offset, u8 reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const u8 *line_timing);
|
||||
|
||||
virtual void device_reset() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
virtual void update_palette() override;
|
||||
virtual void cram_write(uint8_t data) override;
|
||||
virtual void cram_write(u8 data) override;
|
||||
virtual void blit_scanline(int *line_buffer, int *priority_selected, int pixel_offset_x, int pixel_plot_y, int line) override;
|
||||
|
||||
private:
|
||||
@ -239,10 +243,10 @@ public:
|
||||
void stop_timers();
|
||||
|
||||
protected:
|
||||
sega315_5313_mode4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, uint8_t reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const uint8_t *line_timing);
|
||||
sega315_5313_mode4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 cram_size, u8 palette_offset, u8 reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const u8 *line_timing);
|
||||
|
||||
virtual void write_memory(uint8_t data) override;
|
||||
virtual void load_vram_addr(uint8_t data) override;
|
||||
virtual void write_memory(u8 data) override;
|
||||
virtual void load_vram_addr(u8 data) override;
|
||||
virtual void select_sprites(int line) override;
|
||||
virtual void sprite_collision(int line, int sprite_col_x) override;
|
||||
virtual void sprite_count_overflow(int line, int sprite_index) override;
|
||||
|
@ -161,7 +161,6 @@ DEFINE_DEVICE_TYPE(SEGA315_5313, sega315_5313_device, "sega315_5313", "Sega 315-
|
||||
sega315_5313_device::sega315_5313_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
// mode 4 support, for SMS compatibility, is implemented in 315_5124.cpp
|
||||
: sega315_5313_mode4_device(mconfig, SEGA315_5313, tag, owner, clock, SEGA315_5124_CRAM_SIZE, 0x00, 0x1f, 0, 0, line_315_5313_mode4)
|
||||
, device_mixer_interface(mconfig, *this, 2)
|
||||
, m_render_bitmap(nullptr)
|
||||
, m_render_line(nullptr)
|
||||
, m_render_line_raw(nullptr)
|
||||
@ -210,7 +209,6 @@ sega315_5313_device::sega315_5313_device(const machine_config &mconfig, const ch
|
||||
, m_palette_lookup_highlight(nullptr)
|
||||
, m_space68k(nullptr)
|
||||
, m_cpu68k(*this, finder_base::DUMMY_TAG)
|
||||
, m_snsnd(*this, "snsnd")
|
||||
{
|
||||
m_use_alt_timing = 0;
|
||||
m_palwrite_base = -1;
|
||||
@ -227,7 +225,7 @@ void sega315_5313_device::device_add_mconfig(machine_config &config)
|
||||
|
||||
m_palette->set_entries(0x200); // more entries for 32X - not really the cleanest way to do this
|
||||
|
||||
SEGAPSG(config, m_snsnd, DERIVED_CLOCK(1, 15)).add_route(ALL_OUTPUTS, *this, 0.5, AUTO_ALLOC_INPUT, 0);
|
||||
SEGAPSG(config.replace(), m_snsnd, DERIVED_CLOCK(1, 15)).add_route(ALL_OUTPUTS, *this, 0.5, AUTO_ALLOC_INPUT, 0);
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(sega315_5313_device::irq6_on_timer_callback)
|
||||
@ -968,9 +966,9 @@ WRITE16_MEMBER( sega315_5313_device::vdp_w )
|
||||
case 0x16:
|
||||
{
|
||||
// accessed by either segapsg_device or sn76496_device
|
||||
if (m_snsnd && ACCESSING_BITS_0_7)
|
||||
m_snsnd->write(data & 0xff);
|
||||
//if (m_snsnd && ACCESSING_BITS_8_15) sn->write((data>>8) & 0xff);
|
||||
if (ACCESSING_BITS_0_7)
|
||||
psg_w(data & 0xff);
|
||||
//if (ACCESSING_BITS_8_15) psg_w((data>>8) & 0xff);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -9,10 +9,9 @@
|
||||
#include "video/315_5124.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/timer.h"
|
||||
#include "sound/sn76496.h"
|
||||
|
||||
|
||||
class sega315_5313_device : public sega315_5313_mode4_device, public device_mixer_interface
|
||||
class sega315_5313_device : public sega315_5313_mode4_device
|
||||
{
|
||||
public:
|
||||
template <typename T>
|
||||
@ -187,7 +186,6 @@ private:
|
||||
|
||||
address_space *m_space68k;
|
||||
required_device<m68000_base_device> m_cpu68k;
|
||||
required_device<sn76496_base_device> m_snsnd;
|
||||
};
|
||||
|
||||
|
||||
|
@ -41,7 +41,6 @@ this reason.
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/cxd1095.h"
|
||||
#include "sound/sn76496.h"
|
||||
|
||||
#include "includes/megadriv.h"
|
||||
|
||||
@ -607,17 +606,16 @@ void mplay_state::megaplay_bios_map(address_map &map)
|
||||
|
||||
READ8_MEMBER(mplay_state::vdp1_count_r)
|
||||
{
|
||||
address_space &prg = m_bioscpu->space(AS_PROGRAM);
|
||||
if (offset & 0x01)
|
||||
return m_vdp1->hcount_read(prg, offset);
|
||||
return m_vdp1->hcount_read();
|
||||
else
|
||||
return m_vdp1->vcount_read(prg, offset);
|
||||
return m_vdp1->vcount_read();
|
||||
}
|
||||
|
||||
void mplay_state::megaplay_bios_io_map(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
map(0x7f, 0x7f).w("sn2", FUNC(sn76496_device::write));
|
||||
map(0x7f, 0x7f).w(m_vdp1, FUNC(sega315_5124_device::psg_w));
|
||||
|
||||
map(0x40, 0x41).mirror(0x3e).r(FUNC(mplay_state::vdp1_count_r));
|
||||
map(0x80, 0x80).mirror(0x3e).rw(m_vdp1, FUNC(sega315_5124_device::data_read), FUNC(sega315_5124_device::data_write));
|
||||
@ -670,9 +668,9 @@ MACHINE_CONFIG_START(mplay_state::megaplay)
|
||||
|
||||
/* The Megaplay has an extra BIOS cpu which drives an SMS VDP
|
||||
which includes an SN76496 for sound */
|
||||
MCFG_DEVICE_ADD("mtbios", Z80, MASTER_CLOCK / 15) /* ?? */
|
||||
MCFG_DEVICE_PROGRAM_MAP(megaplay_bios_map)
|
||||
MCFG_DEVICE_IO_MAP(megaplay_bios_io_map)
|
||||
Z80(config, m_bioscpu, MASTER_CLOCK / 15); /* ?? */
|
||||
m_bioscpu->set_addrmap(AS_PROGRAM, &mplay_state::megaplay_bios_map);
|
||||
m_bioscpu->set_addrmap(AS_IO, &mplay_state::megaplay_bios_io_map);
|
||||
|
||||
config.m_minimum_quantum = attotime::from_hz(6000);
|
||||
|
||||
@ -692,10 +690,6 @@ MACHINE_CONFIG_START(mplay_state::megaplay)
|
||||
io2.in_porte_cb().set(FUNC(mplay_state::bios_6404_r));
|
||||
io2.out_porte_cb().set(FUNC(mplay_state::bios_6404_w));
|
||||
|
||||
MCFG_DEVICE_ADD("sn2", SN76496, MASTER_CLOCK/15)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) /* 3.58 MHz */
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker",0.25) /* 3.58 MHz */
|
||||
|
||||
/* New update functions to handle the extra layer */
|
||||
MCFG_SCREEN_MODIFY("megadriv")
|
||||
MCFG_SCREEN_RAW_PARAMS(XTAL(10'738'635)/2, \
|
||||
@ -704,10 +698,12 @@ MACHINE_CONFIG_START(mplay_state::megaplay)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(mplay_state, screen_update_megplay)
|
||||
|
||||
// Megaplay has an additional SMS VDP as an overlay
|
||||
SEGA315_5246(config, m_vdp1, 0);
|
||||
SEGA315_5246(config, m_vdp1, MASTER_CLOCK / 5); /* ?? */
|
||||
m_vdp1->set_screen("megadriv");
|
||||
m_vdp1->set_is_pal(false);
|
||||
m_vdp1->irq().set_inputline(m_bioscpu, 0);
|
||||
m_vdp1->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
|
||||
m_vdp1->add_route(ALL_OUTPUTS, "rspeaker", 0.25);
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
@ -78,7 +78,6 @@ Sonic Hedgehog 2 171-6215A 837-6963-62 610-0239-62 MPR
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/cxd1095.h"
|
||||
#include "sound/sn76496.h"
|
||||
#include "rendlay.h"
|
||||
|
||||
#include "includes/megadriv.h"
|
||||
@ -134,8 +133,7 @@ private:
|
||||
DECLARE_READ8_MEMBER(bios_joypad_r);
|
||||
DECLARE_WRITE8_MEMBER(bios_port_7f_w);
|
||||
DECLARE_READ8_MEMBER(vdp1_count_r);
|
||||
DECLARE_READ8_MEMBER(sms_count_r);
|
||||
DECLARE_WRITE8_MEMBER(sms_sn_w);
|
||||
u8 sms_count_r(offs_t offset);
|
||||
DECLARE_READ8_MEMBER(sms_ioport_dc_r);
|
||||
DECLARE_READ8_MEMBER(sms_ioport_dd_r);
|
||||
DECLARE_WRITE8_MEMBER(mt_sms_standard_rom_bank_w);
|
||||
@ -161,7 +159,7 @@ private:
|
||||
|
||||
uint8_t m_mt_cart_select_reg;
|
||||
uint32_t m_bios_port_ctrl;
|
||||
int m_current_MACHINE_IS_sms; // is the current game SMS based (running on genesis z80, in VDP compatibility mode)
|
||||
int m_current_machine_is_sms; // is the current game SMS based (running on genesis z80, in VDP compatibility mode)
|
||||
uint32_t m_bios_ctrl_inputs;
|
||||
uint8_t m_bios_ctrl[6];
|
||||
int m_mt_bank_addr;
|
||||
@ -322,19 +320,12 @@ INPUT_PORTS_END
|
||||
|
||||
/* MEGATECH specific */
|
||||
|
||||
READ8_MEMBER(mtech_state::sms_count_r)
|
||||
u8 mtech_state::sms_count_r(offs_t offset)
|
||||
{
|
||||
address_space &prg = m_z80snd->space(AS_PROGRAM);
|
||||
if (offset & 0x01)
|
||||
return m_vdp->hcount_read(prg, offset);
|
||||
return m_vdp->hcount_read();
|
||||
else
|
||||
return m_vdp->vcount_read(prg, offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mtech_state::sms_sn_w)
|
||||
{
|
||||
address_space &prg = m_z80snd->space(AS_PROGRAM);
|
||||
m_vdp->vdp_w(prg, 0x10 >> 1, data, 0x00ff);
|
||||
return m_vdp->vcount_read();
|
||||
}
|
||||
|
||||
READ8_MEMBER (mtech_state::sms_ioport_dc_r)
|
||||
@ -398,10 +389,10 @@ void mtech_state::set_genz80_as_sms()
|
||||
prg.install_write_handler(0xfffc, 0xffff, write8_delegate(FUNC(mtech_state::mt_sms_standard_rom_bank_w),this));
|
||||
|
||||
// ports
|
||||
io.install_read_handler (0x40, 0x41, 0, 0x3e, 0, read8_delegate(FUNC(mtech_state::sms_count_r),this));
|
||||
io.install_write_handler (0x40, 0x41, 0, 0x3e, 0, write8_delegate(FUNC(mtech_state::sms_sn_w),this));
|
||||
io.install_readwrite_handler (0x80, 0x80, 0, 0x3e, 0, read8_delegate(FUNC(sega315_5124_device::data_read),(sega315_5124_device *)m_vdp), write8_delegate(FUNC(sega315_5124_device::data_write),(sega315_5124_device *)m_vdp));
|
||||
io.install_readwrite_handler (0x81, 0x81, 0, 0x3e, 0, read8_delegate(FUNC(sega315_5124_device::control_read),(sega315_5124_device *)m_vdp), write8_delegate(FUNC(sega315_5124_device::control_write),(sega315_5124_device *)m_vdp));
|
||||
io.install_read_handler (0x40, 0x41, 0, 0x3e, 0, read8sm_delegate(FUNC(mtech_state::sms_count_r),this));
|
||||
io.install_write_handler (0x40, 0x41, 0, 0x3e, 0, write8smo_delegate(FUNC(sega315_5124_device::psg_w),(sega315_5124_device *)m_vdp));
|
||||
io.install_readwrite_handler (0x80, 0x80, 0, 0x3e, 0, read8smo_delegate(FUNC(sega315_5124_device::data_read),(sega315_5124_device *)m_vdp), write8smo_delegate(FUNC(sega315_5124_device::data_write),(sega315_5124_device *)m_vdp));
|
||||
io.install_readwrite_handler (0x81, 0x81, 0, 0x3e, 0, read8smo_delegate(FUNC(sega315_5124_device::control_read),(sega315_5124_device *)m_vdp), write8smo_delegate(FUNC(sega315_5124_device::control_write),(sega315_5124_device *)m_vdp));
|
||||
|
||||
io.install_read_handler (0x10, 0x10, read8_delegate(FUNC(mtech_state::sms_ioport_dd_r),this)); // super tetris
|
||||
|
||||
@ -452,7 +443,7 @@ void mtech_state::switch_cart(int gameno)
|
||||
if (!m_cart_is_genesis[gameno])
|
||||
{
|
||||
logerror("enabling SMS Z80\n");
|
||||
m_current_MACHINE_IS_sms = 1;
|
||||
m_current_machine_is_sms = 1;
|
||||
set_genz80_as_sms();
|
||||
//m_z80snd->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
|
||||
m_z80snd->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
|
||||
@ -460,7 +451,7 @@ void mtech_state::switch_cart(int gameno)
|
||||
else
|
||||
{
|
||||
logerror("disabling SMS Z80\n");
|
||||
m_current_MACHINE_IS_sms = 0;
|
||||
m_current_machine_is_sms = 0;
|
||||
set_genz80_as_md();
|
||||
m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
|
||||
//m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
|
||||
@ -586,18 +577,17 @@ WRITE8_MEMBER(mtech_state::bios_port_7f_w)
|
||||
|
||||
READ8_MEMBER(mtech_state::vdp1_count_r)
|
||||
{
|
||||
address_space &prg = m_bioscpu->space(AS_PROGRAM);
|
||||
if (offset & 0x01)
|
||||
return m_vdp1->hcount_read(prg, offset);
|
||||
return m_vdp1->hcount_read();
|
||||
else
|
||||
return m_vdp1->vcount_read(prg, offset);
|
||||
return m_vdp1->vcount_read();
|
||||
}
|
||||
|
||||
void mtech_state::megatech_bios_portmap(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
map(0x3f, 0x3f).w(FUNC(mtech_state::bios_port_ctrl_w));
|
||||
map(0x7f, 0x7f).w(FUNC(mtech_state::bios_port_7f_w));
|
||||
map(0x7f, 0x7f).w(FUNC(mtech_state::bios_port_7f_w)); // PSG?
|
||||
|
||||
map(0x40, 0x41).mirror(0x3e).r(FUNC(mtech_state::vdp1_count_r));
|
||||
map(0x80, 0x80).mirror(0x3e).rw(m_vdp1, FUNC(sega315_5124_device::data_read), FUNC(sega315_5124_device::data_write));
|
||||
@ -630,7 +620,7 @@ void mtech_state::init_mt_crt()
|
||||
uint32_t mtech_state::screen_update_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
// if we're running an sms game then use the SMS update.. maybe this should be moved to the megadrive emulation core as compatibility mode is a feature of the chip
|
||||
if (!m_current_MACHINE_IS_sms)
|
||||
if (!m_current_machine_is_sms)
|
||||
screen_update_megadriv(screen, bitmap, cliprect);
|
||||
else
|
||||
{
|
||||
@ -652,7 +642,7 @@ uint32_t mtech_state::screen_update_main(screen_device &screen, bitmap_rgb32 &bi
|
||||
|
||||
WRITE_LINE_MEMBER(mtech_state::screen_vblank_main)
|
||||
{
|
||||
if (!m_current_MACHINE_IS_sms)
|
||||
if (!m_current_machine_is_sms)
|
||||
screen_vblank_megadriv(state);
|
||||
}
|
||||
|
||||
@ -696,9 +686,9 @@ MACHINE_CONFIG_START(mtech_state::megatech)
|
||||
md_ntsc(config);
|
||||
|
||||
/* Megatech has an extra SMS based bios *and* an additional screen */
|
||||
MCFG_DEVICE_ADD("mtbios", Z80, MASTER_CLOCK / 15) /* ?? */
|
||||
MCFG_DEVICE_PROGRAM_MAP(megatech_bios_map)
|
||||
MCFG_DEVICE_IO_MAP(megatech_bios_portmap)
|
||||
Z80(config, m_bioscpu, MASTER_CLOCK / 15); /* ?? */
|
||||
m_bioscpu->set_addrmap(AS_PROGRAM, &mtech_state::megatech_bios_map);
|
||||
m_bioscpu->set_addrmap(AS_IO, &mtech_state::megatech_bios_portmap);
|
||||
|
||||
cxd1095_device &io1(CXD1095(config, "io1", 0));
|
||||
io1.in_porta_cb().set_ioport("BIOS_DSW0");
|
||||
@ -733,15 +723,12 @@ MACHINE_CONFIG_START(mtech_state::megatech)
|
||||
sega315_5124_device::HEIGHT_NTSC, sega315_5124_device::TBORDER_START + sega315_5124_device::NTSC_224_TBORDER_HEIGHT, sega315_5124_device::TBORDER_START + sega315_5124_device::NTSC_224_TBORDER_HEIGHT + 224)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(mtech_state, screen_update_menu)
|
||||
|
||||
SEGA315_5246(config, m_vdp1, 0);
|
||||
SEGA315_5246(config, m_vdp1, MASTER_CLOCK / 5); /* ?? */
|
||||
m_vdp1->set_screen("menu");
|
||||
m_vdp1->set_is_pal(false);
|
||||
m_vdp1->irq().set_inputline(m_bioscpu, 0);
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_DEVICE_ADD("sn2", SN76496, MASTER_CLOCK/15)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
|
||||
m_vdp1->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
|
||||
m_vdp1->add_route(ALL_OUTPUTS, "rspeaker", 0.25);
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
@ -308,7 +308,6 @@ GND 8A 8B GND
|
||||
#include "machine/mc8123.h"
|
||||
#include "machine/segacrp2_device.h"
|
||||
#include "machine/upd4701.h"
|
||||
#include "sound/sn76496.h"
|
||||
#include "video/315_5124.h"
|
||||
#include "speaker.h"
|
||||
|
||||
@ -411,8 +410,9 @@ void systeme_state::io_map(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
|
||||
map(0x7b, 0x7b).w("sn1", FUNC(segapsg_device::write));
|
||||
map(0x7e, 0x7f).w("sn2", FUNC(segapsg_device::write));
|
||||
/* TODO : PSG connection correct? */
|
||||
map(0x7b, 0x7b).w(m_vdp1, FUNC(sega315_5124_device::psg_w));
|
||||
map(0x7e, 0x7f).w(m_vdp2, FUNC(sega315_5124_device::psg_w));
|
||||
map(0x7e, 0x7e).r(m_vdp1, FUNC(sega315_5124_device::vcount_read));
|
||||
map(0xba, 0xba).rw(m_vdp1, FUNC(sega315_5124_device::data_read), FUNC(sega315_5124_device::data_write));
|
||||
map(0xbb, 0xbb).rw(m_vdp1, FUNC(sega315_5124_device::control_read), FUNC(sega315_5124_device::control_write));
|
||||
@ -887,9 +887,9 @@ uint32_t systeme_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(systeme_state::systeme)
|
||||
MCFG_DEVICE_ADD("maincpu", Z80, XTAL(10'738'635)/2) /* Z80B @ 5.3693Mhz */
|
||||
MCFG_DEVICE_PROGRAM_MAP(systeme_map)
|
||||
MCFG_DEVICE_IO_MAP(io_map)
|
||||
Z80(config, m_maincpu, XTAL(10'738'635)/2); /* Z80B @ 5.3693Mhz */
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &systeme_state::systeme_map);
|
||||
m_maincpu->set_addrmap(AS_IO, &systeme_state::io_map);
|
||||
|
||||
I8255(config, m_ppi);
|
||||
m_ppi->out_pb_callback().set(FUNC(systeme_state::coin_counters_write));
|
||||
@ -901,23 +901,19 @@ MACHINE_CONFIG_START(systeme_state::systeme)
|
||||
sega315_5124_device::HEIGHT_NTSC, sega315_5124_device::TBORDER_START + sega315_5124_device::NTSC_192_TBORDER_HEIGHT, sega315_5124_device::TBORDER_START + sega315_5124_device::NTSC_192_TBORDER_HEIGHT + 192)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(systeme_state, screen_update)
|
||||
|
||||
SEGA315_5124(config, m_vdp1, 0);
|
||||
m_vdp1->set_is_pal(false);
|
||||
m_vdp1->set_addrmap(0, &systeme_state::vdp1_map);
|
||||
|
||||
SEGA315_5124(config, m_vdp2, 0);
|
||||
m_vdp2->set_is_pal(false);
|
||||
m_vdp2->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp2->set_addrmap(0, &systeme_state::vdp2_map);
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
MCFG_DEVICE_ADD("sn1", SEGAPSG, XTAL(10'738'635)/3)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
SEGA315_5124(config, m_vdp1, XTAL(10'738'635));
|
||||
m_vdp1->set_is_pal(false);
|
||||
m_vdp1->set_addrmap(0, &systeme_state::vdp1_map);
|
||||
m_vdp1->add_route(ALL_OUTPUTS, "mono", 0.50);
|
||||
|
||||
MCFG_DEVICE_ADD("sn2", SEGAPSG, XTAL(10'738'635)/3)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
SEGA315_5124(config, m_vdp2, XTAL(10'738'635));
|
||||
m_vdp2->set_is_pal(false);
|
||||
m_vdp2->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp2->set_addrmap(0, &systeme_state::vdp2_map);
|
||||
m_vdp2->add_route(ALL_OUTPUTS, "mono", 0.50);
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
void systeme_state::hangonjr(machine_config &config)
|
||||
@ -944,13 +940,14 @@ void systeme_state::ridleofp(machine_config &config)
|
||||
ppi.out_pc_callback().append("upd4701", FUNC(upd4701_device::resety_w)).bit(0); // or possibly bit 1
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(systeme_state::systemex)
|
||||
void systeme_state::systemex(machine_config &config)
|
||||
{
|
||||
systeme(config);
|
||||
MCFG_DEVICE_REPLACE("maincpu", MC8123, XTAL(10'738'635)/2) /* Z80B @ 5.3693Mhz */
|
||||
MCFG_DEVICE_PROGRAM_MAP(systeme_map)
|
||||
MCFG_DEVICE_IO_MAP(io_map)
|
||||
MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
|
||||
MACHINE_CONFIG_END
|
||||
mc8123_device &maincpu(MC8123(config.replace(), m_maincpu, XTAL(10'738'635)/2)); /* Z80B @ 5.3693Mhz */
|
||||
maincpu.set_addrmap(AS_PROGRAM, &systeme_state::systeme_map);
|
||||
maincpu.set_addrmap(AS_IO, &systeme_state::io_map);
|
||||
maincpu.set_addrmap(AS_OPCODES, &systeme_state::decrypted_opcodes_map);
|
||||
}
|
||||
|
||||
void systeme_state::systemex_315_5177(machine_config &config)
|
||||
{
|
||||
@ -962,13 +959,14 @@ void systeme_state::systemex_315_5177(machine_config &config)
|
||||
maincpu.set_decrypted_tag(m_decrypted_opcodes);
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(systeme_state::systemeb)
|
||||
void systeme_state::systemeb(machine_config &config)
|
||||
{
|
||||
systeme(config);
|
||||
MCFG_DEVICE_REPLACE("maincpu", MC8123, XTAL(10'738'635)/2) /* Z80B @ 5.3693Mhz */
|
||||
MCFG_DEVICE_PROGRAM_MAP(systeme_map)
|
||||
MCFG_DEVICE_IO_MAP(io_map)
|
||||
MCFG_DEVICE_OPCODES_MAP(banked_decrypted_opcodes_map)
|
||||
MACHINE_CONFIG_END
|
||||
mc8123_device &maincpu(MC8123(config.replace(), m_maincpu, XTAL(10'738'635)/2)); /* Z80B @ 5.3693Mhz */
|
||||
maincpu.set_addrmap(AS_PROGRAM, &systeme_state::systeme_map);
|
||||
maincpu.set_addrmap(AS_IO, &systeme_state::io_map);
|
||||
maincpu.set_addrmap(AS_OPCODES, &systeme_state::banked_decrypted_opcodes_map);
|
||||
}
|
||||
|
||||
|
||||
void systeme_state::init_opaopa()
|
||||
|
@ -301,7 +301,7 @@ void sms_state::sg1000m3_io(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
map.unmap_value_high();
|
||||
map(0x40, 0x7f).rw(FUNC(sms_state::sms_count_r), FUNC(sms_state::sms_psg_w));
|
||||
map(0x40, 0x7f).r(FUNC(sms_state::sms_count_r)).w(m_vdp, FUNC(sega315_5124_device::psg_w));
|
||||
map(0x80, 0x80).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::data_read), FUNC(sega315_5124_device::data_write));
|
||||
map(0x81, 0x81).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::control_read), FUNC(sega315_5124_device::control_write));
|
||||
map(0xc0, 0xc7).mirror(0x38).rw(FUNC(sms_state::sg1000m3_peripheral_r), FUNC(sms_state::sg1000m3_peripheral_w));
|
||||
@ -313,7 +313,7 @@ void sms_state::sms_io(address_map &map)
|
||||
map.unmap_value_high();
|
||||
map(0x00, 0x00).mirror(0x3e).w(FUNC(sms_state::sms_mem_control_w));
|
||||
map(0x01, 0x01).mirror(0x3e).w(FUNC(sms_state::sms_io_control_w));
|
||||
map(0x40, 0x7f).rw(FUNC(sms_state::sms_count_r), FUNC(sms_state::sms_psg_w));
|
||||
map(0x40, 0x7f).r(FUNC(sms_state::sms_count_r)).w(m_vdp, FUNC(sega315_5124_device::psg_w));
|
||||
map(0x80, 0x80).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::data_read), FUNC(sega315_5124_device::data_write));
|
||||
map(0x81, 0x81).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::control_read), FUNC(sega315_5124_device::control_write));
|
||||
map(0xc0, 0xc0).mirror(0x3e).r(FUNC(sms_state::sms_input_port_dc_r));
|
||||
@ -331,7 +331,7 @@ void sms_state::smskr_io(address_map &map)
|
||||
map.unmap_value_high();
|
||||
map(0x3e, 0x3e).w(FUNC(sms_state::sms_mem_control_w));
|
||||
map(0x3f, 0x3f).w(FUNC(sms_state::sms_io_control_w));
|
||||
map(0x40, 0x7f).rw(FUNC(sms_state::sms_count_r), FUNC(sms_state::sms_psg_w));
|
||||
map(0x40, 0x7f).r(FUNC(sms_state::sms_count_r)).w(m_vdp, FUNC(sega315_5124_device::psg_w));
|
||||
map(0x80, 0x80).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::data_read), FUNC(sega315_5124_device::data_write));
|
||||
map(0x81, 0x81).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::control_read), FUNC(sega315_5124_device::control_write));
|
||||
map(0xc0, 0xc0).mirror(0x3e).r(FUNC(sms_state::sms_input_port_dc_r));
|
||||
@ -347,7 +347,7 @@ void sms_state::smsj_io(address_map &map)
|
||||
map.unmap_value_high();
|
||||
map(0x3e, 0x3e).w(FUNC(sms_state::sms_mem_control_w));
|
||||
map(0x3f, 0x3f).w(FUNC(sms_state::sms_io_control_w));
|
||||
map(0x40, 0x7f).rw(FUNC(sms_state::sms_count_r), FUNC(sms_state::sms_psg_w));
|
||||
map(0x40, 0x7f).r(FUNC(sms_state::sms_count_r)).w(m_vdp, FUNC(sega315_5124_device::psg_w));
|
||||
map(0x80, 0x80).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::data_read), FUNC(sega315_5124_device::data_write));
|
||||
map(0x81, 0x81).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::control_read), FUNC(sega315_5124_device::control_write));
|
||||
map(0xc0, 0xc0).r(FUNC(sms_state::sms_input_port_dc_r));
|
||||
@ -371,7 +371,7 @@ void sms_state::gg_io(address_map &map)
|
||||
map(0x06, 0x06).w(FUNC(sms_state::gg_psg_stereo_w));
|
||||
map(0x3e, 0x3e).w(FUNC(sms_state::sms_mem_control_w));
|
||||
map(0x3f, 0x3f).w(FUNC(sms_state::sms_io_control_w));
|
||||
map(0x40, 0x7f).rw(FUNC(sms_state::sms_count_r), FUNC(sms_state::gg_psg_w));
|
||||
map(0x40, 0x7f).r(FUNC(sms_state::sms_count_r)).w(m_vdp, FUNC(sega315_5124_device::psg_w));
|
||||
map(0x80, 0x80).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::data_read), FUNC(sega315_5124_device::data_write));
|
||||
map(0x81, 0x81).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::control_read), FUNC(sega315_5124_device::control_write));
|
||||
map(0xc0, 0xc0).r(FUNC(sms_state::sms_input_port_dc_r));
|
||||
@ -512,15 +512,11 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sms_state::sms_ntsc_base)
|
||||
sms_base(config);
|
||||
MCFG_DEVICE_ADD("maincpu", Z80, XTAL(10'738'635)/3)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms_mem)
|
||||
MCFG_DEVICE_IO_MAP(sms_io)
|
||||
Z80(config, m_maincpu, XTAL(10'738'635)/3);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &sms_state::sms_io);
|
||||
|
||||
config.m_minimum_quantum = attotime::from_hz(60);
|
||||
|
||||
/* actually, PSG is embedded in the VDP chip */
|
||||
MCFG_DEVICE_ADD("segapsg", SEGAPSG, XTAL(10'738'635)/3)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*
|
||||
@ -578,11 +574,12 @@ MACHINE_CONFIG_START(sms_state::sms2_ntsc)
|
||||
MCFG_SCREEN_SMS_NTSC_RAW_PARAMS(XTAL(10'738'635)/2)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms)
|
||||
|
||||
SEGA315_5246(config, m_vdp, 0);
|
||||
SEGA315_5246(config, m_vdp, XTAL(10'738'635));
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(false);
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(ALL_OUTPUTS, "mono", 1.00);
|
||||
|
||||
m_has_bios_full = true;
|
||||
MACHINE_CONFIG_END
|
||||
@ -591,8 +588,7 @@ MACHINE_CONFIG_END
|
||||
MACHINE_CONFIG_START(sms_state::sms1_ntsc)
|
||||
sms_ntsc_base(config);
|
||||
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms1_mem) // This adds the SegaScope handlers for 3-D glasses
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms1_mem); // This adds the SegaScope handlers for 3-D glasses
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
@ -614,11 +610,12 @@ MACHINE_CONFIG_START(sms_state::sms1_ntsc)
|
||||
MCFG_VIDEO_START_OVERRIDE(sms_state,sms1)
|
||||
MCFG_VIDEO_RESET_OVERRIDE(sms_state,sms1)
|
||||
|
||||
SEGA315_5124(config, m_vdp, 0);
|
||||
SEGA315_5124(config, m_vdp, XTAL(10'738'635));
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(false);
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(ALL_OUTPUTS, "mono", 1.00);
|
||||
|
||||
// card and expansion slots, not present in Master System II
|
||||
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
|
||||
@ -633,10 +630,10 @@ MACHINE_CONFIG_START(smssdisp_state::sms_sdisp)
|
||||
|
||||
m_vdp->irq().set(FUNC(smssdisp_state::sms_store_int_callback));
|
||||
|
||||
MCFG_DEVICE_ADD("control", Z80, XTAL(10'738'635)/3)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms_store_mem)
|
||||
Z80(config, m_control_cpu, XTAL(10'738'635)/3);
|
||||
m_control_cpu->set_addrmap(AS_PROGRAM, &smssdisp_state::sms_store_mem);
|
||||
/* Both CPUs seem to communicate with the VDP etc? */
|
||||
MCFG_DEVICE_IO_MAP(sms_io)
|
||||
m_control_cpu->set_addrmap(AS_IO, &smssdisp_state::sms_io);
|
||||
|
||||
config.device_remove("mycard");
|
||||
config.device_remove("smsexp");
|
||||
@ -682,15 +679,11 @@ MACHINE_CONFIG_END
|
||||
MACHINE_CONFIG_START(sms_state::sms_pal_base)
|
||||
sms_base(config);
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK_PAL/15)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms_mem)
|
||||
MCFG_DEVICE_IO_MAP(sms_io)
|
||||
Z80(config, m_maincpu, MASTER_CLOCK_PAL/15);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &sms_state::sms_io);
|
||||
|
||||
config.m_minimum_quantum = attotime::from_hz(50);
|
||||
|
||||
/* actually, PSG is embedded in the VDP chip */
|
||||
MCFG_DEVICE_ADD("segapsg", SEGAPSG, MASTER_CLOCK_PAL/15)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sms_state::sms2_pal)
|
||||
@ -701,11 +694,12 @@ MACHINE_CONFIG_START(sms_state::sms2_pal)
|
||||
MCFG_SCREEN_SMS_PAL_RAW_PARAMS(MASTER_CLOCK_PAL/10)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms)
|
||||
|
||||
SEGA315_5246(config, m_vdp, 0);
|
||||
SEGA315_5246(config, m_vdp, MASTER_CLOCK_PAL/5);
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(true);
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(ALL_OUTPUTS, "mono", 1.00);
|
||||
|
||||
m_has_bios_full = true;
|
||||
MACHINE_CONFIG_END
|
||||
@ -713,8 +707,7 @@ MACHINE_CONFIG_END
|
||||
MACHINE_CONFIG_START(sms_state::sms1_pal)
|
||||
sms_pal_base(config);
|
||||
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms1_mem) // This adds the SegaScope handlers for 3-D glasses
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms1_mem); // This adds the SegaScope handlers for 3-D glasses
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
@ -736,11 +729,12 @@ MACHINE_CONFIG_START(sms_state::sms1_pal)
|
||||
MCFG_VIDEO_START_OVERRIDE(sms_state,sms1)
|
||||
MCFG_VIDEO_RESET_OVERRIDE(sms_state,sms1)
|
||||
|
||||
SEGA315_5124(config, m_vdp, 0);
|
||||
SEGA315_5124(config, m_vdp, MASTER_CLOCK_PAL/5);
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(true);
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(ALL_OUTPUTS, "mono", 1.00);
|
||||
|
||||
// card and expansion slots, not present in Master System II
|
||||
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
|
||||
@ -754,15 +748,11 @@ MACHINE_CONFIG_END
|
||||
MACHINE_CONFIG_START(sms_state::sms_paln_base)
|
||||
sms_base(config);
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK_PALN/3)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms_mem)
|
||||
MCFG_DEVICE_IO_MAP(sms_io)
|
||||
Z80(config, m_maincpu, MASTER_CLOCK_PALN/3);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &sms_state::sms_io);
|
||||
|
||||
config.m_minimum_quantum = attotime::from_hz(50);
|
||||
|
||||
/* actually, PSG is embedded in the VDP chip */
|
||||
MCFG_DEVICE_ADD("segapsg", SEGAPSG, MASTER_CLOCK_PALN/3)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sms_state::sms3_paln)
|
||||
@ -773,11 +763,12 @@ MACHINE_CONFIG_START(sms_state::sms3_paln)
|
||||
MCFG_SCREEN_SMS_PAL_RAW_PARAMS(MASTER_CLOCK_PALN/2)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms)
|
||||
|
||||
SEGA315_5246(config, m_vdp, 0);
|
||||
SEGA315_5246(config, m_vdp, MASTER_CLOCK_PALN);
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(true);
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(ALL_OUTPUTS, "mono", 1.00);
|
||||
|
||||
m_has_bios_full = true;
|
||||
MACHINE_CONFIG_END
|
||||
@ -785,8 +776,7 @@ MACHINE_CONFIG_END
|
||||
MACHINE_CONFIG_START(sms_state::sms1_paln)
|
||||
sms_paln_base(config);
|
||||
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms1_mem) // This adds the SegaScope handlers for 3-D glasses
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms1_mem); // This adds the SegaScope handlers for 3-D glasses
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
@ -808,11 +798,12 @@ MACHINE_CONFIG_START(sms_state::sms1_paln)
|
||||
MCFG_VIDEO_START_OVERRIDE(sms_state,sms1)
|
||||
MCFG_VIDEO_RESET_OVERRIDE(sms_state,sms1)
|
||||
|
||||
SEGA315_5124(config, m_vdp, 0);
|
||||
SEGA315_5124(config, m_vdp, MASTER_CLOCK_PALN);
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(true);
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(ALL_OUTPUTS, "mono", 1.00);
|
||||
|
||||
// card and expansion slots, not present in Tec Toy Master System III
|
||||
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
|
||||
@ -826,16 +817,12 @@ MACHINE_CONFIG_END
|
||||
MACHINE_CONFIG_START(sms_state::sms_br_base)
|
||||
sms_base(config);
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK_PALM/3)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms_mem)
|
||||
MCFG_DEVICE_IO_MAP(sms_io)
|
||||
Z80(config, m_maincpu, MASTER_CLOCK_PALM/3);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &sms_state::sms_io);
|
||||
|
||||
// PAL-M has near the same frequency of NTSC
|
||||
config.m_minimum_quantum = attotime::from_hz(60);
|
||||
|
||||
/* actually, PSG is embedded in the VDP chip */
|
||||
MCFG_DEVICE_ADD("segapsg", SEGAPSG, MASTER_CLOCK_PALM/3)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sms_state::sms3_br)
|
||||
@ -846,11 +833,12 @@ MACHINE_CONFIG_START(sms_state::sms3_br)
|
||||
MCFG_SCREEN_SMS_NTSC_RAW_PARAMS(MASTER_CLOCK_PALM/2)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms)
|
||||
|
||||
SEGA315_5246(config, m_vdp, 0);
|
||||
SEGA315_5246(config, m_vdp, MASTER_CLOCK_PALM);
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(false); // PAL-M has same line count of NTSC
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(ALL_OUTPUTS, "mono", 1.00);
|
||||
|
||||
m_has_bios_full = true;
|
||||
MACHINE_CONFIG_END
|
||||
@ -858,8 +846,7 @@ MACHINE_CONFIG_END
|
||||
MACHINE_CONFIG_START(sms_state::sms1_br)
|
||||
sms_br_base(config);
|
||||
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms1_mem) // This adds the SegaScope handlers for 3-D glasses
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms1_mem); // This adds the SegaScope handlers for 3-D glasses
|
||||
|
||||
/* video hardware */
|
||||
// PAL-M height/width parameters are the same of NTSC screens.
|
||||
@ -882,11 +869,12 @@ MACHINE_CONFIG_START(sms_state::sms1_br)
|
||||
MCFG_VIDEO_START_OVERRIDE(sms_state,sms1)
|
||||
MCFG_VIDEO_RESET_OVERRIDE(sms_state,sms1)
|
||||
|
||||
SEGA315_5124(config, m_vdp, 0);
|
||||
SEGA315_5124(config, m_vdp, MASTER_CLOCK_PALM);
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(false); // PAL-M has same line count of NTSC
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(ALL_OUTPUTS, "mono", 1.00);
|
||||
|
||||
// card and expansion slots, not present in Tec Toy Master System III
|
||||
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
|
||||
@ -899,8 +887,8 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sms_state::sms2_kr)
|
||||
sms2_ntsc(config);
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_IO_MAP(smskr_io)
|
||||
|
||||
m_maincpu->set_addrmap(AS_IO, &sms_state::smskr_io);
|
||||
|
||||
config.device_remove("slot");
|
||||
MCFG_SG1000MK3_CARTRIDGE_ADD("slot", sg1000mk3_cart, nullptr)
|
||||
@ -912,8 +900,8 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sms_state::sms1_kr)
|
||||
sms1_ntsc(config);
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_IO_MAP(smskr_io)
|
||||
|
||||
m_maincpu->set_addrmap(AS_IO, &sms_state::smskr_io);
|
||||
|
||||
// need to replace the cartridge slot with the Japanese version, so to
|
||||
// keep the usual media order, remove and reinsert all of them.
|
||||
@ -936,8 +924,8 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sms_state::smsj)
|
||||
sms1_kr(config);
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_IO_MAP(smsj_io)
|
||||
|
||||
m_maincpu->set_addrmap(AS_IO, &sms_state::smsj_io);
|
||||
|
||||
MCFG_DEVICE_ADD("ym2413", YM2413, XTAL(10'738'635)/3)
|
||||
// if this output gain is changed, the gain set when unmute the output need
|
||||
@ -949,8 +937,8 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sms_state::sg1000m3)
|
||||
sms1_ntsc(config);
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_IO_MAP(sg1000m3_io)
|
||||
|
||||
m_maincpu->set_addrmap(AS_IO, &sms_state::sg1000m3_io);
|
||||
|
||||
// Remove and reinsert all media slots, as done with the sms1_kr config,
|
||||
// and also replace the expansion slot with the SG-1000 version.
|
||||
@ -974,9 +962,9 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sms_state::gamegear)
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK_GG/9)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms_mem)
|
||||
MCFG_DEVICE_IO_MAP(gg_io)
|
||||
Z80(config, m_maincpu, MASTER_CLOCK_GG/9);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &sms_state::gg_io);
|
||||
|
||||
config.m_minimum_quantum = attotime::from_hz(60);
|
||||
|
||||
@ -988,21 +976,18 @@ MACHINE_CONFIG_START(sms_state::gamegear)
|
||||
MCFG_VIDEO_START_OVERRIDE(sms_state,gamegear)
|
||||
MCFG_VIDEO_RESET_OVERRIDE(sms_state,gamegear)
|
||||
|
||||
/* VDP chip of the Gamegear 2 ASIC version */
|
||||
SEGA315_5377(config, m_vdp, 0);
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(false);
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "lspeaker").front_left();
|
||||
SPEAKER(config, "rspeaker").front_right();
|
||||
|
||||
/* actually, PSG is embedded in the VDP chip */
|
||||
MCFG_DEVICE_ADD("gamegear", GAMEGEAR, MASTER_CLOCK_GG/9)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
|
||||
/* VDP chip of the Gamegear 2 ASIC version */
|
||||
SEGA315_5377(config, m_vdp, MASTER_CLOCK_GG/3);
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(false);
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(0, "lspeaker", 1.00);
|
||||
m_vdp->add_route(1, "rspeaker", 1.00);
|
||||
|
||||
/* cartridge */
|
||||
MCFG_GG_CARTRIDGE_ADD("slot", gg_cart, nullptr)
|
||||
|
@ -264,7 +264,7 @@ void smsbootleg_state::sms_supergame_io(address_map &map)
|
||||
map(0x14, 0x14).nopr(); //AM_READ_PORT("IN1") // seem to be from a coinage / timer MCU, changing them directly changes the credits / time value
|
||||
map(0x18, 0x18).w(FUNC(smsbootleg_state::port18_w));
|
||||
|
||||
map(0x40, 0x7f).rw(FUNC(smsbootleg_state::sms_count_r), FUNC(smsbootleg_state::sms_psg_w));
|
||||
map(0x40, 0x7f).r(FUNC(smsbootleg_state::sms_count_r)).w(m_vdp, FUNC(sega315_5124_device::psg_w));
|
||||
map(0x80, 0x80).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::data_read), FUNC(sega315_5124_device::data_write));
|
||||
map(0x81, 0x81).mirror(0x3e).rw(m_vdp, FUNC(sega315_5124_device::control_read), FUNC(sega315_5124_device::control_write));
|
||||
|
||||
@ -275,18 +275,15 @@ void smsbootleg_state::sms_supergame_io(address_map &map)
|
||||
|
||||
MACHINE_CONFIG_START(smsbootleg_state::sms_supergame)
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("maincpu", Z80, XTAL(10'738'635)/3)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sms_supergame_map)
|
||||
MCFG_DEVICE_IO_MAP(sms_supergame_io)
|
||||
Z80(config, m_maincpu, XTAL(10'738'635)/3);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &smsbootleg_state::sms_supergame_map);
|
||||
m_maincpu->set_addrmap(AS_IO, &smsbootleg_state::sms_supergame_io);
|
||||
|
||||
config.m_minimum_quantum = attotime::from_hz(60);
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
MCFG_DEVICE_ADD("segapsg", SEGAPSG, XTAL(10'738'635)/3)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(XTAL(10'738'635)/2, \
|
||||
sega315_5124_device::WIDTH , sega315_5124_device::LBORDER_START + sega315_5124_device::LBORDER_WIDTH - 2, sega315_5124_device::LBORDER_START + sega315_5124_device::LBORDER_WIDTH + 256 + 10, \
|
||||
@ -294,11 +291,12 @@ MACHINE_CONFIG_START(smsbootleg_state::sms_supergame)
|
||||
MCFG_SCREEN_REFRESH_RATE(XTAL(10'738'635)/2 / (sega315_5124_device::WIDTH * sega315_5124_device::HEIGHT_NTSC))
|
||||
MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms)
|
||||
|
||||
SEGA315_5246(config, m_vdp, 0);
|
||||
SEGA315_5246(config, m_vdp, XTAL(10'738'635));
|
||||
m_vdp->set_screen(m_main_scr);
|
||||
m_vdp->set_is_pal(false);
|
||||
m_vdp->irq().set_inputline(m_maincpu, 0);
|
||||
m_vdp->pause().set(FUNC(sms_state::sms_pause_callback));
|
||||
m_vdp->add_route(ALL_OUTPUTS, "mono", 1.00);
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "bus/sg1000_exp/sg1000exp.h"
|
||||
#include "bus/sms_ctrl/smsctrl.h"
|
||||
#include "bus/sms_exp/smsexp.h"
|
||||
#include "sound/sn76496.h"
|
||||
#include "sound/ym2413.h"
|
||||
#include "video/315_5124.h"
|
||||
|
||||
@ -41,8 +40,6 @@ public:
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_vdp(*this, "sms_vdp"),
|
||||
m_main_scr(*this, "screen"),
|
||||
m_psg_sms(*this, "segapsg"),
|
||||
m_psg_gg(*this, "gamegear"),
|
||||
m_ym(*this, "ym2413"),
|
||||
m_port_ctrl1(*this, CONTROL1_TAG),
|
||||
m_port_ctrl2(*this, CONTROL2_TAG),
|
||||
@ -121,8 +118,6 @@ protected:
|
||||
DECLARE_READ8_MEMBER(gg_sio_r);
|
||||
DECLARE_WRITE8_MEMBER(gg_sio_w);
|
||||
DECLARE_WRITE8_MEMBER(gg_psg_stereo_w);
|
||||
DECLARE_WRITE8_MEMBER(gg_psg_w);
|
||||
DECLARE_WRITE8_MEMBER(sms_psg_w);
|
||||
DECLARE_READ8_MEMBER(smsj_audio_control_r);
|
||||
DECLARE_WRITE8_MEMBER(smsj_audio_control_w);
|
||||
DECLARE_WRITE8_MEMBER(smsj_ym2413_register_port_w);
|
||||
@ -170,8 +165,6 @@ protected:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<sega315_5124_device> m_vdp;
|
||||
required_device<screen_device> m_main_scr;
|
||||
optional_device<segapsg_device> m_psg_sms;
|
||||
optional_device<gamegear_device> m_psg_gg;
|
||||
optional_device<ym2413_device> m_ym;
|
||||
optional_device<sms_control_port_device> m_port_ctrl1;
|
||||
optional_device<sms_control_port_device> m_port_ctrl2;
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include "emu.h"
|
||||
#include "crsshair.h"
|
||||
#include "video/315_5124.h"
|
||||
#include "sound/sn76496.h"
|
||||
#include "sound/ym2413.h"
|
||||
#include "includes/sms.h"
|
||||
|
||||
@ -203,9 +202,9 @@ WRITE8_MEMBER(sms_state::sms_io_control_w)
|
||||
READ8_MEMBER(sms_state::sms_count_r)
|
||||
{
|
||||
if (offset & 0x01)
|
||||
return m_vdp->hcount_read(*m_space, offset);
|
||||
return m_vdp->hcount_read();
|
||||
else
|
||||
return m_vdp->vcount_read(*m_space, offset);
|
||||
return m_vdp->vcount_read();
|
||||
}
|
||||
|
||||
|
||||
@ -467,9 +466,9 @@ void sms_state::smsj_set_audio_control(uint8_t data)
|
||||
1,1 : Both PSG and FM enabled
|
||||
*/
|
||||
if (m_smsj_audio_control == 0x00 || m_smsj_audio_control == 0x03)
|
||||
m_psg_sms->set_output_gain(ALL_OUTPUTS, 1.0);
|
||||
m_vdp->set_output_gain(ALL_OUTPUTS, 1.0);
|
||||
else
|
||||
m_psg_sms->set_output_gain(ALL_OUTPUTS, 0.0);
|
||||
m_vdp->set_output_gain(ALL_OUTPUTS, 0.0);
|
||||
|
||||
if (m_smsj_audio_control == 0x01 || m_smsj_audio_control == 0x03)
|
||||
m_ym->set_output_gain(ALL_OUTPUTS, 1.0);
|
||||
@ -526,24 +525,12 @@ WRITE8_MEMBER(sms_state::smsj_ym2413_data_port_w)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::sms_psg_w)
|
||||
{
|
||||
m_psg_sms->write(data);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::gg_psg_w)
|
||||
{
|
||||
m_psg_gg->write(data);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::gg_psg_stereo_w)
|
||||
{
|
||||
if (m_cartslot->exists() && m_cartslot->get_sms_mode())
|
||||
return;
|
||||
|
||||
m_psg_gg->stereo_w(data);
|
||||
m_vdp->psg_stereo_w(data);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user