#define EXPMEM_OFFSET 0x20000
-#define LONG_WIDTH (512 + 32)
+// LONG_WIDTH has already defined limits.h for GCC.20180614 K.O
+#define _V9938_LONG_WIDTH (512 + 32)
static const char *const v9938_modes[] = {
"TEXT 1", "MULTICOLOR", "GRAPHIC 1", "GRAPHIC 2", "GRAPHIC 3",
//v99x8_device::v99x8_device(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, device_t *owner, UINT32 clock)
//: device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__),
-v99x8_device::v99x8_device(VM* parent_vm, EMU* parent_emu)
+v99x8_device::v99x8_device(VM_TEMPLATE* parent_vm, EMU* parent_emu)
: DEVICE(parent_vm, parent_emu),
// device_memory_interface(mconfig, *this),
// device_video_interface(mconfig, *this),
//v9938_device::v9938_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
//: v99x8_device(mconfig, V9938, "V9938 VDP", "v9938", tag, owner, clock)
-v9938_device::v9938_device(VM* parent_vm, EMU* parent_emu)
+v9938_device::v9938_device(VM_TEMPLATE* parent_vm, EMU* parent_emu)
: v99x8_device(parent_vm, parent_emu)
{
m_model = MODEL_V9938;
//v9958_device::v9958_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
//: v99x8_device(mconfig, V9938, "V9958 VDP", "v9958", tag, owner, clock)
-v9958_device::v9958_device(VM* parent_vm, EMU* parent_emu)
+v9958_device::v9958_device(VM_TEMPLATE* parent_vm, EMU* parent_emu)
: v99x8_device(parent_vm, parent_emu)
{
m_model = MODEL_V9958;
int i;
pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
- i = LONG_WIDTH;
+ i = _V9938_LONG_WIDTH;
while (i--) *ln++ = pen;
}
int i;
pen = pens[m_pal_ind256[m_cont_reg[7]]];
- i = LONG_WIDTH;
+ i = _V9938_LONG_WIDTH;
while (i--) *ln++ = pen;
}
pen1 = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
- i = LONG_WIDTH / 2;
+ i = _V9938_LONG_WIDTH / 2;
while (i--) { *ln++ = pen0; *ln++ = pen1; }
}
if (m_cont_reg[9] & 0x08)
{
// ln = &m_bitmap.pix16(m_scanline*2+((m_stat_reg[2]>>1)&1));
- ln = screen+(m_scanline*2+((m_stat_reg[2]>>1)&1))*LONG_WIDTH;
+ ln = screen+(m_scanline*2+((m_stat_reg[2]>>1)&1))*_V9938_LONG_WIDTH;
}
else
{
// ln = &m_bitmap.pix16(m_scanline*2);
// ln2 = &m_bitmap.pix16(m_scanline*2+1);
- ln = screen+(m_scanline*2)*LONG_WIDTH;
- ln2 = screen+(m_scanline*2+1)*LONG_WIDTH;
+ ln = screen+(m_scanline*2)*_V9938_LONG_WIDTH;
+ ln2 = screen+(m_scanline*2+1)*_V9938_LONG_WIDTH;
double_lines = true;
}
}
if (double_lines)
- memcpy(ln2, ln, (512 + 32) * sizeof(scrntype_t));
+ my_memcpy(ln2, ln, (512 + 32) * sizeof(scrntype_t));
}
void v99x8_device::refresh_line(int line)
scrntype_t *dst;
int y;
if(osd == NULL) return;
+ emu->set_vm_screen_lines(__SCREEN_HEIGHT);
for(y=0; y< __SCREEN_HEIGHT; y++) {
if((dst = osd->get_vm_screen_buffer(y)) != NULL) {
- memcpy(dst, screen+(y+18)*LONG_WIDTH+2, __SCREEN_WIDTH*sizeof(scrntype_t));
+ my_memcpy(dst, screen+(y+18)*_V9938_LONG_WIDTH+2, __SCREEN_WIDTH*sizeof(scrntype_t));
}
}
}
#define STATE_VERSION 2
-void v99x8_device::save_state(FILEIO* state_fio)
+bool v99x8_device::process_state(FILEIO* state_fio, bool loading)
{
- state_fio->FputUint32(STATE_VERSION);
- state_fio->FputInt32(this_device_id);
-
- save_load_state(state_fio, true);
-}
-
-bool v99x8_device::load_state(FILEIO* state_fio)
-{
- if(state_fio->FgetUint32() != STATE_VERSION) {
- return false;
- }
- if(state_fio->FgetInt32() != this_device_id) {
- return false;
- }
-
- save_load_state(state_fio, false);
-
- return true;
+ if(!state_fio->StateCheckUint32(STATE_VERSION)) {
+ return false;
+ }
+ if(!state_fio->StateCheckInt32(this_device_id)) {
+ return false;
+ }
+ save_load_state(state_fio, !loading);
+ return true;
}
void v99x8_device::save_load_state(FILEIO* state_fio, bool is_save)