more state cleanup and some modernization (nw)

This commit is contained in:
Miodrag Milanovic 2013-04-19 07:20:14 +00:00
parent 2b291b19f2
commit abedd24d6e
18 changed files with 263 additions and 249 deletions

View File

@ -203,9 +203,9 @@ void wd33c93_device::complete_immediate( int status )
regs[WD_AUXILIARY_STATUS] &= ~(ASR_CIP | ASR_BSY); regs[WD_AUXILIARY_STATUS] &= ~(ASR_CIP | ASR_BSY);
/* if we have a callback, call it */ /* if we have a callback, call it */
if (irq_callback) if (!m_irq_func.isnull())
{ {
irq_callback(machine(), 1); m_irq_func(1);
} }
} }
@ -641,9 +641,9 @@ READ8_MEMBER(wd33c93_device::read)
{ {
regs[WD_AUXILIARY_STATUS] &= ~ASR_INT; regs[WD_AUXILIARY_STATUS] &= ~ASR_INT;
if (irq_callback) if (!m_irq_func.isnull())
{ {
irq_callback(machine(), 0); m_irq_func(0);
} }
LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", space.device().safe_pc(), regs[WD_SCSI_STATUS] )); LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", space.device().safe_pc(), regs[WD_SCSI_STATUS] ));
@ -777,6 +777,7 @@ void wd33c93_device::device_start()
devices[scsidev->GetDeviceID()] = scsidev; devices[scsidev->GetDeviceID()] = scsidev;
} }
} }
m_irq_func.resolve(m_irq_cb, *this);
/* allocate a timer for commands */ /* allocate a timer for commands */
cmd_timer = timer_alloc(0); cmd_timer = timer_alloc(0);

View File

@ -10,7 +10,7 @@
struct WD33C93interface struct WD33C93interface
{ {
void (*irq_callback)(running_machine &machine, int state); /* irq callback */ devcb_write_line m_irq_cb; /* irq callback */
}; };
/* wd register names */ /* wd register names */
@ -107,6 +107,7 @@ private:
emu_timer *cmd_timer; emu_timer *cmd_timer;
emu_timer *service_req_timer; emu_timer *service_req_timer;
emu_timer *deassert_cip_timer; emu_timer *deassert_cip_timer;
devcb_resolved_write_line m_irq_func;
}; };
// device type definition // device type definition

View File

@ -2245,7 +2245,7 @@ INTERRUPT_GEN_MEMBER(cps3_state::cps3_other_interrupt)
static const struct WD33C93interface wd33c93_intf = static const struct WD33C93interface wd33c93_intf =
{ {
NULL /* command completion IRQ */ DEVCB_NULL /* command completion IRQ */
}; };
void cps3_state::machine_reset() void cps3_state::machine_reset()

View File

