pentagon.c: get to work all raster effects (nw)

This commit is contained in:
MetalliC 2015-06-04 20:55:45 +03:00
parent 1c92d1000f
commit b47963e5a2
3 changed files with 26 additions and 3 deletions

View File

@ -29,6 +29,8 @@ public:
DECLARE_DIRECT_UPDATE_MEMBER(pentagon_direct);
DECLARE_WRITE8_MEMBER(pentagon_port_7ffd_w);
DECLARE_WRITE8_MEMBER(pentagon_scr_w);
DECLARE_WRITE8_MEMBER(pentagon_scr2_w);
DECLARE_MACHINE_RESET(pentagon);
INTERRUPT_GEN_MEMBER(pentagon_interrupt);
TIMER_CALLBACK_MEMBER(irq_on);
@ -132,6 +134,21 @@ WRITE8_MEMBER(pentagon_state::pentagon_port_7ffd_w)
pentagon_update_memory();
}
WRITE8_MEMBER(pentagon_state::pentagon_scr_w)
{
spectrum_UpdateScreenBitmap();
*((UINT8*)m_bank2->base() + offset) = data;
}
WRITE8_MEMBER(pentagon_state::pentagon_scr2_w)
{
if ((m_port_7ffd_data & 0x0f) == 0x0f || (m_port_7ffd_data & 0x0f) == 5)
spectrum_UpdateScreenBitmap();
*((UINT8*)m_bank4->base() + offset) = data;
}
void pentagon_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch (id)
@ -184,6 +201,9 @@ MACHINE_RESET_MEMBER(pentagon_state,pentagon)
space.install_read_bank(0x0000, 0x3fff, "bank1");
space.unmap_write(0x0000, 0x3fff);
space.install_write_handler(0x4000, 0x5aff, write8_delegate(FUNC(pentagon_state::pentagon_scr_w), this));
space.install_write_handler(0xc000, 0xdaff, write8_delegate(FUNC(pentagon_state::pentagon_scr2_w), this));
if (m_beta->started())
{
if (strcmp(machine().system().name, "pent1024")==0)

View File

@ -238,7 +238,7 @@ protected:
optional_ioport m_io_plus4;
void spectrum_UpdateBorderBitmap();
void spectrum_UpdateScreenBitmap();
void spectrum_UpdateScreenBitmap(bool eof = false);
inline unsigned char get_display_color(unsigned char color, int invert);
inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color);
void ts2068_hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines);

View File

@ -71,7 +71,7 @@ void spectrum_state::screen_eof_spectrum(screen_device &screen, bool state)
if (state)
{
spectrum_UpdateBorderBitmap();
spectrum_UpdateScreenBitmap();
spectrum_UpdateScreenBitmap(true);
m_frame_number++;
@ -198,7 +198,7 @@ PALETTE_INIT_MEMBER(spectrum_state,spectrum)
palette.set_pen_colors(0, spectrum_palette, ARRAY_LENGTH(spectrum_palette));
}
void spectrum_state::spectrum_UpdateScreenBitmap()
void spectrum_state::spectrum_UpdateScreenBitmap(bool eof)
{
unsigned int x = machine().first_screen()->hpos();
unsigned int y = machine().first_screen()->vpos();
@ -206,6 +206,9 @@ void spectrum_state::spectrum_UpdateScreenBitmap()
int height = m_screen_bitmap.height();
if ((m_previous_screen_x == x) && (m_previous_screen_y == y) && !eof)
return;
if (m_screen_bitmap.valid())
{
//printf("update screen from %d,%d to %d,%d\n", m_previous_screen_x, m_previous_screen_y, x, y);