@ -53,7 +53,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level,
#define BPPMODE_TFT_08 0x0B #define BPPMODE_TFT_08 0x0B
#define BPPMODE_TFT_16 0x0C #define BPPMODE_TFT_16 0x0C
static rgb_t s3c240x_get_color_5551( UINT16 data) inline rgb_t gp32_state::s3c240x_get_color_5551( UINT16 data)
{ {
UINT8 r, g, b, i; UINT8 r, g, b, i;
r = BITS( data, 15, 11) << 3; r = BITS( data, 15, 11) << 3;
@ -83,27 +83,26 @@ void gp32_state::s3c240x_lcd_dma_init()
m_s3c240x_lcd.hozval = BITS( m_s3c240x_lcd_regs[2], 18, 8); m_s3c240x_lcd.hozval = BITS( m_s3c240x_lcd_regs[2], 18, 8);
} }
static UINT32 s3c240x_lcd_dma_read( running_machine &machine) UINT32 gp32_state::s3c240x_lcd_dma_read( )
{ {
gp32_state *state = machine.driver_data<gp32_state>();
UINT8 *vram, data[4]; UINT8 *vram, data[4];
int i; int i;
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
vram = (UINT8 *)state->m_s3c240x_ram.target() + state->m_s3c240x_lcd.vramaddr_cur - 0x0C000000; vram = (UINT8 *)m_s3c240x_ram.target() + m_s3c240x_lcd.vramaddr_cur - 0x0C000000;
data[i*2+0] = vram[0]; data[i*2+0] = vram[0];
data[i*2+1] = vram[1]; data[i*2+1] = vram[1];
state->m_s3c240x_lcd.vramaddr_cur += 2; m_s3c240x_lcd.vramaddr_cur += 2;
state->m_s3c240x_lcd.pagewidth_cur++; m_s3c240x_lcd.pagewidth_cur++;
if (state->m_s3c240x_lcd.pagewidth_cur >= state->m_s3c240x_lcd.pagewidth_max) if (m_s3c240x_lcd.pagewidth_cur >= m_s3c240x_lcd.pagewidth_max)
{ {
state->m_s3c240x_lcd.vramaddr_cur += state->m_s3c240x_lcd.offsize << 1; m_s3c240x_lcd.vramaddr_cur += m_s3c240x_lcd.offsize << 1;
state->m_s3c240x_lcd.pagewidth_cur = 0; m_s3c240x_lcd.pagewidth_cur = 0;
} }
} }
if (state->m_s3c240x_lcd.hwswp == 0) if (m_s3c240x_lcd.hwswp == 0)
{ {
if (state->m_s3c240x_lcd.bswp == 0) if (m_s3c240x_lcd.bswp == 0)
{ {
return (data[3] << 24) | (data[2] << 16) | (data[1] << 8) | (data[0] << 0); return (data[3] << 24) | (data[2] << 16) | (data[1] << 8) | (data[0] << 0);
} }
@ -114,7 +113,7 @@ static UINT32 s3c240x_lcd_dma_read( running_machine &machine)
} }
else else
{ {
if (state->m_s3c240x_lcd.bswp == 0) if (m_s3c240x_lcd.bswp == 0)
{ {
return (data[1] << 24) | (data[0] << 16) | (data[3] << 8) | (data[2] << 0); return (data[1] << 24) | (data[0] << 16) | (data[3] << 8) | (data[2] << 0);
} }
@ -125,121 +124,116 @@ static UINT32 s3c240x_lcd_dma_read( running_machine &machine)
} }
} }
static void s3c240x_lcd_render_01( running_machine &machine) void gp32_state::s3c240x_lcd_render_01( )
{ {
gp32_state *state = machine.driver_data<gp32_state>(); bitmap_rgb32 &bitmap = m_bitmap;
bitmap_rgb32 &bitmap = state->m_bitmap; UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
UINT32 *scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos);
int i, j; int i, j;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
UINT32 data = s3c240x_lcd_dma_read( machine); UINT32 data = s3c240x_lcd_dma_read();
for (j = 0; j < 32; j++) for (j = 0; j < 32; j++)
{ {
*scanline++ = palette_get_color( machine, (data >> 31) & 0x01); *scanline++ = palette_get_color( machine(), (data >> 31) & 0x01);
data = data << 1; data = data << 1;
state->m_s3c240x_lcd.hpos++; m_s3c240x_lcd.hpos++;
if (state->m_s3c240x_lcd.hpos >= (state->m_s3c240x_lcd.pagewidth_max << 4)) if (m_s3c240x_lcd.hpos >= (m_s3c240x_lcd.pagewidth_max << 4))
{ {
state->m_s3c240x_lcd.vpos = (state->m_s3c240x_lcd.vpos + 1) % (state->m_s3c240x_lcd.lineval + 1); m_s3c240x_lcd.vpos = (m_s3c240x_lcd.vpos + 1) % (m_s3c240x_lcd.lineval + 1);
state->m_s3c240x_lcd.hpos = 0; m_s3c240x_lcd.hpos = 0;
scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos); scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
} }
} }
} }
} }
static void s3c240x_lcd_render_02( running_machine &machine) void gp32_state::s3c240x_lcd_render_02( )
{ {
gp32_state *state = machine.driver_data<gp32_state>(); bitmap_rgb32 &bitmap = m_bitmap;
bitmap_rgb32 &bitmap = state->m_bitmap; UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
UINT32 *scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos);
int i, j; int i, j;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
UINT32 data = s3c240x_lcd_dma_read( machine); UINT32 data = s3c240x_lcd_dma_read();
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)
{ {
*scanline++ = palette_get_color( machine, (data >> 30) & 0x03); *scanline++ = palette_get_color( machine(), (data >> 30) & 0x03);
data = data << 2; data = data << 2;
state->m_s3c240x_lcd.hpos++; m_s3c240x_lcd.hpos++;
if (state->m_s3c240x_lcd.hpos >= (state->m_s3c240x_lcd.pagewidth_max << 3)) if (m_s3c240x_lcd.hpos >= (m_s3c240x_lcd.pagewidth_max << 3))
{ {
state->m_s3c240x_lcd.vpos = (state->m_s3c240x_lcd.vpos + 1) % (state->m_s3c240x_lcd.lineval + 1); m_s3c240x_lcd.vpos = (m_s3c240x_lcd.vpos + 1) % (m_s3c240x_lcd.lineval + 1);
state->m_s3c240x_lcd.hpos = 0; m_s3c240x_lcd.hpos = 0;
scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos); scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
} }
} }
} }
} }
static void s3c240x_lcd_render_04( running_machine &machine) void gp32_state::s3c240x_lcd_render_04( )
{ {
gp32_state *state = machine.driver_data<gp32_state>(); bitmap_rgb32 &bitmap = m_bitmap;
bitmap_rgb32 &bitmap = state->m_bitmap; UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
UINT32 *scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos);
int i, j; int i, j;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
UINT32 data = s3c240x_lcd_dma_read( machine); UINT32 data = s3c240x_lcd_dma_read( );
for (j = 0; j < 8; j++) for (j = 0; j < 8; j++)
{ {
*scanline++ = palette_get_color( machine, (data >> 28) & 0x0F); *scanline++ = palette_get_color( machine(), (data >> 28) & 0x0F);
data = data << 4; data = data << 4;
state->m_s3c240x_lcd.hpos++; m_s3c240x_lcd.hpos++;
if (state->m_s3c240x_lcd.hpos >= (state->m_s3c240x_lcd.pagewidth_max << 2)) if (m_s3c240x_lcd.hpos >= (m_s3c240x_lcd.pagewidth_max << 2))
{ {
state->m_s3c240x_lcd.vpos = (state->m_s3c240x_lcd.vpos + 1) % (state->m_s3c240x_lcd.lineval + 1); m_s3c240x_lcd.vpos = (m_s3c240x_lcd.vpos + 1) % (m_s3c240x_lcd.lineval + 1);
state->m_s3c240x_lcd.hpos = 0; m_s3c240x_lcd.hpos = 0;
scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos); scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
} }
} }
} }
} }
static void s3c240x_lcd_render_08( running_machine &machine) void gp32_state::s3c240x_lcd_render_08( )
{ {
gp32_state *state = machine.driver_data<gp32_state>(); bitmap_rgb32 &bitmap = m_bitmap;
bitmap_rgb32 &bitmap = state->m_bitmap; UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
UINT32 *scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos);
int i, j; int i, j;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
UINT32 data = s3c240x_lcd_dma_read( machine); UINT32 data = s3c240x_lcd_dma_read();
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
*scanline++ = palette_get_color( machine, (data >> 24) & 0xFF); *scanline++ = palette_get_color( machine(), (data >> 24) & 0xFF);
data = data << 8; data = data << 8;
state->m_s3c240x_lcd.hpos++; m_s3c240x_lcd.hpos++;
if (state->m_s3c240x_lcd.hpos >= (state->m_s3c240x_lcd.pagewidth_max << 1)) if (m_s3c240x_lcd.hpos >= (m_s3c240x_lcd.pagewidth_max << 1))
{ {
state->m_s3c240x_lcd.vpos = (state->m_s3c240x_lcd.vpos + 1) % (state->m_s3c240x_lcd.lineval + 1); m_s3c240x_lcd.vpos = (m_s3c240x_lcd.vpos + 1) % (m_s3c240x_lcd.lineval + 1);
state->m_s3c240x_lcd.hpos = 0; m_s3c240x_lcd.hpos = 0;
scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos); scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
} }
} }
} }
} }
static void s3c240x_lcd_render_16( running_machine &machine) void gp32_state::s3c240x_lcd_render_16( )
{ {
gp32_state *state = machine.driver_data<gp32_state>(); bitmap_rgb32 &bitmap = m_bitmap;
bitmap_rgb32 &bitmap = state->m_bitmap; UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
UINT32 *scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos);
int i, j; int i, j;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
UINT32 data = s3c240x_lcd_dma_read( machine); UINT32 data = s3c240x_lcd_dma_read();
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
{ {
*scanline++ = s3c240x_get_color_5551( (data >> 16) & 0xFFFF); *scanline++ = s3c240x_get_color_5551( (data >> 16) & 0xFFFF);
data = data << 16; data = data << 16;
state->m_s3c240x_lcd.hpos++; m_s3c240x_lcd.hpos++;
if (state->m_s3c240x_lcd.hpos >= (state->m_s3c240x_lcd.pagewidth_max << 0)) if (m_s3c240x_lcd.hpos >= (m_s3c240x_lcd.pagewidth_max << 0))
{ {
state->m_s3c240x_lcd.vpos = (state->m_s3c240x_lcd.vpos + 1) % (state->m_s3c240x_lcd.lineval + 1); m_s3c240x_lcd.vpos = (m_s3c240x_lcd.vpos + 1) % (m_s3c240x_lcd.lineval + 1);
state->m_s3c240x_lcd.hpos = 0; m_s3c240x_lcd.hpos = 0;
scanline = &bitmap.pix32(state->m_s3c240x_lcd.vpos, state->m_s3c240x_lcd.hpos); scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos);
} }
} }
} }
@ -261,11 +255,11 @@ TIMER_CALLBACK_MEMBER(gp32_state::s3c240x_lcd_timer_exp)
{ {
switch (m_s3c240x_lcd.bppmode) switch (m_s3c240x_lcd.bppmode)
{ {
case BPPMODE_TFT_01 : s3c240x_lcd_render_01( machine()); break; case BPPMODE_TFT_01 : s3c240x_lcd_render_01(); break;
case BPPMODE_TFT_02 : s3c240x_lcd_render_02( machine()); break; case BPPMODE_TFT_02 : s3c240x_lcd_render_02(); break;
case BPPMODE_TFT_04 : s3c240x_lcd_render_04( machine()); break; case BPPMODE_TFT_04 : s3c240x_lcd_render_04(); break;
case BPPMODE_TFT_08 : s3c240x_lcd_render_08( machine()); break; case BPPMODE_TFT_08 : s3c240x_lcd_render_08(); break;
case BPPMODE_TFT_16 : s3c240x_lcd_render_16( machine()); break; case BPPMODE_TFT_16 : s3c240x_lcd_render_16(); break;
default : verboselog( machine(), 0, "s3c240x_lcd_timer_exp: bppmode %d not supported\n", m_s3c240x_lcd.bppmode); break; default : verboselog( machine(), 0, "s3c240x_lcd_timer_exp: bppmode %d not supported\n", m_s3c240x_lcd.bppmode); break;
} }
if ((m_s3c240x_lcd.vpos == 0) && (m_s3c240x_lcd.hpos == 0)) break; if ((m_s3c240x_lcd.vpos == 0) && (m_s3c240x_lcd.hpos == 0)) break;
@ -1256,7 +1250,7 @@ void gp32_state::eeprom_write(UINT16 address, UINT8 data)
// IIC // IIC
#if 0 #if 0
static UINT8 i2cmem_read_byte( running_machine &machine, int last) UINT8 gp32_state::i2cmem_read_byte( int last)
{ {
UINT8 data = 0; UINT8 data = 0;
int i; int i;
@ -1275,7 +1269,7 @@ static UINT8 i2cmem_read_byte( running_machine &machine, int last)
#endif #endif
#if 0 #if 0
static void i2cmem_write_byte( running_machine &machine, UINT8 data) void gp32_state::i2cmem_write_byte( UINT8 data)
{ {
int i; int i;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
@ -1292,7 +1286,7 @@ static void i2cmem_write_byte( running_machine &machine, UINT8 data)
#endif #endif
#if 0 #if 0
static void i2cmem_start( running_machine &machine) void gp32_state::i2cmem_start( )
{ {
i2cmem_write( machine, 0, I2CMEM_SDA, 1); i2cmem_write( machine, 0, I2CMEM_SDA, 1);
i2cmem_write( machine, 0, I2CMEM_SCL, 1); i2cmem_write( machine, 0, I2CMEM_SCL, 1);
@ -1302,7 +1296,7 @@ static void i2cmem_start( running_machine &machine)
#endif #endif
#if 0 #if 0
static void i2cmem_stop( running_machine &machine) void gp32_state::i2cmem_stop( )
{ {
i2cmem_write( machine, 0, I2CMEM_SDA, 0); i2cmem_write( machine, 0, I2CMEM_SDA, 0);
i2cmem_write( machine, 0, I2CMEM_SCL, 1); i2cmem_write( machine, 0, I2CMEM_SCL, 1);

View File

@ -60,6 +60,7 @@ public:
DECLARE_WRITE32_MEMBER(hpc_w); DECLARE_WRITE32_MEMBER(hpc_w);
DECLARE_READ32_MEMBER(int_r); DECLARE_READ32_MEMBER(int_r);
DECLARE_WRITE32_MEMBER(int_w); DECLARE_WRITE32_MEMBER(int_w);
DECLARE_WRITE_LINE_MEMBER(scsi_irq);
DECLARE_DRIVER_INIT(ip204415); DECLARE_DRIVER_INIT(ip204415);
virtual void machine_start(); virtual void machine_start();
virtual void video_start(); virtual void video_start();
@ -479,13 +480,13 @@ static ADDRESS_MAP_START( ip204415_map, AS_PROGRAM, 32, ip20_state )
AM_RANGE( 0xbfc00000, 0xbfc7ffff ) AM_ROM AM_SHARE("share2") /* BIOS Mirror */ AM_RANGE( 0xbfc00000, 0xbfc7ffff ) AM_ROM AM_SHARE("share2") /* BIOS Mirror */
ADDRESS_MAP_END ADDRESS_MAP_END
static void scsi_irq(running_machine &machine, int state) WRITE_LINE_MEMBER(ip20_state::scsi_irq)
{ {
} }
static const struct WD33C93interface wd33c93_intf = static const struct WD33C93interface wd33c93_intf =
{ {
&scsi_irq, /* command completion IRQ */ DEVCB_DRIVER_LINE_MEMBER(ip20_state,scsi_irq) /* command completion IRQ */
}; };
DRIVER_INIT_MEMBER(ip20_state,ip204415) DRIVER_INIT_MEMBER(ip20_state,ip204415)

View File

@ -129,6 +129,7 @@ public:
DECLARE_WRITE32_MEMBER(hpc3_pbusdma_w); DECLARE_WRITE32_MEMBER(hpc3_pbusdma_w);
DECLARE_READ32_MEMBER(hpc3_unkpbus0_r); DECLARE_READ32_MEMBER(hpc3_unkpbus0_r);
DECLARE_WRITE32_MEMBER(hpc3_unkpbus0_w); DECLARE_WRITE32_MEMBER(hpc3_unkpbus0_w);
DECLARE_WRITE_LINE_MEMBER(scsi_irq);
DECLARE_DRIVER_INIT(ip225015); DECLARE_DRIVER_INIT(ip225015);
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
@ -1229,60 +1230,59 @@ void ip22_state::dump_chain(address_space &space, UINT32 ch_base)
#define HPC3_DMACTRL_ENABLE (0x10) #define HPC3_DMACTRL_ENABLE (0x10)
static void scsi_irq(running_machine &machine, int state) WRITE_LINE_MEMBER(ip22_state::scsi_irq)
{ {
ip22_state *drvstate = machine.driver_data<ip22_state>(); address_space &space = m_maincpu->space(AS_PROGRAM);
address_space &space = drvstate->m_maincpu->space(AS_PROGRAM);
if (state) if (state)
{ {
if (drvstate->m_wd33c93->get_dma_count()) if (m_wd33c93->get_dma_count())
{ {
printf("drvstate->m_wd33c93->get_dma_count() is %d\n", drvstate->m_wd33c93->get_dma_count() ); printf("m_wd33c93->get_dma_count() is %d\n", m_wd33c93->get_dma_count() );
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENABLE) if (m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENABLE)
{ {
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_IRQ) logerror("IP22: Unhandled SCSI DMA IRQ\n"); if (m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_IRQ) logerror("IP22: Unhandled SCSI DMA IRQ\n");
} }
// HPC3 DMA: host to device // HPC3 DMA: host to device
if ((drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENABLE) && (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_DIR)) if ((m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENABLE) && (m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_DIR))
{ {
UINT32 wptr, tmpword; UINT32 wptr, tmpword;
int words, dptr, twords; int words, dptr, twords;
words = drvstate->m_wd33c93->get_dma_count(); words = m_wd33c93->get_dma_count();
words /= 4; words /= 4;
wptr = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor); wptr = space.read_dword(m_HPC3.nSCSI0Descriptor);
drvstate->m_HPC3.nSCSI0Descriptor += words*4; m_HPC3.nSCSI0Descriptor += words*4;
dptr = 0; dptr = 0;
printf("DMA to device: %d words @ %x\n", words, wptr); printf("DMA to device: %d words @ %x\n", words, wptr);
drvstate->dump_chain(space, drvstate->m_HPC3.nSCSI0Descriptor); dump_chain(space, m_HPC3.nSCSI0Descriptor);
if (words <= (512/4)) if (words <= (512/4))
{ {
// one-shot // one-shot
//drvstate->m_wd33c93->get_dma_data(drvstate->m_wd33c93->get_dma_count(), drvstate->m_dma_buffer); //m_wd33c93->get_dma_data(m_wd33c93->get_dma_count(), m_dma_buffer);
while (words) while (words)
{ {
tmpword = space.read_dword(wptr); tmpword = space.read_dword(wptr);
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN) if (m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{ {
drvstate->m_dma_buffer[dptr+3] = (tmpword>>24)&0xff; m_dma_buffer[dptr+3] = (tmpword>>24)&0xff;
drvstate->m_dma_buffer[dptr+2] = (tmpword>>16)&0xff; m_dma_buffer[dptr+2] = (tmpword>>16)&0xff;
drvstate->m_dma_buffer[dptr+1] = (tmpword>>8)&0xff; m_dma_buffer[dptr+1] = (tmpword>>8)&0xff;
drvstate->m_dma_buffer[dptr] = tmpword&0xff; m_dma_buffer[dptr] = tmpword&0xff;
} }
else else
{ {
drvstate->m_dma_buffer[dptr] = (tmpword>>24)&0xff; m_dma_buffer[dptr] = (tmpword>>24)&0xff;
drvstate->m_dma_buffer[dptr+1] = (tmpword>>16)&0xff; m_dma_buffer[dptr+1] = (tmpword>>16)&0xff;
drvstate->m_dma_buffer[dptr+2] = (tmpword>>8)&0xff; m_dma_buffer[dptr+2] = (tmpword>>8)&0xff;
drvstate->m_dma_buffer[dptr+3] = tmpword&0xff; m_dma_buffer[dptr+3] = tmpword&0xff;
} }
wptr += 4; wptr += 4;
@ -1290,35 +1290,35 @@ static void scsi_irq(running_machine &machine, int state)
words--; words--;
} }
words = drvstate->m_wd33c93->get_dma_count(); words = m_wd33c93->get_dma_count();
drvstate->m_wd33c93->write_data(words, drvstate->m_dma_buffer); m_wd33c93->write_data(words, m_dma_buffer);
} }
else else
{ {
while (words) while (words)
{ {
//drvstate->m_wd33c93->get_dma_data(512, drvstate->m_dma_buffer); //m_wd33c93->get_dma_data(512, m_dma_buffer);
twords = 512/4; twords = 512/4;
drvstate->m_HPC3.nSCSI0Descriptor += 512; m_HPC3.nSCSI0Descriptor += 512;
dptr = 0; dptr = 0;
while (twords) while (twords)
{ {
tmpword = space.read_dword(wptr); tmpword = space.read_dword(wptr);
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN) if (m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{ {
drvstate->m_dma_buffer[dptr+3] = (tmpword>>24)&0xff; m_dma_buffer[dptr+3] = (tmpword>>24)&0xff;
drvstate->m_dma_buffer[dptr+2] = (tmpword>>16)&0xff; m_dma_buffer[dptr+2] = (tmpword>>16)&0xff;
drvstate->m_dma_buffer[dptr+1] = (tmpword>>8)&0xff; m_dma_buffer[dptr+1] = (tmpword>>8)&0xff;
drvstate->m_dma_buffer[dptr] = tmpword&0xff; m_dma_buffer[dptr] = tmpword&0xff;
} }
else else
{ {
drvstate->m_dma_buffer[dptr] = (tmpword>>24)&0xff; m_dma_buffer[dptr] = (tmpword>>24)&0xff;
drvstate->m_dma_buffer[dptr+1] = (tmpword>>16)&0xff; m_dma_buffer[dptr+1] = (tmpword>>16)&0xff;
drvstate->m_dma_buffer[dptr+2] = (tmpword>>8)&0xff; m_dma_buffer[dptr+2] = (tmpword>>8)&0xff;
drvstate->m_dma_buffer[dptr+3] = tmpword&0xff; m_dma_buffer[dptr+3] = tmpword&0xff;
} }
wptr += 4; wptr += 4;
@ -1326,23 +1326,23 @@ static void scsi_irq(running_machine &machine, int state)
twords--; twords--;
} }
drvstate->m_wd33c93->write_data(512, drvstate->m_dma_buffer); m_wd33c93->write_data(512, m_dma_buffer);
words -= (512/4); words -= (512/4);
} }
} }
// clear DMA on the controller too // clear DMA on the controller too
drvstate->m_wd33c93->clear_dma(); m_wd33c93->clear_dma();
#if 0 #if 0
UINT32 dptr, tmpword; UINT32 dptr, tmpword;
UINT32 bc = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor + 4); UINT32 bc = space.read_dword(m_HPC3.nSCSI0Descriptor + 4);
UINT32 rptr = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor); UINT32 rptr = space.read_dword(m_HPC3.nSCSI0Descriptor);
int length = bc & 0x3fff; int length = bc & 0x3fff;
int xie = (bc & 0x20000000) ? 1 : 0; int xie = (bc & 0x20000000) ? 1 : 0;
int eox = (bc & 0x80000000) ? 1 : 0; int eox = (bc & 0x80000000) ? 1 : 0;
dump_chain(space, drvstate->m_HPC3.nSCSI0Descriptor); dump_chain(space, m_HPC3.nSCSI0Descriptor);
printf("PC is %08x\n", machine.device("maincpu")->safe_pc()); printf("PC is %08x\n", machine.device("maincpu")->safe_pc());
printf("DMA to device: length %x xie %d eox %d\n", length, xie, eox); printf("DMA to device: length %x xie %d eox %d\n", length, xie, eox);
@ -1353,19 +1353,19 @@ static void scsi_irq(running_machine &machine, int state)
while (length > 0) while (length > 0)
{ {
tmpword = space.read_dword(rptr); tmpword = space.read_dword(rptr);
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN) if (m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{ {
drvstate->m_dma_buffer[dptr+3] = (tmpword>>24)&0xff; m_dma_buffer[dptr+3] = (tmpword>>24)&0xff;
drvstate->m_dma_buffer[dptr+2] = (tmpword>>16)&0xff; m_dma_buffer[dptr+2] = (tmpword>>16)&0xff;
drvstate->m_dma_buffer[dptr+1] = (tmpword>>8)&0xff; m_dma_buffer[dptr+1] = (tmpword>>8)&0xff;
drvstate->m_dma_buffer[dptr] = tmpword&0xff; m_dma_buffer[dptr] = tmpword&0xff;
} }
else else
{ {
drvstate->m_dma_buffer[dptr] = (tmpword>>24)&0xff; m_dma_buffer[dptr] = (tmpword>>24)&0xff;
drvstate->m_dma_buffer[dptr+1] = (tmpword>>16)&0xff; m_dma_buffer[dptr+1] = (tmpword>>16)&0xff;
drvstate->m_dma_buffer[dptr+2] = (tmpword>>8)&0xff; m_dma_buffer[dptr+2] = (tmpword>>8)&0xff;
drvstate->m_dma_buffer[dptr+3] = tmpword&0xff; m_dma_buffer[dptr+3] = tmpword&0xff;
} }
dptr += 4; dptr += 4;
@ -1373,11 +1373,11 @@ static void scsi_irq(running_machine &machine, int state)
length -= 4; length -= 4;
} }
length = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor+4) & 0x3fff; length = space.read_dword(m_HPC3.nSCSI0Descriptor+4) & 0x3fff;
drvstate->m_wd33c93->write_data(length, drvstate->m_dma_buffer); m_wd33c93->write_data(length, m_dma_buffer);
// clear DMA on the controller too // clear DMA on the controller too
drvstate->m_wd33c93->clear_dma(); m_wd33c93->clear_dma();
} }
else else
{ {
@ -1387,35 +1387,35 @@ static void scsi_irq(running_machine &machine, int state)
} }
// HPC3 DMA: device to host // HPC3 DMA: device to host
if ((drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENABLE) && !(drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_DIR)) if ((m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENABLE) && !(m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_DIR))
{ {
UINT32 wptr, tmpword; UINT32 wptr, tmpword;
int words, sptr, twords; int words, sptr, twords;
words = drvstate->m_wd33c93->get_dma_count(); words = m_wd33c93->get_dma_count();
words /= 4; words /= 4;
wptr = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor); wptr = space.read_dword(m_HPC3.nSCSI0Descriptor);
sptr = 0; sptr = 0;
// mame_printf_info("DMA from device: %d words @ %x\n", words, wptr); // mame_printf_info("DMA from device: %d words @ %x\n", words, wptr);
drvstate->dump_chain(space, drvstate->m_HPC3.nSCSI0Descriptor); dump_chain(space, m_HPC3.nSCSI0Descriptor);
if (words <= (1024/4)) if (words <= (1024/4))
{ {
// one-shot // one-shot
drvstate->m_wd33c93->get_dma_data(drvstate->m_wd33c93->get_dma_count(), drvstate->m_dma_buffer); m_wd33c93->get_dma_data(m_wd33c93->get_dma_count(), m_dma_buffer);
while (words) while (words)
{ {
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN) if (m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{ {
tmpword = drvstate->m_dma_buffer[sptr+3]<<24 | drvstate->m_dma_buffer[sptr+2]<<16 | drvstate->m_dma_buffer[sptr+1]<<8 | drvstate->m_dma_buffer[sptr]; tmpword = m_dma_buffer[sptr+3]<<24 | m_dma_buffer[sptr+2]<<16 | m_dma_buffer[sptr+1]<<8 | m_dma_buffer[sptr];
} }
else else
{ {
tmpword = drvstate->m_dma_buffer[sptr]<<24 | drvstate->m_dma_buffer[sptr+1]<<16 | drvstate->m_dma_buffer[sptr+2]<<8 | drvstate->m_dma_buffer[sptr+3]; tmpword = m_dma_buffer[sptr]<<24 | m_dma_buffer[sptr+1]<<16 | m_dma_buffer[sptr+2]<<8 | m_dma_buffer[sptr+3];
} }
space.write_dword(wptr, tmpword); space.write_dword(wptr, tmpword);
@ -1428,19 +1428,19 @@ static void scsi_irq(running_machine &machine, int state)
{ {
while (words) while (words)
{ {
drvstate->m_wd33c93->get_dma_data(512, drvstate->m_dma_buffer); m_wd33c93->get_dma_data(512, m_dma_buffer);
twords = 512/4; twords = 512/4;
sptr = 0; sptr = 0;
while (twords) while (twords)
{ {
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN) if (m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{ {
tmpword = drvstate->m_dma_buffer[sptr+3]<<24 | drvstate->m_dma_buffer[sptr+2]<<16 | drvstate->m_dma_buffer[sptr+1]<<8 | drvstate->m_dma_buffer[sptr]; tmpword = m_dma_buffer[sptr+3]<<24 | m_dma_buffer[sptr+2]<<16 | m_dma_buffer[sptr+1]<<8 | m_dma_buffer[sptr];
} }
else else
{ {
tmpword = drvstate->m_dma_buffer[sptr]<<24 | drvstate->m_dma_buffer[sptr+1]<<16 | drvstate->m_dma_buffer[sptr+2]<<8 | drvstate->m_dma_buffer[sptr+3]; tmpword = m_dma_buffer[sptr]<<24 | m_dma_buffer[sptr+1]<<16 | m_dma_buffer[sptr+2]<<8 | m_dma_buffer[sptr+3];
} }
space.write_dword(wptr, tmpword); space.write_dword(wptr, tmpword);
@ -1454,25 +1454,25 @@ static void scsi_irq(running_machine &machine, int state)
} }
// clear DMA on the controller too // clear DMA on the controller too
drvstate->m_wd33c93->clear_dma(); m_wd33c93->clear_dma();
} }
} }
// clear HPC3 DMA active flag // clear HPC3 DMA active flag
drvstate->m_HPC3.nSCSI0DMACtrl &= ~HPC3_DMACTRL_ENABLE; m_HPC3.nSCSI0DMACtrl &= ~HPC3_DMACTRL_ENABLE;
// set the interrupt // set the interrupt
drvstate->int3_raise_local0_irq(INT3_LOCAL0_SCSI0); int3_raise_local0_irq(INT3_LOCAL0_SCSI0);
} }
else else
{ {
drvstate->int3_lower_local0_irq(INT3_LOCAL0_SCSI0); int3_lower_local0_irq(INT3_LOCAL0_SCSI0);
} }
} }
static const struct WD33C93interface wd33c93_intf = static const struct WD33C93interface wd33c93_intf =
{ {
&scsi_irq, /* command completion IRQ */ DEVCB_DRIVER_LINE_MEMBER(ip22_state,scsi_irq) /* command completion IRQ */
}; };
static int ip22_get_out2(running_machine &machine) static int ip22_get_out2(running_machine &machine)

View File

@ -828,7 +828,7 @@ static const applefdc_interface mac_iwm_interface =
static const struct NCR5380interface macplus_5380intf = static const struct NCR5380interface macplus_5380intf =
{ {
mac_scsi_irq // IRQ (unconnected on the Mac Plus) DEVCB_DRIVER_LINE_MEMBER(mac_state,mac_scsi_irq) // IRQ (unconnected on the Mac Plus)
}; };
static const struct NCR539Xinterface mac_539x_intf = static const struct NCR539Xinterface mac_539x_intf =

View File

@ -189,6 +189,12 @@ public:
TIMER_CALLBACK_MEMBER(dma_timer_callback); TIMER_CALLBACK_MEMBER(dma_timer_callback);
IRQ_CALLBACK_MEMBER(int_callback); IRQ_CALLBACK_MEMBER(int_callback);
IRQ_CALLBACK_MEMBER(compis_irq_callback); IRQ_CALLBACK_MEMBER(compis_irq_callback);
void compis_irq_set(UINT8 irq);
void compis_keyb_update();
void compis_keyb_init();
void compis_fdc_reset();
void update_interrupt_state();
void compis_cpu_init();
}; };

View File

@ -181,7 +181,6 @@ public:
TIMER_CALLBACK_MEMBER(s3c240x_dma_timer_exp); TIMER_CALLBACK_MEMBER(s3c240x_dma_timer_exp);
TIMER_CALLBACK_MEMBER(s3c240x_iic_timer_exp); TIMER_CALLBACK_MEMBER(s3c240x_iic_timer_exp);
TIMER_CALLBACK_MEMBER(s3c240x_iis_timer_exp); TIMER_CALLBACK_MEMBER(s3c240x_iis_timer_exp);
protected: protected:
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<smartmedia_image_device> m_smartmedia; required_device<smartmedia_image_device> m_smartmedia;
@ -230,6 +229,17 @@ protected:
void iic_resume(); void iic_resume();
void s3c240x_machine_start(); void s3c240x_machine_start();
void s3c240x_machine_reset(); void s3c240x_machine_reset();
inline rgb_t s3c240x_get_color_5551( UINT16 data);
UINT32 s3c240x_lcd_dma_read( );
void s3c240x_lcd_render_01( );
void s3c240x_lcd_render_02( );
void s3c240x_lcd_render_04( );
void s3c240x_lcd_render_08( );
void s3c240x_lcd_render_16( );
UINT8 i2cmem_read_byte( int last);
void i2cmem_write_byte( UINT8 data);
void i2cmem_start( );
void i2cmem_stop( );
}; };

View File

@ -141,7 +141,6 @@ extern const via6522_interface mac_via6522_intf;
extern const via6522_interface mac_via6522_2_intf; extern const via6522_interface mac_via6522_2_intf;
extern const via6522_interface mac_via6522_adb_intf; extern const via6522_interface mac_via6522_adb_intf;
void mac_scsi_irq(running_machine &machine, int state);
void mac_asc_irq(device_t *device, int state); void mac_asc_irq(device_t *device, int state);
void mac_fdc_set_enable_lines(device_t *device, int enable_mask); void mac_fdc_set_enable_lines(device_t *device, int enable_mask);
@ -399,6 +398,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(cuda_reset_w); DECLARE_WRITE_LINE_MEMBER(cuda_reset_w);
DECLARE_WRITE_LINE_MEMBER(adb_linechange_w); DECLARE_WRITE_LINE_MEMBER(adb_linechange_w);
DECLARE_WRITE_LINE_MEMBER(mac_scsi_irq);
DECLARE_DIRECT_UPDATE_MEMBER(overlay_opbaseoverride); DECLARE_DIRECT_UPDATE_MEMBER(overlay_opbaseoverride);
private: private:

View File

@ -214,6 +214,9 @@ protected:
void spectrum_UpdateBorderBitmap(); void spectrum_UpdateBorderBitmap();
inline unsigned char get_display_color (unsigned char color, int invert); 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); 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);
void ts2068_64col_scanline(bitmap_ind16 &bitmap, int y, int borderlines, unsigned short inkcolor);
void ts2068_lores_scanline(bitmap_ind16 &bitmap, int y, int borderlines, int screen);
}; };

View File

@ -80,6 +80,7 @@ public:
void laser_machine_init(int bank_mask, int video_mask); void laser_machine_init(int bank_mask, int video_mask);
void laser_get_track(); void laser_get_track();
void laser_put_track(); void laser_put_track();
device_t *laser_file();
}; };

View File

@ -80,7 +80,7 @@ enum COMPIS_INTERRUPT_REQUESTS
/* Desc: IRQ - Issue an interrupt request */ /* Desc: IRQ - Issue an interrupt request */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#ifdef UNUSED_FUNCTION #ifdef UNUSED_FUNCTION
void compis_irq_set(UINT8 irq) void compis_state::compis_irq_set(UINT8 irq)
{ {
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, irq); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, irq);
} }
@ -90,9 +90,8 @@ void compis_irq_set(UINT8 irq)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* Keyboard */ /* Keyboard */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static void compis_keyb_update(running_machine &machine) void compis_state::compis_keyb_update()
{ {
compis_state *state = machine.driver_data<compis_state>();
UINT8 key_code; UINT8 key_code;
UINT8 key_status; UINT8 key_status;
UINT8 irow; UINT8 irow;
@ -106,7 +105,7 @@ static void compis_keyb_update(running_machine &machine)
for (irow = 0; irow < 6; irow++) for (irow = 0; irow < 6; irow++)
{ {
data = machine.root_device().ioport(rownames[irow])->read(); data = machine().root_device().ioport(rownames[irow])->read();
if (data != 0) if (data != 0)
{ {
ibit = 1; ibit = 1;
@ -138,28 +137,28 @@ static void compis_keyb_update(running_machine &machine)
} }
if (key_code != 0) if (key_code != 0)
{ {
state->m_compis.keyboard.key_code = key_code; m_compis.keyboard.key_code = key_code;
state->m_compis.keyboard.key_status = key_status; m_compis.keyboard.key_status = key_status;
state->m_compis.usart.status |= COMPIS_USART_STATUS_RX_READY; m_compis.usart.status |= COMPIS_USART_STATUS_RX_READY;
state->m_compis.usart.bytes_sent = 0; m_compis.usart.bytes_sent = 0;
// compis_osp_pic_irq(COMPIS_IRQ_8251_RXRDY); // compis_osp_pic_irq(COMPIS_IRQ_8251_RXRDY);
} }
} }
static void compis_keyb_init(compis_state *state) void compis_state::compis_keyb_init()
{ {
state->m_compis.keyboard.key_code = 0; m_compis.keyboard.key_code = 0;
state->m_compis.keyboard.key_status = 0x80; m_compis.keyboard.key_status = 0x80;
state->m_compis.usart.status = 0; m_compis.usart.status = 0;
state->m_compis.usart.bytes_sent = 0; m_compis.usart.bytes_sent = 0;
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* FDC iSBX-218A */ /* FDC iSBX-218A */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static void compis_fdc_reset(running_machine &machine) void compis_state::compis_fdc_reset()
{ {
machine.device("i8272a")->reset(); machine().device("i8272a")->reset();
} }
void compis_state::compis_fdc_tc(int state) void compis_state::compis_fdc_tc(int state)
@ -235,7 +234,7 @@ WRITE8_MEMBER( compis_state::compis_ppi_port_c_w )
/* FDC Reset */ /* FDC Reset */
if (BIT(data, 6)) if (BIT(data, 6))
compis_fdc_reset(machine()); compis_fdc_reset();
/* FDC Terminal count */ /* FDC Terminal count */
compis_fdc_tc(BIT(data, 7)); compis_fdc_tc(BIT(data, 7));
@ -380,76 +379,75 @@ IRQ_CALLBACK_MEMBER(compis_state::int_callback)
} }
static void update_interrupt_state(running_machine &machine) void compis_state::update_interrupt_state()
{ {
compis_state *state = machine.driver_data<compis_state>();
int i, j, new_vector = 0; int i, j, new_vector = 0;
if (LOG_INTERRUPTS) logerror("update_interrupt_status: req=%02X stat=%02X serv=%02X\n", state->m_i186.intr.request, state->m_i186.intr.status, state->m_i186.intr.in_service); if (LOG_INTERRUPTS) logerror("update_interrupt_status: req=%02X stat=%02X serv=%02X\n", m_i186.intr.request, m_i186.intr.status, m_i186.intr.in_service);
/* loop over priorities */ /* loop over priorities */
for (i = 0; i <= state->m_i186.intr.priority_mask; i++) for (i = 0; i <= m_i186.intr.priority_mask; i++)
{ {
/* note: by checking 4 bits, we also verify that the mask is off */ /* note: by checking 4 bits, we also verify that the mask is off */
if ((state->m_i186.intr.timer & 15) == i) if ((m_i186.intr.timer & 15) == i)
{ {
/* if we're already servicing something at this level, don't generate anything new */ /* if we're already servicing something at this level, don't generate anything new */
if (state->m_i186.intr.in_service & 0x01) if (m_i186.intr.in_service & 0x01)
return; return;
/* if there's something pending, generate an interrupt */ /* if there's something pending, generate an interrupt */
if (state->m_i186.intr.status & 0x07) if (m_i186.intr.status & 0x07)
{ {
if (state->m_i186.intr.status & 1) if (m_i186.intr.status & 1)
new_vector = 0x08; new_vector = 0x08;
else if (state->m_i186.intr.status & 2) else if (m_i186.intr.status & 2)
new_vector = 0x12; new_vector = 0x12;
else if (state->m_i186.intr.status & 4) else if (m_i186.intr.status & 4)
new_vector = 0x13; new_vector = 0x13;
else else
popmessage("Invalid timer interrupt!"); popmessage("Invalid timer interrupt!");
/* set the clear mask and generate the int */ /* set the clear mask and generate the int */
state->m_i186.intr.ack_mask = 0x0001; m_i186.intr.ack_mask = 0x0001;
goto generate_int; goto generate_int;
} }
} }
/* check DMA interrupts */ /* check DMA interrupts */
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
if ((state->m_i186.intr.dma[j] & 15) == i) if ((m_i186.intr.dma[j] & 15) == i)
{ {
/* if we're already servicing something at this level, don't generate anything new */ /* if we're already servicing something at this level, don't generate anything new */
if (state->m_i186.intr.in_service & (0x04 << j)) if (m_i186.intr.in_service & (0x04 << j))
return; return;
/* if there's something pending, generate an interrupt */ /* if there's something pending, generate an interrupt */
if (state->m_i186.intr.request & (0x04 << j)) if (m_i186.intr.request & (0x04 << j))
{ {
new_vector = 0x0a + j; new_vector = 0x0a + j;
/* set the clear mask and generate the int */ /* set the clear mask and generate the int */
state->m_i186.intr.ack_mask = 0x0004 << j; m_i186.intr.ack_mask = 0x0004 << j;
goto generate_int; goto generate_int;
} }
} }
/* check external interrupts */ /* check external interrupts */
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
if ((state->m_i186.intr.ext[j] & 15) == i) if ((m_i186.intr.ext[j] & 15) == i)
{ {
/* if we're already servicing something at this level, don't generate anything new */ /* if we're already servicing something at this level, don't generate anything new */
if (state->m_i186.intr.in_service & (0x10 << j)) if (m_i186.intr.in_service & (0x10 << j))
return; return;
/* if there's something pending, generate an interrupt */ /* if there's something pending, generate an interrupt */
if (state->m_i186.intr.request & (0x10 << j)) if (m_i186.intr.request & (0x10 << j))
{ {
/* otherwise, generate an interrupt for this request */ /* otherwise, generate an interrupt for this request */
new_vector = 0x0c + j; new_vector = 0x0c + j;
/* set the clear mask and generate the int */ /* set the clear mask and generate the int */
state->m_i186.intr.ack_mask = 0x0010 << j; m_i186.intr.ack_mask = 0x0010 << j;
goto generate_int; goto generate_int;
} }
} }
@ -458,13 +456,13 @@ static void update_interrupt_state(running_machine &machine)
generate_int: generate_int:
/* generate the appropriate interrupt */ /* generate the appropriate interrupt */
state->m_i186.intr.poll_status = 0x8000 | new_vector; m_i186.intr.poll_status = 0x8000 | new_vector;
if (!state->m_i186.intr.pending) if (!m_i186.intr.pending)
state->m_maincpu->set_input_line(0, ASSERT_LINE); m_maincpu->set_input_line(0, ASSERT_LINE);
state->m_i186.intr.pending = 1; m_i186.intr.pending = 1;
machine.scheduler().trigger(CPU_RESUME_TRIGGER); machine().scheduler().trigger(CPU_RESUME_TRIGGER);
if (LOG_OPTIMIZATION) logerror(" - trigger due to interrupt pending\n"); if (LOG_OPTIMIZATION) logerror(" - trigger due to interrupt pending\n");
if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", machine.time().as_double(), new_vector); if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", machine().time().as_double(), new_vector);
} }
@ -548,7 +546,7 @@ TIMER_CALLBACK_MEMBER(compis_state::internal_timer_int)
if (t->control & 0x2000) if (t->control & 0x2000)
{ {
m_i186.intr.status |= 0x01 << which; m_i186.intr.status |= 0x01 << which;
update_interrupt_state(machine()); update_interrupt_state();
if (LOG_TIMER) logerror(" Generating timer interrupt\n"); if (LOG_TIMER) logerror(" Generating timer interrupt\n");
} }
@ -736,7 +734,7 @@ TIMER_CALLBACK_MEMBER(compis_state::dma_timer_callback)
{ {
if (LOG_DMA) logerror("DMA%d timer callback - requesting interrupt: count = %04X, source = %04X\n", which, d->count, d->source); if (LOG_DMA) logerror("DMA%d timer callback - requesting interrupt: count = %04X, source = %04X\n", which, d->count, d->source);
m_i186.intr.request |= 0x04 << which; m_i186.intr.request |= 0x04 << which;
update_interrupt_state(machine()); update_interrupt_state();
} }
} }
@ -998,7 +996,7 @@ WRITE16_MEMBER( compis_state::compis_i186_internal_port_w )
case 0x11: case 0x11:
if (LOG_PORTS) logerror("%05X:80186 EOI = %04X\n", m_maincpu->pc(), data16); if (LOG_PORTS) logerror("%05X:80186 EOI = %04X\n", m_maincpu->pc(), data16);
handle_eoi(0x8000); handle_eoi(0x8000);
update_interrupt_state(machine()); update_interrupt_state();
break; break;
case 0x12: case 0x12:
@ -1018,31 +1016,31 @@ WRITE16_MEMBER( compis_state::compis_i186_internal_port_w )
m_i186.intr.ext[1] = (m_i186.intr.ext[1] & ~0x08) | ((data16 >> 2) & 0x08); m_i186.intr.ext[1] = (m_i186.intr.ext[1] & ~0x08) | ((data16 >> 2) & 0x08);
m_i186.intr.ext[2] = (m_i186.intr.ext[2] & ~0x08) | ((data16 >> 3) & 0x08); m_i186.intr.ext[2] = (m_i186.intr.ext[2] & ~0x08) | ((data16 >> 3) & 0x08);
m_i186.intr.ext[3] = (m_i186.intr.ext[3] & ~0x08) | ((data16 >> 4) & 0x08); m_i186.intr.ext[3] = (m_i186.intr.ext[3] & ~0x08) | ((data16 >> 4) & 0x08);
update_interrupt_state(machine()); update_interrupt_state();
break; break;
case 0x15: case 0x15:
if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X\n", m_maincpu->pc(), data16); if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X\n", m_maincpu->pc(), data16);
m_i186.intr.priority_mask = data16 & 0x0007; m_i186.intr.priority_mask = data16 & 0x0007;
update_interrupt_state(machine()); update_interrupt_state();
break; break;
case 0x16: case 0x16:
if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X\n", m_maincpu->pc(), data16); if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X\n", m_maincpu->pc(), data16);
m_i186.intr.in_service = data16 & 0x00ff; m_i186.intr.in_service = data16 & 0x00ff;
update_interrupt_state(machine()); update_interrupt_state();
break; break;
case 0x17: case 0x17:
if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X\n", m_maincpu->pc(), data16); if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X\n", m_maincpu->pc(), data16);
m_i186.intr.request = (m_i186.intr.request & ~0x00c0) | (data16 & 0x00c0); m_i186.intr.request = (m_i186.intr.request & ~0x00c0) | (data16 & 0x00c0);
update_interrupt_state(machine()); update_interrupt_state();
break; break;
case 0x18: case 0x18:
if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X\n", m_maincpu->pc(), data16); if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X\n", m_maincpu->pc(), data16);
m_i186.intr.status = (m_i186.intr.status & ~0x8007) | (data16 & 0x8007); m_i186.intr.status = (m_i186.intr.status & ~0x8007) | (data16 & 0x8007);
update_interrupt_state(machine()); update_interrupt_state();
break; break;
case 0x19: case 0x19:
@ -1233,18 +1231,17 @@ WRITE16_MEMBER( compis_state::compis_i186_internal_port_w )
/* Name: compis */ /* Name: compis */
/* Desc: CPU - Initialize the 80186 CPU */ /* Desc: CPU - Initialize the 80186 CPU */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static void compis_cpu_init(running_machine &machine) void compis_state::compis_cpu_init()
{ {
compis_state *state = machine.driver_data<compis_state>();
/* create timers here so they stick around */ /* create timers here so they stick around */
state->m_i186.timer[0].int_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::internal_timer_int),state)); m_i186.timer[0].int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::internal_timer_int),this));
state->m_i186.timer[1].int_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::internal_timer_int),state)); m_i186.timer[1].int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::internal_timer_int),this));
state->m_i186.timer[2].int_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::internal_timer_int),state)); m_i186.timer[2].int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::internal_timer_int),this));
state->m_i186.timer[0].time_timer = machine.scheduler().timer_alloc(FUNC_NULL); m_i186.timer[0].time_timer = machine().scheduler().timer_alloc(FUNC_NULL);
state->m_i186.timer[1].time_timer = machine.scheduler().timer_alloc(FUNC_NULL); m_i186.timer[1].time_timer = machine().scheduler().timer_alloc(FUNC_NULL);
state->m_i186.timer[2].time_timer = machine.scheduler().timer_alloc(FUNC_NULL); m_i186.timer[2].time_timer = machine().scheduler().timer_alloc(FUNC_NULL);
state->m_i186.dma[0].finish_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::dma_timer_callback),state)); m_i186.dma[0].finish_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::dma_timer_callback),this));
state->m_i186.dma[1].finish_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::dma_timer_callback),state)); m_i186.dma[1].finish_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(compis_state::dma_timer_callback),this));
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
@ -1307,7 +1304,7 @@ DRIVER_INIT_MEMBER(compis_state,compis)
void compis_state::machine_start() void compis_state::machine_start()
{ {
/* CPU */ /* CPU */
compis_cpu_init(machine()); compis_cpu_init();
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* Name: compis */ /* Name: compis */
@ -1316,10 +1313,10 @@ void compis_state::machine_start()
void compis_state::machine_reset() void compis_state::machine_reset()
{ {
/* FDC */ /* FDC */
compis_fdc_reset(machine()); compis_fdc_reset();
/* Keyboard */ /* Keyboard */
compis_keyb_init(this); compis_keyb_init();
/* OSP PIC 8259 */ /* OSP PIC 8259 */
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(compis_state::compis_irq_callback),this)); m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(compis_state::compis_irq_callback),this));
@ -1332,5 +1329,5 @@ void compis_state::machine_reset()
INTERRUPT_GEN_MEMBER(compis_state::compis_vblank_int) INTERRUPT_GEN_MEMBER(compis_state::compis_vblank_int)
{ {
// compis_gdc_vblank_int(); // compis_gdc_vblank_int();
compis_keyb_update(machine()); compis_keyb_update();
} }

View File

@ -1034,7 +1034,7 @@ WRITE16_MEMBER ( mac_state::macii_scsi_w )
m_ncr5380->ncr5380_write_reg(reg, data>>8); m_ncr5380->ncr5380_write_reg(reg, data>>8);
} }
void mac_scsi_irq(running_machine &machine, int state) WRITE_LINE_MEMBER(mac_state::mac_scsi_irq)
{ {
/* mac_state *mac = machine.driver_data<mac_state>(); /* mac_state *mac = machine.driver_data<mac_state>();

View File

@ -80,7 +80,7 @@ void ncr5380_device::device_config_complete()
// or initialize to defaults if none provided // or initialize to defaults if none provided
else else
{ {
irq_callback = NULL; memset(&m_irq_cb, 0, sizeof(m_irq_cb));
} }
} }
@ -110,6 +110,7 @@ void ncr5380_device::device_start()
memset(m_scsi_devices, 0, sizeof(m_scsi_devices)); memset(m_scsi_devices, 0, sizeof(m_scsi_devices));
m_next_req_flag = 0; m_next_req_flag = 0;
m_irq_func.resolve(m_irq_cb, *this);
save_item(NAME(m_5380_Registers)); save_item(NAME(m_5380_Registers));
save_item(NAME(m_5380_Command)); save_item(NAME(m_5380_Command));

View File

@ -10,7 +10,7 @@
struct NCR5380interface struct NCR5380interface
{ {
void (*irq_callback)(running_machine &machine, int state); /* irq callback */ devcb_write_line m_irq_cb; /* irq callback */
}; };
// 5380 registers // 5380 registers
@ -69,6 +69,7 @@ private:
UINT8 m_5380_Command[32]; UINT8 m_5380_Command[32];
INT32 m_cmd_ptr, m_d_ptr, m_d_limit, m_next_req_flag; INT32 m_cmd_ptr, m_d_ptr, m_d_limit, m_next_req_flag;
UINT8 m_5380_Data[512]; UINT8 m_5380_Data[512];
devcb_resolved_write_line m_irq_func;
}; };
// device type definition // device type definition

View File

@ -331,10 +331,9 @@ DEVICE_IMAGE_UNLOAD_MEMBER( vtech2_state, laser_cart )
memset(&m_mem[0x30000], 0xff, 0x10000); memset(&m_mem[0x30000], 0xff, 0x10000);
} }
static device_t *laser_file(running_machine &machine) device_t *vtech2_state::laser_file()
{ {
vtech2_state *state = machine.driver_data<vtech2_state>(); return machine().device(m_laser_drive ? FLOPPY_1 : FLOPPY_0);
return machine.device( state->m_laser_drive ? FLOPPY_1 : FLOPPY_0 );
} }
void vtech2_state::laser_get_track() void vtech2_state::laser_get_track()
@ -342,10 +341,10 @@ void vtech2_state::laser_get_track()
sprintf(m_laser_frame_message, "#%d get track %02d", m_laser_drive, m_laser_track_x2[m_laser_drive]/2); sprintf(m_laser_frame_message, "#%d get track %02d", m_laser_drive, m_laser_track_x2[m_laser_drive]/2);
m_laser_frame_time = 30; m_laser_frame_time = 30;
/* drive selected or and image file ok? */ /* drive selected or and image file ok? */
if( m_laser_drive >= 0 && laser_file(machine()) != NULL ) if( m_laser_drive >= 0 && laser_file() != NULL )
{ {
int size, offs; int size, offs;
device_image_interface *image = dynamic_cast<device_image_interface *>(laser_file(machine())); device_image_interface *image = dynamic_cast<device_image_interface *>(laser_file());
size = TRKSIZE_VZ; size = TRKSIZE_VZ;
offs = TRKSIZE_VZ * m_laser_track_x2[m_laser_drive]/2; offs = TRKSIZE_VZ * m_laser_track_x2[m_laser_drive]/2;
image->fseek(offs, SEEK_SET); image->fseek(offs, SEEK_SET);
@ -358,9 +357,9 @@ void vtech2_state::laser_get_track()
void vtech2_state::laser_put_track() void vtech2_state::laser_put_track()
{ {
device_image_interface *image = dynamic_cast<device_image_interface *>(laser_file(machine())); device_image_interface *image = dynamic_cast<device_image_interface *>(laser_file());
/* drive selected and image file ok? */ /* drive selected and image file ok? */
if( m_laser_drive >= 0 && laser_file(machine()) != NULL ) if( m_laser_drive >= 0 && laser_file() != NULL )
{ {
int size, offs; int size, offs;
offs = TRKSIZE_VZ * m_laser_track_x2[m_laser_drive]/2; offs = TRKSIZE_VZ * m_laser_track_x2[m_laser_drive]/2;

View File

@ -17,7 +17,7 @@
#include "includes/spectrum.h" #include "includes/spectrum.h"
#include "machine/ram.h" #include "machine/ram.h"
INLINE void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color) inline void spectrum_state::spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color)
{ {
bitmap.pix16(y, x) = (UINT16)color; bitmap.pix16(y, x) = (UINT16)color;
} }
@ -53,9 +53,8 @@ VIDEO_START_MEMBER(spectrum_state,ts2068)
*******************************************************************/ *******************************************************************/
/* Draw a scanline in TS2068/TC2048 hires mode (code modified from COUPE.C) */ /* Draw a scanline in TS2068/TC2048 hires mode (code modified from COUPE.C) */
static void ts2068_hires_scanline(running_machine &machine,bitmap_ind16 &bitmap, int y, int borderlines) void spectrum_state::ts2068_hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines)
{ {
spectrum_state *state = machine.driver_data<spectrum_state>();
int x,b,scrx,scry; int x,b,scrx,scry;
unsigned short ink,pap; unsigned short ink,pap;
unsigned char *attr, *scr; unsigned char *attr, *scr;
@ -63,13 +62,13 @@ static void ts2068_hires_scanline(running_machine &machine,bitmap_ind16 &bitmap,
scrx=TS2068_LEFT_BORDER; scrx=TS2068_LEFT_BORDER;
scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0); scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0);
scr=machine.device<ram_device>(RAM_TAG)->pointer() + y*32; scr=machine().device<ram_device>(RAM_TAG)->pointer() + y*32;
attr=scr + 0x2000; attr=scr + 0x2000;
for (x=0;x<32;x++) for (x=0;x<32;x++)
{ {
/* Get ink and paper colour with bright */ /* Get ink and paper colour with bright */
if (state->m_flash_invert && (*attr & 0x80)) if (m_flash_invert && (*attr & 0x80))
{ {
ink=((*attr)>>3) & 0x0f; ink=((*attr)>>3) & 0x0f;
pap=((*attr) & 0x07) + (((*attr)>>3) & 0x08); pap=((*attr) & 0x07) + (((*attr)>>3) & 0x08);
@ -99,7 +98,7 @@ static void ts2068_hires_scanline(running_machine &machine,bitmap_ind16 &bitmap,
} }
/* Draw a scanline in TS2068/TC2048 64-column mode */ /* Draw a scanline in TS2068/TC2048 64-column mode */
static void ts2068_64col_scanline(running_machine &machine,bitmap_ind16 &bitmap, int y, int borderlines, unsigned short inkcolor) void spectrum_state::ts2068_64col_scanline(bitmap_ind16 &bitmap, int y, int borderlines, unsigned short inkcolor)
{ {
int x,b,scrx,scry; int x,b,scrx,scry;
unsigned char *scr1, *scr2; unsigned char *scr1, *scr2;
@ -107,7 +106,7 @@ static void ts2068_64col_scanline(running_machine &machine,bitmap_ind16 &bitmap,
scrx=TS2068_LEFT_BORDER; scrx=TS2068_LEFT_BORDER;
scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0); scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0);
scr1=machine.device<ram_device>(RAM_TAG)->pointer() + y*32; scr1=machine().device<ram_device>(RAM_TAG)->pointer() + y*32;
scr2=scr1 + 0x2000; scr2=scr1 + 0x2000;
for (x=0;x<32;x++) for (x=0;x<32;x++)
@ -133,9 +132,8 @@ static void ts2068_64col_scanline(running_machine &machine,bitmap_ind16 &bitmap,
} }
/* Draw a scanline in TS2068/TC2048 lores (normal Spectrum) mode */ /* Draw a scanline in TS2068/TC2048 lores (normal Spectrum) mode */
static void ts2068_lores_scanline(running_machine &machine,bitmap_ind16 &bitmap, int y, int borderlines, int screen) void spectrum_state::ts2068_lores_scanline(bitmap_ind16 &bitmap, int y, int borderlines, int screen)
{ {
spectrum_state *state = machine.driver_data<spectrum_state>();
int x,b,scrx,scry; int x,b,scrx,scry;
unsigned short ink,pap; unsigned short ink,pap;
unsigned char *attr, *scr; unsigned char *attr, *scr;
@ -143,13 +141,13 @@ static void ts2068_lores_scanline(running_machine &machine,bitmap_ind16 &bitmap,
scrx=TS2068_LEFT_BORDER; scrx=TS2068_LEFT_BORDER;
scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0); scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0);
scr = machine.device<ram_device>(RAM_TAG)->pointer() + y*32 + screen*0x2000; scr = machine().device<ram_device>(RAM_TAG)->pointer() + y*32 + screen*0x2000;
attr = machine.device<ram_device>(RAM_TAG)->pointer() + ((scry>>3)*32) + screen*0x2000 + 0x1800; attr = machine().device<ram_device>(RAM_TAG)->pointer() + ((scry>>3)*32) + screen*0x2000 + 0x1800;
for (x=0;x<32;x++) for (x=0;x<32;x++)
{ {
/* Get ink and paper colour with bright */ /* Get ink and paper colour with bright */
if (state->m_flash_invert && (*attr & 0x80)) if (m_flash_invert && (*attr & 0x80))
{ {
ink=((*attr)>>3) & 0x0f; ink=((*attr)>>3) & 0x0f;
pap=((*attr) & 0x07) + (((*attr)>>3) & 0x08); pap=((*attr) & 0x07) + (((*attr)>>3) & 0x08);
@ -191,25 +189,25 @@ UINT32 spectrum_state::screen_update_ts2068(screen_device &screen, bitmap_ind16
/* 64 Column mode */ /* 64 Column mode */
unsigned short inkcolor = (m_port_ff_data & 0x38) >> 3; unsigned short inkcolor = (m_port_ff_data & 0x38) >> 3;
for (count = 0; count < 192; count++) for (count = 0; count < 192; count++)
ts2068_64col_scanline(machine(),bitmap, count, TS2068_TOP_BORDER, inkcolor); ts2068_64col_scanline(bitmap, count, TS2068_TOP_BORDER, inkcolor);
} }
else if ((m_port_ff_data & 7) == 2) else if ((m_port_ff_data & 7) == 2)
{ {
/* Extended Color mode */ /* Extended Color mode */
for (count = 0; count < 192; count++) for (count = 0; count < 192; count++)
ts2068_hires_scanline(machine(),bitmap, count, TS2068_TOP_BORDER); ts2068_hires_scanline(bitmap, count, TS2068_TOP_BORDER);
} }
else if ((m_port_ff_data & 7) == 1) else if ((m_port_ff_data & 7) == 1)
{ {
/* Screen 6000-7aff */ /* Screen 6000-7aff */
for (count = 0; count < 192; count++) for (count = 0; count < 192; count++)
ts2068_lores_scanline(machine(),bitmap, count, TS2068_TOP_BORDER, 1); ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 1);
} }
else else
{ {
/* Screen 4000-5aff */ /* Screen 4000-5aff */
for (count = 0; count < 192; count++) for (count = 0; count < 192; count++)
ts2068_lores_scanline(machine(),bitmap, count, TS2068_TOP_BORDER, 0); ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 0);
} }
return 0; return 0;
@ -228,25 +226,25 @@ UINT32 spectrum_state::screen_update_tc2048(screen_device &screen, bitmap_ind16
/* 64 Column mode */ /* 64 Column mode */
unsigned short inkcolor = (m_port_ff_data & 0x38) >> 3; unsigned short inkcolor = (m_port_ff_data & 0x38) >> 3;
for (count = 0; count < 192; count++) for (count = 0; count < 192; count++)
ts2068_64col_scanline(machine(),bitmap, count, SPEC_TOP_BORDER, inkcolor); ts2068_64col_scanline(bitmap, count, SPEC_TOP_BORDER, inkcolor);
} }
else if ((m_port_ff_data & 7) == 2) else if ((m_port_ff_data & 7) == 2)
{ {
/* Extended Color mode */ /* Extended Color mode */
for (count = 0; count < 192; count++) for (count = 0; count < 192; count++)
ts2068_hires_scanline(machine(),bitmap, count, SPEC_TOP_BORDER); ts2068_hires_scanline(bitmap, count, SPEC_TOP_BORDER);
} }
else if ((m_port_ff_data & 7) == 1) else if ((m_port_ff_data & 7) == 1)
{ {
/* Screen 6000-7aff */ /* Screen 6000-7aff */
for (count = 0; count < 192; count++) for (count = 0; count < 192; count++)
ts2068_lores_scanline(machine(),bitmap, count, SPEC_TOP_BORDER, 1); ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 1);
} }
else else
{ {
/* Screen 4000-5aff */ /* Screen 4000-5aff */
for (count = 0; count < 192; count++) for (count = 0; count < 192; count++)
ts2068_lores_scanline(machine(),bitmap, count, SPEC_TOP_BORDER, 0); ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 0);
} }
return 0; return 0;