diff options
Diffstat (limited to 'src/mess')
120 files changed, 1730 insertions, 1752 deletions
diff --git a/src/mess/audio/dave.c b/src/mess/audio/dave.c index f2462a8171c..ed1da446e6c 100644 --- a/src/mess/audio/dave.c +++ b/src/mess/audio/dave.c @@ -55,13 +55,13 @@ ADDRESS_MAP_END dave_device::dave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, DAVE, "DAVE", tag, owner, clock, "dave", __FILE__), - device_memory_interface(mconfig, *this), - device_sound_interface(mconfig, *this), - m_program_space_config("program", ENDIANNESS_LITTLE, 8, 22, 0, *ADDRESS_MAP_NAME(program_map)), - m_io_space_config("i/o", ENDIANNESS_LITTLE, 8, 16, 0, *ADDRESS_MAP_NAME(io_map)), - m_write_irq(*this), - m_write_lh(*this), - m_write_rh(*this) + device_memory_interface(mconfig, *this), + device_sound_interface(mconfig, *this), + m_program_space_config("program", ENDIANNESS_LITTLE, 8, 22, 0, *ADDRESS_MAP_NAME(program_map)), + m_io_space_config("i/o", ENDIANNESS_LITTLE, 8, 16, 0, *ADDRESS_MAP_NAME(io_map)), + m_write_irq(*this), + m_write_lh(*this), + m_write_rh(*this) { } @@ -80,7 +80,7 @@ void dave_device::device_start() // allocate timers m_timer_1hz = timer_alloc(TIMER_1HZ); m_timer_1hz->adjust(attotime::from_hz(2), 0, attotime::from_hz(2)); - + m_timer_50hz = timer_alloc(TIMER_50HZ); m_timer_50hz->adjust(attotime::from_hz(2000), 0, attotime::from_hz(2000)); @@ -101,10 +101,10 @@ void dave_device::device_start() m_count[i] = (STEP * machine().sample_rate()) / 125000; m_level[i] = 0; } - + /* dave has 3 tone channels and 1 noise channel. the volumes are mixed internally and output as left and right volume */ - + /* 3 tone channels + 1 noise channel */ m_sound_stream_var = machine().sound().stream_alloc(*this, 0, 2, machine().sample_rate(), this); } @@ -186,20 +186,20 @@ void dave_device::sound_stream_update(sound_stream &stream, stream_sample_t **in int output_volumes[8]; int left_volume; int right_volume; - + //logerror("sound update!\n"); - + buffer1 = outputs[0]; buffer2 = outputs[1]; - + while (samples) { int vol[4]; - + /* vol[] keeps track of how long each square wave stays */ /* in the 1 position during the sample period. */ vol[0] = vol[1] = vol[2] = vol[3] = 0; - + for (int i = 0; i < 3; i++) { if ((m_regs[7] & (1 << i))==0) @@ -230,9 +230,9 @@ void dave_device::sound_stream_update(sound_stream &stream, stream_sample_t **in vol[i] -= m_count[i]; } } - + /* update volume outputs */ - + /* setup output volumes for each channel */ /* channel 0 */ output_volumes[0] = ((m_level[0] & m_level_and[0]) | m_level_or[0]) & m_mame_volumes[0]; @@ -246,13 +246,13 @@ void dave_device::sound_stream_update(sound_stream &stream, stream_sample_t **in /* channel 3 */ output_volumes[6] = ((m_level[3] & m_level_and[6]) | m_level_or[6]) & m_mame_volumes[3]; output_volumes[7] = ((m_level[3] & m_level_and[7]) | m_level_or[7]) & m_mame_volumes[7]; - + left_volume = (output_volumes[0] + output_volumes[2] + output_volumes[4] + output_volumes[6])>>2; right_volume = (output_volumes[1] + output_volumes[3] + output_volumes[5] + output_volumes[7])>>2; - + *(buffer1++) = left_volume; *(buffer2++) = right_volume; - + samples--; } } @@ -600,7 +600,7 @@ WRITE8_MEMBER( dave_device::io_w ) //------------------------------------------------- -// update_interrupt - +// update_interrupt - //------------------------------------------------- void dave_device::update_interrupt() diff --git a/src/mess/audio/dave.h b/src/mess/audio/dave.h index a4bcdd79a10..78be61b75ff 100644 --- a/src/mess/audio/dave.h +++ b/src/mess/audio/dave.h @@ -27,12 +27,12 @@ ///************************************************************************* #define MCFG_DAVE_ADD(_tag, _clock, _irq, _program_map, _io_map) \ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") \ + MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") \ MCFG_SOUND_ADD(_tag, DAVE, _clock) \ MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) \ MCFG_SOUND_ROUTE(1, "rspeaker", 0.25) \ - MCFG_DEVICE_ADDRESS_MAP(AS_PROGRAM, _program_map) \ - MCFG_DEVICE_ADDRESS_MAP(AS_IO, _io_map) \ + MCFG_DEVICE_ADDRESS_MAP(AS_PROGRAM, _program_map) \ + MCFG_DEVICE_ADDRESS_MAP(AS_IO, _io_map) \ downcast<dave_device *>(device)->set_irq_callback(DEVCB2_##_irq); @@ -89,14 +89,14 @@ private: enum { - IRQ_50HZ_DIVIDER = 0x01, - IRQ_50HZ_LATCH = 0x02, - IRQ_1HZ_DIVIDER = 0x04, - IRQ_1HZ_LATCH = 0x08, - IRQ_INT1 = 0x10, - IRQ_INT1_LATCH = 0x20, - IRQ_INT2 = 0x40, - IRQ_INT2_LATCH = 0x80, + IRQ_50HZ_DIVIDER = 0x01, + IRQ_50HZ_LATCH = 0x02, + IRQ_1HZ_DIVIDER = 0x04, + IRQ_1HZ_LATCH = 0x08, + IRQ_INT1 = 0x10, + IRQ_INT1_LATCH = 0x20, + IRQ_INT2 = 0x40, + IRQ_INT2_LATCH = 0x80, IRQ_LATCH = IRQ_INT2_LATCH | IRQ_INT1_LATCH | IRQ_1HZ_LATCH | IRQ_50HZ_LATCH }; @@ -122,7 +122,7 @@ private: int m_period[4]; int m_count[4]; int m_level[4]; - + /* these are used to force channels on/off */ /* if one of the or values is 0x0ff, this means the volume will be forced on,else it is dependant on @@ -131,13 +131,13 @@ private: /* if one of the values is 0x00, this means the volume is forced off, else it is dependant on the wave */ int m_level_and[8]; - + /* these are the current channel volumes in MAME form */ int m_mame_volumes[8]; - + /* update step */ //int m_update_step; - + sound_stream *m_sound_stream_var; }; diff --git a/src/mess/audio/mac.c b/src/mess/audio/mac.c index be71718116d..82b064eacc3 100644 --- a/src/mess/audio/mac.c +++ b/src/mess/audio/mac.c @@ -82,20 +82,20 @@ void mac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t { INT16 last_val = 0; stream_sample_t *buffer = outputs[0]; - + if ((m_mac_model == MODEL_MAC_PORTABLE) || (m_mac_model == MODEL_MAC_PB100)) { memset(buffer, 0, samples * sizeof(*buffer)); return; } - + /* if we're not enabled, just fill with 0 */ if (machine().sample_rate() == 0) { memset(buffer, 0, samples * sizeof(*buffer)); return; } - + /* fill in the sample */ while (samples && m_snd_cache_len) { @@ -105,7 +105,7 @@ void mac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t m_snd_cache_len--; samples--; } - + while (samples--) { /* should never happen */ diff --git a/src/mess/audio/mea8000.c b/src/mess/audio/mea8000.c index 677c62970d9..65482e5c252 100644 --- a/src/mess/audio/mea8000.c +++ b/src/mess/audio/mea8000.c @@ -130,7 +130,7 @@ void mea8000_device::device_config_complete() const mea8000_interface *intf = reinterpret_cast<const mea8000_interface *>(static_config()); if (intf != NULL) *static_cast<mea8000_interface *>(this) = *intf; - + // or initialize to defaults if none provided else { @@ -146,9 +146,9 @@ void mea8000_device::device_start() m_req_out.resolve(m_req_out_cb, *this); m_dac = machine().device<dac_device>(m_channel); - + init_tables(); - + m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mea8000_device::timer_expire),this)); save_item(NAME(m_state)); @@ -176,7 +176,7 @@ void mea8000_device::device_start() save_item(NAME(m_last_pitch)); save_item(NAME(m_pitch)); save_item(NAME(m_noise)); -} +} //------------------------------------------------- // device_reset - device-specific reset @@ -210,7 +210,6 @@ int mea8000_device::accept_byte() void mea8000_device::update_req() { - // actually, req pulses less than 3us for each new byte, // it goes back up if there space left in the buffer, or stays low if the // buffer contains a complete frame and the CPU nees to wait for the next @@ -557,7 +556,7 @@ WRITE8_MEMBER( mea8000_device::write ) else { /* enqueue frame byte */ - LOG(("$%04x %f: mea8000_w data %02X in frame pos %i\n", machine().firstcpu->pcbase(), machine().time().as_double(), + LOG(("$%04x %f: mea8000_w data %02X in frame pos %i\n", machine().firstcpu->pcbase(), machine().time().as_double(), data, m_bufpos)); m_buf[m_bufpos] = data; m_bufpos++; diff --git a/src/mess/audio/mea8000.h b/src/mess/audio/mea8000.h index 52b36ebab18..c8e5d3ae316 100644 --- a/src/mess/audio/mea8000.h +++ b/src/mess/audio/mea8000.h @@ -52,7 +52,7 @@ struct mea8000_interface { /* output channel */ const char * m_channel; - + /* 1-bit 'ready' output, not negated */ devcb_write8 m_req_out_cb; }; @@ -105,37 +105,37 @@ private: /* state */ mea8000_state m_state; /* current state */ - + UINT8 m_buf[4]; /* store 4 consecutive data to form a frame info */ UINT8 m_bufpos; /* new byte to write in frame info buffer */ - + UINT8 m_cont; /* if no data 0=stop 1=repeat last frame */ UINT8 m_roe; /* enable req output, now unimplemented */ - + UINT16 m_framelength; /* in samples */ UINT16 m_framepos; /* in samples */ UINT16 m_framelog; /* log2 of framelength */ - + INT16 m_lastsample, m_sample; /* output samples are interpolated */ - + UINT32 m_phi; /* absolute phase for frequency / noise generator */ - + filter_t m_f[4]; /* filters */ - + UINT16 m_last_ampl, m_ampl; /* amplitude * 1000 */ UINT16 m_last_pitch, m_pitch; /* pitch of sawtooth signal, in Hz */ UINT8 m_noise; - + emu_timer *m_timer; - + devcb_resolved_write8 m_req_out; - + int m_cos_table[TABLE_LEN]; /* fm => cos coefficient */ int m_exp_table[TABLE_LEN]; /* bw => exp coefficient */ int m_exp2_table[TABLE_LEN]; /* bw => 2*exp coefficient */ int m_noise_table[NOISE_LEN]; - + }; extern const device_type MEA8000; diff --git a/src/mess/audio/upd1771.c b/src/mess/audio/upd1771.c index 601e8b78f6f..ad07d815a98 100644 --- a/src/mess/audio/upd1771.c +++ b/src/mess/audio/upd1771.c @@ -240,7 +240,7 @@ void upd1771c_device::device_config_complete() const upd1771_interface *intf = reinterpret_cast<const upd1771_interface *>(static_config()); if (intf != NULL) *static_cast<upd1771_interface *>(this) = *intf; - + // or initialize to defaults if none provided else { @@ -256,11 +256,11 @@ void upd1771c_device::device_start() { /* resolve callbacks */ m_ack_out_func.resolve(m_ack_callback, *this); - + m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(upd1771c_device::ack_callback),this)); - + m_channel = machine().sound().stream_alloc(*this, 0, 1, clock() / 4, this); - + save_item(NAME(m_packet)); save_item(NAME(m_index)); save_item(NAME(m_expected_bytes)); @@ -385,32 +385,32 @@ WRITE8_MEMBER( upd1771c_device::write ) m_index = 0; //logerror( "upd1771_w: ----------------silence state reset\n"); break; - + case 1: if (m_index == 10) { m_state = STATE_NOISE; m_index = 0; - + m_nw_timbre = (m_packet[1] & 0xe0) >> 5; m_nw_period = ((UINT32)m_packet[2] + 1) << 7; m_nw_volume = m_packet[3] & 0x1f; - + //very long clocked periods.. used for engine drones m_n_period[0] = (((UINT32)m_packet[4]) + 1) << 7; m_n_period[1] = (((UINT32)m_packet[5]) + 1) << 7; m_n_period[2] = (((UINT32)m_packet[6]) + 1) << 7; - + m_n_volume[0] = m_packet[7] & 0x1f; m_n_volume[1] = m_packet[8] & 0x1f; m_n_volume[2] = m_packet[9] & 0x1f; - + //logerror( "upd1771_w: ----------------noise state reset\n"); } else m_timer->adjust(attotime::from_ticks(512, clock())); break; - + case 2: if (m_index == 4) { @@ -421,18 +421,18 @@ WRITE8_MEMBER( upd1771c_device::write ) //smaller periods dont all equal to 0x20 if (m_t_period < 0x20) m_t_period = 0x20; - + m_t_volume = m_packet[3] & 0x1f; m_state = STATE_TONE; m_index = 0; } else - m_timer->adjust(attotime::from_ticks(512, clock())); + m_timer->adjust(attotime::from_ticks(512, clock())); break; case 0x1f: //6Khz(ish) DIGI playback - + //end capture if (m_index >= 2 && m_packet[m_index - 2] == 0xfe && m_packet[m_index - 1] == 0x00) { @@ -481,37 +481,37 @@ TIMER_CALLBACK_MEMBER( upd1771c_device::ack_callback ) void upd1771c_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { stream_sample_t *buffer = outputs[0]; - + switch (m_state) { case STATE_TONE: //logerror( "upd1771_STATE_TONE samps:%d %d %d %d %d %d\n",(int)samples, // (int)m_t_timbre,(int)m_t_offset,(int)m_t_volume,(int)m_t_period,(int)m_t_tpos); - + while (--samples >= 0) { *buffer++ = (WAVEFORMS[m_t_timbre][m_t_tpos]) * m_t_volume * 2; - + m_t_ppos++; if (m_t_ppos >= m_t_period) { m_t_tpos++; if (m_t_tpos == 32) m_t_tpos = m_t_offset; - + m_t_ppos = 0; } } break; - + case STATE_NOISE: while (--samples >= 0) { *buffer = 0; - + //"wavetable-LFSR" component int wlfsr_val = ((int)noise_tbl[m_nw_tpos]) - 127;//data too wide - + m_nw_ppos++; if (m_nw_ppos >= m_nw_period) { @@ -520,7 +520,7 @@ void upd1771c_device::sound_stream_update(sound_stream &stream, stream_sample_t m_nw_tpos = 0; m_nw_ppos = 0; } - + //mix in each of the noise's 3 pulse components char res[3]; for (int i = 0; i < 3; ++i) @@ -535,16 +535,16 @@ void upd1771c_device::sound_stream_update(sound_stream &stream, stream_sample_t } //not quite, but close. *buffer+= ( - (wlfsr_val * m_nw_volume) | - (res[0] * m_n_volume[0]) | - (res[1] * m_n_volume[1]) | - (res[2] * m_n_volume[2]) - ) ; - + (wlfsr_val * m_nw_volume) | + (res[0] * m_n_volume[0]) | + (res[1] * m_n_volume[1]) | + (res[2] * m_n_volume[2]) + ) ; + buffer++; } break; - + default: //fill buffer with silence while (--samples >= 0) diff --git a/src/mess/audio/upd1771.h b/src/mess/audio/upd1771.h index a798bcd9550..f8c50a7996c 100644 --- a/src/mess/audio/upd1771.h +++ b/src/mess/audio/upd1771.h @@ -36,7 +36,7 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); WRITE_LINE_MEMBER( pcm_write ); - + protected: // device-level overrides virtual void device_config_complete(); @@ -57,10 +57,10 @@ private: UINT8 m_packet[MAX_PACKET_SIZE]; UINT32 m_index; UINT8 m_expected_bytes; - + UINT8 m_state;//0:silence, 1 noise, 2 tone UINT8 m_pc3; - + //tone UINT8 m_t_timbre; //[0; 7] UINT8 m_t_offset; //[0; 32] @@ -68,14 +68,14 @@ private: UINT8 m_t_volume; //[0; 31] UINT8 m_t_tpos;//timbre pos UINT16 m_t_ppos;//period pos - + //noise wavetable LFSR UINT8 m_nw_timbre; //[0; 7] UINT8 m_nw_volume; //[0; 31] UINT32 m_nw_period; UINT32 m_nw_tpos; //timbre pos UINT32 m_nw_ppos; //period pos - + //noise pulse components UINT8 m_n_value[3]; //[0;1] UINT16 m_n_volume[3]; //[0; 31] diff --git a/src/mess/drivers/a7000.c b/src/mess/drivers/a7000.c index a45cada5a40..bf559cb09c8 100644 --- a/src/mess/drivers/a7000.c +++ b/src/mess/drivers/a7000.c @@ -5,8 +5,8 @@ very preliminary driver by Angelo Salese, based on work by Tomasz Slanina and Tom Walker - TODO: - - probably needs a full rewrite & merge with ssfindo.c + TODO: + - probably needs a full rewrite & merge with ssfindo.c ??? bp (0382827C) (second trigger) diff --git a/src/mess/drivers/abc80.c b/src/mess/drivers/abc80.c index 9c71b12c979..fdc8b56cf81 100644 --- a/src/mess/drivers/abc80.c +++ b/src/mess/drivers/abc80.c @@ -215,7 +215,7 @@ static INPUT_PORTS_START( abc80 ) PORT_DIPUNKNOWN_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:6" ) PORT_DIPUNKNOWN_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW1:7" ) PORT_DIPUNKNOWN_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" ) - + PORT_START("SW2") PORT_DIPUNKNOWN_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" ) PORT_DIPUNKNOWN_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW2:2" ) diff --git a/src/mess/drivers/altos5.c b/src/mess/drivers/altos5.c index 3456234bbe5..13931f021e1 100644 --- a/src/mess/drivers/altos5.c +++ b/src/mess/drivers/altos5.c @@ -129,7 +129,7 @@ UINT8 altos5_state::convert(offs_t offset, bool state) // normalise bank number (4x becomes 0x; 2x and 1x are already ok) return data & 0x3f; } - + void altos5_state::setup_banks(UINT8 source) { offs_t offs,temp; @@ -248,7 +248,7 @@ static Z80DMA_INTERFACE( dma_intf ) { DEVCB_DRIVER_LINE_MEMBER(altos5_state, busreq_w), DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), - DEVCB_NULL, // BAO, not used + DEVCB_NULL, // BAO, not used DEVCB_DRIVER_MEMBER(altos5_state, memory_read_byte), DEVCB_DRIVER_MEMBER(altos5_state, memory_write_byte), DEVCB_DRIVER_MEMBER(altos5_state, io_read_byte), @@ -300,7 +300,7 @@ static Z80PIO_INTERFACE( pio0_intf ) d0: L = a HD is present d1: L = a 2nd hard drive is present d2: unused configuration input (must be H to skip HD boot) -d3: selected floppy is single(L) or double sided(H) +d3: selected floppy is single(L) or double sided(H) d7: IRQ from FDC */ READ8_MEMBER( altos5_state::port08_r ) diff --git a/src/mess/drivers/applix.c b/src/mess/drivers/applix.c index c030c0fe314..c14a0c6bd58 100644 --- a/src/mess/drivers/applix.c +++ b/src/mess/drivers/applix.c @@ -954,7 +954,6 @@ ROM_END DRIVER_INIT_MEMBER(applix_state, applix) { - floppy_connector *con = machine().device<floppy_connector>("wd1772:0"); floppy_image_device *floppy = con ? con->get_device() : 0; if (floppy) diff --git a/src/mess/drivers/argo.c b/src/mess/drivers/argo.c index ca1b4788b78..80b99fe84da 100644 --- a/src/mess/drivers/argo.c +++ b/src/mess/drivers/argo.c @@ -35,8 +35,8 @@ public: argo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_p_videoram(*this, "p_videoram"){ } + m_maincpu(*this, "maincpu"), + m_p_videoram(*this, "p_videoram"){ } required_device<cpu_device> m_maincpu; DECLARE_WRITE8_MEMBER(argo_videoram_w); diff --git a/src/mess/drivers/attache.c b/src/mess/drivers/attache.c index 19971f91708..d8333a77d41 100644 --- a/src/mess/drivers/attache.c +++ b/src/mess/drivers/attache.c @@ -68,42 +68,42 @@ class attache_state : public driver_device public: attache_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this,"maincpu"), - m_rom(*this,"boot"), - m_ram(*this,RAM_TAG), - m_char_rom(*this,"video"), - m_rtc(*this,"rtc"), - m_psg(*this,"psg"), - m_fdc(*this,"fdc"), - m_sio(*this,"sio"), - m_pio(*this,"pio"), - m_ctc(*this,"ctc"), - m_crtc(*this,"crtc"), - m_dma(*this, "dma"), - m_floppy0(*this, "fdc:0:525dd"), - m_floppy1(*this, "fdc:1:525dd"), - m_kb_row0(*this, "row0"), - m_kb_row1(*this, "row1"), - m_kb_row2(*this, "row2"), - m_kb_row3(*this, "row3"), - m_kb_row4(*this, "row4"), - m_kb_row5(*this, "row5"), - m_kb_row6(*this, "row6"), - m_kb_row7(*this, "row7"), - m_kb_mod(*this, "modifiers"), - m_membank1(*this, "bank1"), - m_membank2(*this, "bank2"), - m_membank3(*this, "bank3"), - m_membank4(*this, "bank4"), - m_membank5(*this, "bank5"), - m_membank6(*this, "bank6"), - m_membank7(*this, "bank7"), - m_membank8(*this, "bank8"), - m_nvram(*this, "nvram"), - m_rom_active(true), - m_gfx_enabled(false), - m_kb_clock(true), - m_kb_empty(true) + m_maincpu(*this,"maincpu"), + m_rom(*this,"boot"), + m_ram(*this,RAM_TAG), + m_char_rom(*this,"video"), + m_rtc(*this,"rtc"), + m_psg(*this,"psg"), + m_fdc(*this,"fdc"), + m_sio(*this,"sio"), + m_pio(*this,"pio"), + m_ctc(*this,"ctc"), + m_crtc(*this,"crtc"), + m_dma(*this, "dma"), + m_floppy0(*this, "fdc:0:525dd"), + m_floppy1(*this, "fdc:1:525dd"), + m_kb_row0(*this, "row0"), + m_kb_row1(*this, "row1"), + m_kb_row2(*this, "row2"), + m_kb_row3(*this, "row3"), + m_kb_row4(*this, "row4"), + m_kb_row5(*this, "row5"), + m_kb_row6(*this, "row6"), + m_kb_row7(*this, "row7"), + m_kb_mod(*this, "modifiers"), + m_membank1(*this, "bank1"), + m_membank2(*this, "bank2"), + m_membank3(*this, "bank3"), + m_membank4(*this, "bank4"), + m_membank5(*this, "bank5"), + m_membank6(*this, "bank6"), + m_membank7(*this, "bank7"), + m_membank8(*this, "bank8"), + m_nvram(*this, "nvram"), + m_rom_active(true), + m_gfx_enabled(false), + m_kb_clock(true), + m_kb_empty(true) { } // PIO port B operation select @@ -235,7 +235,7 @@ UINT32 attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, { UINT8 x,y,bit,scan,data; UINT8 dbl_mode = 0; // detemines which half of character to display when using double size attribute, - // as it can start on either odd or even character cells. + // as it can start on either odd or even character cells. // Graphics output (if enabled) if(m_gfx_enabled) @@ -542,31 +542,31 @@ void attache_state::operation_strobe(address_space& space, UINT8 data) WRITE8_MEMBER(attache_state::pio_portA_w) { - // AO-7 = LATCH DATA OUT: - // LO = MOTOR ON - // L1 = GRAPHICS ENABLE - // L2 = /EPROM ENABLE - // L3-7 = DISPLAY BRIGHTNESS - // AO-7 = 8910 DATA I/O: - // AO-3 = 5832 DO-3 I/O - // A4-7 = 5832 AO-3 OUT - // AO-3 = 5101 DO-3 I/O - // A4-7 = 5101 AO-3 OUT + // AO-7 = LATCH DATA OUT: + // LO = MOTOR ON + // L1 = GRAPHICS ENABLE + // L2 = /EPROM ENABLE + // L3-7 = DISPLAY BRIGHTNESS + // AO-7 = 8910 DATA I/O: + // AO-3 = 5832 DO-3 I/O + // A4-7 = 5832 AO-3 OUT + // AO-3 = 5101 DO-3 I/O + // A4-7 = 5101 AO-3 OUT m_pio_porta = data; } WRITE8_MEMBER(attache_state::pio_portB_w) { - // BO-1 = 5101 A4-5 - // B2-4 = OPERATION SELECT - // 0 = 8910 ADDR LOAD - // 1 = 8910 DATA LOAD - // 2 = 5832 WRITE - // 3 = 5832 READ - // 4 = 5101 WRITE - // 5 = 5101 READ - // 6 = LATCH LOAD - // 7 = NO-OP + // BO-1 = 5101 A4-5 + // B2-4 = OPERATION SELECT + // 0 = 8910 ADDR LOAD + // 1 = 8910 DATA LOAD + // 2 = 5832 WRITE + // 3 = 5832 READ + // 4 = 5101 WRITE + // 5 = 5101 READ + // 6 = LATCH LOAD + // 7 = NO-OP //B5 = /'138 OPERATION STROBE //B6 = /KEYBOARD DATA IN //B7 = /KEYBOARD CLOCK OUT @@ -646,8 +646,8 @@ WRITE8_MEMBER(attache_state::display_data_w) case DISP_CHAR: m_char_ram[(m_char_line*128)+(param & 0x7f)] = data; break; -// default: -// logerror("Unimplemented display operation %02x data %02x param %02x\n",m_current_cmd,data,param); +// default: +// logerror("Unimplemented display operation %02x data %02x param %02x\n",m_current_cmd,data,param); } } @@ -756,7 +756,6 @@ WRITE_LINE_MEMBER(attache_state::eop_w) WRITE_LINE_MEMBER( attache_state::fdc_dack_w ) { - } static ADDRESS_MAP_START( attache_map , AS_PROGRAM, 8, attache_state) @@ -1040,7 +1039,7 @@ static MACHINE_CONFIG_START( attache, attache_state ) MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("64k") - + MCFG_SOFTWARE_LIST_ADD("disk_list","attache") MACHINE_CONFIG_END diff --git a/src/mess/drivers/bml3.c b/src/mess/drivers/bml3.c index 4727a19f165..3d0f47d6cf8 100644 --- a/src/mess/drivers/bml3.c +++ b/src/mess/drivers/bml3.c @@ -806,49 +806,49 @@ static WRITE_LINE_DEVICE_HANDLER( bml3_fdc_intrq_w ) TIMER_DEVICE_CALLBACK_MEMBER(bml3_state::keyboard_callback) { static const char *const portnames[3] = { "key1","key2","key3" }; - int i,port_i,scancode,trigger = 0; - - if(!m_keyb_press_flag) - { - m_keyb_scancode = (m_keyb_scancode + 1) & 0x7F; - scancode = m_keyb_scancode; - - if (scancode == 0x7F) - { - if (m_keyb_empty_scan == 1) - { - // full scan completed with no keypress - m_keyb_press = 0; - if (!m_keyb_counter_operation_disabled) - trigger = !0; - } - if (m_keyb_empty_scan > 0) - m_keyb_empty_scan--; - } - else if (scancode < 32*3) - { - port_i = scancode / 32; - i = scancode % 32; + int i,port_i,scancode,trigger = 0; + + if(!m_keyb_press_flag) + { + m_keyb_scancode = (m_keyb_scancode + 1) & 0x7F; + scancode = m_keyb_scancode; + + if (scancode == 0x7F) + { + if (m_keyb_empty_scan == 1) + { + // full scan completed with no keypress + m_keyb_press = 0; + if (!m_keyb_counter_operation_disabled) + trigger = !0; + } + if (m_keyb_empty_scan > 0) + m_keyb_empty_scan--; + } + else if (scancode < 32*3) + { + port_i = scancode / 32; + i = scancode % 32; if((ioport(portnames[port_i])->read()>>i) & 1) { - m_keyb_empty_scan = 2; - trigger = !0; - } - } - if (trigger) - { - m_keyb_press_flag = 1; - m_keyb_press = m_keyb_scancode | 0x80; - if (!m_keyb_interrupt_disabled) + m_keyb_empty_scan = 2; + trigger = !0; + } + } + if (trigger) + { + m_keyb_press_flag = 1; + m_keyb_press = m_keyb_scancode | 0x80; + if (!m_keyb_interrupt_disabled) m_maincpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE); - } - /* - else { - // #$# ? don't need this - m_maincpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); - } - */ - } + } + /* + else { + // #$# ? don't need this + m_maincpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); + } + */ + } } @@ -1167,10 +1167,10 @@ static MACHINE_CONFIG_START( bml3, bml3_state ) MCFG_PIA6821_ADD("pia6821", bml3_pia_config) MCFG_ACIA6850_ADD("acia6850", bml3_acia_if) - /* floppy */ + /* floppy */ // #$# not sure what wd17xx model, this is just a guess - MCFG_WD1773_ADD("fdc", bml3_wd17xx_interface ) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bml3_floppy_interface) + MCFG_WD1773_ADD("fdc", bml3_wd17xx_interface ) + MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bml3_floppy_interface) /* Audio */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/chessmst.c b/src/mess/drivers/chessmst.c index 8825d6cb446..f8685f3a0a9 100644 --- a/src/mess/drivers/chessmst.c +++ b/src/mess/drivers/chessmst.c @@ -23,7 +23,7 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_speaker(*this, "speaker") - { } + { } required_device<cpu_device> m_maincpu; required_device<speaker_sound_device> m_speaker; diff --git a/src/mess/drivers/concept.c b/src/mess/drivers/concept.c index 7e714dc44b9..71402ad765a 100644 --- a/src/mess/drivers/concept.c +++ b/src/mess/drivers/concept.c @@ -237,8 +237,8 @@ static MACHINE_CONFIG_START( concept, concept_state ) MCFG_MOS6551_ADD(ACIA_1_TAG, XTAL_1_8432MHz, NULL) MCFG_CONCEPT_EXP_PORT_ADD("exp1", concept_exp_devices, NULL) - MCFG_CONCEPT_EXP_PORT_ADD("exp2", concept_exp_devices, "fdc") // Flat cable Hard Disk Controller in Slot 2 - MCFG_CONCEPT_EXP_PORT_ADD("exp3", concept_exp_devices, "hdc") // Floppy Disk Controller in Slot 3 + MCFG_CONCEPT_EXP_PORT_ADD("exp2", concept_exp_devices, "fdc") // Flat cable Hard Disk Controller in Slot 2 + MCFG_CONCEPT_EXP_PORT_ADD("exp3", concept_exp_devices, "hdc") // Floppy Disk Controller in Slot 3 MCFG_CONCEPT_EXP_PORT_ADD("exp4", concept_exp_devices, NULL) // 2x RS232 ports! @@ -249,21 +249,21 @@ ROM_START( concept ) ROM_REGION16_BE(0x100000,"maincpu",0) /* 68k rom and ram */ // concept boot ROM - ROM_SYSTEM_BIOS(0, "lvl8", "Level 8" ) // v0? + ROM_SYSTEM_BIOS(0, "lvl8", "Level 8" ) // v0? ROMX_LOAD("bootl08h", 0x010000, 0x1000, CRC(ee479f51) SHA1(b20ba18564672196076e46507020c6d69a640a2f), ROM_BIOS(1) | ROM_SKIP(1)) ROMX_LOAD("bootl08l", 0x010001, 0x1000, CRC(acaefd07) SHA1(de0c7eaacaf4c0652aa45e523cebce2b2993c437), ROM_BIOS(1) | ROM_SKIP(1)) - ROM_SYSTEM_BIOS(1, "lvl7", "Level 7" ) // v0? v1? + ROM_SYSTEM_BIOS(1, "lvl7", "Level 7" ) // v0? v1? ROMX_LOAD("cc07h", 0x010000, 0x1000, CRC(455abac8) SHA1(b12e1580220242d34eafed1b486cebd89e823c8b), ROM_BIOS(2) | ROM_SKIP(1)) ROMX_LOAD("cc07l", 0x010001, 0x1000, CRC(107a3830) SHA1(0ea12ef13b0d11fcd83b306b3a1bb8014ba910c0), ROM_BIOS(2) | ROM_SKIP(1)) - ROM_SYSTEM_BIOS(2, "lvl6", "Level 6" ) // v0? + ROM_SYSTEM_BIOS(2, "lvl6", "Level 6" ) // v0? ROMX_LOAD("cc06h", 0x010000, 0x1000, CRC(66b6b259) SHA1(1199a38ef3e94f695e8da6a7c80c6432da3cb80c), ROM_BIOS(3) | ROM_SKIP(1)) ROMX_LOAD("cc06l", 0x010001, 0x1000, CRC(600940d3) SHA1(c3278bf23b3b1c35ea1e3da48a05e877862a8345), ROM_BIOS(3) | ROM_SKIP(1)) #if 0 // version 1 lvl 7 release - ROM_LOAD16_BYTE("bootl17h", 0x010000, 0x1000, CRC(6dd9718f)) // where does this come from? + ROM_LOAD16_BYTE("bootl17h", 0x010000, 0x1000, CRC(6dd9718f)) // where does this come from? ROM_LOAD16_BYTE("bootl17l", 0x010001, 0x1000, CRC(107a3830)) #elif 0 // version $F lvl 8 (development version found on a floppy disk along with diff --git a/src/mess/drivers/cortex.c b/src/mess/drivers/cortex.c index bbcf3d8e54b..c35520fd656 100644 --- a/src/mess/drivers/cortex.c +++ b/src/mess/drivers/cortex.c @@ -16,7 +16,7 @@ TMS9929 - Video TMS9911 - DMA to floppy TMS9909 - Floppy Disk Controller - AY-5-2376 - Keyboard controller + AY-5-2376 - Keyboard controller ****************************************************************************/ diff --git a/src/mess/drivers/ep64.c b/src/mess/drivers/ep64.c index 75931e757fd..6191ad097e9 100644 --- a/src/mess/drivers/ep64.c +++ b/src/mess/drivers/ep64.c @@ -13,12 +13,12 @@ Enterprise Sixty Four / Enterprise One Two Eight Enterprise Computers Ltd. 1985 MAIN PCB Layout ---------------- +--------------- DUAL |-----------| 9V TAPE_IN/OUT RES -|HEATSINK | DC_IN MON1 AND REMOTE SR1 PR1 CN2A CN1A |-| +|HEATSINK | DC_IN MON1 AND REMOTE SR1 PR1 CN2A CN1A |-| | |--||---|--||--|--| |--| |-||-||-||-||-| |----| |-----| |--| |--| |-|-|------| -|-----------|7805 | MOD | |-| |-| |-| |-| |-| |-| |-| EXP2 --|EXTERNAL +|-----------|7805 | MOD | |-| |-| |-| |-| |-| |-| |-| EXP2 --|EXTERNAL |---+7805 | | 74LS06 74LS273 74LS86 74LS32 --|EXPANSION | | |------| 74LS244 --|CONNECTOR | |78L12 POT1 LM386 |-----| |-----| EXP1 --| @@ -27,7 +27,7 @@ MAIN PCB Layout | | 4.433619MHz 74LS145 POT3 LED |-----| |-----| --| |---+ --| | 74LS74 74LS244 74LS244 74LS245 |---------| - | | + | | | 74LS373 4164 4164 74F157 | | | | 16-2-103 LM339 LM324 4164 4164 74F157 EXOS.IC2 | @@ -38,8 +38,8 @@ MAIN PCB Layout |------------------------------------------------------------------| Notes: (all IC's shown) Z80A - Z80A CPU, clock input 4MHz [8/2] - EXOS.IC2 - 32k x8-bit mask ROM usually 23256 manufactured by GI (DIP24). Contains EXOS operating - system and built-in word processor software. A few official revisions were made and + EXOS.IC2 - 32k x8-bit mask ROM usually 23256 manufactured by GI (DIP24). Contains EXOS operating + system and built-in word processor software. A few official revisions were made and there were a few unofficial revision made with additional capabilities and bug-fixes ROM labelling of some official versions found.... 9256DS-0019 (C)1984 INTELLIGENT SOFTWARE LTD ENTER 08-45-A GI @@ -77,7 +77,7 @@ Notes: (all IC's shown) MOD - Astec UM1233 TV modulator RES - Reset push button switch MON1 - Monitor output connector. Pinout is.... - + Green A1 B1 NC Ground A2 B2 Ground Mono Comp. Video A3 B3 Blue @@ -85,16 +85,16 @@ Notes: (all IC's shown) VSync A5 B5 Composite Sync NC A6 B6 Mode Switch Left Audio A7 B7 Right Audio - + SR1 - Serial/Network connector. Pinout is.... - + Reference A1 B1 Ground - A2 B2 - RTS A3 B3 Data Out CTS A4 B4 Data In PR1 - Printer connector. Pinout is.... - + Ground A1 B1 Ground Strobe A2 B2 Ready Data 3 A3 B3 Data 4 @@ -104,9 +104,9 @@ Notes: (all IC's shown) Data 0 A7 B7 Data 7 CN2A - Joystick 2 connector - CN1A - Joystick 1 connector + CN1A - Joystick 1 connector Pinout is.... - + Keyboard J A1 B1 Ground Keyboard L A2 B2 Keyboard K - A3 B3 - @@ -116,7 +116,7 @@ Notes: (all IC's shown) Internal Memory Expansion PCB Layout ------------------------------------- +------------------------------------ |---------------------| | 4164 74LS00 PL3 PL2| @@ -138,15 +138,15 @@ Notes: (All IC's shown) /* - TODO: + TODO: - - POST RAM errors - - rewrite DAVE to output to discrete DAC - - rewrite NICK - - cassette - - external joysticks + - POST RAM errors + - rewrite DAVE to output to discrete DAC + - rewrite NICK + - cassette + - external joysticks - http://ep.homeserver.hu/Dokumentacio/Konyvek/ + http://ep.homeserver.hu/Dokumentacio/Konyvek/ */ @@ -191,9 +191,9 @@ READ8_MEMBER( ep64_state::rd0_r ) WRITE8_MEMBER( ep64_state::wr0_w ) { /* - + bit description - + 0 KEY A 1 KEY B 2 KEY C @@ -202,7 +202,7 @@ WRITE8_MEMBER( ep64_state::wr0_w ) 5 CASSETTE OUT 6 REMOTE 1 7 REMOTE 2 - + */ // keyboard @@ -228,9 +228,9 @@ WRITE8_MEMBER( ep64_state::wr0_w ) READ8_MEMBER( ep64_state::rd1_r ) { /* - + bit description - + 0 KBJ 1 KBK 2 KBL @@ -239,7 +239,7 @@ READ8_MEMBER( ep64_state::rd1_r ) 5 SERIAL/NET STATUS IN 6 CASSETTE IN 7 ? - + */ UINT8 data = 0; @@ -265,18 +265,18 @@ READ8_MEMBER( ep64_state::rd1_r ) WRITE8_MEMBER( ep64_state::wr2_w ) { /* - + bit description - + 0 SERIAL/NET DATA OUT 1 SERIAL/NET STATUS OUT - 2 - 3 - 4 - 5 - 6 - 7 - + 2 + 3 + 4 + 5 + 6 + 7 + */ // serial @@ -596,7 +596,7 @@ ROM_START( ep64 ) ROM_CART_LOAD( "cart", 0x00000, 0x10000, ROM_MIRROR ) ROM_END -#define rom_phc64 rom_ep64 +#define rom_phc64 rom_ep64 //------------------------------------------------- diff --git a/src/mess/drivers/gba.c b/src/mess/drivers/gba.c index 19730b8e153..17a5012f2a4 100644 --- a/src/mess/drivers/gba.c +++ b/src/mess/drivers/gba.c @@ -1920,7 +1920,7 @@ static ADDRESS_MAP_START( gba_map, AS_PROGRAM, 32, gba_state ) AM_RANGE(0x05000000, 0x050003ff) AM_RAM_WRITE(gba_pram_w) AM_SHARE("gba_pram") // Palette RAM AM_RANGE(0x06000000, 0x06017fff) AM_RAM_WRITE(gba_vram_w) AM_SHARE("gba_vram") // VRAM AM_RANGE(0x07000000, 0x070003ff) AM_RAM_WRITE(gba_oam_w) AM_SHARE("gba_oam") // OAM - //AM_RANGE(0x08000000, 0x0cffffff) // cart ROM + mirrors, mapped here at machine_start if a cart is present + //AM_RANGE(0x08000000, 0x0cffffff) // cart ROM + mirrors, mapped here at machine_start if a cart is present AM_RANGE(0x10000000, 0xffffffff) AM_READ(gba_10000000_r) // for "Justice League Chronicles" (game bug) ADDRESS_MAP_END @@ -2117,7 +2117,7 @@ void gba_state::machine_start() /* and an IRQ handling timer */ m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::handle_irq),this)); m_irq_timer->adjust(attotime::never); - + // install the cart ROM into the address map, if present m_cartslot->install_rom(); @@ -2144,7 +2144,7 @@ void gba_state::machine_start() m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe01ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cartslot)); m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe01ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cartslot)); } - + save_item(NAME(m_DISPSTAT)); save_item(NAME(m_BG2X)); save_item(NAME(m_BG2Y)); @@ -2241,9 +2241,9 @@ static SLOT_INTERFACE_START(gba_cart) SLOT_INTERFACE_INTERNAL("gba_eeprom", GBA_ROM_EEPROM) SLOT_INTERFACE_INTERNAL("gba_eeprom_4k", GBA_ROM_EEPROM) SLOT_INTERFACE_INTERNAL("gba_eeprom_64k", GBA_ROM_EEPROM64) - SLOT_INTERFACE_INTERNAL("gba_flash", GBA_ROM_FLASH) // Panasonic - SLOT_INTERFACE_INTERNAL("gba_flash_512", GBA_ROM_FLASH) // Panasonic - SLOT_INTERFACE_INTERNAL("gba_flash_1m", GBA_ROM_FLASH1M) // Sanyo + SLOT_INTERFACE_INTERNAL("gba_flash", GBA_ROM_FLASH) // Panasonic + SLOT_INTERFACE_INTERNAL("gba_flash_512", GBA_ROM_FLASH) // Panasonic + SLOT_INTERFACE_INTERNAL("gba_flash_1m", GBA_ROM_FLASH1M) // Sanyo SLOT_INTERFACE_END diff --git a/src/mess/drivers/hx20.c b/src/mess/drivers/hx20.c index 68338634fd5..7a5b15fdefc 100644 --- a/src/mess/drivers/hx20.c +++ b/src/mess/drivers/hx20.c @@ -8,19 +8,19 @@ /* - TODO: - - - m6800.c rewrite - - keyboard interrupt - - LCD controller - - serial - - SW6 read - - RS-232 - - microcassette - - printer - - ROM cartridge - - floppy TF-20 - - barcode reader + TODO: + + - m6800.c rewrite + - keyboard interrupt + - LCD controller + - serial + - SW6 read + - RS-232 + - microcassette + - printer + - ROM cartridge + - floppy TF-20 + - barcode reader */ @@ -84,18 +84,18 @@ READ8_MEMBER( hx20_state::krtn07_r ) READ8_MEMBER( hx20_state::krtn89_r ) { /* - + bit description - + 0 KRTN8 1 KRTN9 - 2 - 3 - 4 - 5 + 2 + 3 + 4 + 5 6 _PWSW 7 _BUSY - + */ UINT8 data = 0xff; @@ -120,9 +120,9 @@ READ8_MEMBER( hx20_state::krtn89_r ) WRITE8_MEMBER( hx20_state::lcd_cs_w ) { /* - + bit description - + 0 LCD CS bit 0 1 LCD CS bit 1 2 LCD CS bit 2 @@ -131,7 +131,7 @@ WRITE8_MEMBER( hx20_state::lcd_cs_w ) 5 SERIAL POUT 6 MO1 7 MO2 - + */ logerror("LCD CS %02x\n", data); @@ -153,7 +153,7 @@ WRITE8_MEMBER( hx20_state::lcd_cs_w ) case 5: m_lcdc4->cs_w(0); break; case 6: m_lcdc5->cs_w(0); break; } - + int cd = BIT(data, 3); m_lcdc0->cd_w(cd); @@ -187,18 +187,18 @@ WRITE8_MEMBER( hx20_state::lcd_data_w ) READ8_MEMBER( hx20_state::main_p1_r ) { /* - + bit description - + 0 RS-232 DSR 1 RS-232 CTS - 2 + 2 3 _INT EX 4 _PWA 5 _K.B REQUEST 6 SERIAL PIN 7 CARTRIDGE MI1 (0=ROM, 1=microcassette) - + */ UINT8 data = 0x98; @@ -224,18 +224,18 @@ READ8_MEMBER( hx20_state::main_p1_r ) WRITE8_MEMBER( hx20_state::main_p1_w ) { /* - + bit description - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + */ } @@ -247,25 +247,25 @@ WRITE8_MEMBER( hx20_state::main_p1_w ) READ8_MEMBER( hx20_state::main_p2_r ) { /* - + bit description - + 0 bar code reader data - 1 + 1 2 SLAVE P34 3 RX - 4 - 5 - 6 - 7 - + 4 + 5 + 6 + 7 + */ - + UINT8 data = M6801_MODE_4; // serial data &= ~(!m_slave_flag << 2); - + if (m_slave_sio) data |= m_slave_rx << 3; else @@ -282,18 +282,18 @@ READ8_MEMBER( hx20_state::main_p2_r ) WRITE8_MEMBER( hx20_state::main_p2_w ) { /* - + bit description - - 0 + + 0 1 RS-232 TXD 2 serial select (0=peripheral, 1=slave 6301) - 3 + 3 4 TX - 5 - 6 - 7 - + 5 + 6 + 7 + */ // RS-232 @@ -316,18 +316,18 @@ WRITE8_MEMBER( hx20_state::main_p2_w ) READ8_MEMBER( hx20_state::slave_p1_r ) { /* - + bit description - - 0 - 1 - 2 - 3 - 4 - 5 + + 0 + 1 + 2 + 3 + 4 + 5 6 printer reset pulse 7 printer timing pulse - + */ UINT8 data = 0; @@ -343,18 +343,18 @@ READ8_MEMBER( hx20_state::slave_p1_r ) WRITE8_MEMBER( hx20_state::slave_p1_w ) { /* - + bit description - + 0 printer head 1 (1=on) 1 printer head 2 2 printer head 3 3 printer head 4 4 printer motor (0=on) 5 speaker (1=on) - 6 - 7 - + 6 + 7 + */ // speaker @@ -369,20 +369,20 @@ WRITE8_MEMBER( hx20_state::slave_p1_w ) READ8_MEMBER( hx20_state::slave_p2_r ) { /* - + bit description - + 0 RS-232 RXD / microcassette (0=read, 1=write) - 1 - 2 + 1 + 2 3 TX - 4 - 5 - 6 - 7 - + 4 + 5 + 6 + 7 + */ - + UINT8 data = M6801_MODE_7; // serial @@ -399,18 +399,18 @@ READ8_MEMBER( hx20_state::slave_p2_r ) WRITE8_MEMBER( hx20_state::slave_p2_w ) { /* - + bit description - - 0 + + 0 1 microcassette internal clock, write data 2 serial select (0=brake, 1=normal) - 3 + 3 4 RX - 5 - 6 - 7 - + 5 + 6 + 7 + */ // serial @@ -425,18 +425,18 @@ WRITE8_MEMBER( hx20_state::slave_p2_w ) READ8_MEMBER( hx20_state::slave_p3_r ) { /* - + bit description - - 0 - 1 + + 0 + 1 2 external cassette read data - 3 - 4 - 5 - 6 - 7 - + 3 + 4 + 5 + 6 + 7 + */ UINT8 data = 0; @@ -452,18 +452,18 @@ READ8_MEMBER( hx20_state::slave_p3_r ) WRITE8_MEMBER( hx20_state::slave_p3_w ) { /* - + bit description - + 0 external cassette remote (0=on) 1 RS-232 RTS - 2 + 2 3 external cassette write data 4 slave status flag 5 bar code power (1=on) 6 RS-232 power (1=on) 7 program power (1=on) - + */ // RS-232 @@ -481,20 +481,20 @@ WRITE8_MEMBER( hx20_state::slave_p3_w ) READ8_MEMBER( hx20_state::slave_p4_r ) { /* - + bit description - + 0 PLUG 2 - 1 - 2 - 3 - 4 - 5 - 6 + 1 + 2 + 3 + 4 + 5 + 6 7 RS-232 CD - + */ - + UINT8 data = 0; // RS-232 @@ -511,18 +511,18 @@ READ8_MEMBER( hx20_state::slave_p4_r ) WRITE8_MEMBER( hx20_state::slave_p4_w ) { /* - + bit description - - 0 + + 0 1 port enable always on / printer motor control (0=open, 1=brake) 2 clear shift register / microcassette power switch (1=on) 3 ROM cartridge power switch (1=on) / microcassette command 4 ROM address counter clear / clock 5 cassette/RS-232 select (0=RS-232, 1=microcassette) 6 ROM cartridge select / microcassette clock (0=counter, 1=head switch) - 7 - + 7 + */ } @@ -598,7 +598,7 @@ ADDRESS_MAP_END static INPUT_PORTS_START( hx20 ) PORT_START("KSC0") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('_') - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') @@ -871,7 +871,7 @@ static MACHINE_CONFIG_START( hx20, hx20_state ) MCFG_RS232_PORT_ADD(RS232_TAG, rs232_intf, default_rs232_devices, NULL) MCFG_CASSETTE_ADD(CASSETTE_TAG, default_cassette_interface) MCFG_EPSON_SIO_ADD("sio", "tf20") - + // internal ram MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("16K") diff --git a/src/mess/drivers/intv.c b/src/mess/drivers/intv.c index 0919ea1a2c7..87118cfed93 100644 --- a/src/mess/drivers/intv.c +++ b/src/mess/drivers/intv.c @@ -94,8 +94,8 @@ void intv_state::palette_init() for (int i = 0; i < 16; i++) { - r = intv_colors[i * 3 + 0]; - g = intv_colors[i * 3 + 1]; + r = intv_colors[i * 3 + 0]; + g = intv_colors[i * 3 + 1]; b = intv_colors[i * 3 + 2]; colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b)); colortable_palette_set_color(machine().colortable, i + 16, MAKE_RGB(r, g, b)); diff --git a/src/mess/drivers/juicebox.c b/src/mess/drivers/juicebox.c index a6c476d8f29..135f0117f82 100644 --- a/src/mess/drivers/juicebox.c +++ b/src/mess/drivers/juicebox.c @@ -258,7 +258,7 @@ void juicebox_state::machine_start() address_space &space = m_maincpu->space(AS_PROGRAM); smc_init(); - + space.install_readwrite_handler(0x01c00000, 0x01c0000b, 0, 0, read32_delegate(FUNC(s3c44b0_device::cpuwrap_r), &(*m_s3c44b0)), write32_delegate(FUNC(s3c44b0_device::cpuwrap_w), &(*m_s3c44b0))); space.install_readwrite_handler(0x01d00000, 0x01d0002b, 0, 0, read32_delegate(FUNC(s3c44b0_device::uart_0_r), &(*m_s3c44b0)), write32_delegate(FUNC(s3c44b0_device::uart_0_w), &(*m_s3c44b0))); space.install_readwrite_handler(0x01d04000, 0x01d0402b, 0, 0, read32_delegate(FUNC(s3c44b0_device::uart_1_r), &(*m_s3c44b0)), write32_delegate(FUNC(s3c44b0_device::uart_1_w), &(*m_s3c44b0))); diff --git a/src/mess/drivers/pasogo.c b/src/mess/drivers/pasogo.c index 4e550ad0940..f11471603e2 100644 --- a/src/mess/drivers/pasogo.c +++ b/src/mess/drivers/pasogo.c @@ -30,13 +30,13 @@ PT-GMAIN01D |----------------------------| Notes: (all ICs shown) - VG230 - Vadem VG230 single-chip PC platform. Contains 16 MHz NEC uPD70116H V30HL CPU - (which is a high-speed low-power 8086 variation), IBM PC/XT-compatible core + VG230 - Vadem VG230 single-chip PC platform. Contains 16 MHz NEC uPD70116H V30HL CPU + (which is a high-speed low-power 8086 variation), IBM PC/XT-compatible core logic, LCD controller (CGA/AT&T640x400), keyboard matrix scanner, dual PCMCIA 2.1 card controller, EMS 4.0 hardware support for up to 64MB, built-in timer PIC/DMA/UART/RTC controllers. The clock input is 32.2200MHz. An internal divider creates a 16.11MHz clock for the V30HL CPU. - HM514800 - Hitachi HM514800 512k x8-bit DRAM + HM514800 - Hitachi HM514800 512k x8-bit DRAM MC14071 - Motorola MC14071 Quad 2-input OR gate 74HC04 - 74HC04 Hex inverter LM2937 - Texas Instruments LM2937ES-5 voltage regulator (Max 26V input, 5V output at 500mA) @@ -45,27 +45,27 @@ Notes: (all ICs shown) VOL - Volume pot CN5 - 5 pin connector for 4-way control pad (up/down/left/right/ground) CN4 - 5 pin connector for on/off switch and 2 buttons - CN3 - 2 pin power input from 6x AA-battery compartment (input voltage is 9V DC) - CN2 - Flat cable connector for video out to LCD panel. When the LCD is powered on the pixels - are blue. The LCD panel PCB has part number 97-44264-8 LMG6912RPFC LMG6910RPGR + CN3 - 2 pin power input from 6x AA-battery compartment (input voltage is 9V DC) + CN2 - Flat cable connector for video out to LCD panel. When the LCD is powered on the pixels + are blue. The LCD panel PCB has part number 97-44264-8 LMG6912RPFC LMG6910RPGR and contains the following parts..... Matsushita 53008HEB-8 Sanyo LA6324N quad operational amplifier Hitachi BD66285BFC LCD controller IC (x3) Hitachi BD66284BFC LCD controller IC (x4) - The LCD flat cable has several wires but 2 of them have frequencies which measure + The LCD flat cable has several wires but 2 of them have frequencies which measure 69.9161Hz and 16.7798kHz. These are assumed to be VSync and HSync CN1 - Cart slot X1 - Marked 322. Measures 32.21732MHz so this is a common 32.22MHz OSC. X2 - No markings. Measures 32.768kHz and used for the RTC * - These parts are on the other side of the PCB - + Carts ----- -All of the carts are identical. Most have only one surface mounted mask ROM. Either a -MX23C8100 (8M) or YRM0442 (4M). Some are populated with additional parts including a 62256 -32kx8 SRAM, a 3v coin battery and a MM1081N reset chip plus a few resistors/capacitors and +All of the carts are identical. Most have only one surface mounted mask ROM. Either a +MX23C8100 (8M) or YRM0442 (4M). Some are populated with additional parts including a 62256 +32kx8 SRAM, a 3v coin battery and a MM1081N reset chip plus a few resistors/capacitors and a transistor. All parts are surface mounted. PT-GMEM01B @@ -214,15 +214,15 @@ protected: UINT8 m_pc_spkrdata; UINT8 m_pc_input; - int m_ppi_portc_switch_high; - int m_ppi_speaker; - int m_ppi_keyboard_clear; - UINT8 m_ppi_keyb_clock; - UINT8 m_ppi_portb; - UINT8 m_ppi_clock_signal; - UINT8 m_ppi_data_signal; - UINT8 m_ppi_shift_register; - UINT8 m_ppi_shift_enable; + int m_ppi_portc_switch_high; + int m_ppi_speaker; + int m_ppi_keyboard_clear; + UINT8 m_ppi_keyb_clock; + UINT8 m_ppi_portb; + UINT8 m_ppi_clock_signal; + UINT8 m_ppi_data_signal; + UINT8 m_ppi_shift_register; + UINT8 m_ppi_shift_enable; }; diff --git a/src/mess/drivers/pc.c b/src/mess/drivers/pc.c index ba3532cf510..7f96cfcb87a 100644 --- a/src/mess/drivers/pc.c +++ b/src/mess/drivers/pc.c @@ -1567,7 +1567,7 @@ static MACHINE_CONFIG_DERIVED( asst128, iskr1031 ) MCFG_DEVICE_REMOVE("pit8253") MCFG_PIT8253_ADD( "pit8253", pcjr_pit8253_config ) - + MCFG_FLOPPY_DRIVE_ADD("fdc:0", asst128_floppies, "525ssqd", pc_state::asst128_formats) MCFG_FLOPPY_DRIVE_ADD("fdc:1", asst128_floppies, "525ssqd", pc_state::asst128_formats) @@ -2038,8 +2038,8 @@ ROM_END ROM_START( t1000sl ) ROM_REGION(0x100000,"maincpu", 0) - // 8076312.hu1 - most likely v01.04.00 - // 8075312.hu2 + // 8076312.hu1 - most likely v01.04.00 + // 8075312.hu2 // partlist says it has 1 128kbyte rom diff --git a/src/mess/drivers/pc1512.c b/src/mess/drivers/pc1512.c index 36e13d469af..b4151837a40 100644 --- a/src/mess/drivers/pc1512.c +++ b/src/mess/drivers/pc1512.c @@ -473,7 +473,7 @@ READ8_MEMBER( pc1640_state::io_r ) offs_t addr = offset & 0x3ff; bool decoded = false; - if ( addr <= 0x00f) { data = m_dmac->read(space, offset & 0x0f); decoded = true; } + if ( addr <= 0x00f) { data = m_dmac->read(space, offset & 0x0f); decoded = true; } else if (addr >= 0x020 && addr <= 0x021) { data = m_pic->read(space, offset & 0x01); decoded = true; } else if (addr >= 0x040 && addr <= 0x043) { data = m_pit->read(space, offset & 0x03); decoded = true; } else if (addr >= 0x060 && addr <= 0x06f) { data = system_r(space, offset & 0x0f); decoded = true; } diff --git a/src/mess/drivers/pes.c b/src/mess/drivers/pes.c index ef48ff92ef3..2380b612fdd 100644 --- a/src/mess/drivers/pes.c +++ b/src/mess/drivers/pes.c @@ -223,7 +223,7 @@ void pes_state::machine_reset() ******************************************************************************/ /*static TIMER_CALLBACK_MEMBER(pes_state::serial_read_cb ) { - timer_set(attotime::from_hz(10000), TIMER_OUTFIFO_READ); + timer_set(attotime::from_hz(10000), TIMER_OUTFIFO_READ); }*/ DRIVER_INIT_MEMBER(pes_state,pes) diff --git a/src/mess/drivers/pet.c b/src/mess/drivers/pet.c index 81d2d840d30..086399f6f87 100644 --- a/src/mess/drivers/pet.c +++ b/src/mess/drivers/pet.c @@ -668,7 +668,7 @@ INPUT_PORTS_START( petb ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') diff --git a/src/mess/drivers/pv1000.c b/src/mess/drivers/pv1000.c index 0ec3e1bbc9b..d24046625c8 100644 --- a/src/mess/drivers/pv1000.c +++ b/src/mess/drivers/pv1000.c @@ -35,7 +35,7 @@ private: UINT16 period; UINT8 val; } m_voice[4]; - + sound_stream *m_sh_channel; }; @@ -95,38 +95,38 @@ WRITE8_MEMBER(pv1000_sound_device::voice_w) /* plgDavid's audio implementation/analysis notes: - + Sound appears to be 3 50/50 pulse voices made by cutting the main clock by 1024, then by the value of the 6bit period registers. This creates a surprisingly accurate pitch range. - + Note: the register periods are inverted. */ void pv1000_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { stream_sample_t *buffer = outputs[0]; - + while (samples > 0) { *buffer=0; - + for (int i = 0; i < 3; i++) { UINT32 per = (0x3f - (m_voice[i].period & 0x3f)); - - if (per != 0) //OFF! + + if (per != 0) //OFF! *buffer += m_voice[i].val * 8192; - + m_voice[i].count++; - + if (m_voice[i].count >= per) { m_voice[i].count = 0; m_voice[i].val = !m_voice[i].val; } } - + buffer++; samples--; } @@ -412,7 +412,7 @@ void pv1000_state::machine_start() m_gfxram = memregion("gfxram")->base(); save_pointer(NAME(m_gfxram), 0x400); - + save_item(NAME(m_io_regs)); save_item(NAME(m_fd_data)); save_item(NAME(m_pcg_bank)); diff --git a/src/mess/drivers/ql.c b/src/mess/drivers/ql.c index 73c52d09a30..f0596d9d6c3 100644 --- a/src/mess/drivers/ql.c +++ b/src/mess/drivers/ql.c @@ -144,12 +144,12 @@ READ8_MEMBER( ql_state::ipc_port2_r ) bit description 0 Serial data input (SER2 RxD, SER1 TxD) - 1 - 2 - 3 - 4 - 5 - 6 + 1 + 2 + 3 + 4 + 5 + 6 7 ZX8302 serial link input/output (COMDATA) */ @@ -176,13 +176,13 @@ WRITE8_MEMBER( ql_state::ipc_port2_w ) bit description - 0 + 0 1 Speaker output 2 Interrupt output (IPL0-2) 3 Interrupt output (IPL1) 4 Serial Clear-to-Send output (SER1 CTS) 5 Serial Data Terminal Ready output (SER2 DTR) - 6 + 6 7 ZX8302 serial link input/output (COMDATA) */ @@ -1074,10 +1074,10 @@ MACHINE_CONFIG_END //------------------------------------------------- static MACHINE_CONFIG_DERIVED( opd, ql ) - // internal ram - MCFG_RAM_MODIFY(RAM_TAG) - MCFG_RAM_DEFAULT_SIZE("128K") - MCFG_RAM_EXTRA_OPTIONS("256K") + // internal ram + MCFG_RAM_MODIFY(RAM_TAG) + MCFG_RAM_DEFAULT_SIZE("128K") + MCFG_RAM_EXTRA_OPTIONS("256K") MACHINE_CONFIG_END diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c index 859310193df..b8172882f9e 100644 --- a/src/mess/drivers/qx10.c +++ b/src/mess/drivers/qx10.c @@ -45,7 +45,7 @@ #define MAIN_CLK 15974400 -#define RS232_TAG "rs232" +#define RS232_TAG "rs232" /* Driver data @@ -696,14 +696,14 @@ ADDRESS_MAP_END /* TODO: shift break */ /*INPUT_CHANGED_MEMBER(qx10_state::key_stroke) { - if(newval && !oldval) - { - m_keyb.rx = (UINT8)(FPTR)(param) & 0x7f; - m_pic_m->ir4_w(1); - } + if(newval && !oldval) + { + m_keyb.rx = (UINT8)(FPTR)(param) & 0x7f; + m_pic_m->ir4_w(1); + } - if(oldval && !newval) - m_keyb.rx = 0; + if(oldval && !newval) + m_keyb.rx = 0; }*/ static INPUT_PORTS_START( qx10 ) diff --git a/src/mess/drivers/samcoupe.c b/src/mess/drivers/samcoupe.c index fc7c5c9ad7e..4d0e3e99542 100644 --- a/src/mess/drivers/samcoupe.c +++ b/src/mess/drivers/samcoupe.c @@ -55,7 +55,7 @@ /*************************************************************************** - TIMERS + TIMERS ***************************************************************************/ void samcoupe_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) diff --git a/src/mess/drivers/scv.c b/src/mess/drivers/scv.c index 94ef5505262..78b4408b8cb 100644 --- a/src/mess/drivers/scv.c +++ b/src/mess/drivers/scv.c @@ -71,7 +71,7 @@ protected: ioport_port *m_key[8]; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - + void scv_set_banks(); inline void plot_sprite_part( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 pat, UINT8 col, UINT8 screen_sprite_start_line ); inline void draw_sprite( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 tile_idx, UINT8 col, UINT8 left, UINT8 right, UINT8 top, UINT8 bottom, UINT8 clip_y, UINT8 screen_sprite_start_line ); @@ -421,7 +421,7 @@ void scv_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo case TIMER_VB: { int vpos = machine().primary_screen->vpos(); - + switch( vpos ) { case 240: @@ -784,7 +784,7 @@ void scv_state::machine_start() save_item(NAME(m_porta)); save_item(NAME(m_portc)); save_item(NAME(m_cart_ram_enabled)); - + machine().save().register_postload(save_prepost_delegate(FUNC(scv_state::scv_postload), this)); } diff --git a/src/mess/drivers/sdk86.c b/src/mess/drivers/sdk86.c index 86e9ce5825c..3a907357b85 100644 --- a/src/mess/drivers/sdk86.c +++ b/src/mess/drivers/sdk86.c @@ -31,8 +31,8 @@ ToDo: #include "machine/serial.h" #include "sdk86.lh" -#define I8251_TAG "i8251" -#define RS232_TAG "rs232" +#define I8251_TAG "i8251" +#define RS232_TAG "rs232" class sdk86_state : public driver_device @@ -40,8 +40,8 @@ class sdk86_state : public driver_device public: sdk86_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , - m_maincpu(*this, "maincpu"), - m_usart(*this, I8251_TAG) + m_maincpu(*this, "maincpu"), + m_usart(*this, I8251_TAG) { } required_device<cpu_device> m_maincpu; diff --git a/src/mess/drivers/sg1000.c b/src/mess/drivers/sg1000.c index 853e4810511..c0b24fc1603 100644 --- a/src/mess/drivers/sg1000.c +++ b/src/mess/drivers/sg1000.c @@ -741,7 +741,7 @@ void sc3000_state::machine_start() /* register for state saving */ save_item(NAME(m_keylatch)); - if (m_cartslot && (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR + if (m_cartslot && (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEA || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEB)) { m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(sega8_cart_slot_device::read_ram),(sega8_cart_slot_device*)m_cartslot)); diff --git a/src/mess/drivers/snes.c b/src/mess/drivers/snes.c index 29d0fce0ad9..86ca9c2c09e 100644 --- a/src/mess/drivers/snes.c +++ b/src/mess/drivers/snes.c @@ -531,7 +531,7 @@ WRITE8_MEMBER( snes_console_state::snessfx_lo_w ) READ8_MEMBER( snes_console_state::snessa1_hi_r ) { UINT16 address = offset & 0xffff; - + if (offset < 0x400000) { if (address < 0x2000) @@ -539,14 +539,14 @@ READ8_MEMBER( snes_console_state::snessa1_hi_r ) else if (address < 0x6000) { if (address >= 0x2200 && address < 0x2400) - return m_cartslot->chip_read(space, offset); // SA-1 Regs + return m_cartslot->chip_read(space, offset); // SA-1 Regs else if (address >= 0x3000 && address < 0x3800) - return m_cartslot->chip_read(space, offset); // Internal SA-1 RAM (2K) + return m_cartslot->chip_read(space, offset); // Internal SA-1 RAM (2K) else return snes_r_io(space, address); } else if (address < 0x8000) - return m_cartslot->chip_read(space, offset); // SA-1 BWRAM + return m_cartslot->chip_read(space, offset); // SA-1 BWRAM else return m_cartslot->read_h(space, offset); } @@ -557,7 +557,7 @@ READ8_MEMBER( snes_console_state::snessa1_hi_r ) READ8_MEMBER( snes_console_state::snessa1_lo_r ) { UINT16 address = offset & 0xffff; - + if (offset < 0x400000) { if (address < 0x2000) @@ -565,21 +565,21 @@ READ8_MEMBER( snes_console_state::snessa1_lo_r ) else if (address < 0x6000) { if (address >= 0x2200 && address < 0x2400) - return m_cartslot->chip_read(space, offset); // SA-1 Regs + return m_cartslot->chip_read(space, offset); // SA-1 Regs else if (address >= 0x3000 && address < 0x3800) - return m_cartslot->chip_read(space, offset); // Internal SA-1 RAM (2K) + return m_cartslot->chip_read(space, offset); // Internal SA-1 RAM (2K) else return snes_r_io(space, address); } else if (address < 0x8000) - return m_cartslot->chip_read(space, offset); // SA-1 BWRAM + return m_cartslot->chip_read(space, offset); // SA-1 BWRAM else return m_cartslot->read_l(space, offset); } else if (offset < 0x500000) - return m_cartslot->chip_read(space, offset); // SA-1 BWRAM (not mirrored above!) + return m_cartslot->chip_read(space, offset); // SA-1 BWRAM (not mirrored above!) else - return snes_r_io(space, address); // nothing mapped here! + return snes_r_io(space, address); // nothing mapped here! } WRITE8_MEMBER( snes_console_state::snessa1_hi_w ) @@ -592,21 +592,21 @@ WRITE8_MEMBER( snes_console_state::snessa1_hi_w ) else if (address < 0x6000) { if (address >= 0x2200 && address < 0x2400) - m_cartslot->chip_write(space, offset, data); // SA-1 Regs + m_cartslot->chip_write(space, offset, data); // SA-1 Regs else if (address >= 0x3000 && address < 0x3800) - m_cartslot->chip_write(space, offset, data); // Internal SA-1 RAM (2K) + m_cartslot->chip_write(space, offset, data); // Internal SA-1 RAM (2K) else snes_w_io(space, address, data); } else if (address < 0x8000) - m_cartslot->chip_write(space, offset, data); // SA-1 BWRAM + m_cartslot->chip_write(space, offset, data); // SA-1 BWRAM } } WRITE8_MEMBER( snes_console_state::snessa1_lo_w ) { if (offset >= 0x400000 && offset < 0x500000) - m_cartslot->chip_write(space, offset, data); // SA-1 BWRAM (not mirrored above!) + m_cartslot->chip_write(space, offset, data); // SA-1 BWRAM (not mirrored above!) else snessfx_hi_w(space, offset, data, 0xff); } @@ -886,7 +886,7 @@ WRITE8_MEMBER( snes_console_state::snesbsx_lo_w ) READ8_MEMBER( snes_console_state::snessgb_hi_r ) { UINT16 address = offset & 0xffff; - + if (offset < 0x400000) { if (address < 0x2000) diff --git a/src/mess/drivers/softbox.c b/src/mess/drivers/softbox.c index 994d803a62a..b8d232db107 100644 --- a/src/mess/drivers/softbox.c +++ b/src/mess/drivers/softbox.c @@ -5,81 +5,81 @@ http://mikenaberezny.com/hardware/pet-cbm/sse-softbox-z80-computer/ - Using the Corvus hard disk - -------------------------- + Using the Corvus hard disk + -------------------------- - The SoftBox distribution disk (softbox-distrib.d80) is configured for - a CBM 8050 as CP/M drives A/B and a 10MB Corvus hard disk as drives C/D. + The SoftBox distribution disk (softbox-distrib.d80) is configured for + a CBM 8050 as CP/M drives A/B and a 10MB Corvus hard disk as drives C/D. - Use the CHDMAN utility to create a 10MB hard disk image for the Corvus: + Use the CHDMAN utility to create a 10MB hard disk image for the Corvus: - $ chdman createhd -o /path/to/corvus10mb.chd -chs 358,3,20 -ss 512 + $ chdman createhd -o /path/to/corvus10mb.chd -chs 358,3,20 -ss 512 - Start the SoftBox emulator with the floppy and hard disk images mounted: + Start the SoftBox emulator with the floppy and hard disk images mounted: - $ mess softbox -flop1 /path/to/softbox-distrib.d80 \ - -hard1 /path/to/corvus10mb.chd + $ mess softbox -flop1 /path/to/softbox-distrib.d80 \ + -hard1 /path/to/corvus10mb.chd - Before the Corvus can be used under CP/M, it must be prepared - by running DIAG.COM and FORMAT.COM. + Before the Corvus can be used under CP/M, it must be prepared + by running DIAG.COM and FORMAT.COM. - DIAG.COM + DIAG.COM - Enter "diag" (no arguments) at the CP/M prompt to run the Corvus diagnostics - program. This program will perform the Corvus low-level format. + Enter "diag" (no arguments) at the CP/M prompt to run the Corvus diagnostics + program. This program will perform the Corvus low-level format. - Select option 6 (Update Controller Code) at the menu. - Enter "corvb184.fmt" when prompted for the filename. - Enter "y" at the confirmation prompts. - Enter "1" for the Corvus drive number (two prompts). - After formatting is complete, it will return to the menu. + Select option 6 (Update Controller Code) at the menu. + Enter "corvb184.fmt" when prompted for the filename. + Enter "y" at the confirmation prompts. + Enter "1" for the Corvus drive number (two prompts). + After formatting is complete, it will return to the menu. - Select option 3 (Read Controller Code Version #) at the menu. - Enter "1" for the Corvus drive number. - It should report "V18.4AP" and then return to the menu. + Select option 3 (Read Controller Code Version #) at the menu. + Enter "1" for the Corvus drive number. + It should report "V18.4AP" and then return to the menu. - Select option 9 to return to CP/M. + Select option 9 to return to CP/M. - FORMAT.COM + FORMAT.COM - Enter "format" (no arguments) at the CP/M prompt to run the SoftBox disk - format program. This program will perform the CP/M filesystem format. + Enter "format" (no arguments) at the CP/M prompt to run the SoftBox disk + format program. This program will perform the CP/M filesystem format. - Enter drive letter "c" at the prompt. - Enter "y" to confirm the format. - After formatting is complete, it will prompt for a drive letter again. + Enter drive letter "c" at the prompt. + Enter "y" to confirm the format. + After formatting is complete, it will prompt for a drive letter again. - Enter drive letter "d" at the prompt. - Enter "y" to confirm the format. - After formatting is complete, it will prompt for a drive letter again. + Enter drive letter "d" at the prompt. + Enter "y" to confirm the format. + After formatting is complete, it will prompt for a drive letter again. - Press RETURN to return to CP/M. + Press RETURN to return to CP/M. - STAT.COM + STAT.COM - After all steps are completed, drives C and D should be usable from - CP/M. Each drive is one half of the Corvus 10MB disk. Running the - command "stat c: dsk:" should show 4712 kilobyte drive capacity. - Drive D should show the same information. + After all steps are completed, drives C and D should be usable from + CP/M. Each drive is one half of the Corvus 10MB disk. Running the + command "stat c: dsk:" should show 4712 kilobyte drive capacity. + Drive D should show the same information. - Using other Corvus hard disk sizes - ---------------------------------- + Using other Corvus hard disk sizes + ---------------------------------- - The SoftBox supports 5, 10, and 20 MB hard disks. The distribution disk - is configured for 10 MB as explained above. To use other sizes, make - a new image with CHDMAN. See the top of src/mess/includes/corvushd.h - for the parameters for the other drives. + The SoftBox supports 5, 10, and 20 MB hard disks. The distribution disk + is configured for 10 MB as explained above. To use other sizes, make + a new image with CHDMAN. See the top of src/mess/includes/corvushd.h + for the parameters for the other drives. - After the image has been created and the SoftBox emulator started with - it mounted, the SoftBox BIOS needs to be told what size Corvus hard - disk is attached. Use the NEWSYS.COM utility to reconfigure the drive - size. When NEWSYS prompts for a source drive, enter "a" (the drive letter - of the CP/M distribution disk). Use option "d" (Disk drive assignment) - to reconfigure the Corvus size. After the change has been made, use option - "s" (Save new system) to write the configuration to the floppy (drive A) and - option "e" (Execute new system) to restart CP/M with the configuration. - DIAG.COM and FORMAT.COM can then be used to format the hard disk. + After the image has been created and the SoftBox emulator started with + it mounted, the SoftBox BIOS needs to be told what size Corvus hard + disk is attached. Use the NEWSYS.COM utility to reconfigure the drive + size. When NEWSYS prompts for a source drive, enter "a" (the drive letter + of the CP/M distribution disk). Use option "d" (Disk drive assignment) + to reconfigure the Corvus size. After the change has been made, use option + "s" (Save new system) to write the configuration to the floppy (drive A) and + option "e" (Execute new system) to restart CP/M with the configuration. + DIAG.COM and FORMAT.COM can then be used to format the hard disk. */ diff --git a/src/mess/drivers/superslave.c b/src/mess/drivers/superslave.c index dd2292d2b3f..f7d971cc1d4 100644 --- a/src/mess/drivers/superslave.c +++ b/src/mess/drivers/superslave.c @@ -104,18 +104,18 @@ WRITE8_MEMBER( superslave_state::baud_w ) WRITE8_MEMBER( superslave_state::memctrl_w ) { /* - + bit description - + 0 Memory bank 0 on 1 Memory bank 1 on - 2 - 3 + 2 + 3 4 Unswitched memory boundary bit 0 5 Unswitched memory boundary bit 1 6 Unswitched memory boundary bit 2 7 Unswitched memory boundary bit 3 - + */ m_memctrl = data; @@ -129,9 +129,9 @@ WRITE8_MEMBER( superslave_state::memctrl_w ) READ8_MEMBER( superslave_state::status_r) { /* - + bit description - + 0 Sense Switch (0=closed) 1 Parity error (1=error) 2 Syncerr (1=error) @@ -140,7 +140,7 @@ READ8_MEMBER( superslave_state::status_r) 5 Data Set Ready 2 6 Data Set Ready 1 7 Data Set Ready 0 - + */ UINT8 data = 1; @@ -162,9 +162,9 @@ READ8_MEMBER( superslave_state::status_r) WRITE8_MEMBER( superslave_state::cmd_w ) { /* - + bit description - + 0 Prom enable (1=enabled) 1 Clear Parity (1=cleared) 2 Clear Syncerr (1=cleared) @@ -173,7 +173,7 @@ WRITE8_MEMBER( superslave_state::cmd_w ) 5 Command bit 5 6 Command bit 6 7 Command bit 7 - + */ m_cmd = data; diff --git a/src/mess/drivers/tec1.c b/src/mess/drivers/tec1.c index 48f75571149..22a5b66a740 100644 --- a/src/mess/drivers/tec1.c +++ b/src/mess/drivers/tec1.c @@ -258,7 +258,7 @@ TIMER_CALLBACK_MEMBER(tec1_state::tec1_kbd_callback) else if (m_kbd_row == 3) i = m_io_line3->read(); - + /* if previous key is still held, bail out */ if (i) if (tec1_convert_col_to_bin(i, m_kbd_row) == m_kbd) diff --git a/src/mess/drivers/victor9k.c b/src/mess/drivers/victor9k.c index 49789f65e80..149f9dfbcd9 100644 --- a/src/mess/drivers/victor9k.c +++ b/src/mess/drivers/victor9k.c @@ -9,31 +9,31 @@ /* - Sector format - ------------- - - Header sync - Sector header (header ID, track ID, sector ID, and checksum) - Gap 1 - Data Sync - Data field (data sync, data ID, data bytes, and checksum) - Gap 2 - - Track format - ------------ - - ZONE LOWER HEAD UPPER HEAD SECTORS ROTATIONAL - NUMBER TRACKS TRACKS PER TRACK PERIOD (MS) - - 0 0-3 unused 19 237.9 - 1 4-15 0-7 18 224.5 - 2 16-26 8-18 17 212.2 - 3 27-37 19-29 16 199.9 - 4 38-48 30-40 15 187.6 - 5 49-59 41-51 14 175.3 - 6 60-70 52-62 13 163.0 - 7 71-79 63-74 12 149.6 - 8 unused 75-79 11 144.0 + Sector format + ------------- + + Header sync + Sector header (header ID, track ID, sector ID, and checksum) + Gap 1 + Data Sync + Data field (data sync, data ID, data bytes, and checksum) + Gap 2 + + Track format + ------------ + + ZONE LOWER HEAD UPPER HEAD SECTORS ROTATIONAL + NUMBER TRACKS TRACKS PER TRACK PERIOD (MS) + + 0 0-3 unused 19 237.9 + 1 4-15 0-7 18 224.5 + 2 16-26 8-18 17 212.2 + 3 27-37 19-29 16 199.9 + 4 38-48 30-40 15 187.6 + 5 49-59 41-51 14 175.3 + 6 60-70 52-62 13 163.0 + 7 71-79 63-74 12 149.6 + 8 unused 75-79 11 144.0 */ @@ -67,9 +67,9 @@ READ8_MEMBER( victor9k_state::floppy_p1_r ) { /* - + bit description - + 0 L0MS0 1 L0MS1 2 L0MS2 @@ -78,7 +78,7 @@ READ8_MEMBER( victor9k_state::floppy_p1_r ) 5 L1MS1 6 L1MS2 7 L1MS3 - + */ return m_lms; @@ -92,18 +92,18 @@ READ8_MEMBER( victor9k_state::floppy_p1_r ) READ8_MEMBER( victor9k_state::floppy_p2_r ) { /* - + bit description - - 0 - 1 - 2 - 3 - 4 - 5 + + 0 + 1 + 2 + 3 + 4 + 5 6 RDY0 7 RDY1 - + */ UINT8 data = 0; @@ -122,18 +122,18 @@ READ8_MEMBER( victor9k_state::floppy_p2_r ) WRITE8_MEMBER( victor9k_state::floppy_p2_w ) { /* - + bit description - + 0 START0 1 STOP0 2 START1 3 STOP1 4 SEL1 5 SEL0 - 6 - 7 - + 6 + 7 + */ if (BIT(data, 0)) m_floppy0->mon_w(0); @@ -142,7 +142,7 @@ WRITE8_MEMBER( victor9k_state::floppy_p2_w ) if (BIT(data, 3)) m_floppy1->mon_w(1); int sel0 = BIT(data, 5); - + if (m_sel0 && !sel0) { m_da0 = m_da; @@ -152,7 +152,7 @@ WRITE8_MEMBER( victor9k_state::floppy_p2_w ) m_sel0 = sel0; int sel1 = BIT(data, 4); - + if (m_sel1 && !sel1) { m_da1 = m_da; @@ -1034,7 +1034,7 @@ READ8_MEMBER( victor9k_state::via6_pb_r ) // single/double sided data |= (m_drive ? m_floppy1->twosid_r() : m_floppy0->twosid_r()) << 5; - + return data; } @@ -1148,7 +1148,7 @@ void victor9k_state::unload0_cb(floppy_image_device *device) void victor9k_state::ready1_cb(floppy_image_device *device, int state) { m_rdy1 = state; - + m_via5->write_cb2(m_rdy1); } diff --git a/src/mess/drivers/vip.c b/src/mess/drivers/vip.c index 8ea259ed382..dc521af8bdd 100644 --- a/src/mess/drivers/vip.c +++ b/src/mess/drivers/vip.c @@ -762,7 +762,7 @@ static MACHINE_CONFIG_START( vip, vip_state ) MCFG_VIP_BYTEIO_PORT_ADD(VIP_BYTEIO_PORT_TAG, vip_byteio_cards, NULL, WRITELINE(vip_state, byteio_inst_w)) MCFG_VIP_EXPANSION_SLOT_ADD(VIP_EXPANSION_SLOT_TAG, XTAL_3_52128MHz/2, vip_expansion_cards, NULL) - MCFG_VIP_EXPANSION_SLOT_CALLBACKS(WRITELINE(vip_state, exp_int_w), WRITELINE(vip_state, exp_dma_out_w), WRITELINE(vip_state, exp_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(WRITELINE(vip_state, exp_int_w), WRITELINE(vip_state, exp_dma_out_w), WRITELINE(vip_state, exp_dma_in_w)) // devices MCFG_QUICKLOAD_ADD("quickload", vip_state, vip, "bin,c8,c8x", 0) diff --git a/src/mess/drivers/vk100.c b/src/mess/drivers/vk100.c index d35e30c88f7..f3323842ceb 100644 --- a/src/mess/drivers/vk100.c +++ b/src/mess/drivers/vk100.c @@ -153,8 +153,8 @@ state machine and sees if the GO bit ever finishes and goes back to 0 #include "machine/serial.h" #include "vk100.lh" -#define RS232_TAG "rs232" -#define COM5016T_TAG "com5016t" +#define RS232_TAG "rs232" +#define COM5016T_TAG "com5016t" class vk100_state : public driver_device { diff --git a/src/mess/drivers/vt100.c b/src/mess/drivers/vt100.c index 8b96385eaaf..fb13abaec9d 100644 --- a/src/mess/drivers/vt100.c +++ b/src/mess/drivers/vt100.c @@ -27,8 +27,8 @@ #include "video/vtvideo.h" #include "vt100.lh" -#define RS232_TAG "rs232" -#define COM5016T_TAG "com5016t" +#define RS232_TAG "rs232" +#define COM5016T_TAG "com5016t" class vt100_state : public driver_device { diff --git a/src/mess/includes/abc1600.h b/src/mess/includes/abc1600.h index 77aa70b4fa4..6de9a606fff 100644 --- a/src/mess/includes/abc1600.h +++ b/src/mess/includes/abc1600.h @@ -42,8 +42,8 @@ #define BUS0X_TAG "bus0x" #define BUS1_TAG "bus1" #define BUS2_TAG "bus2" -#define RS232_A_TAG "rs232a" -#define RS232_B_TAG "rs232b" +#define RS232_A_TAG "rs232a" +#define RS232_B_TAG "rs232b" diff --git a/src/mess/includes/bw12.h b/src/mess/includes/bw12.h index cf5df7ac5f0..445526819ea 100644 --- a/src/mess/includes/bw12.h +++ b/src/mess/includes/bw12.h @@ -28,8 +28,8 @@ #define AY3600PRO002_TAG "ic74" #define CENTRONICS_TAG "centronics" #define FLOPPY_TIMER_TAG "motor_off" -#define RS232_A_TAG "rs232a" -#define RS232_B_TAG "rs232b" +#define RS232_A_TAG "rs232a" +#define RS232_B_TAG "rs232b" #define BW12_VIDEORAM_MASK 0x7ff #define BW12_CHARROM_MASK 0xfff diff --git a/src/mess/includes/ep64.h b/src/mess/includes/ep64.h index 39e522d7cbd..9a9a04dd47c 100644 --- a/src/mess/includes/ep64.h +++ b/src/mess/includes/ep64.h @@ -24,38 +24,38 @@ #include "video/nick.h" #define Z80_TAG "u1" -#define DAVE_TAG "u3" -#define NICK_TAG "u4" -#define CENTRONICS_TAG "centronics" -#define RS232_TAG "rs232" -#define CASSETTE1_TAG "cassette1" -#define CASSETTE2_TAG "cassette2" -#define SCREEN_TAG "screen" +#define DAVE_TAG "u3" +#define NICK_TAG "u4" +#define CENTRONICS_TAG "centronics" +#define RS232_TAG "rs232" +#define CASSETTE1_TAG "cassette1" +#define CASSETTE2_TAG "cassette2" +#define SCREEN_TAG "screen" class ep64_state : public driver_device { public: ep64_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, Z80_TAG), - m_dave(*this, DAVE_TAG), - m_nick(*this, NICK_TAG), - m_centronics(*this, CENTRONICS_TAG), - m_rs232(*this, RS232_TAG), - m_cassette1(*this, CASSETTE1_TAG), - m_cassette2(*this, CASSETTE2_TAG), - m_ram(*this, RAM_TAG), - m_rom(*this, Z80_TAG), - m_y0(*this, "Y0"), - m_y1(*this, "Y1"), - m_y2(*this, "Y2"), - m_y3(*this, "Y3"), - m_y4(*this, "Y4"), - m_y5(*this, "Y5"), - m_y6(*this, "Y6"), - m_y7(*this, "Y7"), - m_y8(*this, "Y8"), - m_y9(*this, "Y9") + m_maincpu(*this, Z80_TAG), + m_dave(*this, DAVE_TAG), + m_nick(*this, NICK_TAG), + m_centronics(*this, CENTRONICS_TAG), + m_rs232(*this, RS232_TAG), + m_cassette1(*this, CASSETTE1_TAG), + m_cassette2(*this, CASSETTE2_TAG), + m_ram(*this, RAM_TAG), + m_rom(*this, Z80_TAG), + m_y0(*this, "Y0"), + m_y1(*this, "Y1"), + m_y2(*this, "Y2"), + m_y3(*this, "Y3"), + m_y4(*this, "Y4"), + m_y5(*this, "Y5"), + m_y6(*this, "Y6"), + m_y7(*this, "Y7"), + m_y8(*this, "Y8"), + m_y9(*this, "Y9") { } required_device<cpu_device> m_maincpu; @@ -80,7 +80,7 @@ public: virtual void machine_start(); virtual void machine_reset(); - + DECLARE_READ8_MEMBER( rd0_r ); DECLARE_WRITE8_MEMBER( wr0_w ); DECLARE_READ8_MEMBER( rd1_r ); diff --git a/src/mess/includes/gba.h b/src/mess/includes/gba.h index daebffeb782..05a14c78f6a 100644 --- a/src/mess/includes/gba.h +++ b/src/mess/includes/gba.h @@ -265,7 +265,7 @@ public: inline void update_mask(UINT8* mask, int mode, int submode, UINT32* obj_win, UINT8 inwin0, UINT8 inwin1, UINT8 in0_mask, UINT8 in1_mask, UINT8 out_mask); void draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* line1, UINT32* line2, UINT32* line3, UINT32* lineOBJ, UINT32* lineOBJWin, UINT32* lineMix, int bpp); - + protected: required_memory_region m_region_maincpu; required_ioport m_io_in0; diff --git a/src/mess/includes/hx20.h b/src/mess/includes/hx20.h index ee322551233..fb491236630 100644 --- a/src/mess/includes/hx20.h +++ b/src/mess/includes/hx20.h @@ -14,52 +14,52 @@ #include "sound/speaker.h" #include "rendlay.h" -#define HD6301V1_MAIN_TAG "8g" -#define HD6301V1_SLAVE_TAG "6d" -#define MC146818_TAG "6g" -#define UPD7227_0_TAG "lcdc0" -#define UPD7227_1_TAG "lcdc1" -#define UPD7227_2_TAG "lcdc2" -#define UPD7227_3_TAG "lcdc3" -#define UPD7227_4_TAG "lcdc4" -#define UPD7227_5_TAG "lcdc5" -#define SPEAKER_TAG "speaker" -#define CASSETTE_TAG "cassette" -#define RS232_TAG "rs232" -#define SCREEN_TAG "screen" +#define HD6301V1_MAIN_TAG "8g" +#define HD6301V1_SLAVE_TAG "6d" +#define MC146818_TAG "6g" +#define UPD7227_0_TAG "lcdc0" +#define UPD7227_1_TAG "lcdc1" +#define UPD7227_2_TAG "lcdc2" +#define UPD7227_3_TAG "lcdc3" +#define UPD7227_4_TAG "lcdc4" +#define UPD7227_5_TAG "lcdc5" +#define SPEAKER_TAG "speaker" +#define CASSETTE_TAG "cassette" +#define RS232_TAG "rs232" +#define SCREEN_TAG "screen" class hx20_state : public driver_device { public: hx20_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, HD6301V1_MAIN_TAG), - m_subcpu(*this, HD6301V1_SLAVE_TAG), - m_rtc(*this, MC146818_TAG), - m_lcdc0(*this, UPD7227_0_TAG), - m_lcdc1(*this, UPD7227_1_TAG), - m_lcdc2(*this, UPD7227_2_TAG), - m_lcdc3(*this, UPD7227_3_TAG), - m_lcdc4(*this, UPD7227_4_TAG), - m_lcdc5(*this, UPD7227_5_TAG), - m_speaker(*this, SPEAKER_TAG), - m_cassette(*this, CASSETTE_TAG), - m_rs232(*this, RS232_TAG), - m_sio(*this, "sio"), - m_ksc0(*this, "KSC0"), - m_ksc1(*this, "KSC1"), - m_ksc2(*this, "KSC2"), - m_ksc3(*this, "KSC3"), - m_ksc4(*this, "KSC4"), - m_ksc5(*this, "KSC5"), - m_ksc6(*this, "KSC6"), - m_ksc7(*this, "KSC7"), - m_sw6(*this, "SW6"), - m_slave_rx(1), - m_slave_tx(1), - m_slave_flag(1), - m_rtc_irq(CLEAR_LINE), - m_kbrequest(1) + m_maincpu(*this, HD6301V1_MAIN_TAG), + m_subcpu(*this, HD6301V1_SLAVE_TAG), + m_rtc(*this, MC146818_TAG), + m_lcdc0(*this, UPD7227_0_TAG), + m_lcdc1(*this, UPD7227_1_TAG), + m_lcdc2(*this, UPD7227_2_TAG), + m_lcdc3(*this, UPD7227_3_TAG), + m_lcdc4(*this, UPD7227_4_TAG), + m_lcdc5(*this, UPD7227_5_TAG), + m_speaker(*this, SPEAKER_TAG), + m_cassette(*this, CASSETTE_TAG), + m_rs232(*this, RS232_TAG), + m_sio(*this, "sio"), + m_ksc0(*this, "KSC0"), + m_ksc1(*this, "KSC1"), + m_ksc2(*this, "KSC2"), + m_ksc3(*this, "KSC3"), + m_ksc4(*this, "KSC4"), + m_ksc5(*this, "KSC5"), + m_ksc6(*this, "KSC6"), + m_ksc7(*this, "KSC7"), + m_sw6(*this, "SW6"), + m_slave_rx(1), + m_slave_tx(1), + m_slave_flag(1), + m_rtc_irq(CLEAR_LINE), + m_kbrequest(1) { } required_device<cpu_device> m_maincpu; diff --git a/src/mess/includes/mac.h b/src/mess/includes/mac.h index 3b73637c322..bdde2f17f0d 100644 --- a/src/mess/includes/mac.h +++ b/src/mess/includes/mac.h @@ -152,7 +152,7 @@ class mac_sound_device : public device_t, public: mac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~mac_sound_device() {} - + void enable_sound(int on); void set_sound_buffer(int buffer); void set_volume(int volume); @@ -167,7 +167,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); private: // internal state - + ram_device *m_ram; model_t m_mac_model; diff --git a/src/mess/includes/pc1512.h b/src/mess/includes/pc1512.h index e7af4cd7488..20198e543fe 100644 --- a/src/mess/includes/pc1512.h +++ b/src/mess/includes/pc1512.h @@ -36,7 +36,7 @@ #define SPEAKER_TAG "speaker" #define ISA_BUS_TAG "isa" #define SCREEN_TAG "screen" -#define RS232_TAG "rs232" +#define RS232_TAG "rs232" class pc1512_state : public driver_device { diff --git a/src/mess/includes/sg1000.h b/src/mess/includes/sg1000.h index 5cd5ec82b5b..6a341774d4f 100644 --- a/src/mess/includes/sg1000.h +++ b/src/mess/includes/sg1000.h @@ -29,8 +29,8 @@ #define UPD9255_1_TAG "upd9255_1" #define CENTRONICS_TAG "centronics" #define TMS9918A_TAG "tms9918a" -#define RS232_TAG "rs232" -#define CARTSLOT_TAG "slot" +#define RS232_TAG "rs232" +#define CARTSLOT_TAG "slot" INPUT_PORTS_EXTERN( sk1100 ); diff --git a/src/mess/includes/sms.h b/src/mess/includes/sms.h index 2dafd6a0022..10bfb3088b9 100644 --- a/src/mess/includes/sms.h +++ b/src/mess/includes/sms.h @@ -102,7 +102,7 @@ public: device_t *m_left_lcd; device_t *m_right_lcd; address_space *m_space; - + UINT8 m_bios_page_count; UINT8 m_fm_detect; UINT8 m_ctrl_reg; @@ -113,11 +113,11 @@ public: UINT8 m_input_port0; UINT8 m_input_port1; UINT8 m_gg_sio[5]; - + // [0] for 0x400-0x3fff, [1] for 0x4000-0x7fff, [2] for 0x8000-0xffff, [3] for 0x0000-0x0400 int m_bank_enabled[4]; UINT8 m_bios_page[4]; - + // for gamegear LCD persistence hack bitmap_rgb32 m_prev_bitmap; @@ -168,7 +168,7 @@ public: UINT8 m_frame_sscope_state; // these are only used by the Store Display unit, but we keep them here temporarily to avoid the need of separate start/reset - UINT8 m_store_control; + UINT8 m_store_control; int m_current_cartridge; sega8_cart_slot_device *m_slots[16]; sega8_card_slot_device *m_cards[16]; @@ -241,7 +241,7 @@ public: : sms_state(mconfig, type, tag), m_control_cpu(*this, "control") { } - + required_device<cpu_device> m_control_cpu; DECLARE_READ8_MEMBER(sms_store_cart_select_r); @@ -251,13 +251,13 @@ public: DECLARE_READ8_MEMBER(sms_store_control_r); DECLARE_WRITE8_MEMBER(sms_store_control_w); DECLARE_DRIVER_INIT(smssdisp); - + DECLARE_READ8_MEMBER(store_read_0000); DECLARE_READ8_MEMBER(store_read_4000); DECLARE_READ8_MEMBER(store_read_8000); DECLARE_READ8_MEMBER(store_cart_peek); DECLARE_WRITE8_MEMBER(store_write_cart); - + DECLARE_WRITE_LINE_MEMBER(sms_store_int_callback); }; diff --git a/src/mess/includes/superslave.h b/src/mess/includes/superslave.h index ae6c8aab441..eb98b59ea8d 100644 --- a/src/mess/includes/superslave.h +++ b/src/mess/includes/superslave.h @@ -13,12 +13,12 @@ #include "machine/z80dart.h" #include "machine/z80pio.h" -#define Z80_TAG "u45" -#define Z80DART_0_TAG "u14" -#define Z80DART_1_TAG "u30" -#define Z80PIO_TAG "u43" -#define AM9519_TAG "u13" -#define BR1941_TAG "u12" +#define Z80_TAG "u45" +#define Z80DART_0_TAG "u14" +#define Z80DART_1_TAG "u30" +#define Z80PIO_TAG "u43" +#define AM9519_TAG "u13" +#define BR1941_TAG "u12" #define RS232_A_TAG "rs232a" #define RS232_B_TAG "rs232b" #define RS232_C_TAG "rs232c" @@ -29,18 +29,18 @@ class superslave_state : public driver_device public: superslave_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, Z80_TAG), - m_dart0(*this, Z80DART_0_TAG), - m_dart1(*this, Z80DART_1_TAG), - m_dbrg(*this, BR1941_TAG), - m_ram(*this, RAM_TAG), - m_rs232a(*this, RS232_A_TAG), - m_rs232b(*this, RS232_B_TAG), - m_rs232c(*this, RS232_C_TAG), - m_rs232d(*this, RS232_D_TAG), - m_rom(*this, Z80_TAG), - m_memctrl(0x01), - m_cmd(0x01) + m_maincpu(*this, Z80_TAG), + m_dart0(*this, Z80DART_0_TAG), + m_dart1(*this, Z80DART_1_TAG), + m_dbrg(*this, BR1941_TAG), + m_ram(*this, RAM_TAG), + m_rs232a(*this, RS232_A_TAG), + m_rs232b(*this, RS232_B_TAG), + m_rs232c(*this, RS232_C_TAG), + m_rs232d(*this, RS232_D_TAG), + m_rom(*this, Z80_TAG), + m_memctrl(0x01), + m_cmd(0x01) { } required_device<cpu_device> m_maincpu; diff --git a/src/mess/includes/tandy2k.h b/src/mess/includes/tandy2k.h index 37269840b2c..bb4f9f2a016 100644 --- a/src/mess/includes/tandy2k.h +++ b/src/mess/includes/tandy2k.h @@ -35,7 +35,7 @@ #define WD1010_TAG "u18" #define WD1100_11_TAG "u12" #define CENTRONICS_TAG "centronics" -#define RS232_TAG "rs232" +#define RS232_TAG "rs232" class tandy2k_state : public driver_device { diff --git a/src/mess/includes/v1050.h b/src/mess/includes/v1050.h index ad6fe0d69a3..19f7175ca7e 100644 --- a/src/mess/includes/v1050.h +++ b/src/mess/includes/v1050.h @@ -43,7 +43,7 @@ #define TIMER_ACK_TAG "timer_ack" #define TIMER_RST_TAG "timer_rst" #define SASIBUS_TAG "sasi" -#define RS232_TAG "rs232" +#define RS232_TAG "rs232" #define V1050_VIDEORAM_SIZE 0x8000 #define V1050_VIDEORAM_MASK 0x7fff diff --git a/src/mess/includes/victor9k.h b/src/mess/includes/victor9k.h index cc1fac5ab56..81f9360e6d7 100644 --- a/src/mess/includes/victor9k.h +++ b/src/mess/includes/victor9k.h @@ -43,8 +43,8 @@ #define M6522_4_TAG "1f" #define M6522_5_TAG "1k" #define M6522_6_TAG "1h" -#define DAC0808_0_TAG "5b" -#define DAC0808_1_TAG "5c" +#define DAC0808_0_TAG "5b" +#define DAC0808_1_TAG "5c" #define CENTRONICS_TAG "centronics" #define RS232_A_TAG "rs232a" #define RS232_B_TAG "rs232b" @@ -203,7 +203,7 @@ public: int m_rdy1; int m_ds0; int m_ds1; - UINT8 m_lms; /* motor speed */ + UINT8 m_lms; /* motor speed */ int m_st[2]; /* stepper phase */ int m_stp[2]; /* stepper enable */ int m_drive; /* selected drive */ diff --git a/src/mess/includes/vixen.h b/src/mess/includes/vixen.h index a63461593ce..bfbca9959c3 100644 --- a/src/mess/includes/vixen.h +++ b/src/mess/includes/vixen.h @@ -20,7 +20,7 @@ #define P8251A_TAG "c3" #define DISCRETE_TAG "discrete" #define SCREEN_TAG "screen" -#define RS232_TAG "rs232" +#define RS232_TAG "rs232" class vixen_state : public driver_device { diff --git a/src/mess/includes/wangpc.h b/src/mess/includes/wangpc.h index c3eab3d15e9..5a75ce50f3a 100644 --- a/src/mess/includes/wangpc.h +++ b/src/mess/includes/wangpc.h @@ -36,7 +36,7 @@ #define SCN2661_TAG "scn2661" #define UPD765_TAG "upd765" #define CENTRONICS_TAG "centronics" -#define RS232_TAG "rs232" +#define RS232_TAG "rs232" class wangpc_state : public driver_device { diff --git a/src/mess/machine/abc99.c b/src/mess/machine/abc99.c index aa438ebcdbb..ff7dc083f19 100644 --- a/src/mess/machine/abc99.c +++ b/src/mess/machine/abc99.c @@ -153,10 +153,10 @@ ADDRESS_MAP_END //------------------------------------------------- static ADDRESS_MAP_START( abc99_z5_io, AS_IO, 8, abc99_device ) -/* AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(z5_p1_r) - AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(z5_p2_w) - AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITENOP // Z2 CLK - AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(z5_t1_r)*/ +/* AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(z5_p1_r) + AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(z5_p2_w) + AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITENOP // Z2 CLK + AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(z5_t1_r)*/ ADDRESS_MAP_END diff --git a/src/mess/machine/abc99.h b/src/mess/machine/abc99.h index 75ae283c292..2b146a3c8e2 100644 --- a/src/mess/machine/abc99.h +++ b/src/mess/machine/abc99.h @@ -64,7 +64,7 @@ private: TIMER_SERIAL, TIMER_MOUSE }; - + enum { LED_1 = 0, diff --git a/src/mess/machine/abckb.h b/src/mess/machine/abckb.h index a231d461aa5..207ca9c0a49 100644 --- a/src/mess/machine/abckb.h +++ b/src/mess/machine/abckb.h @@ -20,7 +20,7 @@ // MACROS / CONSTANTS //************************************************************************** -#define ABC_KEYBOARD_PORT_TAG "kb" +#define ABC_KEYBOARD_PORT_TAG "kb" diff --git a/src/mess/machine/apollo.c b/src/mess/machine/apollo.c index 3315635550e..bf842dae2cb 100644 --- a/src/mess/machine/apollo.c +++ b/src/mess/machine/apollo.c @@ -691,9 +691,9 @@ IRQ_CALLBACK_MEMBER(apollo_state::apollo_pic_acknowledge) READ8_MEMBER( apollo_state::apollo_pic8259_get_slave_ack ) { - MLOG1(("apollo_pic8259_get_slave_ack: offset=%x", offset)); + MLOG1(("apollo_pic8259_get_slave_ack: offset=%x", offset)); - return offset == 3 ? m_pic8259_slave->inta_r() : 0; + return offset == 3 ? m_pic8259_slave->inta_r() : 0; } WRITE_LINE_MEMBER( apollo_state::apollo_pic8259_master_set_int_line ) { diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c index fe3786c5ba6..0dfbddb6406 100644 --- a/src/mess/machine/bbc.c +++ b/src/mess/machine/bbc.c @@ -1417,8 +1417,8 @@ TIMER_CALLBACK_MEMBER(bbc_state::bbc_tape_timer_cb) READ_LINE_MEMBER( bbc_state::bbc_rxd_r ) -{ - return ( m_serproc_data & 0x40 ) ? m_rs232->rx() : m_rxd_cass; +{ + return ( m_serproc_data & 0x40 ) ? m_rs232->rx() : m_rxd_cass; } @@ -1429,7 +1429,7 @@ READ_LINE_MEMBER( bbc_state::bbc_dcd_r ) READ_LINE_MEMBER( bbc_state::bbc_cts_r ) -{ +{ return ( m_serproc_data & 0x40 ) ? m_rs232->cts_r() : 0; } diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c index b4272e4277c..d8656b53faa 100644 --- a/src/mess/machine/concept.c +++ b/src/mess/machine/concept.c @@ -58,7 +58,7 @@ void concept_state::machine_start() /* clear keyboard interface state */ m_KeyQueueHead = m_KeyQueueLen = 0; memset(m_KeyStateSave, 0, sizeof(m_KeyStateSave)); - + m_exp[0] = machine().device<concept_exp_port_device>("exp1"); m_exp[1] = machine().device<concept_exp_port_device>("exp2"); m_exp[2] = machine().device<concept_exp_port_device>("exp3"); @@ -248,10 +248,10 @@ READ16_MEMBER(concept_state::concept_io_r) /* I/O slot regs */ switch ((offset >> 4) & 7) { - case 1: // IO1 registers - case 2: // IO2 registers - case 3: // IO3 registers - case 4: // IO4 registers + case 1: // IO1 registers + case 2: // IO2 registers + case 3: // IO3 registers + case 4: // IO4 registers return m_exp[((offset >> 4) & 7) - 1]->reg_r(space, offset & 0x0f); break; @@ -261,10 +261,10 @@ READ16_MEMBER(concept_state::concept_io_r) } break; - case 1: // IO1 ROM - case 2: // IO2 ROM - case 3: // IO3 ROM - case 4: // IO4 ROM + case 1: // IO1 ROM + case 2: // IO2 ROM + case 3: // IO3 ROM + case 4: // IO4 ROM LOG(("concept_io_r: Slot ROM memory accessed for slot %d at address 0x03%4.4x\n", ((offset >> 8) & 7) - 1, offset << 1)); return m_exp[((offset >> 8) & 7) - 1]->rom_r(space, offset & 0xff); break; @@ -373,23 +373,23 @@ WRITE16_MEMBER(concept_state::concept_io_w) /* I/O slot regs */ switch ((offset >> 4) & 7) { - case 1: // IO1 registers - case 2: // IO2 registers - case 3: // IO3 registers - case 4: // IO4 registers + case 1: // IO1 registers + case 2: // IO2 registers + case 3: // IO3 registers + case 4: // IO4 registers return m_exp[((offset >> 4) & 7) - 1]->reg_w(space, offset & 0x0f, data); break; - default: // ??? + default: // ??? logerror("concept_io_w: Slot I/O memory written for unknown purpose at address 0x03%4.4x, data: 0x%4.4x\n", offset << 1, data); break; } break; - case 1: // IO1 ROM - case 2: // IO2 ROM - case 3: // IO3 ROM - case 4: // IO4 ROM + case 1: // IO1 ROM + case 2: // IO2 ROM + case 3: // IO3 ROM + case 4: // IO4 ROM LOG(("concept_io_w: Slot ROM memory written to for slot %d at address 0x03%4.4x, data: 0x%4.4x\n", ((offset >> 8) & 7) - 1, offset << 1, data)); return m_exp[((offset >> 8) & 7) - 1]->rom_w(space, offset & 0xff, data); break; @@ -463,4 +463,3 @@ WRITE16_MEMBER(concept_state::concept_io_w) break; } } - diff --git a/src/mess/machine/concept_exp.c b/src/mess/machine/concept_exp.c index 1c07300c491..94a8be1119b 100644 --- a/src/mess/machine/concept_exp.c +++ b/src/mess/machine/concept_exp.c @@ -1,14 +1,14 @@ /********************************************************************** - + Corvus Concept expansion port emulation - + Copyright MESS Team. Visit http://mamedev.org for licensing and usage restrictions. - - + + FIXME: Concept expansion ports should just use the Apple II Bus device! - The code below is outdated and inaccurate! - + The code below is outdated and inaccurate! + **********************************************************************/ #include "machine/concept_exp.h" @@ -82,7 +82,7 @@ READ8_MEMBER( concept_exp_port_device::rom_r ) { if (m_card) return m_card->reg_r(space, offset); - + return 0; } @@ -139,7 +139,7 @@ enum LS_8IN_bit = 5, // 1 if 8" floppy drive? LS_DSKCHG_bit = 6, // 0 if disk changed, 1 if not LS_SD_bit = 7, // 1 if single density - + LS_DRQ_mask = (1 << LS_DRQ_bit), LS_INT_mask = (1 << LS_INT_bit), LS_SS_mask = (1 << LS_SS_bit), @@ -156,7 +156,7 @@ enum LC_MOTOROF_bit = 5, // 1 if motor to be turned off LC_FLP8IN_bit = 6, // 1 to select 8", 0 for 5"1/4 (which I knew what it means) LC_FMMFM_bit = 7, // 1 to select single density, 0 for double - + LC_FLPSD1_mask = (1 << LC_FLPSD1_bit), LC_DE0_mask = (1 << LC_DE0_bit), LC_DE1_mask = (1 << LC_DE1_bit), @@ -209,22 +209,22 @@ READ8_MEMBER(concept_fdc_device::reg_r) { switch (offset) { - case 0: // LOCAL STATUS REG + case 0: // LOCAL STATUS REG return m_fdc_local_status; - - case 8: // FDC STATUS REG + + case 8: // FDC STATUS REG return wd17xx_status_r(m_wd179x, space, offset); - - case 9: // FDC TRACK REG + + case 9: // FDC TRACK REG return wd17xx_track_r(m_wd179x, space, offset); - - case 10: // FDC SECTOR REG + + case 10: // FDC SECTOR REG return wd17xx_sector_r(m_wd179x, space, offset); - - case 11: // FDC DATA REG + + case 11: // FDC DATA REG return wd17xx_data_r(m_wd179x, space, offset); } - + return 0; } @@ -234,9 +234,9 @@ WRITE8_MEMBER(concept_fdc_device::reg_w) switch (offset) { - case 0: // LOCAL COMMAND REG + case 0: // LOCAL COMMAND REG m_fdc_local_command = data; - + wd17xx_set_side(m_wd179x, (data & LC_FLPSD1_mask) != 0); current_drive = ((data >> LC_DE0_bit) & 1) | ((data >> (LC_DE1_bit-1)) & 2); wd17xx_set_drive(m_wd179x, current_drive); @@ -246,20 +246,20 @@ WRITE8_MEMBER(concept_fdc_device::reg_w) wd17xx_dden_w(m_wd179x, BIT(data, 7)); floppy_drive_set_ready_state(floppy_get_device(machine(), current_drive), 1, 0); break; - - case 8: // FDC COMMAMD REG + + case 8: // FDC COMMAMD REG wd17xx_command_w(m_wd179x, space, offset, data); break; - - case 9: // FDC TRACK REG + + case 9: // FDC TRACK REG wd17xx_track_w(m_wd179x, space, offset, data); break; - - case 10: // FDC SECTOR REG + + case 10: // FDC SECTOR REG wd17xx_sector_w(m_wd179x, space, offset, data); break; - - case 11: // FDC DATA REG + + case 11: // FDC DATA REG wd17xx_data_w(m_wd179x, space, offset, data); break; } @@ -276,42 +276,42 @@ static LEGACY_FLOPPY_OPTIONS_START(concept) #if 1 /* SSSD 8" */ LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 8\" SSSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([77]) - SECTORS([26]) - SECTOR_LENGTH([128]) - FIRST_SECTOR_ID([1])) + HEADS([1]) + TRACKS([77]) + SECTORS([26]) + SECTOR_LENGTH([128]) + FIRST_SECTOR_ID([1])) #elif 0 /* SSDD 8" (according to ROMs) */ LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 8\" SSDD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([77]) - SECTORS([26]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) + HEADS([1]) + TRACKS([77]) + SECTORS([26]) + SECTOR_LENGTH([256]) + FIRST_SECTOR_ID([1])) #elif 0 /* Apple II DSDD 5"1/4 (according to ROMs) */ LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept Apple II 5\"1/4 DSDD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([35]) - SECTORS([16]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) + HEADS([2]) + TRACKS([35]) + SECTORS([16]) + SECTOR_LENGTH([256]) + FIRST_SECTOR_ID([1])) #elif 0 /* actual formats found */ LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 5\"1/4 DSDD disk image (256-byte sectors)", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([80]) - SECTORS([16]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) + HEADS([2]) + TRACKS([80]) + SECTORS([16]) + SECTOR_LENGTH([256]) + FIRST_SECTOR_ID([1])) #else LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 5\"1/4 DSDD disk image (512-byte sectors)", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([80]) - SECTORS([9]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) + HEADS([2]) + TRACKS([80]) + SECTORS([9]) + SECTOR_LENGTH([512]) + FIRST_SECTOR_ID([1])) #endif LEGACY_FLOPPY_OPTIONS_END @@ -358,13 +358,13 @@ READ8_MEMBER(concept_hdc_device::reg_r) { switch (offset) { - case 0: // HDC Data Register + case 0: // HDC Data Register return corvus_hdc_data_r(space, offset); - - case 1: // HDC Status Register + + case 1: // HDC Status Register return corvus_hdc_status_r(space, offset); } - + return 0; } @@ -373,7 +373,7 @@ WRITE8_MEMBER(concept_hdc_device::reg_w) { switch (offset) { - case 0: // HDC Data Register + case 0: // HDC Data Register corvus_hdc_data_w(space, offset, data); break; } @@ -396,4 +396,3 @@ machine_config_constructor concept_hdc_device::device_mconfig_additions() const { return MACHINE_CONFIG_NAME(hdc); } - diff --git a/src/mess/machine/concept_exp.h b/src/mess/machine/concept_exp.h index 4c8e22d20e2..fc9fab4be13 100644 --- a/src/mess/machine/concept_exp.h +++ b/src/mess/machine/concept_exp.h @@ -54,12 +54,12 @@ class concept_exp_card_device : public device_slot_card_interface public: // construction/destruction concept_exp_card_device(const machine_config &mconfig, device_t &device); - + DECLARE_READ8_MEMBER( reg_r ) { return 0xff; } DECLARE_READ8_MEMBER( rom_r ) { return 0xff; } DECLARE_WRITE8_MEMBER( reg_w ) {} DECLARE_WRITE8_MEMBER( rom_w ) {} - + protected: }; @@ -70,19 +70,19 @@ class concept_fdc_device : public device_t, public: // construction/destruction concept_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + DECLARE_READ8_MEMBER(reg_r); DECLARE_READ8_MEMBER(rom_r); DECLARE_WRITE8_MEMBER(reg_w); DECLARE_WRITE_LINE_MEMBER(intrq_w); DECLARE_WRITE_LINE_MEMBER(drq_w); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual machine_config_constructor device_mconfig_additions() const; - + protected: device_t *m_wd179x; @@ -96,7 +96,7 @@ class concept_hdc_device : public device_t, public: // construction/destruction concept_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + DECLARE_READ8_MEMBER( reg_r ); DECLARE_READ8_MEMBER( rom_r ); DECLARE_WRITE8_MEMBER( reg_w ); diff --git a/src/mess/machine/ds1315.c b/src/mess/machine/ds1315.c index 632fb4fc02f..f5a9d0903c5 100644 --- a/src/mess/machine/ds1315.c +++ b/src/mess/machine/ds1315.c @@ -216,5 +216,3 @@ void ds1315_device::input_raw_data() We always return the host's time when asked. */ } - - diff --git a/src/mess/machine/ds1315.h b/src/mess/machine/ds1315.h index e7ba2c1d58a..d4ab0cfb967 100644 --- a/src/mess/machine/ds1315.h +++ b/src/mess/machine/ds1315.h @@ -48,7 +48,7 @@ private: void fill_raw_data(); void input_raw_data(); - + int m_count; ds1315_mode_t m_mode; UINT8 m_raw_data[8*8]; diff --git a/src/mess/machine/ep64_exdos.c b/src/mess/machine/ep64_exdos.c index 4c7b5be1e5f..c587419f50f 100644 --- a/src/mess/machine/ep64_exdos.c +++ b/src/mess/machine/ep64_exdos.c @@ -12,7 +12,7 @@ Floppy Drive Controller PCB Layout ---------------------------------- -INTELLIGENT SOFTWARE LTD DISK CONTROLLER +INTELLIGENT SOFTWARE LTD DISK CONTROLLER ISS1 |--------------------------------------------| | | @@ -54,7 +54,7 @@ This PCB plugs into the external expansion connector on the right side of the ma // MACROS/CONSTANTS //************************************************************************** -#define WD1770_TAG "u1" +#define WD1770_TAG "u1" @@ -180,18 +180,18 @@ void ep64_exdos_device::device_reset() READ8_MEMBER( ep64_exdos_device::read ) { /* - + bit description - - 0 + + 0 1 INTRQ - 2 - 3 - 4 - 5 + 2 + 3 + 4 + 5 6 DCHG 7 DRQ - + */ UINT8 data = 0; @@ -212,9 +212,9 @@ READ8_MEMBER( ep64_exdos_device::read ) WRITE8_MEMBER( ep64_exdos_device::write ) { /* - + bit description - + 0 SELECT 0 1 SELECT 1 2 SELECT 2 @@ -223,7 +223,7 @@ WRITE8_MEMBER( ep64_exdos_device::write ) 5 _DDEN 6 DISK CHANGE RESET 7 IN USE - + */ m_floppy = NULL; diff --git a/src/mess/machine/ep64_exdos.h b/src/mess/machine/ep64_exdos.h index 18f1561e288..8cc83b36d5e 100644 --- a/src/mess/machine/ep64_exdos.h +++ b/src/mess/machine/ep64_exdos.h @@ -26,7 +26,7 @@ // ======================> ep64_exdos_device class ep64_exdos_device : public device_t, - public device_ep64_expansion_bus_card_interface + public device_ep64_expansion_bus_card_interface { public: // construction/destruction diff --git a/src/mess/machine/ep64exp.h b/src/mess/machine/ep64exp.h index 93d60d03f32..db2e89f27bd 100644 --- a/src/mess/machine/ep64exp.h +++ b/src/mess/machine/ep64exp.h @@ -57,7 +57,7 @@ // MACROS / CONSTANTS //************************************************************************** -#define EP64_EXPANSION_BUS_TAG "exp" +#define EP64_EXPANSION_BUS_TAG "exp" @@ -86,7 +86,7 @@ class device_ep64_expansion_bus_card_interface; class ep64_expansion_bus_slot_device : public device_t, - public device_slot_interface + public device_slot_interface { friend class device_ep64_expansion_bus_card_interface; diff --git a/src/mess/machine/gba_rom.c b/src/mess/machine/gba_rom.c index 1d2bf5c649a..3b2c081de21 100644 --- a/src/mess/machine/gba_rom.c +++ b/src/mess/machine/gba_rom.c @@ -1,12 +1,12 @@ /*********************************************************************************************************** - + Game Boy Advance cart emulation We support carts with several kind of Save RAM (actual SRAM, Flash RAM or EEPROM) - - + + ***********************************************************************************************************/ @@ -120,7 +120,7 @@ void gba_rom_eeprom64_device::device_start() { astring tempstring; m_rom = (UINT32 *)memregion(this->subtag(tempstring, "cartridge"))->base(); - + // for the moment we use a custom eeprom implementation, so we alloc/save it as nvram nvram_alloc(machine(), 0x2000); m_eeprom = auto_alloc(machine(), gba_eeprom_device(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 14)); @@ -140,7 +140,7 @@ READ32_MEMBER(gba_rom_sram_device::read_ram) { if (m_nvram && offset < m_nvram_size/4) return m_nvram[offset]; - else // this cannot actually happen... + else // this cannot actually happen... return 0xffffffff; } @@ -168,25 +168,25 @@ machine_config_constructor gba_rom_flash_device::device_mconfig_additions() cons READ32_MEMBER(gba_rom_flash_device::read_ram) { UINT32 rv = 0; - + offset &= m_flash_mask; - - if (mem_mask & 0xff) + + if (mem_mask & 0xff) rv |= m_flash->read(offset * 4); - if (mem_mask & 0xff00) + if (mem_mask & 0xff00) rv |= m_flash->read((offset * 4) + 1) << 8; - if (mem_mask & 0xff0000) + if (mem_mask & 0xff0000) rv |= m_flash->read((offset * 4) + 2) << 16; - if (mem_mask & 0xff000000) + if (mem_mask & 0xff000000) rv |= m_flash->read((offset * 4) + 3) << 24; - + return rv; } WRITE32_MEMBER(gba_rom_flash_device::write_ram) { offset &= m_flash_mask; - + switch (mem_mask) { case 0xff: @@ -220,18 +220,18 @@ machine_config_constructor gba_rom_flash1m_device::device_mconfig_additions() co READ32_MEMBER(gba_rom_flash1m_device::read_ram) { UINT32 rv = 0; - + offset &= m_flash_mask; - if (mem_mask & 0xff) + if (mem_mask & 0xff) rv |= m_flash->read(offset * 4); - if (mem_mask & 0xff00) + if (mem_mask & 0xff00) rv |= m_flash->read((offset * 4) + 1) << 8; - if (mem_mask & 0xff0000) + if (mem_mask & 0xff0000) rv |= m_flash->read((offset * 4) + 2) << 16; - if (mem_mask & 0xff000000) + if (mem_mask & 0xff000000) rv |= m_flash->read((offset * 4) + 3) << 24; - + return rv; } @@ -262,8 +262,8 @@ WRITE32_MEMBER(gba_rom_flash1m_device::write_ram) /*------------------------------------------------- Carts with EEPROM - - TODO: can this sketchy EEPROM device be merged + + TODO: can this sketchy EEPROM device be merged with the core implementation? -------------------------------------------------*/ @@ -288,16 +288,16 @@ gba_eeprom_device::gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UI UINT32 gba_eeprom_device::read() { UINT32 out; - + switch (m_state) { case EEP_IDLE: // printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %d\n", offset, ~mem_mask, m_state, activecpu_get_pc(), 1); return 0x00010001; // "ready" - + case EEP_READFIRST: m_count--; - + if (!m_count) { m_count = 64; @@ -318,19 +318,19 @@ UINT32 gba_eeprom_device::read() m_addr++; m_bits = 8; } - + out = (m_eep_data & 0x80) ? 1 : 0; out |= (out<<16); m_eep_data <<= 1; - + m_bits--; m_count--; - + if (!m_count) { m_state = EEP_IDLE; } - + // printf("out = %08x\n", out); // printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %08x\n", offset, ~mem_mask, m_state, activecpu_get_pc(), out); return out; @@ -348,7 +348,7 @@ void gba_eeprom_device::write(UINT32 data) if (data == 1) m_state++; break; - + case EEP_COMMAND: if (data == 1) m_command = EEP_READFIRST; @@ -358,7 +358,7 @@ void gba_eeprom_device::write(UINT32 data) m_count = m_addr_bits; m_addr = 0; break; - + case EEP_ADDR: m_addr <<= 1; m_addr |= (data & 1); @@ -377,7 +377,7 @@ void gba_eeprom_device::write(UINT32 data) } } break; - + case EEP_AFTERADDR: m_state = m_command; m_count = 64; @@ -386,13 +386,13 @@ void gba_eeprom_device::write(UINT32 data) if (m_state == EEP_READFIRST) m_count = 4; break; - + case EEP_WRITE: m_eep_data <<= 1; m_eep_data |= (data & 1); m_bits--; m_count--; - + if (m_bits == 0) { mame_printf_verbose("%08x: EEPROM: %02x to %x\n", machine().device("maincpu")->safe_pc(), m_eep_data, m_addr); @@ -404,11 +404,11 @@ void gba_eeprom_device::write(UINT32 data) m_eep_data = 0; m_bits = 8; } - + if (!m_count) m_state = EEP_AFTERWRITE; break; - + case EEP_AFTERWRITE: m_state = EEP_IDLE; break; @@ -434,7 +434,7 @@ WRITE32_MEMBER(gba_rom_eeprom_device::write_ram) if (~mem_mask == 0x0000ffff) data >>= 16; - + m_eeprom->write(data); } @@ -443,7 +443,7 @@ READ32_MEMBER(gba_rom_eeprom64_device::read_ram) // Larger games have smaller access to EERPOM content if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4) return 0xffffffff; - + return m_eeprom->read(); } @@ -452,10 +452,9 @@ WRITE32_MEMBER(gba_rom_eeprom64_device::write_ram) // Larger games have smaller access to EEPROM content if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4) return; - + if (~mem_mask == 0x0000ffff) data >>= 16; - + m_eeprom->write(data); } - diff --git a/src/mess/machine/gba_rom.h b/src/mess/machine/gba_rom.h index bb232a649b3..d51de2b36c9 100644 --- a/src/mess/machine/gba_rom.h +++ b/src/mess/machine/gba_rom.h @@ -19,7 +19,7 @@ public: virtual void device_start(); virtual const rom_entry *device_rom_region() const; virtual void device_reset(); - + // reading and writing virtual DECLARE_READ32_MEMBER(read_rom) { return m_rom[offset]; } }; @@ -31,7 +31,7 @@ class gba_rom_sram_device : public gba_rom_device public: // construction/destruction gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ32_MEMBER(read_ram); virtual DECLARE_WRITE32_MEMBER(write_ram); @@ -44,11 +44,11 @@ class gba_rom_flash_device : public gba_rom_device public: // construction/destruction gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual machine_config_constructor device_mconfig_additions() const; virtual void device_reset(); - + // reading and writing virtual DECLARE_READ32_MEMBER(read_ram); virtual DECLARE_WRITE32_MEMBER(write_ram); @@ -66,15 +66,15 @@ class gba_rom_flash1m_device : public gba_rom_device public: // construction/destruction gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual machine_config_constructor device_mconfig_additions() const; virtual void device_reset(); - + // reading and writing virtual DECLARE_READ32_MEMBER(read_ram); virtual DECLARE_WRITE32_MEMBER(write_ram); - + private: //UINT32 m_flash_size; UINT32 m_flash_mask; @@ -115,7 +115,7 @@ protected: int m_bits; int m_addr_bits; UINT8 m_eep_data; - + running_machine& m_machine; }; @@ -127,10 +127,10 @@ class gba_rom_eeprom_device : public gba_rom_device public: // construction/destruction gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); - + // reading and writing virtual DECLARE_READ32_MEMBER(read_ram); virtual DECLARE_WRITE32_MEMBER(write_ram); @@ -147,14 +147,14 @@ class gba_rom_eeprom64_device : public gba_rom_device public: // construction/destruction gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); - + // reading and writing virtual DECLARE_READ32_MEMBER(read_ram); virtual DECLARE_WRITE32_MEMBER(write_ram); - + private: gba_eeprom_device *m_eeprom; }; diff --git a/src/mess/machine/gba_slot.c b/src/mess/machine/gba_slot.c index 9a75d1ae50a..4486d07b0a9 100644 --- a/src/mess/machine/gba_slot.c +++ b/src/mess/machine/gba_slot.c @@ -159,7 +159,7 @@ bool gba_cart_slot_device::call_load() { UINT8 *ROM = (UINT8 *)m_cart->get_rom_base(); UINT32 cart_size; - + if (software_entry() == NULL) { cart_size = length(); @@ -169,9 +169,9 @@ bool gba_cart_slot_device::call_load() return IMAGE_INIT_FAIL; } fread(ROM, cart_size); - m_cart->set_rom_size(cart_size); // we store the actual game size... + m_cart->set_rom_size(cart_size); // we store the actual game size... - m_type = get_cart_type(ROM, cart_size); + m_type = get_cart_type(ROM, cart_size); } else { @@ -184,8 +184,8 @@ bool gba_cart_slot_device::call_load() return IMAGE_INIT_FAIL; } memcpy(ROM, get_software_region("rom"), cart_size); - m_cart->set_rom_size(cart_size); // we store the actual game size... - + m_cart->set_rom_size(cart_size); // we store the actual game size... + if (pcb_name) m_type = gba_get_pcb_id(pcb_name); @@ -249,7 +249,7 @@ bool gba_cart_slot_device::call_softlist_load(char *swlist, char *swname, rom_en /*------------------------------------------------- - get_cart_type - code to detect NVRAM type from + get_cart_type - code to detect NVRAM type from fullpath -------------------------------------------------*/ @@ -305,16 +305,16 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) chip |= GBA_CHIP_RTC; } mame_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).cstr()); - + // fix for games which return more than one kind of chip: either it is one of the known titles, or we default to no battery if (gba_chip_has_conflict(chip)) { char game_code[5] = { 0 }; bool resolved = FALSE; - + if (len >= 0xac + 4) memcpy(game_code, ROM + 0xac, 4); - + mame_printf_info("GBA: Game Code \"%s\"\n", game_code); chip &= ~(GBA_CHIP_EEPROM | GBA_CHIP_EEPROM_4K | GBA_CHIP_EEPROM_64K | GBA_CHIP_FLASH | GBA_CHIP_FLASH_1M | GBA_CHIP_FLASH_512 | GBA_CHIP_SRAM); @@ -333,7 +333,7 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) if (!resolved) mame_printf_warning("GBA: NVRAM is disabled because multiple NVRAM chips were detected!\n"); } - + // fix for games which are known to require an eeprom with 14-bit addressing (64 kbit) if (chip & GBA_CHIP_EEPROM) { @@ -341,7 +341,7 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) if (len >= 0xac + 4) memcpy(game_code, ROM + 0xac, 4); - + mame_printf_info("GBA: Game Code \"%s\"\n", game_code); for (int i = 0; i < sizeof(gba_chip_fix_eeprom_list) / sizeof(gba_chip_fix_eeprom_item); i++) @@ -462,7 +462,7 @@ void gba_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) /*------------------------------------------------- - Install ROM - directly point system address map + Install ROM - directly point system address map to the cart ROM region so to avoid the memory system additional load -------------------------------------------------*/ @@ -481,4 +481,3 @@ void gba_cart_slot_device::install_rom() machine().root_device().membank("rom3")->set_base(machine().root_device().memregion(m_cart->device().subtag(tempstring, "cartridge"))->base()); } } - diff --git a/src/mess/machine/gba_slot.h b/src/mess/machine/gba_slot.h index 119d0d31aa8..efb3c9077a5 100644 --- a/src/mess/machine/gba_slot.h +++ b/src/mess/machine/gba_slot.h @@ -42,9 +42,9 @@ public: void set_rom_size(UINT32 val) { m_rom_size = val; } // internal state - UINT32 *m_rom; // this points to the cart rom region + UINT32 *m_rom; // this points to the cart rom region UINT32 *m_nvram; - UINT32 m_rom_size; // this is the actual game size, not the rom region size! + UINT32 m_rom_size; // this is the actual game size, not the rom region size! UINT32 m_nvram_size; }; @@ -119,9 +119,9 @@ extern const device_type GBA_CART_SLOT; //------------------------------------------------------------------------ -// +// // Misc structs to attempt NVRAM identification when loading from fullpath -// +// //------------------------------------------------------------------------ diff --git a/src/mess/machine/intv.c b/src/mess/machine/intv.c index 0119b6b992d..21205d72adc 100644 --- a/src/mess/machine/intv.c +++ b/src/mess/machine/intv.c @@ -250,7 +250,7 @@ READ16_MEMBER( intv_state::intv_stic_r ) { if (m_bus_copy_mode || !m_stic->read_stic_handshake()) return m_stic->read(space, offset, mem_mask); - else + else return offset; } @@ -266,8 +266,8 @@ READ16_MEMBER( intv_state::intv_gram_r ) //logerror("read: %d = GRAM(%d)\n",state->m_gram[offset],offset); if (m_bus_copy_mode || !m_stic->read_stic_handshake()) return m_stic->gram_read(space, offset, mem_mask); - else - return offset; + else + return offset; } WRITE16_MEMBER( intv_state::intv_gram_w ) @@ -345,7 +345,7 @@ WRITE16_MEMBER( intv_state::ecs_bank2_page_select ) if (data == 0x7a50) { m_ecs_bank_src[1] = 1; - m_bank2->set_base(m_bank_base[m_ecs_bank_src[1]] + (0x7000 << 1)); // ECS ROM at 0x7000 is on page 1 + m_bank2->set_base(m_bank_base[m_ecs_bank_src[1]] + (0x7000 << 1)); // ECS ROM at 0x7000 is on page 1 } else if (data == 0x7a51 ) { @@ -619,10 +619,10 @@ void intv_state::machine_reset() if (m_is_ecs) { // ECS can switch between the maincpu and the ecs roms - m_ecs_bank_src[0] = 0; // CPU - m_ecs_bank_src[1] = 1; // ECS - m_ecs_bank_src[2] = 0; // CPU - m_ecs_bank_src[3] = 0; // CPU + m_ecs_bank_src[0] = 0; // CPU + m_ecs_bank_src[1] = 1; // ECS + m_ecs_bank_src[2] = 0; // CPU + m_ecs_bank_src[3] = 0; // CPU m_bank_base[0] = m_region_maincpu->base(); m_bank_base[1] = m_region_ecs_rom->base(); m_bank1->set_base(m_bank_base[m_ecs_bank_src[0]] + (0x2000 << 1)); @@ -684,7 +684,7 @@ void intv_state::machine_start() save_item(NAME(m_ecs_bank_src)); machine().save().register_postload(save_prepost_delegate(FUNC(intv_state::ecs_banks_restore), this)); } - + // intvkbd if (m_is_keybd) { diff --git a/src/mess/machine/mboard.c b/src/mess/machine/mboard.c index 6650de7ab63..a669df137e1 100644 --- a/src/mess/machine/mboard.c +++ b/src/mess/machine/mboard.c @@ -109,11 +109,11 @@ data: 0 0000 0000 all fields occupied else { /* looking for a piece in this line and clear bit in data if found */ - + for (i_AH = 0; i_AH < 8; i_AH = i_AH + 1) if (IsPiece(64 - (i_18 * 8 + 8 - i_AH))) data &= ~(1 << i_AH); // clear bit - + read_board_flag = TRUE; } } diff --git a/src/mess/machine/mc68328.c b/src/mess/machine/mc68328.c index 732f8839661..89fbb7be55b 100644 --- a/src/mess/machine/mc68328.c +++ b/src/mess/machine/mc68328.c @@ -47,7 +47,7 @@ void mc68328_device::device_config_complete() const mc68328_interface *intf = reinterpret_cast<const mc68328_interface *>(static_config()); if (intf != NULL) *static_cast<mc68328_interface *>(this) = *intf; - + // or initialize to defaults if none provided else { @@ -84,7 +84,7 @@ void mc68328_device::device_config_complete() //------------------------------------------------- void mc68328_device::device_start() -{ +{ m_out_port_a.resolve(m_out_port_a_func, *this); m_out_port_b.resolve(m_out_port_b_func, *this); m_out_port_c.resolve(m_out_port_c_func, *this); @@ -95,7 +95,7 @@ void mc68328_device::device_start() m_out_port_j.resolve(m_out_port_j_func, *this); m_out_port_k.resolve(m_out_port_k_func, *this); m_out_port_m.resolve(m_out_port_m_func, *this); - + m_in_port_a.resolve(m_in_port_a_func, *this); m_in_port_b.resolve(m_in_port_b_func, *this); m_in_port_c.resolve(m_in_port_c_func, *this); @@ -108,7 +108,7 @@ void mc68328_device::device_start() m_in_port_m.resolve(m_in_port_m_func, *this); m_out_pwm.resolve(m_out_pwm_func, *this); - + m_out_spim.resolve(m_out_spim_func, *this); m_in_spim.resolve(m_in_spim_func, *this); @@ -155,18 +155,18 @@ void mc68328_device::device_reset() m_regs.csd1 = 0x00010006; m_regs.csd2 = 0x00010006; m_regs.csd3 = 0x00010006; - + m_regs.pllcr = 0x2400; m_regs.pllfsr = 0x0123; m_regs.pctlr = 0x1f; - + m_regs.ivr = 0x00; m_regs.icr = 0x0000; m_regs.imr = 0x00ffffff; m_regs.iwr = 0x00ffffff; m_regs.isr = 0x00000000; m_regs.ipr = 0x00000000; - + m_regs.padir = 0x00; m_regs.padata = 0x00; m_regs.pasel = 0x00; @@ -206,12 +206,12 @@ void mc68328_device::device_reset() m_regs.pmdata = 0x00; m_regs.pmpuen = 0xff; m_regs.pmsel = 0xff; - + m_regs.pwmc = 0x0000; m_regs.pwmp = 0x0000; m_regs.pwmw = 0x0000; m_regs.pwmcnt = 0x0000; - + m_regs.tctl[0] = m_regs.tctl[1] = 0x0000; m_regs.tprer[0] = m_regs.tprer[1] = 0x0000; m_regs.tcmp[0] = m_regs.tcmp[1] = 0xffff; @@ -221,18 +221,18 @@ void mc68328_device::device_reset() m_regs.wctlr = 0x0000; m_regs.wcmpr = 0xffff; m_regs.wcn = 0x0000; - + m_regs.spisr = 0x0000; - + m_regs.spimdata = 0x0000; m_regs.spimcont = 0x0000; - + m_regs.ustcnt = 0x0000; m_regs.ubaud = 0x003f; m_regs.urx = 0x0000; m_regs.utx = 0x0000; m_regs.umisc = 0x0000; - + m_regs.lssa = 0x00000000; m_regs.lvpw = 0xff; m_regs.lxmax = 0x03ff; @@ -251,14 +251,14 @@ void mc68328_device::device_reset() m_regs.lposr = 0x00; m_regs.lfrcm = 0xb9; m_regs.lgpmr = 0x1073; - + m_regs.hmsr = 0x00000000; m_regs.alarm = 0x00000000; m_regs.rtcctl = 0x00; m_regs.rtcisr = 0x00; m_regs.rtcienr = 0x00; m_regs.stpwtch = 0x00; - + m_rtc->adjust(attotime::from_hz(1), 0, attotime::from_hz(1)); } @@ -2735,13 +2735,13 @@ UINT32 mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap UINT16 word; UINT16 *line; int y, x, b; - + if (m_regs.lckcon & LCKCON_LCDC_EN) { for (y = 0; y < 160; y++) { line = &bitmap.pix16(y); - + for (x = 0; x < 160; x += 16) { word = *(video_ram++); @@ -2757,7 +2757,7 @@ UINT32 mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap for (y = 0; y < 160; y++) { line = &bitmap.pix16(y); - + for (x = 0; x < 160; x++) { line[x] = 0; @@ -2905,4 +2905,3 @@ void mc68328_device::register_state_save() save_item(NAME(m_regs.rtcienr)); save_item(NAME(m_regs.stpwtch)); } - diff --git a/src/mess/machine/mc68328.h b/src/mess/machine/mc68328.h index 617c21e7f9a..78ed79fa43b 100644 --- a/src/mess/machine/mc68328.h +++ b/src/mess/machine/mc68328.h @@ -1,14 +1,14 @@ /********************************************************************** - + Motorola 68328 ("DragonBall") System-on-a-Chip implementation - + By MooglyGuy contact mooglyguy@gmail.com with licensing and usage questions. - + **********************************************************************/ /***************************************************************************************************************** - + P P P P P P P P P P P P P P E E E E E E E J J J J J J J 1 2 3 4 5 6 7 0 1 2 3 4 5 6 @@ -80,11 +80,11 @@ 1 2 P I O - + Figure 12-1. MC68328 144-Lead Plastic Thin-Quad Flat Pack Pin Assignment - + Source: MC68328 (DragonBall)(tm) Integrated Processor User's Manual - + *****************************************************************************************************************/ #ifndef __MC68328_H__ @@ -412,7 +412,7 @@ struct mc68328_interface { const char *m68k_cpu_tag; - + devcb_write8 m_out_port_a_func; /* 8-bit output */ devcb_write8 m_out_port_b_func; /* 8-bit output */ devcb_write8 m_out_port_c_func; /* 8-bit output */ @@ -423,7 +423,7 @@ struct mc68328_interface devcb_write8 m_out_port_j_func; /* 8-bit output */ devcb_write8 m_out_port_k_func; /* 8-bit output */ devcb_write8 m_out_port_m_func; /* 8-bit output */ - + devcb_read8 m_in_port_a_func; /* 8-bit input */ devcb_read8 m_in_port_b_func; /* 8-bit input */ devcb_read8 m_in_port_c_func; /* 8-bit input */ @@ -434,9 +434,9 @@ struct mc68328_interface devcb_read8 m_in_port_j_func; /* 8-bit input */ devcb_read8 m_in_port_k_func; /* 8-bit input */ devcb_read8 m_in_port_m_func; /* 8-bit input */ - + devcb_write8 m_out_pwm_func; /* 1-bit output */ - + devcb_write16 m_out_spim_func; /* 16-bit output */ devcb_read16 m_in_spim_func; /* 16-bit input */ @@ -449,7 +449,7 @@ struct mc68328_regs_t // $(FF)FFF000 UINT8 scr; // System Control Register UINT8 unused0[255]; - + // $(FF)FFF100 UINT16 grpbasea; // Chip Select Group A Base Register UINT16 grpbaseb; // Chip Select Group B Base Register @@ -476,14 +476,14 @@ struct mc68328_regs_t UINT32 csd2; // Group D Chip Select 2 Register UINT32 csd3; // Group D Chip Select 3 Register UINT8 unused1[176]; - + // $(FF)FFF200 UINT16 pllcr; // PLL Control Register UINT16 pllfsr; // PLL Frequency Select Register UINT8 pad2[3]; UINT8 pctlr; // Power Control Register UINT8 unused3[248]; - + // $(FF)FFF300 UINT8 ivr; // Interrupt Vector Register UINT8 unused4[1]; @@ -493,26 +493,26 @@ struct mc68328_regs_t UINT32 isr; // Interrupt Status Register UINT32 ipr; // Interrupt Pending Register UINT8 unused5[236]; - + // $(FF)FFF400 UINT8 padir; // Port A Direction Register UINT8 padata; // Port A Data Register UINT8 unused6[1]; UINT8 pasel; // Port A Select Register UINT8 unused7[4]; - + UINT8 pbdir; // Port B Direction Register UINT8 pbdata; // Port B Data Register UINT8 unused8[1]; UINT8 pbsel; // Port B Select Register UINT8 unused9[4]; - + UINT8 pcdir; // Port C Direction Register UINT8 pcdata; // Port C Data Register UINT8 unused10[1]; UINT8 pcsel; // Port C Select Register UINT8 unused11[4]; - + UINT8 pddir; // Port D Direction Register UINT8 pddata; // Port D Data Register UINT8 pdpuen; // Port D Pullup Enable Register @@ -521,25 +521,25 @@ struct mc68328_regs_t UINT8 pdirqen; // Port D IRQ Enable Register UINT8 pddataedge; // Port D Data Edge Level UINT8 pdirqedge; // Port D IRQ Edge Register - + UINT8 pedir; // Port E Direction Register UINT8 pedata; // Port E Data Register UINT8 pepuen; // Port E Pullup Enable Register UINT8 pesel; // Port E Select Register UINT8 unused14[4]; - + UINT8 pfdir; // Port F Direction Register UINT8 pfdata; // Port F Data Register UINT8 pfpuen; // Port F Pullup Enable Register UINT8 pfsel; // Port F Select Register UINT8 unused15[4]; - + UINT8 pgdir; // Port G Direction Register UINT8 pgdata; // Port G Data Register UINT8 pgpuen; // Port G Pullup Enable Register UINT8 pgsel; // Port G Select Register UINT8 unused16[4]; - + UINT8 pjdir; // Port J Direction Register UINT8 pjdata; // Port J Data Register UINT8 unused17[1]; @@ -550,20 +550,20 @@ struct mc68328_regs_t UINT8 pkpuen; // Port K Pullup Enable Register UINT8 pksel; // Port K Select Register UINT8 unused19[4]; - + UINT8 pmdir; // Port M Direction Register UINT8 pmdata; // Port M Data Register UINT8 pmpuen; // Port M Pullup Enable Register UINT8 pmsel; // Port M Select Register UINT8 unused20[180]; - + // $(FF)FFF500 UINT16 pwmc; // PWM Control Register UINT16 pwmp; // PWM Period Register UINT16 pwmw; // PWM Width Register UINT16 pwmcnt; // PWN Counter UINT8 unused21[248]; - + // $(FF)FFF600 UINT16 tctl[2]; // Timer Control Register UINT16 tprer[2]; // Timer Prescaler Register @@ -576,16 +576,16 @@ struct mc68328_regs_t UINT16 wcn; // Watchdog Counter UINT8 tclear[2]; // Timer Clearable Status UINT8 unused22[224]; - + // $(FF)FFF700 UINT16 spisr; // SPIS Register UINT8 unused23[254]; - + // $(FF)FFF800 UINT16 spimdata; // SPIM Data Register UINT16 spimcont; // SPIM Control/Status Register UINT8 unused24[252]; - + // $(FF)FFF900 UINT16 ustcnt; // UART Status/Control Register UINT16 ubaud; // UART Baud Control Register @@ -593,7 +593,7 @@ struct mc68328_regs_t UINT16 utx; // UART TX Register UINT16 umisc; // UART Misc Register UINT8 unused25[246]; - + // $(FF)FFFA00 UINT32 lssa; // Screen Starting Address Register UINT8 unused26[1]; @@ -625,7 +625,7 @@ struct mc68328_regs_t UINT8 lfrcm; // Frame Rate Control Modulation Register UINT16 lgpmr; // Gray Palette Mapping Register UINT8 unused37[204]; - + // $(FF)FFFB00 UINT32 hmsr; // RTC Hours Minutes Seconds Register UINT32 alarm; // RTC Alarm Register @@ -657,15 +657,15 @@ protected: virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); - -private: + +private: // internal state void set_interrupt_line(UINT32 line, UINT32 active); void poll_port_d_interrupts(); UINT32 get_timer_frequency(UINT32 index); void maybe_start_timer(UINT32 index, UINT32 new_enable); void timer_compare_event(UINT32 index); - + void register_state_save(); TIMER_CALLBACK_MEMBER(timer1_hit); @@ -674,11 +674,11 @@ private: TIMER_CALLBACK_MEMBER(rtc_tick); mc68328_regs_t m_regs; - + emu_timer *m_gptimer[2]; emu_timer *m_rtc; emu_timer *m_pwm; - + devcb_resolved_write8 m_out_port_a; /* 8-bit output */ devcb_resolved_write8 m_out_port_b; /* 8-bit output */ devcb_resolved_write8 m_out_port_c; /* 8-bit output */ @@ -689,7 +689,7 @@ private: devcb_resolved_write8 m_out_port_j; /* 8-bit output */ devcb_resolved_write8 m_out_port_k; /* 8-bit output */ devcb_resolved_write8 m_out_port_m; /* 8-bit output */ - + devcb_resolved_read8 m_in_port_a; /* 8-bit input */ devcb_resolved_read8 m_in_port_b; /* 8-bit input */ devcb_resolved_read8 m_in_port_c; /* 8-bit input */ @@ -700,13 +700,13 @@ private: devcb_resolved_read8 m_in_port_j; /* 8-bit input */ devcb_resolved_read8 m_in_port_k; /* 8-bit input */ devcb_resolved_read8 m_in_port_m; /* 8-bit input */ - + devcb_resolved_write8 m_out_pwm; /* 1-bit output */ - + devcb_resolved_write16 m_out_spim; /* 16-bit output */ devcb_resolved_read16 m_in_spim; /* 16-bit input */ - devcb_resolved_write_line m_spim_xch_trigger; // not really a write_line, fix when converting to devcb2! + devcb_resolved_write_line m_spim_xch_trigger; // not really a write_line, fix when converting to devcb2! cpu_device *m_cpu; }; diff --git a/src/mess/machine/md_rom.c b/src/mess/machine/md_rom.c index 93fc21639db..17d3113284e 100644 --- a/src/mess/machine/md_rom.c +++ b/src/mess/machine/md_rom.c @@ -1212,7 +1212,7 @@ WRITE16_MEMBER(md_rom_tekkensp_device::write) // data output mode bit 1 ? (never written by game) break; default: - if (data & 0x100) // data input (only connected to D0 ?) + if (data & 0x100) // data input (only connected to D0 ?) { // 4-bit hardware register ($400004 corresponds to bit0, $400006 to bit1, etc) int shift = (offset - 2) & 3; diff --git a/src/mess/machine/md_rom.h b/src/mess/machine/md_rom.h index 890e6287db6..6cd16d477d2 100644 --- a/src/mess/machine/md_rom.h +++ b/src/mess/machine/md_rom.h @@ -155,7 +155,7 @@ class md_rom_16mj2_device : public md_std_rom_device public: // construction/destruction md_rom_16mj2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ16_MEMBER(read); }; @@ -447,15 +447,15 @@ class md_rom_tekkensp_device : public md_std_rom_device public: // construction/destruction md_rom_tekkensp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); - + private: UINT16 m_reg; }; diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c index 8df2039e0ad..a76d1ba0aa2 100644 --- a/src/mess/machine/msx.c +++ b/src/mess/machine/msx.c @@ -858,7 +858,7 @@ void msx_state::msx_memory_init() size = layout->size; option = layout->option; - + if (layout->type != SLOT_CARTRIDGE1 && layout->type != SLOT_CARTRIDGE2) { int size_tmp = 0; diff --git a/src/mess/machine/pce.c b/src/mess/machine/pce.c index 0e8925a009b..daee087e3b5 100644 --- a/src/mess/machine/pce.c +++ b/src/mess/machine/pce.c @@ -120,7 +120,7 @@ MACHINE_RESET_MEMBER(pce_state,mess_pce) m_sys3_card = 1; m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x080000, 0x087fff, read8_delegate(FUNC(pce_state::pce_cd_acard_wram_r),this),write8_delegate(FUNC(pce_state::pce_cd_acard_wram_w),this)); } - + if (m_cartslot->get_type() == PCE_CDSYS3U) { m_sys3_card = 3; @@ -213,7 +213,7 @@ WRITE8_MEMBER(pce_state::pce_cd_intf_w) if (offset & 0x200 && m_sys3_card && m_acard) // route Arcade Card handling ports return m_cd->acard_w(space, offset, data); - + m_cd->intf_w(space, offset, data); m_cd->update(); @@ -238,7 +238,7 @@ READ8_MEMBER(pce_state::pce_cd_intf_r) case 0xc7: return 0x03; } } - + return m_cd->intf_r(space, offset); } diff --git a/src/mess/machine/pce_cd.c b/src/mess/machine/pce_cd.c index ca08ef6847a..3050fc6e989 100644 --- a/src/mess/machine/pce_cd.c +++ b/src/mess/machine/pce_cd.c @@ -98,30 +98,30 @@ void pce_cd_device::device_start() /* set up adpcm related things */ m_adpcm_ram = auto_alloc_array_clear(machine(), UINT8, PCE_ADPCM_RAM_SIZE); m_adpcm_clock_divider = 1; - + /* Set up cd command buffer */ m_command_buffer = auto_alloc_array_clear(machine(), UINT8, PCE_CD_COMMAND_BUFFER_SIZE); m_command_buffer_index = 0; - + /* Set up Arcade Card RAM buffer */ m_acard_ram = auto_alloc_array_clear(machine(), UINT8, PCE_ACARD_RAM_SIZE); - + m_data_buffer = auto_alloc_array_clear(machine(), UINT8, 8192); m_data_buffer_size = 0; m_data_buffer_index = 0; - + m_subcode_buffer = auto_alloc_array(machine(), UINT8, 96); - + m_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::data_timer_callback),this)); m_data_timer->adjust(attotime::never); m_adpcm_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_dma_timer_callback),this)); m_adpcm_dma_timer->adjust(attotime::never); - + m_cdda_fadeout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::cdda_fadeout_callback),this)); m_cdda_fadeout_timer->adjust(attotime::never); m_cdda_fadein_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::cdda_fadein_callback),this)); m_cdda_fadein_timer->adjust(attotime::never); - + m_adpcm_fadeout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_fadeout_callback),this)); m_adpcm_fadeout_timer->adjust(attotime::never); m_adpcm_fadein_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_fadein_callback),this)); @@ -187,16 +187,16 @@ void pce_cd_device::device_start() } void pce_cd_device::device_reset() -{ +{ m_adpcm_read_buf = 0; m_adpcm_write_buf = 0; - + // TODO: add CD-DA stop command here //m_cdda_status = PCE_CD_CDDA_OFF; //m_cdda->stop_audio(); memset(m_regs, 0, sizeof(m_regs)); - + m_regs[0x0c] |= PCE_CD_ADPCM_STOP_FLAG; m_regs[0x0c] &= ~PCE_CD_ADPCM_PLAY_FLAG; //m_regs[0x03] = (m_regs[0x03] & ~0x0c) | (PCE_CD_SAMPLE_STOP_PLAY); @@ -286,28 +286,28 @@ void pce_cd_device::adpcm_play() WRITE_LINE_MEMBER( pce_cd_device::msm5205_int ) { UINT8 msm_data; - + // popmessage("%08x %08x %08x %02x %02x",m_msm_start_addr,m_msm_end_addr,m_msm_half_addr,m_regs[0x0c],m_regs[0x0d]); - + if (m_msm_idle) return; - + /* Supply new ADPCM data */ msm_data = (m_msm_nibble) ? (m_adpcm_ram[m_msm_start_addr] & 0x0f) : ((m_adpcm_ram[m_msm_start_addr] & 0xf0) >> 4); - + m_msm->data_w(msm_data); m_msm_nibble ^= 1; - + if (m_msm_nibble == 0) { m_msm_start_addr++; - + if (m_msm_start_addr == m_msm_half_addr) { //set_irq_line(PCE_CD_IRQ_SAMPLE_FULL_PLAY, CLEAR_LINE); //set_irq_line(PCE_CD_IRQ_SAMPLE_HALF_PLAY, ASSERT_LINE); } - + if (m_msm_start_addr > m_msm_end_addr) { //set_irq_line(PCE_CD_IRQ_SAMPLE_HALF_PLAY, CLEAR_LINE); @@ -328,7 +328,7 @@ void pce_cd_device::reply_status_byte(UINT8 status) m_scsi_MSG = 0; m_message_after_status = 1; m_status_sent = m_message_sent = 0; - + if (status == SCSI_STATUS_OK) { m_regs[0x01] = 0x00; @@ -361,24 +361,24 @@ void pce_cd_device::read_6() UINT32 frame = ((m_command_buffer[1] & 0x1f) << 16) | (m_command_buffer[2] << 8) | m_command_buffer[3]; UINT32 frame_count = m_command_buffer[4]; printf("%08x %08x\n",frame,frame_count); - + /* Check for presence of a CD */ if (!m_cd_file) { reply_status_byte(SCSI_CHECK_CONDITION); return; } - + if (m_cdda_status != PCE_CD_CDDA_OFF) { m_cdda_status = PCE_CD_CDDA_OFF; m_cdda->stop_audio(); m_end_mark = 0; } - + m_current_frame = frame; m_end_frame = frame + frame_count; - + if (frame_count == 0) { /* Star Breaker uses this */ @@ -389,7 +389,7 @@ void pce_cd_device::read_6() { m_data_timer->adjust(attotime::from_hz(PCE_CD_DATA_FRAMES_PER_SECOND), 0, attotime::from_hz(PCE_CD_DATA_FRAMES_PER_SECOND)); } - + /* TODO: correct place? */ set_irq_line(PCE_CD_IRQ_TRANSFER_READY, ASSERT_LINE); } @@ -398,14 +398,14 @@ void pce_cd_device::read_6() void pce_cd_device::nec_set_audio_start_position() { UINT32 frame = 0; - + if (!m_cd_file) { /* Throw some error here */ reply_status_byte(SCSI_CHECK_CONDITION); return; } - + switch (m_command_buffer[9] & 0xC0) { case 0x00: @@ -415,11 +415,11 @@ void pce_cd_device::nec_set_audio_start_position() case 0x40: { UINT8 m,s,f; - + m = bcd_2_dec(m_command_buffer[2]); s = bcd_2_dec(m_command_buffer[3]); f = bcd_2_dec(m_command_buffer[4]); - + frame = f + 75 * (s + m * 60); // PCE tries to be clever here and set (start of track + track pregap size) to skip the pregap // (I guess it wants the TOC to have the real start sector for data tracks and the start of the pregap for audio?) @@ -434,9 +434,9 @@ void pce_cd_device::nec_set_audio_start_position() //assert(NULL == nec_set_audio_start_position); break; } - + m_current_frame = frame; - + if (m_cdda_status == PCE_CD_CDDA_PAUSED) { m_cdda_status = PCE_CD_CDDA_OFF; @@ -463,7 +463,7 @@ void pce_cd_device::nec_set_audio_start_position() m_cdda_play_mode = 3; } } - + reply_status_byte(SCSI_STATUS_OK); set_irq_line(PCE_CD_IRQ_TRANSFER_DONE, ASSERT_LINE); } @@ -472,14 +472,14 @@ void pce_cd_device::nec_set_audio_start_position() void pce_cd_device::nec_set_audio_stop_position() { UINT32 frame = 0; - + if (!m_cd_file) { /* Throw some error here */ reply_status_byte(SCSI_CHECK_CONDITION); return; } - + switch (m_command_buffer[9] & 0xC0) { case 0x00: @@ -489,11 +489,11 @@ void pce_cd_device::nec_set_audio_stop_position() case 0x40: { UINT8 m,s,f; - + m = bcd_2_dec(m_command_buffer[2]); s = bcd_2_dec(m_command_buffer[3]); f = bcd_2_dec(m_command_buffer[4]); - + frame = f + 75 * (s + m * 60); // if (frame >= 525) // TODO: seven seconds gap? O_o // frame -= 525; @@ -507,10 +507,10 @@ void pce_cd_device::nec_set_audio_stop_position() //assert(NULL == nec_set_audio_start_position); break; } - + m_end_frame = frame; m_cdda_play_mode = m_command_buffer[1] & 0x03; - + if (m_cdda_play_mode) { if (m_cdda_status == PCE_CD_CDDA_PAUSED) @@ -533,7 +533,7 @@ void pce_cd_device::nec_set_audio_stop_position() m_end_mark = 0; // assert(NULL == nec_set_audio_stop_position); } - + reply_status_byte(SCSI_STATUS_OK); set_irq_line(PCE_CD_IRQ_TRANSFER_DONE, ASSERT_LINE); } @@ -547,14 +547,14 @@ void pce_cd_device::nec_pause() reply_status_byte(SCSI_CHECK_CONDITION); return; } - + /* If there was no cdda playing, throw an error */ if (m_cdda_status == PCE_CD_CDDA_OFF) { reply_status_byte(SCSI_CHECK_CONDITION); return; } - + m_cdda_status = PCE_CD_CDDA_PAUSED; m_current_frame = m_cdda->get_audio_lba(); m_cdda->pause_audio(1); @@ -566,16 +566,16 @@ void pce_cd_device::nec_get_subq() { /* WP - I do not have access to chds with subchannel information yet, so I'm faking something here */ UINT32 msf_abs, msf_rel, track, frame; - + if (!m_cd_file) { /* Throw some error here */ reply_status_byte(SCSI_CHECK_CONDITION); return; } - + frame = m_current_frame; - + switch (m_cdda_status) { case PCE_CD_CDDA_PAUSED: @@ -590,11 +590,11 @@ void pce_cd_device::nec_get_subq() m_data_buffer[0] = 3; break; } - + msf_abs = lba_to_msf_alt(frame); track = cdrom_get_track(m_cd_file, frame); msf_rel = lba_to_msf_alt(frame - cdrom_get_track_start(m_cd_file, track)); - + m_data_buffer[1] = 0x01 | ((cdrom_get_track_type(m_cd_file, cdrom_get_track(m_cd_file, track+1)) == CD_TRACK_AUDIO) ? 0x00 : 0x40); m_data_buffer[2] = dec_2_bcd(track+1); /* track */ m_data_buffer[3] = 1; /* index */ @@ -605,7 +605,7 @@ void pce_cd_device::nec_get_subq() m_data_buffer[8] = dec_2_bcd((msf_abs >> 8) & 0xFF); /* S (absolute) */ m_data_buffer[9] = dec_2_bcd(msf_abs & 0xFF); /* F (absolute) */ m_data_buffer_size = 10; - + m_data_buffer_index = 0; m_data_transferred = 1; m_scsi_IO = 1; @@ -618,15 +618,15 @@ void pce_cd_device::nec_get_dir_info() UINT32 frame, msf, track = 0; const cdrom_toc *toc; logerror("nec get dir info\n"); - + if (!m_cd_file) { /* Throw some error here */ reply_status_byte(SCSI_CHECK_CONDITION); } - + toc = cdrom_get_toc(m_cd_file); - + switch (m_command_buffer[1]) { case 0x00: /* Get first and last track numbers */ @@ -638,7 +638,7 @@ void pce_cd_device::nec_get_dir_info() frame = toc->tracks[toc->numtrks-1].logframeofs; frame += toc->tracks[toc->numtrks-1].frames; msf = lba_to_msf(frame + 150); - + m_data_buffer[0] = (msf >> 16) & 0xFF; /* M */ m_data_buffer[1] = (msf >> 8) & 0xFF; /* S */ m_data_buffer[2] = msf & 0xFF; /* F */ @@ -672,7 +672,7 @@ void pce_cd_device::nec_get_dir_info() // assert(pce_cd_nec_get_dir_info == NULL); // Not implemented yet break; } - + m_data_buffer_index = 0; m_data_transferred = 1; m_scsi_IO = 1; @@ -702,28 +702,28 @@ void pce_cd_device::handle_data_output() { 0xDE,10, &pce_cd_device::nec_get_dir_info }, /* NEC GET DIR INFO */ { 0xFF, 1, &pce_cd_device::end_of_list } /* end of list marker */ }; - + if (m_scsi_REQ && m_scsi_ACK) { /* Command byte received */ logerror("Command byte $%02X received\n", m_regs[0x01]); - + /* Check for buffer overflow */ assert(m_command_buffer_index < PCE_CD_COMMAND_BUFFER_SIZE); - + m_command_buffer[m_command_buffer_index] = m_regs[0x01]; m_command_buffer_index++; m_scsi_REQ = 0; } - + if (! m_scsi_REQ && ! m_scsi_ACK && m_command_buffer_index) { int i = 0; - + logerror("Check if command done\n"); - + for(i = 0; m_command_buffer[0] > pce_cd_commands[i].command_byte; i++); - + /* Check for unknown commands */ if (m_command_buffer[0] != pce_cd_commands[i].command_byte) { @@ -732,7 +732,7 @@ void pce_cd_device::handle_data_output() popmessage("CD command 0x03 issued (Request Sense), contact MESSdev"); } assert(m_command_buffer[0] == pce_cd_commands[i].command_byte); - + if (m_command_buffer_index == pce_cd_commands[i].command_size) { //printf("%02x command issued\n",m_command_buffer[0]); @@ -757,7 +757,7 @@ void pce_cd_device::handle_data_input() m_scsi_REQ = 0; m_status_sent = 1; } - + if (! m_scsi_REQ && ! m_scsi_ACK && m_status_sent) { m_status_sent = 0; @@ -777,7 +777,7 @@ void pce_cd_device::handle_data_input() { m_scsi_REQ = 0; } - + if (! m_scsi_REQ && ! m_scsi_ACK) { if (m_data_buffer_index == m_data_buffer_size) @@ -814,7 +814,7 @@ void pce_cd_device::handle_message_input() m_scsi_REQ = 0; m_message_sent = 1; } - + if (! m_scsi_REQ && ! m_scsi_ACK && m_message_sent) { m_message_sent = 0; @@ -842,7 +842,7 @@ void pce_cd_device::update() } m_scsi_last_RST = m_scsi_RST; } - + /* Check if bus can be freed */ if (! m_scsi_SEL && ! m_scsi_BSY && m_selected) { @@ -851,7 +851,7 @@ void pce_cd_device::update() m_scsi_CD = m_scsi_MSG = m_scsi_IO = m_scsi_REQ = 0; set_irq_line(PCE_CD_IRQ_TRANSFER_DONE, CLEAR_LINE); } - + /* Select the CD device */ if (m_scsi_SEL) { @@ -863,7 +863,7 @@ void pce_cd_device::update() m_scsi_MSG = m_scsi_IO = 0; } } - + if (m_scsi_ATN) { } @@ -900,7 +900,7 @@ void pce_cd_device::update() } } } - + /* FIXME: presumably CD-DA needs an irq interface for this */ if (m_cdda->audio_ended() && m_end_mark == 1) { @@ -919,7 +919,7 @@ void pce_cd_device::set_irq_line(int num, int state) m_regs[0x03] |= num; else m_regs[0x03] &= ~num; - + if (m_regs[0x02] & m_regs[0x03] & 0x7c) { //printf("IRQ PEND = %02x MASK = %02x IRQ ENABLE %02X\n",m_regs[0x02] & m_regs[0x03] & 0x7c,m_regs[0x02] & 0x7c,m_regs[0x03] & 0x7c); @@ -945,14 +945,14 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::data_timer_callback) { logerror("Succesfully read mode1 frame #%d\n", m_current_frame); } - + m_data_buffer_index = 0; m_data_buffer_size = 2048; m_current_frame++; - + m_scsi_IO = 1; m_scsi_CD = 0; - + if (m_current_frame == m_end_frame) { /* We are done, disable the timer */ @@ -997,7 +997,7 @@ void pce_cd_device::set_adpcm_ram_byte(UINT8 val) TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadeout_callback) { m_cdda_volume -= 0.1; - + if (m_cdda_volume <= 0) { m_cdda_volume = 0.0; @@ -1014,7 +1014,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadeout_callback) TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadein_callback) { m_cdda_volume += 0.1; - + if (m_cdda_volume >= 100.0) { m_cdda_volume = 100.0; @@ -1031,7 +1031,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadein_callback) TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadeout_callback) { m_adpcm_volume -= 0.1; - + if (m_adpcm_volume <= 0) { m_adpcm_volume = 0.0; @@ -1048,7 +1048,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadeout_callback) TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadein_callback) { m_adpcm_volume += 0.1; - + if (m_adpcm_volume >= 100.0) { m_adpcm_volume = 100.0; @@ -1066,7 +1066,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadein_callback) WRITE8_MEMBER(pce_cd_device::intf_w) { logerror("%04X: write to CD interface offset %02X, data %02X\n", space.device().safe_pc(), offset, data); - + switch (offset & 0xf) { case 0x00: /* CDC status */ @@ -1134,7 +1134,7 @@ WRITE8_MEMBER(pce_cd_device::intf_w) adpcm_stop(0); m_msm->reset_w(1); } - + if ((data & 0x40) && ((m_regs[0x0D] & 0x40) == 0)) // ADPCM play { m_msm_start_addr = (m_adpcm_read_ptr); @@ -1143,7 +1143,7 @@ WRITE8_MEMBER(pce_cd_device::intf_w) m_msm_nibble = 0; adpcm_play(); m_msm->reset_w(0); - + //popmessage("%08x %08x",m_adpcm_read_ptr,m_adpcm_length); } else if ((data & 0x40) == 0) @@ -1152,9 +1152,9 @@ WRITE8_MEMBER(pce_cd_device::intf_w) adpcm_stop(0); m_msm->reset_w(1); } - + m_msm_repeat = BIT(data, 5); - + if (data & 0x10) //ADPCM set length { m_adpcm_length = (m_regs[0x09] << 8) | m_regs[0x08]; @@ -1273,7 +1273,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_dma_timer_callback) { m_adpcm_ram[m_adpcm_write_ptr] = get_cd_data_byte(); m_adpcm_write_ptr = (m_adpcm_write_ptr + 1) & 0xFFFF; - + m_regs[0x0c] &= ~4; } } @@ -1288,10 +1288,10 @@ UINT8 pce_cd_device::get_adpcm_ram_byte() else { UINT8 res; - + res = m_adpcm_ram[m_adpcm_read_ptr]; m_adpcm_read_ptr = ((m_adpcm_read_ptr + 1) & 0xffff); - + return res; } } @@ -1356,7 +1356,7 @@ READ8_MEMBER(pce_cd_device::intf_r) data = 0xFF; break; } - + return data; } @@ -1370,7 +1370,7 @@ PC Engine Arcade Card emulation READ8_MEMBER(pce_cd_device::acard_r) { UINT8 r_num; - + if ((offset & 0x2e0) == 0x2e0) { switch (offset & 0x2ef) @@ -1384,12 +1384,12 @@ READ8_MEMBER(pce_cd_device::acard_r) case 0x2ee: return 0x10; case 0x2ef: return 0x51; } - + return 0; } - + r_num = (offset & 0x30) >> 4; - + switch (offset & 0x0f) { case 0x00: @@ -1400,7 +1400,7 @@ READ8_MEMBER(pce_cd_device::acard_r) res = m_acard_ram[(m_acard_base_addr[r_num] + m_acard_addr_offset[r_num]) & 0x1fffff]; else res = m_acard_ram[m_acard_base_addr[r_num] & 0x1fffff]; - + if (m_acard_ctrl[r_num] & 0x1) { if (m_acard_ctrl[r_num] & 0x10) @@ -1413,7 +1413,7 @@ READ8_MEMBER(pce_cd_device::acard_r) m_acard_addr_offset[r_num] += m_acard_addr_inc[r_num]; } } - + return res; } case 0x02: return (m_acard_base_addr[r_num] >> 0) & 0xff; @@ -1426,14 +1426,14 @@ READ8_MEMBER(pce_cd_device::acard_r) case 0x09: return m_acard_ctrl[r_num]; default: return 0; } - + return 0; } WRITE8_MEMBER(pce_cd_device::acard_w) { UINT8 w_num; - + if ((offset & 0x2e0) == 0x2e0) { switch (offset & 0x0f) @@ -1445,7 +1445,7 @@ WRITE8_MEMBER(pce_cd_device::acard_w) case 4: { m_acard_shift_reg = data & 0x0f; - + if (m_acard_shift_reg != 0) { m_acard_shift = (m_acard_shift_reg < 8) ? @@ -1460,7 +1460,7 @@ WRITE8_MEMBER(pce_cd_device::acard_w) else { w_num = (offset & 0x30) >> 4; - + switch (offset & 0x0f) { case 0x00: @@ -1469,7 +1469,7 @@ WRITE8_MEMBER(pce_cd_device::acard_w) m_acard_ram[(m_acard_base_addr[w_num] + m_acard_addr_offset[w_num]) & 0x1fffff] = data; else m_acard_ram[m_acard_base_addr[w_num] & 0x1FFFFF] = data; - + if (m_acard_ctrl[w_num] & 0x1) { if (m_acard_ctrl[w_num] & 0x10) @@ -1482,16 +1482,16 @@ WRITE8_MEMBER(pce_cd_device::acard_w) m_acard_addr_offset[w_num] += m_acard_addr_inc[w_num]; } } - + break; - + case 0x02: m_acard_base_addr[w_num] = (data & 0xff) | (m_acard_base_addr[w_num] & 0xffff00); break; case 0x03: m_acard_base_addr[w_num] = (data << 8) | (m_acard_base_addr[w_num] & 0xff00ff); break; case 0x04: m_acard_base_addr[w_num] = (data << 16) | (m_acard_base_addr[w_num] & 0x00ffff); break; case 0x05: m_acard_addr_offset[w_num] = (data & 0xff) | (m_acard_addr_offset[w_num] & 0xff00); break; case 0x06: m_acard_addr_offset[w_num] = (data << 8) | (m_acard_addr_offset[w_num] & 0x00ff); - + if ((m_acard_ctrl[w_num] & 0x60) == 0x40) { m_acard_base_addr[w_num] += m_acard_addr_offset[w_num] + ((m_acard_ctrl[w_num] & 0x08) ? 0xff0000 : 0); diff --git a/src/mess/machine/pce_cd.h b/src/mess/machine/pce_cd.h index 967e0f8d887..c500ccb0770 100644 --- a/src/mess/machine/pce_cd.h +++ b/src/mess/machine/pce_cd.h @@ -105,7 +105,7 @@ private: UINT8 m_msm_nibble; UINT8 m_msm_idle; UINT8 m_msm_repeat; - + /* SCSI signals */ int m_scsi_BSY; /* Busy. Bus in use */ int m_scsi_SEL; /* Select. Initiator has won arbitration and has selected a target */ @@ -128,7 +128,7 @@ private: int m_data_buffer_size; int m_data_buffer_index; int m_data_transferred; - + /* Arcade Card specific */ UINT8 *m_acard_ram; UINT8 m_acard_latch; @@ -138,7 +138,7 @@ private: UINT16 m_acard_addr_inc[4]; UINT32 m_acard_shift; UINT8 m_acard_shift_reg; - + UINT32 m_current_frame; UINT32 m_end_frame; UINT32 m_last_frame; @@ -151,12 +151,12 @@ private: required_device<cdda_device> m_cdda; required_device<nvram_device> m_nvram; required_device<cdrom_image_device> m_cdrom; - + cdrom_file *m_cd_file; const cdrom_toc* m_toc; emu_timer *m_data_timer; emu_timer *m_adpcm_dma_timer; - + emu_timer *m_cdda_fadeout_timer; emu_timer *m_cdda_fadein_timer; double m_cdda_volume; diff --git a/src/mess/machine/pce_rom.c b/src/mess/machine/pce_rom.c index 4fbef351d62..86474afa9a4 100644 --- a/src/mess/machine/pce_rom.c +++ b/src/mess/machine/pce_rom.c @@ -1,8 +1,8 @@ /*********************************************************************************************************** - + PC-Engine & Turbografx-16 cart emulation - + ***********************************************************************************************************/ @@ -98,7 +98,7 @@ READ8_MEMBER(pce_populous_device::read_cart) int bank = offset / 0x20000; if (m_ram && offset >= 0x80000 && offset < 0x88000) return m_ram[offset]; - + return m_rom[rom_bank_map[bank] * 0x20000 + (offset & 0x1ffff)]; } @@ -122,4 +122,3 @@ WRITE8_MEMBER(pce_sf2_device::write_cart) if (offset >= 0x1ff0 && offset < 0x1ff4) m_bank_base = offset & 3; } - diff --git a/src/mess/machine/pce_rom.h b/src/mess/machine/pce_rom.h index 40eb8b45a9e..caaa1bcc7c7 100644 --- a/src/mess/machine/pce_rom.h +++ b/src/mess/machine/pce_rom.h @@ -13,11 +13,11 @@ public: // construction/destruction pce_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); pce_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start() {} virtual void device_reset() {} - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); }; @@ -57,11 +57,11 @@ class pce_sf2_device : public pce_rom_device public: // construction/destruction pce_sf2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); diff --git a/src/mess/machine/pce_slot.c b/src/mess/machine/pce_slot.c index a4286622710..bb190ca7dd8 100644 --- a/src/mess/machine/pce_slot.c +++ b/src/mess/machine/pce_slot.c @@ -96,7 +96,7 @@ void device_pce_cart_interface::rom_map_setup(UINT32 size) // setup the rom_bank_map array to faster ROM read for (i = 0; i < size / 0x20000 && i < 8; i++) rom_bank_map[i] = i; - + // fill up remaining blocks with mirrors while (i % 8) { @@ -110,10 +110,10 @@ void device_pce_cart_interface::rom_map_setup(UINT32 size) } } // check bank map! -// for (i = 0; i < 8; i++) -// { -// printf("bank %3d = %3d\t", i, rom_bank_map[i]); -// } +// for (i = 0; i < 8; i++) +// { +// printf("bank %3d = %3d\t", i, rom_bank_map[i]); +// } } @@ -218,7 +218,7 @@ bool pce_cart_slot_device::call_load() UINT32 offset = 0; UINT32 len = (software_entry() == NULL) ? length() : get_software_region_length("rom"); UINT8 *ROM; - + // From fullpath, check for presence of a header and skip it if (software_entry() == NULL && (len % 0x4000) == 512) { @@ -227,7 +227,7 @@ bool pce_cart_slot_device::call_load() len -= offset; fseek(offset, SEEK_SET); } - + m_cart->rom_alloc(machine(), len); ROM = m_cart->get_rom_base(); @@ -240,11 +240,11 @@ bool pce_cart_slot_device::call_load() if (ROM[0x1fff] < 0xe0) { UINT8 decrypted[256]; - + /* Initialize decryption table */ for (int i = 0; i < 256; i++) decrypted[i] = ((i & 0x01) << 7) | ((i & 0x02) << 5) | ((i & 0x04) << 3) | ((i & 0x08) << 1) | ((i & 0x10) >> 1) | ((i & 0x20 ) >> 3) | ((i & 0x40) >> 5) | ((i & 0x80) >> 7); - + /* Decrypt ROM image */ for (int i = 0; i < len; i++) ROM[i] = decrypted[ROM[i]]; @@ -253,13 +253,13 @@ bool pce_cart_slot_device::call_load() m_cart->rom_map_setup(len); if (software_entry() == NULL) - m_type = get_cart_type(ROM, len); + m_type = get_cart_type(ROM, len); else { const char *pcb_name = get_feature("slot"); if (pcb_name) m_type = pce_get_pcb_id(pcb_name); - } + } //printf("Type: %s\n", pce_get_slot(m_type)); if (m_type == PCE_POPULOUS) @@ -296,7 +296,7 @@ bool pce_cart_slot_device::call_softlist_load(char *swlist, char *swname, rom_en /*------------------------------------------------- - get_cart_type - code to detect NVRAM type from + get_cart_type - code to detect NVRAM type from fullpath -------------------------------------------------*/ @@ -307,11 +307,11 @@ int pce_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) /* Check for Street fighter 2 */ if (len == 0x280000) type = PCE_SF2; - + /* Check for Populous */ if (len >= 0x1f26 + 8 && !memcmp(ROM + 0x1f26, "POPULOUS", 8)) type = PCE_POPULOUS; - + // Check for CD system card v3 which adds on-cart RAM to the system if (!memcmp(ROM + 0x3FFB6, "PC Engine CD-ROM SYSTEM", 23)) { @@ -382,4 +382,3 @@ WRITE8_MEMBER(pce_cart_slot_device::write_cart) void pce_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) { } - diff --git a/src/mess/machine/pce_slot.h b/src/mess/machine/pce_slot.h index b8c4ca0b65f..5622024ebd8 100644 --- a/src/mess/machine/pce_slot.h +++ b/src/mess/machine/pce_slot.h @@ -44,7 +44,7 @@ public: UINT32 m_ram_size; void rom_map_setup(UINT32 size); - + UINT8 rom_bank_map[8]; // 128K chunks of rom }; diff --git a/src/mess/machine/s3c44b0.c b/src/mess/machine/s3c44b0.c index 487c5410263..18e4df1cfb2 100644 --- a/src/mess/machine/s3c44b0.c +++ b/src/mess/machine/s3c44b0.c @@ -61,7 +61,7 @@ void s3c44b0_device::device_config_complete() const s3c44b0_interface *intf = reinterpret_cast<const s3c44b0_interface *>(static_config()); if (intf != NULL) *static_cast<s3c44b0_interface *>(this) = *intf; - + // or initialize to defaults if none provided else { @@ -83,8 +83,8 @@ void s3c44b0_device::device_start() m_sda_w.resolve(i2c_itf.sda_w, *this); m_adc_data_r.resolve(adc_itf.data_r, *this); m_i2s_data_w.resolve(i2s_itf.data_w, *this); - - + + for (int i = 0; i < 6; i++) m_pwm.timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::pwm_timer_exp),this)); for (int i = 0; i < 2; i++) m_uart[i].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::uart_timer_exp),this)); for (int i = 0; i < 2; i++) m_zdma[i].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::zdma_timer_exp),this)); @@ -114,12 +114,12 @@ void s3c44b0_device::device_start() save_item(NAME(m_irq.regs.f_ispc)); save_item(NAME(m_irq.line_irq)); save_item(NAME(m_irq.line_fiq)); - + save_item(NAME(m_clkpow.regs.pllcon)); save_item(NAME(m_clkpow.regs.clkcon)); save_item(NAME(m_clkpow.regs.clkslow)); save_item(NAME(m_clkpow.regs.locktime)); - + // FIXME: how to save m_lcd.bitmap which gets allocated/freed during emulation? save_item(NAME(m_lcd.regs.lcdcon1)); save_item(NAME(m_lcd.regs.lcdcon2)); @@ -149,9 +149,9 @@ void s3c44b0_device::device_start() save_item(NAME(m_lcd.vpos_max)); save_item(NAME(m_lcd.vpos_end)); save_item(NAME(m_lcd.frame_time)); - + machine().save().register_postload(save_prepost_delegate(FUNC(s3c44b0_device::s3c44b0_postload), this)); - + for (int i = 0; i < 2; i++) { save_item(NAME(m_zdma[i].regs.dcon), i); @@ -161,7 +161,7 @@ void s3c44b0_device::device_start() save_item(NAME(m_zdma[i].regs.dcsrc), i); save_item(NAME(m_zdma[i].regs.dcdst), i); save_item(NAME(m_zdma[i].regs.dccnt), i); - + save_item(NAME(m_bdma[i].regs.dcon), i); save_item(NAME(m_bdma[i].regs.disrc), i); save_item(NAME(m_bdma[i].regs.didst), i); @@ -169,7 +169,7 @@ void s3c44b0_device::device_start() save_item(NAME(m_bdma[i].regs.dcsrc), i); save_item(NAME(m_bdma[i].regs.dcdst), i); save_item(NAME(m_bdma[i].regs.dccnt), i); - + save_item(NAME(m_uart[i].regs.ulcon), i); save_item(NAME(m_uart[i].regs.ucon), i); save_item(NAME(m_uart[i].regs.ufcon), i); @@ -182,13 +182,13 @@ void s3c44b0_device::device_start() save_item(NAME(m_uart[i].regs.urxh), i); save_item(NAME(m_uart[i].regs.ubrdiv), i); } - + save_item(NAME(m_sio.regs.siocon)); save_item(NAME(m_sio.regs.siodat)); save_item(NAME(m_sio.regs.sbrdr)); save_item(NAME(m_sio.regs.itvcnt)); save_item(NAME(m_sio.regs.dcntz)); - + save_item(NAME(m_pwm.regs.tcfg0)); save_item(NAME(m_pwm.regs.tcfg1)); save_item(NAME(m_pwm.regs.tcon)); @@ -212,17 +212,17 @@ void s3c44b0_device::device_start() save_item(NAME(m_pwm.cnt)); save_item(NAME(m_pwm.cmp)); save_item(NAME(m_pwm.freq)); - + save_item(NAME(m_wdt.regs.wtcon)); save_item(NAME(m_wdt.regs.wtdat)); save_item(NAME(m_wdt.regs.wtcnt)); - + save_item(NAME(m_iic.regs.iiccon)); save_item(NAME(m_iic.regs.iicstat)); save_item(NAME(m_iic.regs.iicadd)); save_item(NAME(m_iic.regs.iicds)); save_item(NAME(m_iic.count)); - + save_item(NAME(m_iis.regs.iiscon)); save_item(NAME(m_iis.regs.iismod)); save_item(NAME(m_iis.regs.iispsr)); @@ -230,7 +230,7 @@ void s3c44b0_device::device_start() save_item(NAME(m_iis.regs.iisfifo)); save_item(NAME(m_iis.fifo)); save_item(NAME(m_iis.fifo_index)); - + save_item(NAME(m_gpio.regs.gpacon)); save_item(NAME(m_gpio.regs.gpadat)); save_item(NAME(m_gpio.regs.gpbcon)); @@ -253,11 +253,11 @@ void s3c44b0_device::device_start() save_item(NAME(m_gpio.regs.spucr)); save_item(NAME(m_gpio.regs.extint)); save_item(NAME(m_gpio.regs.extintpnd)); - + save_item(NAME(m_adc.regs.adccon)); save_item(NAME(m_adc.regs.adcpsr)); save_item(NAME(m_adc.regs.adcdat)); - + save_item(NAME(m_cpuwrap.regs.syscfg)); save_item(NAME(m_cpuwrap.regs.ncachbe0)); save_item(NAME(m_cpuwrap.regs.ncachbe1)); diff --git a/src/mess/machine/s3c44b0.h b/src/mess/machine/s3c44b0.h index 5b764d99ee3..0ae1c60699c 100644 --- a/src/mess/machine/s3c44b0.h +++ b/src/mess/machine/s3c44b0.h @@ -635,7 +635,7 @@ class s3c44b0_device : public device_t, public: s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~s3c44b0_device() {} - + DECLARE_READ32_MEMBER(lcd_r); DECLARE_READ32_MEMBER(clkpow_r); DECLARE_READ32_MEMBER(irq_r); @@ -680,7 +680,7 @@ protected: virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); - + private: // internal state // LCD Controller @@ -754,7 +754,7 @@ private: void adc_stop(); void adc_recalc(); TIMER_CALLBACK_MEMBER(adc_timer_exp); - + // SIO void sio_start(); void sio_stop(); diff --git a/src/mess/machine/sega8_rom.c b/src/mess/machine/sega8_rom.c index 9d8b37262de..4f02c3b6cc7 100644 --- a/src/mess/machine/sega8_rom.c +++ b/src/mess/machine/sega8_rom.c @@ -1,7 +1,7 @@ /*********************************************************************************************************** Sega 8-bit cart emulation (for Master System, GameGear and SG-1000) - + TODO: implement proper ROM & RAM mirroring when the cart size is not a power of 2K (e.g. 24K or 48K) ***********************************************************************************************************/ @@ -318,20 +318,20 @@ void sega8_korean_device::late_bank_setup() -------------------------------------------------*/ /*------------------------------------------------- - + Base Sega 8bit carts, possibly with bankswitch (only used by Mark III, SMS and GG games) - + -------------------------------------------------*/ READ8_MEMBER(sega8_rom_device::read_cart) { int bank = offset / 0x4000; - + if (bank == 2 && m_ram && m_ram_enabled) return m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram_size]; - if (offset < 0x400) // first 1k is hardcoded + if (offset < 0x400) // first 1k is hardcoded return m_rom[offset]; return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)]; @@ -340,7 +340,7 @@ READ8_MEMBER(sega8_rom_device::read_cart) WRITE8_MEMBER(sega8_rom_device::write_cart) { int bank = offset / 0x4000; - + if (bank == 2 && m_ram && m_ram_enabled) m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram_size] = data; } @@ -362,29 +362,29 @@ WRITE8_MEMBER(sega8_rom_device::write_mapper) else m_ram_enabled = 0; break; - + case 1: // Select 16k ROM bank for 0000-3fff case 2: // Select 16k ROM bank for 4000-7fff case 3: // Select 16k ROM bank for 8000-bfff m_rom_bank_base[offset - 1] = data % m_rom_page_count; break; - } + } } /*------------------------------------------------- - - Sega Card Catcher is a passthrough adapter for - SG-1000 to load games in MyCard format into the + + Sega Card Catcher is a passthrough adapter for + SG-1000 to load games in MyCard format into the main cartslot - + -------------------------------------------------*/ READ8_MEMBER(sega8_cardcatch_device::read_cart) { if (offset < 0x8000) return m_card->read_cart(space, offset); - + return 0xff; } @@ -409,11 +409,11 @@ machine_config_constructor sega8_cardcatch_device::device_mconfig_additions() co } /*------------------------------------------------- - - Othello is a SG-1000 game featuring 2K of + + Othello is a SG-1000 game featuring 2K of oncart RAM, mapped at 0x8000-0x9fff. Is RAM mirrored? For now we assume so... - + -------------------------------------------------*/ READ8_MEMBER(sega8_othello_device::read_cart) @@ -421,7 +421,7 @@ READ8_MEMBER(sega8_othello_device::read_cart) // 8K of RAM sits in 0x8000-0x9fff if (offset >= 0x8000 && offset < 0xa000) return m_ram[offset & 0x7ff]; - + return m_rom[offset % m_rom_size]; } @@ -434,10 +434,10 @@ WRITE8_MEMBER(sega8_othello_device::write_cart) /*------------------------------------------------- - - The Castle is a SG-1000 game featuring 8K of + + The Castle is a SG-1000 game featuring 8K of oncart RAM, mapped at 0x8000-0x9fff - + -------------------------------------------------*/ READ8_MEMBER(sega8_castle_device::read_cart) @@ -445,7 +445,7 @@ READ8_MEMBER(sega8_castle_device::read_cart) // 8K of RAM sits in 0x8000-0x9fff if (offset >= 0x8000 && offset < 0xa000) return m_ram[offset & 0x1fff]; - + return m_rom[offset % m_rom_size]; } @@ -458,10 +458,10 @@ WRITE8_MEMBER(sega8_castle_device::write_cart) /*------------------------------------------------- - - BASIC Level III cart featured 32K of + + BASIC Level III cart featured 32K of oncart RAM, mapped at 0x8000-0xffff? - + -------------------------------------------------*/ READ8_MEMBER(sega8_basic_l3_device::read_cart) @@ -469,7 +469,7 @@ READ8_MEMBER(sega8_basic_l3_device::read_cart) // 8K of RAM sits in 0x8000-0x9fff if (offset >= 0x8000) return m_ram[offset & 0x3fff]; - + return m_rom[offset % m_rom_size]; } @@ -492,10 +492,10 @@ WRITE8_MEMBER(sega8_basic_l3_device::write_ram) /*------------------------------------------------- - - Music Editor cart featured 10K of oncart RAM, mapped + + Music Editor cart featured 10K of oncart RAM, mapped in 0x8000-0x9fff and 0xc000-0xffff - + -------------------------------------------------*/ READ8_MEMBER(sega8_music_editor_device::read_cart) @@ -503,7 +503,7 @@ READ8_MEMBER(sega8_music_editor_device::read_cart) // 8K of RAM sits in 0x8000-0x9fff if (offset >= 0x8000 && offset < 0xa000) return m_ram[offset & 0x1fff]; - + return m_rom[offset % m_rom_size]; } @@ -530,38 +530,38 @@ WRITE8_MEMBER(sega8_music_editor_device::write_ram) /*------------------------------------------------- - + SG-1000 Terebi Oekaki using a Tablet input device - + -------------------------------------------------*/ /* - + Terebi Oekaki (TV Draw) - + Address Access Bits 7 6 5 4 3 2 1 0 $6000 W - - - - - - - AXIS $8000 R BUSY - - - - - - PRESS $A000 R/W DATA - + AXIS: write 0 to select X axis, 1 to select Y axis. BUSY: reads 1 when graphic board is busy sampling position, else 0. PRESS: reads 0 when pen is touching graphic board, else 1. DATA: when pen is touching graphic board, return 8-bit sample position for currently selected axis (X is in the 0-255 range, Y in the 0-191 range). Else, return 0. - + */ READ8_MEMBER(sega8_terebi_device::read_cart) { int bank = offset / 0x4000; - + if (offset == 0x8000) return m_tvdraw_pen->read(); if (offset == 0xa000) return m_tvdraw_data; - + return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)]; } @@ -573,7 +573,7 @@ WRITE8_MEMBER(sega8_terebi_device::write_cart) if (data & 0x01) { m_tvdraw_data = m_tvdraw_x->read(); - + if (m_tvdraw_data < 4) m_tvdraw_data = 4; if (m_tvdraw_data > 251) m_tvdraw_data = 251; } @@ -604,16 +604,16 @@ ioport_constructor sega8_terebi_device::device_input_ports() const /*------------------------------------------------- - + Dahjee carts were sold with a RAM expansion pass-through - cart (which we don't emulate separately for the - moment) which allowed to play on old SG1000 machines + cart (which we don't emulate separately for the + moment) which allowed to play on old SG1000 machines some MSX conversions requiring more RAM than available - + Two kind of expansion existed (for different games), - one with 9K of RAM (Type A) and one with 8K of + one with 9K of RAM (Type A) and one with 8K of RAM (Type B). - + -------------------------------------------------*/ // TYPE A @@ -622,7 +622,7 @@ READ8_MEMBER(sega8_dahjee_typea_device::read_cart) // 8K of RAM sits in 0x2000-0x3fff if (offset >= 0x2000 && offset < 0x4000) return m_ram[offset & 0x1fff]; - + return m_rom[offset % m_rom_size]; } @@ -670,27 +670,27 @@ WRITE8_MEMBER(sega8_dahjee_typeb_device::write_ram) /*------------------------------------------------- - + Sega carts + EEPROM, used for some GameGear baseball games - + -------------------------------------------------*/ READ8_MEMBER(sega8_eeprom_device::read_cart) { int bank = offset / 0x4000; - + if (offset == 0x8000 && m_93c46_enabled) { UINT8 value = (m_93c46_lines & 0xfc) | 0x02; value |= m_eeprom->read_bit() ? 1 : 0; return value; } - - if (offset < 0x400) // first 1k is hardcoded + + if (offset < 0x400) // first 1k is hardcoded return m_rom[offset]; - + return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)]; } @@ -719,13 +719,13 @@ WRITE8_MEMBER(sega8_eeprom_device::write_mapper) m_93c46_enabled = BIT(data, 3); logerror("eeprom %s\n", m_93c46_enabled ? "enabled" : "disabled"); break; - + case 1: // Select 16k ROM bank for 0000-3fff case 2: // Select 16k ROM bank for 4000-7fff case 3: // Select 16k ROM bank for 8000-bfff m_rom_bank_base[offset - 1] = data % m_rom_page_count; break; - } + } } MACHINE_CONFIG_FRAGMENT( gg_eeprom ) @@ -739,19 +739,19 @@ machine_config_constructor sega8_eeprom_device::device_mconfig_additions() const /*------------------------------------------------- - + Codemasters carts, possibly having on cart RAM (Ernie Els Golf) - + -------------------------------------------------*/ READ8_MEMBER(sega8_codemasters_device::read_cart) { int bank = offset / 0x2000; - + if (bank == 5 && m_ram && m_ram_enabled) return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size]; - + return m_rom[m_rom_bank_base[bank/2] * 0x4000 + (offset & 0x3fff)]; } @@ -786,9 +786,9 @@ WRITE8_MEMBER(sega8_codemasters_device::write_cart) } /*------------------------------------------------- - + HES 4 PAK All Action cart - + -------------------------------------------------*/ @@ -814,25 +814,25 @@ WRITE8_MEMBER(sega8_4pak_device::write_cart) /*------------------------------------------------- - + base Zemina carts, allowing for 8K bankswitch - + -------------------------------------------------*/ READ8_MEMBER(sega8_zemina_device::read_cart) { int bank = offset / 0x2000; - + if (bank >= 4 && m_ram && m_ram_enabled) return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size]; - + return m_rom[m_rom_bank_base[bank] * 0x2000 + (offset & 0x1fff)]; } WRITE8_MEMBER(sega8_zemina_device::write_cart) { int bank = offset / 0x2000; - + if (bank >= 4 && m_ram && m_ram_enabled) m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size] = data; @@ -857,28 +857,28 @@ WRITE8_MEMBER(sega8_zemina_device::write_cart) } /*------------------------------------------------- - + Zemina cart used for Nemesis: same as above, but different bank layout at start (see late_bank_setup) - + -------------------------------------------------*/ /*------------------------------------------------- - + Daiou cart used for SMS Janggun-ui Adeul - + the game expects to access 256 x 8K banks: first 64 are just the game, second 64 are a mirror of the first ones upper 128 are the same as the previous but with bytes in reverse order probably as a shortcut to get sprite flipping for free from hw so if bit7 of current bank page is set, we swap the result - + -------------------------------------------------*/ READ8_MEMBER(sega8_janggun_device::read_cart) { int bank = offset / 0x2000; - + if (m_rom_bank_base[bank] < 0x80) return m_rom[(m_rom_bank_base[bank] & 0x3f) * 0x2000 + (offset & 0x1fff)]; else @@ -911,32 +911,31 @@ WRITE8_MEMBER(sega8_janggun_device::write_mapper) { case 0: break; - + case 1: // Select 16k ROM bank for 0000-3fff case 2: // Select 16k ROM bank for 4000-7fff case 3: // Select 16k ROM bank for 8000-bfff m_rom_bank_base[(offset - 1) * 2] = (data % m_rom_page_count) * 2; m_rom_bank_base[(offset - 1) * 2 + 1] = (data % m_rom_page_count) * 2 + 1; break; - } + } } /*------------------------------------------------- - - Korean cart, used e.g. in Dodgeball King, + + Korean cart, used e.g. in Dodgeball King, uses writes to 0xa000 for bankswitch - + -------------------------------------------------*/ WRITE8_MEMBER(sega8_korean_device::write_cart) { int bank = offset / 0x4000; - + if (bank == 2 && m_ram && m_ram_enabled) m_ram[m_ram_base * 0x4000 + (offset & 0x3fff)] = data; if (offset == 0xa000) m_rom_bank_base[2] = data % m_rom_page_count; } - diff --git a/src/mess/machine/sega8_rom.h b/src/mess/machine/sega8_rom.h index 1c78a20788f..98403c2f0ec 100644 --- a/src/mess/machine/sega8_rom.h +++ b/src/mess/machine/sega8_rom.h @@ -41,14 +41,14 @@ class sega8_cardcatch_device : public sega8_rom_device public: // construction/destruction sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); virtual DECLARE_WRITE8_MEMBER(write_mapper) {} - + virtual machine_config_constructor device_mconfig_additions() const; - + protected: required_device<sega8_card_slot_device> m_card; }; @@ -61,7 +61,7 @@ class sega8_othello_device : public sega8_rom_device public: // construction/destruction sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); @@ -76,7 +76,7 @@ class sega8_castle_device : public sega8_rom_device public: // construction/destruction sega8_castle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); @@ -91,12 +91,12 @@ class sega8_basic_l3_device : public sega8_rom_device public: // construction/destruction sega8_basic_l3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); virtual DECLARE_WRITE8_MEMBER(write_mapper) {} - + // has internal RAM which overwrites the system one! virtual DECLARE_READ8_MEMBER(read_ram); virtual DECLARE_WRITE8_MEMBER(write_ram); @@ -110,12 +110,12 @@ class sega8_music_editor_device : public sega8_rom_device public: // construction/destruction sega8_music_editor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); virtual DECLARE_WRITE8_MEMBER(write_mapper) {} - + // has internal RAM which overwrites the system one! virtual DECLARE_READ8_MEMBER(read_ram); virtual DECLARE_WRITE8_MEMBER(write_ram); @@ -129,21 +129,21 @@ class sega8_terebi_device : public sega8_rom_device public: // construction/destruction sega8_terebi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual ioport_constructor device_input_ports() const; virtual void device_reset(); - + required_ioport m_tvdraw_x; required_ioport m_tvdraw_y; required_ioport m_tvdraw_pen; - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); virtual DECLARE_WRITE8_MEMBER(write_mapper) {} - + protected: UINT8 m_tvdraw_data; }; @@ -156,12 +156,12 @@ class sega8_dahjee_typea_device : public sega8_rom_device public: // construction/destruction sega8_dahjee_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); virtual DECLARE_WRITE8_MEMBER(write_mapper) {} - + // has internal RAM which overwrites the system one! virtual DECLARE_READ8_MEMBER(read_ram); virtual DECLARE_WRITE8_MEMBER(write_ram); @@ -175,12 +175,12 @@ class sega8_dahjee_typeb_device : public sega8_rom_device public: // construction/destruction sega8_dahjee_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart) {} virtual DECLARE_WRITE8_MEMBER(write_mapper) {} - + // has internal RAM which overwrites the system one! virtual DECLARE_READ8_MEMBER(read_ram); virtual DECLARE_WRITE8_MEMBER(write_ram); @@ -197,22 +197,22 @@ class sega8_eeprom_device : public device_t, public: // construction/destruction sega8_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual machine_config_constructor device_mconfig_additions() const; virtual void device_reset(); - + virtual void late_bank_setup(); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); virtual DECLARE_WRITE8_MEMBER(write_mapper); - + protected: UINT8 m_rom_bank_base[3]; - + required_device<eeprom_device> m_eeprom; int m_93c46_enabled; UINT8 m_93c46_lines; @@ -227,18 +227,18 @@ class sega8_codemasters_device : public device_t, public: // construction/destruction sega8_codemasters_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); - + virtual void late_bank_setup(); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); // no mapper write for this! - + protected: UINT8 m_rom_bank_base[3]; UINT8 m_ram_base; @@ -253,7 +253,7 @@ class sega8_4pak_device : public sega8_rom_device public: // construction/destruction sega8_4pak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); @@ -275,18 +275,18 @@ public: // construction/destruction sega8_zemina_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); sega8_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); - + virtual void late_bank_setup(); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); // no mapper write for this! - + protected: UINT8 m_rom_bank_base[6]; UINT8 m_ram_base; @@ -301,7 +301,7 @@ class sega8_nemesis_device : public sega8_zemina_device public: // construction/destruction sega8_nemesis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + virtual void late_bank_setup(); }; @@ -317,14 +317,14 @@ public: // device-level overrides virtual void device_start() { save_item(NAME(m_rom_bank_base)); } - + virtual void late_bank_setup(); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_cart); virtual DECLARE_WRITE8_MEMBER(write_cart); virtual DECLARE_WRITE8_MEMBER(write_mapper); - + protected: UINT8 m_rom_bank_base[6]; }; @@ -337,9 +337,9 @@ class sega8_korean_device : public sega8_rom_device public: // construction/destruction sega8_korean_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + virtual void late_bank_setup(); - + // reading and writing virtual DECLARE_WRITE8_MEMBER(write_cart); virtual DECLARE_WRITE8_MEMBER(write_mapper) {} diff --git a/src/mess/machine/sega8_slot.c b/src/mess/machine/sega8_slot.c index 31d8245d966..5b4f53bb810 100644 --- a/src/mess/machine/sega8_slot.c +++ b/src/mess/machine/sega8_slot.c @@ -1,13 +1,13 @@ /*********************************************************************************************************** - - + + Sega 8-bit cart emulation (through slot devices) Master System (Mark III) and Game Gear memory map can access 3 x 16K banks of ROM in - 0x0000-0xbfff memory range. These banks can however point to different ROM or RAM area + 0x0000-0xbfff memory range. These banks can however point to different ROM or RAM area of the cart (or to BIOS banks, but these are handled directly in SMS emulation). - + Hence, carts can interface with the main system through the following handlers * read_cart : to read from ROM/RAM in memory range [0000-bfff] * write_cart : to write to ROM/RAM in memory range [0000-bfff] @@ -17,10 +17,10 @@ Note about Sega Card / MyCard: the data contained in these matches the data in carts, it's only the connector to be different. We emulate this with a variant of the slot having different media switch and different interface (the latter not implemented yet) - + TODO: - investigate SG-1000 carts so to reduce duplicated code and to add full .sg support to sg1000m3 - + ***********************************************************************************************************/ @@ -81,8 +81,8 @@ void device_sega8_cart_interface::rom_alloc(running_machine &machine, UINT32 siz m_rom = auto_alloc_array_clear(machine, UINT8, size); m_rom_size = size; m_rom_page_count = size / 0x4000; - if (!m_rom_page_count) - m_rom_page_count = 1; // we compute rom pages through (XXX % m_rom_page_count)! + if (!m_rom_page_count) + m_rom_page_count = 1; // we compute rom pages through (XXX % m_rom_page_count)! late_bank_setup(); } } @@ -221,14 +221,14 @@ static const char *sega8_get_slot(int type) int sega8_cart_slot_device::verify_cart( UINT8 *magic, int size ) { int retval = IMAGE_VERIFY_FAIL; - + // Verify the file is a valid image - check $7ff0 for "TMR SEGA" if (size >= 0x8000) { if (!strncmp((char*)&magic[0x7ff0], "TMR SEGA", 8)) - retval = IMAGE_VERIFY_PASS; + retval = IMAGE_VERIFY_PASS; } - + return retval; } @@ -256,19 +256,19 @@ void sega8_cart_slot_device::set_lphaser_xoffset( UINT8 *rom, int size ) { if (!memcmp(&rom[0x7ff0], signatures[0], 16) || !memcmp(&rom[0x7ff0], signatures[1], 16)) xoff = 41; - + if (!memcmp(&rom[0x7ff0], signatures[2], 16)) xoff = 50; - + if (!memcmp(&rom[0x7ff0], signatures[3], 16)) xoff = 48; - + if (!memcmp(&rom[0x7ff0], signatures[4], 16)) xoff = 45; - + if (!memcmp(&rom[0x7ff0], signatures[5], 16)) xoff = 54; - + } m_cart->set_lphaser_xoffs(xoff); @@ -313,11 +313,11 @@ void sega8_cart_slot_device::setup_ram() // Codemasters cart can have 64KB of RAM (Ernie Els Golf? or 8KB?) and no battery m_cart->ram_alloc(machine(), 0x10000); m_cart->set_has_battery(FALSE); - } + } else { - // for generic carts loaded from fullpath we have no way to know exactly if there was RAM, - // how much RAM was in the cart and if there was a battery so we always alloc 32KB and + // for generic carts loaded from fullpath we have no way to know exactly if there was RAM, + // how much RAM was in the cart and if there was a battery so we always alloc 32KB and // we save its content only if the game enable the RAM m_cart->set_late_battery(TRUE); m_cart->ram_alloc(machine(), 0x08000); @@ -328,13 +328,13 @@ void sega8_cart_slot_device::setup_ram() // from softlist we rely on the xml to only allocate the correct amount of RAM and to save it only if a battery was present const char *battery = get_feature("battery"); m_cart->set_late_battery(FALSE); - + if (get_software_region_length("ram")) m_cart->ram_alloc(machine(), get_software_region_length("ram")); if (battery && !strcmp(battery, "yes")) m_cart->set_has_battery(TRUE); - } + } } bool sega8_cart_slot_device::call_load() @@ -350,21 +350,21 @@ bool sega8_cart_slot_device::call_load() seterror(IMAGE_ERROR_UNSPECIFIED, "Attempted loading a card larger than 32KB"); return IMAGE_INIT_FAIL; } - + // check for header if ((len % 0x4000) == 512) { offset = 512; len -= 512; } - + // make sure that we only get complete (0x4000) rom banks if (len & 0x3fff) len = ((len >> 14) + 1) << 14; - + m_cart->rom_alloc(machine(), len); ROM = m_cart->get_rom_base(); - + if (software_entry() == NULL) { fseek(offset, SEEK_SET); @@ -372,7 +372,7 @@ bool sega8_cart_slot_device::call_load() } else memcpy(ROM, get_software_region("rom") + offset, len); - + /* check the image */ if (verify_cart(ROM, len) == IMAGE_VERIFY_FAIL) logerror("Warning loading image: verify_cart failed\n"); @@ -381,11 +381,11 @@ bool sega8_cart_slot_device::call_load() m_type = sega8_get_pcb_id(get_feature("slot") ? get_feature("slot") : "rom"); else m_type = get_cart_type(ROM, len); - + set_lphaser_xoffset(ROM, len); setup_ram(); - + // Check for gamegear cartridges with PIN 42 set to SMS mode if (software_entry() != NULL) { @@ -398,11 +398,11 @@ bool sega8_cart_slot_device::call_load() // we attempt to load a battery because the game might have it! if (m_cart->get_ram_size() && (m_cart->get_has_battery() || m_cart->get_late_battery())) battery_load(m_cart->get_ram_base(), m_cart->get_ram_size(), 0x00); - + //printf("Type: %s\n", sega8_get_slot(type)); - + internal_header_logging(ROM + offset, len, m_cart->get_ram_size()); - + return IMAGE_INIT_PASS; } @@ -452,19 +452,19 @@ bool sega8_cart_slot_device::call_softlist_load(char *swlist, char *swname, rom_ - gamegear Pete Sampras Tennis - gamegear S.S. Lucifer - 95 - gamegear Micro Machines 2 - Turbo Tournament - + The Korean game Jang Pung II also seems to use a codemasters style mapper. */ int sms_state::detect_codemasters_mapper( UINT8 *rom ) { static const UINT8 jang_pung2[16] = { 0x00, 0xba, 0x38, 0x0d, 0x00, 0xb8, 0x38, 0x0c, 0x00, 0xb6, 0x38, 0x0b, 0x00, 0xb4, 0x38, 0x0a }; - + if (((rom[0x7fe0] & 0x0f ) <= 9) && (rom[0x7fe3] == 0x93 || rom[0x7fe3] == 0x94 || rom[0x7fe3] == 0x95) && rom[0x7fef] == 0x00) return 1; - + if (!memcmp(&rom[0x7ff0], jang_pung2, 16)) return 1; - + return 0; } @@ -477,7 +477,7 @@ int sms_state::detect_korean_mapper( UINT8 *rom ) { 0x41, 0x48, 0x37, 0x37, 0x44, 0x37, 0x4e, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20 }, /* Sangokushi 3 */ }; int i; - + for (i = 0; i < 2; i++) { if (!memcmp(&rom[0x7ff0], signatures[i], 16)) @@ -518,9 +518,9 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) { i += 2; _6000++; continue; } } } - + LOG(("Mapper test: _0002 = %d, _8000 = %d, _a000 = %d, _ffff = %d\n", _0002, _8000, _a000, _ffff)); - + // 2 is a security measure, although tests on existing ROM showed it was not needed if (_0002 > _ffff + 2 || (_0002 > 0 && _ffff == 0)) { @@ -545,13 +545,13 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) if (len >= 0x8000) { int x2000_3000 = 0, xd000_e000_f000 = 0, x2000_ff = 0; - + for (int i = 0; i < 0x8000; i++) { if (ROM[i] == 0x32) { UINT16 addr = ROM[i + 1] | (ROM[i + 2] << 8); - + switch (addr & 0xf000) { case 0x2000: @@ -559,7 +559,7 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) i += 2; x2000_3000++; break; - + case 0xd000: case 0xe000: case 0xf000: @@ -582,7 +582,7 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) type = SEGA8_DAHJEE_TYPEA; } } - + // Terebi Oekaki (TV Draw) if (!strncmp((const char *)&ROM[0x13b3], "annakmn", 7)) type = SEGA8_TEREBIOEKAKI; @@ -590,16 +590,16 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) // The Castle (ROM+RAM) if (!strncmp((const char *)&ROM[0x1cc3], "ASCII 1986", 10)) type = SEGA8_CASTLE; - + // BASIC Level 3 if (!strncmp((const char *)&ROM[0x6a20], "SC-3000 BASIC Level 3 ver 1.0", 29)) type = SEGA8_BASIC_L3; - + // Music Editor if (!strncmp((const char *)&ROM[0x0841], "PIANO", 5) || !strncmp((const char *)&ROM[0x0841], "music", 5)) type = SEGA8_MUSIC_EDITOR; - - + + return type; } /*------------------------------------------------- @@ -724,12 +724,12 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN 0x10000, 0x20000, }; - + char reserved[10]; UINT8 version, csum_size, region, serial[3]; UINT16 checksum, csum = 0; UINT32 csum_end = 0; - + // LOG FILE DETAILS logerror("FILE DETAILS\n" ); logerror("============\n" ); @@ -741,30 +741,30 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN if (nvram_len) logerror("RAM (Allocated) Size: 0x%X - Battery: %s\n", nvram_len, m_cart->get_has_battery() ? "Yes" : "No"); logerror("\n" ); - - + + // LOG HEADER DETAILS if (len < 0x8000) return; for (int i = 0; i < 10; i++) reserved[i] = ROM[0x7ff0 + i]; - + checksum = ROM[0x7ffa] | (ROM[0x7ffb] << 8); - + for (int i = 0; i < 3; i++) serial[i] = ROM[0x7ffc + i]; serial[2] &= 0x0f; - + version = (ROM[0x7ffe] & 0xf0) >> 4; - + csum_size = ROM[0x7fff] & 0x0f; csum_end = csum_length[csum_size]; if (!csum_end || csum_end > len) csum_end = len; - + region = (ROM[0x7fff] & 0xf0) >> 4; - + // compute cart checksum to compare with expected one for (int i = 0; i < csum_end; i++) { @@ -772,9 +772,9 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN { csum += ROM[i]; csum &= 0xffff; - } + } } - + logerror("INTERNAL HEADER\n" ); logerror("===============\n" ); logerror("Reserved String: %.10s\n", reserved); @@ -785,12 +785,12 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN logerror("Software Revision: %x\n", version); logerror("\n" ); - + if (m_type == SEGA8_CODEMASTERS) { UINT8 day, month, year, hour, minute; csum = 0; - + day = ROM[0x7fe1]; month = ROM[0x7fe2]; year = ROM[0x7fe3]; @@ -808,7 +808,7 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN csum &= 0xffff; } } - + logerror("CODEMASTERS HEADER\n" ); logerror("==================\n" ); logerror("Build date & time: %x/%x/%x %.2x:%.2x\n", day, month, year, hour, minute); diff --git a/src/mess/machine/sega8_slot.h b/src/mess/machine/sega8_slot.h index 2a4fafb53f3..7e681ae294b 100644 --- a/src/mess/machine/sega8_slot.h +++ b/src/mess/machine/sega8_slot.h @@ -48,12 +48,12 @@ public: // a few carts (for SG1000) acts as a RAM expansion, taking control of the system RAM in 0xc000-0xffff virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_ram) {} - + void rom_alloc(running_machine &machine, UINT32 size); void ram_alloc(running_machine &machine, UINT32 size); - + virtual void late_bank_setup() {} - + void set_has_battery(bool val) { has_battery = val; } bool get_has_battery() { return has_battery; } void set_late_battery(bool val) { m_late_battery_enable = val; } @@ -62,7 +62,7 @@ public: int get_lphaser_xoffs() { return m_lphaser_xoffs; } void set_sms_mode(int val) { m_sms_mode = val; } int get_sms_mode() { return m_sms_mode; } - + //protected: UINT8* get_rom_base() { return m_rom; } UINT8* get_ram_base() { return m_ram; } @@ -81,10 +81,10 @@ public: int m_rom_page_count; bool has_battery; - - // we use this variable for fullpath loading only: in this case, RAM is always allocated, + + // we use this variable for fullpath loading only: in this case, RAM is always allocated, // but we set has_battery only if RAM is actually enabled during game... - bool m_late_battery_enable; + bool m_late_battery_enable; int m_lphaser_xoffs; int m_sms_mode; @@ -218,14 +218,12 @@ public: MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ static_cast<sega8_card_slot_device *>(device)->set_mandatory(FALSE); \ static_cast<sega8_card_slot_device *>(device)->set_intf("sms_card"); \ - static_cast<sega8_card_slot_device *>(device)->set_ext("bin"); \ - + static_cast<sega8_card_slot_device *>(device)->set_ext("bin"); #define MCFG_SG1000_CARD_ADD(_tag,_slot_intf,_def_slot) \ MCFG_DEVICE_ADD(_tag, SEGA8_CARD_SLOT, 0) \ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ static_cast<sega8_card_slot_device *>(device)->set_intf("sg1000_cart"); \ - static_cast<sega8_card_slot_device *>(device)->set_ext("bin,sg"); \ - + static_cast<sega8_card_slot_device *>(device)->set_ext("bin,sg"); #endif diff --git a/src/mess/machine/sms.c b/src/mess/machine/sms.c index 3f62b69aa09..c75f71794d3 100644 --- a/src/mess/machine/sms.c +++ b/src/mess/machine/sms.c @@ -694,7 +694,7 @@ WRITE8_MEMBER(sms_state::sms_mapper_w) { bool bios_selected = false; bool cartridge_selected = false; - + m_mapper[offset] = data; m_mainram[0x1ffc + offset] = data; @@ -703,19 +703,19 @@ WRITE8_MEMBER(sms_state::sms_mapper_w) if (!(m_bios_port & IO_CARTRIDGE) || (m_is_gamegear && m_BIOS == NULL)) cartridge_selected = true; else - return; // nothing to page in + return; // nothing to page in } else { if (!m_BIOS) - return; // nothing to page in + return; // nothing to page in bios_selected = true; } - + switch (offset) { case 0: // Control RAM/ROM - if (!(data & 0x08) && !(m_bios_port & IO_BIOS_ROM) && bios_selected) // BIOS ROM + if (!(data & 0x08) && !(m_bios_port & IO_BIOS_ROM) && bios_selected) // BIOS ROM { if (!m_has_bios_0400 && !m_has_bios_2000) { @@ -723,13 +723,13 @@ WRITE8_MEMBER(sms_state::sms_mapper_w) m_bios_page[2] = m_mapper[3]; } } - else if (cartridge_selected) // CART ROM/RAM + else if (cartridge_selected) // CART ROM/RAM { m_bank_enabled[2] = ENABLE_CART; m_cartslot->write_mapper(space, offset, data); } break; - + case 1: // Select 16k ROM bank for 0400-3fff case 2: // Select 16k ROM bank for 4000-7fff case 3: // Select 16k ROM bank for 8000-bfff @@ -761,9 +761,9 @@ READ8_MEMBER(sms_state::read_0000) return m_BIOS[(m_bios_page[3] * 0x4000) + (offset & 0x3fff)]; } if (m_bank_enabled[3] == ENABLE_CART) - return m_cartslot->read_cart(space, offset); + return m_cartslot->read_cart(space, offset); if (m_card && m_bank_enabled[3] == ENABLE_CARD) - return m_card->read_cart(space, offset); + return m_card->read_cart(space, offset); } else { @@ -773,10 +773,10 @@ READ8_MEMBER(sms_state::read_0000) return m_BIOS[(m_bios_page[0] * 0x4000) + (offset & 0x3fff)]; } if (m_bank_enabled[0] == ENABLE_CART) - return m_cartslot->read_cart(space, offset); + return m_cartslot->read_cart(space, offset); if (m_card && m_bank_enabled[0] == ENABLE_CARD) - return m_card->read_cart(space, offset); - } + return m_card->read_cart(space, offset); + } return m_region_maincpu->base()[offset]; } @@ -789,9 +789,9 @@ READ8_MEMBER(sms_state::read_4000) } if (m_bank_enabled[1] == ENABLE_CART) - return m_cartslot->read_cart(space, offset + 0x4000); + return m_cartslot->read_cart(space, offset + 0x4000); if (m_card && m_bank_enabled[1] == ENABLE_CARD) - return m_card->read_cart(space, offset + 0x4000); + return m_card->read_cart(space, offset + 0x4000); return m_region_maincpu->base()[offset]; } @@ -805,9 +805,9 @@ READ8_MEMBER(sms_state::read_8000) } if (m_bank_enabled[2] == ENABLE_CART) - return m_cartslot->read_cart(space, offset + 0x8000); + return m_cartslot->read_cart(space, offset + 0x8000); if (m_card && m_bank_enabled[2] == ENABLE_CARD) - return m_card->read_cart(space, offset + 0x8000); + return m_card->read_cart(space, offset + 0x8000); return m_region_maincpu->base()[offset]; } @@ -827,9 +827,9 @@ READ8_MEMBER(smssdisp_state::store_read_0000) return m_BIOS[(m_bios_page[3] * 0x4000) + (offset & 0x3fff)]; } if (m_bank_enabled[3] == ENABLE_CART) - return m_slots[m_current_cartridge]->read_cart(space, offset); + return m_slots[m_current_cartridge]->read_cart(space, offset); if (m_bank_enabled[3] == ENABLE_CARD) - return m_cards[m_current_cartridge]->read_cart(space, offset); + return m_cards[m_current_cartridge]->read_cart(space, offset); } else { @@ -839,10 +839,10 @@ READ8_MEMBER(smssdisp_state::store_read_0000) return m_BIOS[(m_bios_page[0] * 0x4000) + (offset & 0x3fff)]; } if (m_bank_enabled[0] == ENABLE_CART) - return m_slots[m_current_cartridge]->read_cart(space, offset); + return m_slots[m_current_cartridge]->read_cart(space, offset); if (m_bank_enabled[0] == ENABLE_CARD) - return m_cards[m_current_cartridge]->read_cart(space, offset); - } + return m_cards[m_current_cartridge]->read_cart(space, offset); + } return m_region_maincpu->base()[offset]; } @@ -855,10 +855,10 @@ READ8_MEMBER(smssdisp_state::store_read_4000) return m_BIOS[(m_bios_page[1] * 0x4000) + (offset & 0x3fff)]; } if (m_bank_enabled[1] == ENABLE_CART) - return m_slots[m_current_cartridge]->read_cart(space, offset + 0x4000); + return m_slots[m_current_cartridge]->read_cart(space, offset + 0x4000); if (m_bank_enabled[1] == ENABLE_CARD) - return m_cards[m_current_cartridge]->read_cart(space, offset + 0x4000); - + return m_cards[m_current_cartridge]->read_cart(space, offset + 0x4000); + return m_region_maincpu->base()[offset]; } @@ -868,12 +868,12 @@ READ8_MEMBER(smssdisp_state::store_read_8000) { if (m_BIOS) return m_BIOS[(m_bios_page[2] * 0x4000) + (offset & 0x3fff)]; - } + } if (m_bank_enabled[2] == ENABLE_CART) - return m_slots[m_current_cartridge]->read_cart(space, offset + 0x8000); + return m_slots[m_current_cartridge]->read_cart(space, offset + 0x8000); if (m_bank_enabled[2] == ENABLE_CARD) - return m_cards[m_current_cartridge]->read_cart(space, offset + 0x8000); - + return m_cards[m_current_cartridge]->read_cart(space, offset + 0x8000); + return m_region_maincpu->base()[offset]; } @@ -882,18 +882,18 @@ WRITE8_MEMBER(smssdisp_state::store_write_cart) // this might only work because we are not emulating properly the cart/card selection system // it will have to be reviewed when proper emulation is worked on! if (m_bank_enabled[0] == ENABLE_CART) - m_slots[m_current_cartridge]->write_cart(space, offset, data); + m_slots[m_current_cartridge]->write_cart(space, offset, data); if (m_bank_enabled[0] == ENABLE_CARD) - m_cards[m_current_cartridge]->write_cart(space, offset, data); + m_cards[m_current_cartridge]->write_cart(space, offset, data); } READ8_MEMBER(smssdisp_state::store_cart_peek) { if (m_bank_enabled[1] == ENABLE_CART) - return m_slots[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff)); + return m_slots[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff)); if (m_bank_enabled[1] == ENABLE_CARD) - return m_cards[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff)); - + return m_cards[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff)); + return m_region_maincpu->base()[offset]; } @@ -1055,7 +1055,7 @@ void sms_state::setup_bios() MACHINE_START_MEMBER(sms_state,sms) { char str[7]; - + m_rapid_fire_timer = timer_alloc(TIMER_RAPID_FIRE); m_rapid_fire_timer->adjust(attotime::from_hz(10), 0, attotime::from_hz(10)); @@ -1132,7 +1132,7 @@ MACHINE_START_MEMBER(sms_state,sms) // a bunch of SG1000 carts (compatible with SG1000 Mark III) can access directly system RAM... let's install here the necessary handlers // TODO: are BASIC and Music actually compatible with Mark III?? - if (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR + if (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEA || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEB) { m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(sega8_cart_slot_device::read_ram),(sega8_cart_slot_device*)m_cartslot)); @@ -1206,8 +1206,8 @@ WRITE8_MEMBER(smssdisp_state::sms_store_cart_select_w) logerror("switching in part of %s slot #%d\n", slottype ? "card" : "cartridge", slot ); /* cartridge? slot #0 */ -// if (slottype == 0) -// m_current_cartridge = slot; +// if (slottype == 0) +// m_current_cartridge = slot; setup_rom(); } diff --git a/src/mess/machine/sns_sa1.c b/src/mess/machine/sns_sa1.c index 147f088277b..bdfac6cf11f 100644 --- a/src/mess/machine/sns_sa1.c +++ b/src/mess/machine/sns_sa1.c @@ -53,7 +53,6 @@ sns_sa1_device::sns_sa1_device(const machine_config &mconfig, const char *tag, d void sns_sa1_device::device_start() { - } void sns_sa1_device::device_reset() @@ -78,7 +77,7 @@ void sns_sa1_device::device_reset() m_bwram_sa1 = 0; m_bwram_sa1_source = 0; m_bwram_sa1_format = 0; - m_bwram_write_snes = 1; + m_bwram_write_snes = 1; m_bwram_write_sa1 = 1; m_bwpa_sa1 = 0x0f; m_iram_write_snes = 1; @@ -220,15 +219,15 @@ UINT8 sns_sa1_device::read_regs(address_space &space, UINT32 offset) UINT32 data = (var_length_read(space, m_vda + 0) << 0) | (var_length_read(space, m_vda + 1) << 8) | (var_length_read(space, m_vda + 2) << 16); data >>= m_vbit; - - if (m_drm == 1) + + if (m_drm == 1) { //auto-increment mode m_vbit += m_vlen; m_vda += (m_vbit >> 3); m_vbit &= 7; } - + value = (data >> 8) & 0xff; } break; @@ -255,7 +254,7 @@ void sns_sa1_device::write_regs(UINT32 offset, UINT8 data) // reset sa-1? } m_sa1_ctrl = data; - + if (BIT(m_sa1_ctrl, 7)) { // IRQ diff --git a/src/mess/machine/sns_sdd1.c b/src/mess/machine/sns_sdd1.c index 85d336d4d5a..8291e00574e 100644 --- a/src/mess/machine/sns_sdd1.c +++ b/src/mess/machine/sns_sdd1.c @@ -435,7 +435,7 @@ void sns_rom_sdd1_device::device_start() save_item(NAME(m_sdd1_enable)); save_item(NAME(m_xfer_enable)); save_item(NAME(m_mmc)); - + for (int i = 0; i < 8; i++) { save_item(NAME(m_dma[i].addr), i); diff --git a/src/mess/machine/sns_sgb.c b/src/mess/machine/sns_sgb.c index eba0b14b57e..cdab2bdd3a4 100644 --- a/src/mess/machine/sns_sgb.c +++ b/src/mess/machine/sns_sgb.c @@ -1,12 +1,12 @@ /*********************************************************************************************************** - + Super Game Boy emulation (for SNES/SFC) - + Copyright MESS Team. Visit http://mamedev.org for licensing and usage restrictions. TODO: almost everything - + ***********************************************************************************************************/ @@ -123,60 +123,60 @@ READ8_MEMBER( sns_rom_sgb_device::chip_read ) UINT16 address = offset & 0xffff; //LY counter - if (address == 0x6000) + if (address == 0x6000) { m_sgb_ly = 0;// GameBoy PPU LY here m_sgb_row = m_lcd_row; return m_sgb_ly; } - + //command ready port - if (address == 0x6002) + if (address == 0x6002) { bool data = (m_packetsize > 0); - if (data) + if (data) { - for (int i = 0; i < 16; i++) + for (int i = 0; i < 16; i++) m_joy_pckt[i] = m_packet_data[0][i]; - m_packetsize--; + m_packetsize--; //hack because we still don't emulate input packets! if (!m_packetsize) m_packetsize = 64; // shift packet - for (int i = 0; i < m_packetsize; i++) + for (int i = 0; i < m_packetsize; i++) for (int j = 0; j < 16; j++) m_packet_data[i][j] = m_packet_data[i + 1][j]; } return data; } - + //ICD2 revision - if (address == 0x600f) + if (address == 0x600f) return 0x21; - + //command port - if ((address & 0xfff0) == 0x7000) + if ((address & 0xfff0) == 0x7000) return m_joy_pckt[address & 0x0f]; - + //VRAM port - if (address == 0x7800) + if (address == 0x7800) { UINT8 data = m_lcd_output[m_vram_offs]; m_vram_offs = (m_vram_offs + 1) % 320; return data; } - return 0x00; // this should never happen? + return 0x00; // this should never happen? } -void sns_rom_sgb_device::lcd_render(UINT32 *source) +void sns_rom_sgb_device::lcd_render(UINT32 *source) { memset(m_lcd_output, 0x00, 320 * sizeof(UINT16)); - + for (int y = 0; y < 8; y++) { - for (int x = 0; x < 160; x++) + for (int x = 0; x < 160; x++) { UINT32 pixel = *source++; UINT16 addr = y * 2 + (x / 8 * 16); @@ -189,59 +189,58 @@ void sns_rom_sgb_device::lcd_render(UINT32 *source) WRITE8_MEMBER( sns_rom_sgb_device::chip_write ) { UINT16 address = offset & 0xffff; - + //VRAM port - if (address == 0x6001) + if (address == 0x6001) { m_vram = data; m_vram_offs = 0; - + UINT8 offset = (m_sgb_row - (4 - (m_vram - (m_sgb_ly & 3)))) & 3; lcd_render(m_lcd_buffer + offset * 160 * 8); - + return; } - + //control port - if (address == 0x6003) + if (address == 0x6003) { - if ((m_port & 0x80) == 0x00 && (data & 0x80) == 0x80) + if ((m_port & 0x80) == 0x00 && (data & 0x80) == 0x80) { //reset } - switch (data & 3) + switch (data & 3) { //change CPU frequency } m_port = data; return; } - - if (address == 0x6004) + + if (address == 0x6004) { //joypad 1 - m_joy1 = data; - return; + m_joy1 = data; + return; } - if (address == 0x6005) + if (address == 0x6005) { //joypad 2 - m_joy2 = data; - return; + m_joy2 = data; + return; } - if (address == 0x6006) + if (address == 0x6006) { //joypad 3 - m_joy3 = data; - return; + m_joy3 = data; + return; } - if (address == 0x6007) + if (address == 0x6007) { //joypad 4 - m_joy4 = data; - return; + m_joy4 = data; + return; } - -} +} diff --git a/src/mess/machine/sns_sgb.h b/src/mess/machine/sns_sgb.h index 4c6ebf15af5..492a35f3315 100644 --- a/src/mess/machine/sns_sgb.h +++ b/src/mess/machine/sns_sgb.h @@ -14,7 +14,7 @@ class sns_rom_sgb_device : public sns_rom_device public: // construction/destruction sns_rom_sgb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); @@ -25,7 +25,7 @@ public: virtual DECLARE_READ8_MEMBER(read_h); virtual DECLARE_READ8_MEMBER(chip_read); virtual DECLARE_WRITE8_MEMBER(chip_write); - + virtual DECLARE_READ8_MEMBER(gb_cart_r); virtual DECLARE_WRITE8_MEMBER(gb_bank_w); virtual DECLARE_READ8_MEMBER(gb_ram_r); diff --git a/src/mess/machine/sns_spc7110.c b/src/mess/machine/sns_spc7110.c index 8bf8536284b..2eb768af13f 100644 --- a/src/mess/machine/sns_spc7110.c +++ b/src/mess/machine/sns_spc7110.c @@ -318,7 +318,7 @@ SPC7110_Decomp::SPC7110_Decomp(running_machine &machine) + map(3, 24) + map(2, 16) + map(1, 8) + map(0, 0); #undef map } - + state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_decomp_mode); state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_decomp_offset); state_save_register_item_pointer(machine, "SNES_SPC7110", NULL, 0, m_decomp_buffer, SPC7110_DECOMP_BUFFER_SIZE); @@ -331,7 +331,7 @@ SPC7110_Decomp::SPC7110_Decomp(running_machine &machine) state_save_register_item(machine, "SNES_SPC7110", NULL, i, m_context[i].index); state_save_register_item(machine, "SNES_SPC7110", NULL, i, m_context[i].invert); } - + state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m0_val); state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m0_in); state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m0_span); @@ -349,7 +349,7 @@ SPC7110_Decomp::SPC7110_Decomp(running_machine &machine) state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m1_inverts); state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m1_lps); state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m1_in_count); - + state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m2_pixelorder); state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m2_realorder); state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m2_bitplanebuffer); @@ -455,7 +455,7 @@ UINT8 SPC7110_Decomp::dataread(UINT8 *ROM, UINT32 len) } void SPC7110_Decomp::mode0(UINT8 init, UINT8 *ROM, UINT32 len) -{ +{ if (init == 1) { m_m0_out = m_m0_inverts = m_m0_lps = 0; diff --git a/src/mess/machine/sns_spc7110.h b/src/mess/machine/sns_spc7110.h index 24871f3040f..0a607d2d001 100644 --- a/src/mess/machine/sns_spc7110.h +++ b/src/mess/machine/sns_spc7110.h @@ -36,7 +36,7 @@ public: void mode2(UINT8 init, UINT8 *ROM, UINT32 len); private: - + UINT8 dataread(UINT8 *ROM, UINT32 len); UINT8 probability(UINT32 n); UINT8 next_lps(UINT32 n); @@ -44,21 +44,21 @@ private: UINT8 toggle_invert(UINT32 n); UINT32 morton_2x8(UINT32 data); UINT32 morton_4x8(UINT32 data); - + UINT32 m_decomp_mode; UINT32 m_decomp_offset; - + UINT8 *m_decomp_buffer; UINT32 m_decomp_buffer_rdoffset; UINT32 m_decomp_buffer_wroffset; UINT32 m_decomp_buffer_length; - + struct ContextState { UINT8 index; UINT8 invert; } m_context[32]; - + UINT32 m_morton16[2][256]; UINT32 m_morton32[4][256]; diff --git a/src/mess/machine/softbox.h b/src/mess/machine/softbox.h index 68100948ad8..f11d5737cb6 100644 --- a/src/mess/machine/softbox.h +++ b/src/mess/machine/softbox.h @@ -74,4 +74,4 @@ extern const device_type SOFTBOX; -#endif
\ No newline at end of file +#endif diff --git a/src/mess/machine/upd71071.c b/src/mess/machine/upd71071.c index b3ebe814bd8..58fa6a44e90 100644 --- a/src/mess/machine/upd71071.c +++ b/src/mess/machine/upd71071.c @@ -100,7 +100,7 @@ void upd71071_device::device_config_complete() const upd71071_intf *intf = reinterpret_cast<const upd71071_intf *>(static_config()); if (intf != NULL) *static_cast<upd71071_intf *>(this) = *intf; - + // or initialize to defaults if none provided else { diff --git a/src/mess/machine/victor9kb.h b/src/mess/machine/victor9kb.h index f067320a7ca..cd4321b688c 100644 --- a/src/mess/machine/victor9kb.h +++ b/src/mess/machine/victor9kb.h @@ -32,8 +32,7 @@ #define MCFG_VICTOR9K_KEYBOARD_ADD(_kbrdy) \ MCFG_DEVICE_ADD(VICTOR9K_KEYBOARD_TAG, VICTOR9K_KEYBOARD, 0) \ - downcast<victor9k_keyboard_device *>(device)->set_kbrdy_callback(DEVCB2_##_kbrdy); \ - + downcast<victor9k_keyboard_device *>(device)->set_kbrdy_callback(DEVCB2_##_kbrdy); //************************************************************************** diff --git a/src/mess/machine/vp575.c b/src/mess/machine/vp575.c index e31c7a10923..17f9c8c1aff 100644 --- a/src/mess/machine/vp575.c +++ b/src/mess/machine/vp575.c @@ -65,15 +65,15 @@ WRITE_LINE_MEMBER( vp575_device::exp5_dma_in_w ) { m_dma_in[4] = state; update_i static MACHINE_CONFIG_FRAGMENT( vp575 ) MCFG_VIP_EXPANSION_SLOT_ADD("exp1", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) - MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_in_w)) MCFG_VIP_EXPANSION_SLOT_ADD("exp2", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) - MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_in_w)) MCFG_VIP_EXPANSION_SLOT_ADD("exp3", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) - MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_in_w)) MCFG_VIP_EXPANSION_SLOT_ADD("exp4", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) - MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_in_w)) MCFG_VIP_EXPANSION_SLOT_ADD("exp5", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) - MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_in_w)) MACHINE_CONFIG_END diff --git a/src/mess/machine/wangpc_mcc.c b/src/mess/machine/wangpc_mcc.c index aa83bb1fdd7..0049608899e 100644 --- a/src/mess/machine/wangpc_mcc.c +++ b/src/mess/machine/wangpc_mcc.c @@ -272,7 +272,7 @@ void wangpc_mcc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, U case 0x06/2: m_sio->cd_ba_w(space, offset >> 1, data & 0xff); break; - + case 0x08/2: case 0x0a/2: case 0x0c/2: diff --git a/src/mess/machine/zx8302.h b/src/mess/machine/zx8302.h index edabc673d00..47b46d12ecb 100644 --- a/src/mess/machine/zx8302.h +++ b/src/mess/machine/zx8302.h @@ -172,7 +172,7 @@ private: enum { - INT_GAP = 0x01, + INT_GAP = 0x01, INT_INTERFACE = 0x02, INT_TRANSMIT = 0x04, INT_FRAME = 0x08, @@ -181,7 +181,7 @@ private: enum { - STATUS_NETWORK_PORT = 0x01, + STATUS_NETWORK_PORT = 0x01, STATUS_TX_BUFFER_FULL = 0x02, STATUS_RX_BUFFER_FULL = 0x04, STATUS_MICRODRIVE_GAP = 0x08, diff --git a/src/mess/video/gba.c b/src/mess/video/gba.c index 2bf8756f4e2..ef3fbc1351d 100644 --- a/src/mess/video/gba.c +++ b/src/mess/video/gba.c @@ -53,16 +53,16 @@ inline void gba_state::update_mask(UINT8* mask, int mode, int submode, UINT32* o for (int x = 0; x < 240; x++) { mask[x] = out_mask; - + if ((obj_win[x] & 0x80000000) == 0) mask[x] = m_WINOUT >> 8; - + if (inwin1) { if (is_in_window(x, 1)) mask[x] = in1_mask; } - + if (inwin0) { if (is_in_window(x, 0)) @@ -87,7 +87,7 @@ inline void gba_state::update_mask(UINT8* mask, int mode, int submode, UINT32* o mode_mask = ~0x0b; } - + if (mode_mask) { for (int x = 0; x < 240; x++) @@ -103,8 +103,8 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* UINT8 inWin0Mask = m_WININ & 0x00ff; UINT8 inWin1Mask = m_WININ >> 8; UINT8 outMask = m_WINOUT & 0x00ff; - UINT8 masks[240]; // this puts together WinMasks with the fact that some modes/submodes skip specific layers! - + UINT8 masks[240]; // this puts together WinMasks with the fact that some modes/submodes skip specific layers! + if (submode == GBA_SUBMODE2) { if (m_DISPCNT & DISPCNT_WIN0_EN) @@ -117,7 +117,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* else inWindow0 |= (y >= v0 || y < v1) ? 1 : 0; } - + if (m_DISPCNT & DISPCNT_WIN1_EN) { UINT8 v0 = m_WIN1V >> 8; @@ -129,7 +129,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* inWindow1 |= (y >= v0 || y < v1) ? 1 : 0; } } - + // Draw BG switch (mode) { @@ -154,7 +154,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* draw_roz_bitmap_scanline(line2, y, DISPCNT_BG2_EN, m_BG2CNT, m_BG2X, m_BG2Y, m_BG2PA, m_BG2PB, m_BG2PC, m_BG2PD, &m_gfxBG2X, &m_gfxBG2Y, m_gfxBG2Changed, bpp); break; } - + // Draw OAM draw_gba_oam(lineOBJ, y); if (submode == GBA_SUBMODE2) @@ -162,73 +162,73 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* memset(masks, 0xff, sizeof(masks)); update_mask(&masks[0], mode, submode, lineOBJWin, inWindow0, inWindow1, inWin0Mask, inWin1Mask, outMask); - + for (int x = 0; x < 240; x++) { UINT32 color = backdrop; UINT8 top = 0x20; - + if ((UINT8)(line0[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x01) { color = line0[x]; top = 0x01; } - + if ((UINT8)(line1[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x02) { color = line1[x]; top = 0x02; } - + if ((UINT8)(line2[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x04) { color = line2[x]; top = 0x04; } - + if ((UINT8)(line3[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x08) { color = line3[x]; top = 0x08; } - + if ((UINT8)(lineOBJ[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x10) { color = lineOBJ[x]; top = 0x10; } - + if (color & 0x00010000) { if (submode != GBA_SUBMODE0 || top == 0x10) { UINT32 back = backdrop; UINT8 top2 = 0x20; - + if ((UINT8)(line0[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x01) { back = line0[x]; top2 = 0x01; } - + if ((UINT8)(line1[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x02) { back = line1[x]; top2 = 0x02; } - + if ((UINT8)(line2[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x04) { back = line2[x]; top2 = 0x04; } - + if ((UINT8)(line3[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x08) { back = line3[x]; top2 = 0x08; } - + if (top2 & (m_BLDCNT >> BLDCNT_TP2_SHIFT)) color = alpha_blend_pixel(color, back, coeff[m_BLDALPHA & 0x1f], coeff[(m_BLDALPHA >> 8) & 0x1f]); else @@ -260,7 +260,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* { UINT32 back = backdrop; UINT8 top2 = 0x20; - + if ((UINT8)(line0[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x01) { if (top != 0x01) @@ -269,7 +269,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* top2 = 0x01; } } - + if ((UINT8)(line1[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x02) { if (top != 0x02) @@ -278,7 +278,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* top2 = 0x02; } } - + if ((UINT8)(line2[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x04) { if (top != 0x04) @@ -287,7 +287,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* top2 = 0x04; } } - + if ((UINT8)(line3[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x08) { if (top != 0x08) @@ -296,7 +296,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* top2 = 0x08; } } - + if ((UINT8)(lineOBJ[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x10) { if (top != 0x10) @@ -305,7 +305,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* top2 = 0x10; } } - + if (top2 & (m_BLDCNT >> BLDCNT_TP2_SHIFT)) color = alpha_blend_pixel(color, back, coeff[m_BLDALPHA & 0x1f], coeff[(m_BLDALPHA >> 8) & 0x1f]); } @@ -320,7 +320,7 @@ void gba_state::draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* } } lineMix[x] = color; - } + } if (mode == GBA_MODE1 || mode == GBA_MODE2 || mode == GBA_MODE345) m_gfxBG2Changed = 0; if (mode == GBA_MODE2) @@ -336,13 +336,13 @@ void gba_state::draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, UINT32 enab INT32 sy = (depth == 4) ? 128 : 160; UINT32 prio = ((ctrl & BGCNT_PRIORITY) << 25) + 0x1000000; INT32 cx, cy, pixx, pixy, x; - + if ((depth == 8) && (m_DISPCNT & DISPCNT_FRAMESEL)) src8 += 0xa000; - + if ((depth == 4) && (m_DISPCNT & DISPCNT_FRAMESEL)) src16 += 0xa000/2; - + // sign extend roz parameters if (X & 0x08000000) X |= 0xf0000000; if (Y & 0x08000000) Y |= 0xf0000000; @@ -350,23 +350,23 @@ void gba_state::draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, UINT32 enab if (PB & 0x8000) PB |= 0xffff0000; if (PC & 0x8000) PC |= 0xffff0000; if (PD & 0x8000) PD |= 0xffff0000; - + if(ypos == 0) changed = 3; - + if(changed & 1) *currentx = X; else *currentx += PB; - + if(changed & 2) *currenty = Y; else *currenty += PD; - + cx = *currentx; cy = *currenty; - + if(ctrl & BGCNT_MOSAIC) { INT32 mosaic_line = ((m_MOSAIC & 0xf0) >> 4) + 1; @@ -374,10 +374,10 @@ void gba_state::draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, UINT32 enab cx = X + tempy*PB; cy = Y + tempy*PD; } - + pixx = cx >> 8; pixy = cy >> 8; - + for(x = 0; x < 240; x++) { if(pixx < 0 || pixy < 0 || pixx >= sx || pixy >= sy) @@ -396,14 +396,14 @@ void gba_state::draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, UINT32 enab scanline[x] = src16[pixy*sx + pixx] | prio; } } - + cx += PA; cy += PC; - + pixx = cx >> 8; pixy = cy >> 8; } - + if(ctrl & BGCNT_MOSAIC) { INT32 mosaicx = (m_MOSAIC & 0x0f) + 1; @@ -508,17 +508,17 @@ void gba_state::draw_roz_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, // shall we shift for (ctrl & BGCNT_PALETTE256)?? or is not effective for ROZ? tile = mgba_vram[mapbase + (pixx >> 3) + (pixy >> 3) * (sizes[size] >> 3)]; pixel = mgba_vram[base + (tile << 6) + (tiley << 3) + tilex]; - + // plot it scanline[x] = pixel ? (pgba_pram[pixel] | prio) : 0x80000000; } - + cx += PA; cy += PC; - + pixx = cx >> 8; pixy = cy >> 8; - + if(ctrl & BGCNT_PALETTESET_WRAP) { pixx %= sizes[size]; @@ -573,10 +573,9 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, for (x = 0; x < 240; x++) scanline[x] = 0x80000000; - + if(m_DISPCNT & enablemask) { - switch((ctrl & BGCNT_SCREENSIZE) >> BGCNT_SCREENSIZE_SHIFT) { case 1: @@ -590,13 +589,13 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, height = 512; break; } - + maskx = width - 1; masky = height - 1; - + pixx = hofs & maskx; pixy = (vofs + ypos) & masky; - + if(use_mosaic) { if((ypos % mosaicy) != 0) @@ -605,7 +604,7 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, pixy = (vofs + mosaicy) & masky; } } - + if(pixy > 255 && height > 256) { pixy &= 0x000000ff; @@ -615,9 +614,9 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, screendata += 0x400; } } - + stride = (pixy >> 3) << 5; - + UINT16 *src = screendata + 0x400 * (pixx >> 8) + ((pixx & 255) >> 3) + stride; for(x = 0; x < 240; x++) { @@ -627,7 +626,7 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, INT32 tiley = pixy & 7; UINT8 color; UINT8 palindex; - + if(data & TILEOBJ_HFLIP) { tilex = 7 - tilex; @@ -636,7 +635,7 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, { tiley = 7 - tiley; } - + if (ctrl & BGCNT_PALETTE256) { color = chardata[(tile << 6) + (tiley << 3) + tilex]; @@ -645,19 +644,19 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, else { color = chardata[(tile << 5) + (tiley << 2) + (tilex >> 1)]; - + if (tilex & 1) color >>= 4; else color &= 0x0f; palindex = (data >> 8) & 0x00f0; - } + } if (color) scanline[x] = palette[palindex + color] | priority; else scanline[x] = 0x80000000; - + if (data & TILEOBJ_HFLIP) { if (tilex == 0) @@ -669,7 +668,7 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, { src++; } - + pixx++; if(pixx == 256) { @@ -689,7 +688,7 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, src = screendata + stride; } } - + if(use_mosaic) { if(mosaicx > 1) @@ -707,7 +706,7 @@ void gba_state::draw_bg_scanline(UINT32 *scanline, int ypos, UINT32 enablemask, } } } - + } } @@ -722,7 +721,7 @@ void gba_state::draw_gba_oam_window(UINT32 *scanline, int y) for (x = 0; x < 240; x++) scanline[x] = 0x80000000; - + if (m_DISPCNT & DISPCNT_OBJWIN_EN) { for( gba_oamindex = 127; gba_oamindex >= 0; gba_oamindex-- ) @@ -1170,7 +1169,7 @@ void gba_state::draw_gba_oam(UINT32 *scanline, int y) for (x = 0; x < 240; x++) scanline[x] = 0x80000000; - + if( m_DISPCNT & DISPCNT_OBJ_EN ) { for( gba_oamindex = 0; gba_oamindex < 128; gba_oamindex++ ) @@ -1861,7 +1860,7 @@ void gba_state::draw_scanline(int y) depth = 8; else if ((m_DISPCNT & 7) == 5) depth = 4; - + //printf("mode = %d, %d\n", m_DISPCNT & 7, submode); switch(m_DISPCNT & 7) @@ -1880,7 +1879,7 @@ void gba_state::draw_scanline(int y) fatalerror("Invalid screen mode (6 or 7)!\n"); break; } - + for (int x = 0; x < 240; x++) { scanline[x] = m_xferscan[6][1024 + x] & 0x7fff; diff --git a/src/mess/video/gf4500.c b/src/mess/video/gf4500.c index a8619ea7cc6..4ca6cbf3789 100644 --- a/src/mess/video/gf4500.c +++ b/src/mess/video/gf4500.c @@ -74,7 +74,7 @@ void gf4500_device::device_reset() { m_screen_x = m_screen_y = 0; m_screen_x_max = m_screen_y_max = m_screen_x_min = m_screen_y_min = 0; -} +} void gf4500_device::vram_write16( UINT16 data ) @@ -180,4 +180,3 @@ WRITE32_MEMBER( gf4500_device::write ) } } } - diff --git a/src/mess/video/gf4500.h b/src/mess/video/gf4500.h index 0a4e3299f7e..2e14c450562 100644 --- a/src/mess/video/gf4500.h +++ b/src/mess/video/gf4500.h @@ -15,8 +15,8 @@ class gf4500_device : public device_t public: gf4500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~gf4500_device() {} - - + + DECLARE_READ32_MEMBER( read ); DECLARE_WRITE32_MEMBER( write ); @@ -27,12 +27,12 @@ protected: virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); - -private: + +private: // internal state void vram_write16(UINT16 data); - + UINT32 *m_data; int m_screen_x; int m_screen_y; diff --git a/src/mess/video/newport.c b/src/mess/video/newport.c index 4f32d6400fb..210d6406f8f 100644 --- a/src/mess/video/newport.c +++ b/src/mess/video/newport.c @@ -102,7 +102,7 @@ void newport_video_device::device_config_complete() void newport_video_device::device_start() { m_base = auto_alloc_array_clear(machine(), UINT32, (1280+64) * (1024+64)); - + save_pointer(NAME(m_base), (1280+64) * (1024+64)); save_item(NAME(m_VC2.nRegister)); save_item(NAME(m_VC2.nRAM)); @@ -203,8 +203,8 @@ void newport_video_device::device_reset() m_REX3.nDrawMode0 = 0x00000000; m_REX3.nDrawMode1 = 0x3002f001; m_REX3.nDCBMode = 0x00000780; - m_REX3.nKludge_SkipLine = 0; -} + m_REX3.nKludge_SkipLine = 0; +} UINT32 newport_video_device::screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect) @@ -214,7 +214,7 @@ UINT32 newport_video_device::screen_update(screen_device &device, bitmap_rgb32 & { UINT32 *src = &m_base[1344 * y]; UINT32 *dest = &bitmap.pix32(y, cliprect.min_x); - + /* loop over columns */ for (int x = cliprect.min_x; x < cliprect.max_x; x++) { diff --git a/src/mess/video/newport.h b/src/mess/video/newport.h index 4df773e0ac4..0fa7d9fc198 100644 --- a/src/mess/video/newport.h +++ b/src/mess/video/newport.h @@ -116,22 +116,22 @@ class newport_video_device : public device_t public: newport_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~newport_video_device() {} - - + + DECLARE_READ32_MEMBER( rex3_r ); DECLARE_WRITE32_MEMBER( rex3_w ); - + UINT32 screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect); - + protected: // device-level overrides virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); - -private: + +private: // internal state - + DECLARE_READ32_MEMBER( cmap0_r ); DECLARE_WRITE32_MEMBER( cmap0_w ); DECLARE_READ32_MEMBER( cmap1_r ); @@ -142,14 +142,14 @@ private: DECLARE_READ32_MEMBER( vc2_r ); DECLARE_WRITE32_MEMBER( vc2_w ); void DoREX3Command(); - + VC2_t m_VC2; XMAP_t m_XMAP0; XMAP_t m_XMAP1; REX3_t m_REX3; UINT32 *m_base; UINT8 m_nDrawGreen; - CMAP_t m_CMAP0; + CMAP_t m_CMAP0; }; diff --git a/src/mess/video/nick.c b/src/mess/video/nick.c index 57b919e781d..883feb96708 100644 --- a/src/mess/video/nick.c +++ b/src/mess/video/nick.c @@ -104,18 +104,18 @@ ADDRESS_MAP_END nick_device::nick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NICK, "NICK", tag, owner, clock, "nick", __FILE__), - device_memory_interface(mconfig, *this), - m_space_config("vram", ENDIANNESS_LITTLE, 8, 16, 0, *ADDRESS_MAP_NAME(nick_map)), - m_write_virq(*this), - horizontal_clock(0), - m_scanline_count(0), - m_FIXBIAS(0), - m_BORDER(0), - m_LPL(0), - m_LPH(0), - m_LD1(0), - m_LD2(0), - m_virq(CLEAR_LINE) + device_memory_interface(mconfig, *this), + m_space_config("vram", ENDIANNESS_LITTLE, 8, 16, 0, *ADDRESS_MAP_NAME(nick_map)), + m_write_virq(*this), + horizontal_clock(0), + m_scanline_count(0), + m_FIXBIAS(0), + m_BORDER(0), + m_LPL(0), + m_LPH(0), + m_LD1(0), + m_LD2(0), + m_virq(CLEAR_LINE) { } @@ -243,7 +243,7 @@ WRITE8_MEMBER( nick_device::vram_w ) //------------------------------------------------- -// fixbias_w - +// fixbias_w - //------------------------------------------------- WRITE8_MEMBER( nick_device::fixbias_w ) @@ -253,7 +253,7 @@ WRITE8_MEMBER( nick_device::fixbias_w ) //------------------------------------------------- -// border_w - +// border_w - //------------------------------------------------- WRITE8_MEMBER( nick_device::border_w ) @@ -263,7 +263,7 @@ WRITE8_MEMBER( nick_device::border_w ) //------------------------------------------------- -// lpl_w - +// lpl_w - //------------------------------------------------- WRITE8_MEMBER( nick_device::lpl_w ) @@ -275,7 +275,7 @@ WRITE8_MEMBER( nick_device::lpl_w ) //------------------------------------------------- -// lph_w - +// lph_w - //------------------------------------------------- WRITE8_MEMBER( nick_device::lph_w ) @@ -287,7 +287,7 @@ WRITE8_MEMBER( nick_device::lph_w ) //------------------------------------------------- -// initialize_palette - +// initialize_palette - //------------------------------------------------- void nick_device::initialize_palette() @@ -305,9 +305,9 @@ void nick_device::initialize_palette() for (int i = 0; i < 256; i++) { /* - + bit description - + PC0 100R -- RED PC1 100R -- GREEN PC2 82R -- BLUE @@ -316,7 +316,7 @@ void nick_device::initialize_palette() PC5 220R -- BLUE PC6 470R -- RED PC7 470R -- GREEN - + */ int ra = BIT(i, 0); @@ -340,10 +340,10 @@ void nick_device::initialize_palette() for (int i = 0; i < 256; i++) { int pen_index; - + pen_index = (BIT(i, 7) << 0) | (BIT(i, 3) << 1); m_pen_idx_4col[i] = pen_index; - + pen_index = (BIT(i, 7) << 0) | (BIT(i, 3) << 1) | (BIT(i, 5) << 2) | (BIT(i, 1) << 3); m_pen_idx_16col[i] = pen_index; } @@ -437,10 +437,10 @@ void nick_device::write_pixels2color_lpixel(UINT8 pen0, UINT8 pen1, UINT8 data_b int col_index[2]; int pen_index; UINT8 data = data_byte; - + col_index[0] = get_color_index(pen0); col_index[1] = get_color_index(pen1); - + for (int i = 0; i < 8; i++) { pen_index = col_index[BIT(data, 7)]; diff --git a/src/mess/video/nick.h b/src/mess/video/nick.h index acc3a795c4d..efd6f942a40 100644 --- a/src/mess/video/nick.h +++ b/src/mess/video/nick.h @@ -66,7 +66,7 @@ struct LPT_ENTRY // ======================> nick_device class nick_device : public device_t, - public device_memory_interface + public device_memory_interface { public: // construction/destruction @@ -132,28 +132,28 @@ private: UINT8 horizontal_clock; /* current scanline within LPT */ UINT8 m_scanline_count; - + UINT8 m_FIXBIAS; UINT8 m_BORDER; UINT8 m_LPL; UINT8 m_LPH; - + UINT16 m_LD1; UINT16 m_LD2; - + LPT_ENTRY m_LPT; - + UINT32 *m_dest; int m_dest_pos; int m_dest_max_pos; - + UINT8 m_reg[4]; - + /* first clock visible on left hand side */ int m_first_visible_clock; /* first clock visible on right hand side */ int m_last_visible_clock; - + /* given a bit pattern, this will get the pen index */ UINT8 m_pen_idx_4col[256]; /* given a bit pattern, this will get the pen index */ diff --git a/src/mess/video/stic.c b/src/mess/video/stic.c index cca1631d632..142da8646aa 100644 --- a/src/mess/video/stic.c +++ b/src/mess/video/stic.c @@ -1,11 +1,11 @@ /********************************************************************** - + General Instruments AY-3-8900-1 a.k.a. Standard Television Interface Chip (STIC) emulation for Mattel Intellivision - + Copyright MESS Team. Visit http://mamedev.org for licensing and usage restrictions. - + *********************************************************************/ #include "emu.h" @@ -42,7 +42,7 @@ stic_device::~stic_device() void stic_device::device_start() { machine().primary_screen->register_screen_bitmap(m_bitmap); - + save_item(NAME(m_stic_registers)); save_item(NAME(m_gramdirty)); save_item(NAME(m_gram)); @@ -123,7 +123,7 @@ void stic_device::device_reset() m_col_delay = 0; m_row_delay = 0; m_left_edge_inhibit = 0; - m_top_edge_inhibit = 0; + m_top_edge_inhibit = 0; } ROM_START( stic_grom ) @@ -149,12 +149,12 @@ const rom_entry *stic_device::device_rom_region() const void stic_device::intv_set_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color) { int w, h; - + // output scaling x *= m_x_scale; y *= m_y_scale; color = SET_COLOR(color); - + for (h = 0; h < m_y_scale; h++) for (w = 0; w < m_x_scale; w++) bitmap.pix16(y + h, x + w) = color; @@ -174,10 +174,10 @@ void stic_device::intv_plot_box(bitmap_ind16 &bitmap, int x, int y, int w, int h int stic_device::sprites_collide(int spriteNum1, int spriteNum2) { INT16 x0, y0, w0, h0, x1, y1, w1, h1, x2, y2, w2, h2; - + intv_sprite_type* s1 = &m_sprite[spriteNum1]; intv_sprite_type* s2 = &m_sprite[spriteNum2]; - + x0 = STIC_OVERSCAN_LEFT_WIDTH + m_col_delay - STIC_CARD_WIDTH; y0 = STIC_OVERSCAN_TOP_HEIGHT + m_row_delay - STIC_CARD_HEIGHT; x1 = (s1->xpos + x0) * STIC_X_SCALE; y1 = (s1->ypos + y0) * STIC_Y_SCALE; @@ -186,11 +186,11 @@ int stic_device::sprites_collide(int spriteNum1, int spriteNum2) w2 = (s2->doublex ? 2 : 1) * STIC_CARD_WIDTH; h1 = (s1->quady ? 4 : 1) * (s1->doubley ? 2 : 1) * (s1->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT; h2 = (s2->quady ? 4 : 1) * (s2->doubley ? 2 : 1) * (s2->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT; - + if ((x1 >= x2 + w2) || (y1 >= y2 + h2) || (x2 >= x1 + w1) || (y2 >= y1 + h1)) return FALSE; - + // iterate over the intersecting bits to see if any touch x0 = MAX(x1, x2); y0 = MAX(y1, y2); @@ -209,7 +209,7 @@ int stic_device::sprites_collide(int spriteNum1, int spriteNum2) return TRUE; } } - + return FALSE; } @@ -221,13 +221,13 @@ void stic_device::determine_sprite_collisions() intv_sprite_type* s1 = &m_sprite[i]; if (s1->xpos == 0 || !s1->coll) continue; - + for (int j = i + 1; j < STIC_MOBS; j++) { intv_sprite_type* s2 = &m_sprite[j]; if (s2->xpos == 0 || !s2->coll) continue; - + if (sprites_collide(i, j)) { s1->collision |= (1 << j); @@ -246,21 +246,21 @@ void stic_device::render_sprites() INT32 nextX; INT32 nextY; INT32 xInc; - + UINT8* memory = m_grom_region->base(); - + for (int i = 0; i < STIC_MOBS; i++) { intv_sprite_type* s = &m_sprite[i]; - + if (s->grom) cardMemoryLocation = (s->card * STIC_CARD_HEIGHT); else cardMemoryLocation = ((s->card & 0x003F) * STIC_CARD_HEIGHT); - + pixelSize = (s->quady ? 4 : 1) * (s->doubley ? 2 : 1); spritePixelHeight = pixelSize * (s->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT; - + for (int j = 0; j < spritePixelHeight; j++) { nextMemoryLocation = (cardMemoryLocation + (j/pixelSize)); @@ -273,7 +273,7 @@ void stic_device::render_sprites() nextX = (s->xflip ? ((s->doublex ? 2 : 1) * STIC_CARD_WIDTH - 1) : 0); nextY = (s->yflip ? (spritePixelHeight - j - 1) : j); xInc = (s->xflip ? -1: 1); - + for (int k = 0; k < STIC_CARD_WIDTH * (1 + s->doublex); k++) { m_sprite_buffers[i][nextX + k * xInc][nextY] = (nextData & (1 << ((STIC_CARD_WIDTH - 1) - k / (1 + s->doublex)))) != 0; @@ -285,7 +285,7 @@ void stic_device::render_sprites() void stic_device::render_line(bitmap_ind16 &bitmap, UINT8 nextByte, UINT16 x, UINT16 y, UINT8 fgcolor, UINT8 bgcolor) { UINT32 color; - + for (int i = 0; i < STIC_CARD_WIDTH; i++) { color = (nextByte & (1 << ((STIC_CARD_WIDTH - 1) - i)) ? fgcolor : bgcolor); @@ -308,17 +308,17 @@ void stic_device::render_color_stack_mode(bitmap_ind16 &bitmap) UINT8 csPtr = 0; UINT16 nextCard; UINT8 *ram = m_grom_region->base(); - + for (h = 0, nexty = (STIC_OVERSCAN_TOP_HEIGHT + m_row_delay) * STIC_Y_SCALE; - h < STIC_BACKTAB_HEIGHT; - h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE) + h < STIC_BACKTAB_HEIGHT; + h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE) { for (w = 0, nextx = (STIC_OVERSCAN_LEFT_WIDTH + m_col_delay) * STIC_X_SCALE; - w < STIC_BACKTAB_WIDTH; - w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE) + w < STIC_BACKTAB_WIDTH; + w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE) { nextCard = m_backtab_buffer[h][w]; - + // colored squares mode if ((nextCard & (STIC_CSTM_FG3|STIC_CSTM_SEL)) == STIC_CSTM_FG3) { @@ -329,10 +329,10 @@ void stic_device::render_color_stack_mode(bitmap_ind16 &bitmap) UINT8 color3 = ((nextCard & STIC_CSQM_D2) >> 11) | ((nextCard & (STIC_CSQM_D10)) >> 9); render_colored_squares(bitmap, nextx, nexty, - (color0 == 7 ? csColor : (color0 | FOREGROUND_BIT)), - (color1 == 7 ? csColor : (color1 | FOREGROUND_BIT)), - (color2 == 7 ? csColor : (color2 | FOREGROUND_BIT)), - (color3 == 7 ? csColor : (color3 | FOREGROUND_BIT))); + (color0 == 7 ? csColor : (color0 | FOREGROUND_BIT)), + (color1 == 7 ? csColor : (color1 | FOREGROUND_BIT)), + (color2 == 7 ? csColor : (color2 | FOREGROUND_BIT)), + (color3 == 7 ? csColor : (color3 | FOREGROUND_BIT))); } //color stack mode else @@ -340,15 +340,15 @@ void stic_device::render_color_stack_mode(bitmap_ind16 &bitmap) UINT8 isGrom; UINT16 memoryLocation, fgcolor, bgcolor; UINT8* memory; - + //advance the color pointer, if necessary if (nextCard & STIC_CSTM_ADV) csPtr = (csPtr+1) & (STIC_CSRS - 1); - + fgcolor = ((nextCard & STIC_CSTM_FG3) >> 9) | (nextCard & (STIC_CSTM_FG20)) | FOREGROUND_BIT; bgcolor = m_stic_registers[STIC_CSR + csPtr] & STIC_CSR_BG; - + isGrom = !(nextCard & STIC_CSTM_SEL); if (isGrom) { @@ -378,20 +378,20 @@ void stic_device::render_fg_bg_mode(bitmap_ind16 &bitmap) UINT16 nextCard, memoryLocation; UINT8* memory; UINT8* ram = m_grom_region->base(); - + for (h = 0, nexty = (STIC_OVERSCAN_TOP_HEIGHT + m_row_delay) * STIC_Y_SCALE; - h < STIC_BACKTAB_HEIGHT; - h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE) + h < STIC_BACKTAB_HEIGHT; + h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE) { for (w = 0, nextx = (STIC_OVERSCAN_LEFT_WIDTH + m_col_delay) * STIC_X_SCALE; - w < STIC_BACKTAB_WIDTH; - w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE) + w < STIC_BACKTAB_WIDTH; + w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE) { nextCard = m_backtab_buffer[h][w]; fgcolor = (nextCard & STIC_FBM_FG) | FOREGROUND_BIT; bgcolor = ((nextCard & STIC_FBM_BG2) >> 11) | ((nextCard & STIC_FBM_BG310) >> 9); - + isGrom = !(nextCard & STIC_FBM_SEL); if (isGrom) { @@ -421,27 +421,27 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) INT16 leftX, nextY; INT16 leftBorder, rightBorder, topBorder, bottomBorder; INT32 nextX; - + for (int i = STIC_MOBS - 1; i >= 0; i--) { intv_sprite_type *s = &m_sprite[i]; if (s->xpos == 0 || (!s->coll && !s->visible)) continue; - + borderCollision = FALSE; foregroundCollision = FALSE; - + spritePixelHeight = (s->quady ? 4 : 1) * (s->doubley ? 2 : 1) * (s->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT; width = (s->doublex ? 2 : 1) * STIC_CARD_WIDTH; - + leftX = (s->xpos - STIC_CARD_WIDTH + STIC_OVERSCAN_LEFT_WIDTH + m_col_delay) * STIC_X_SCALE; nextY = (s->ypos - STIC_CARD_HEIGHT + STIC_OVERSCAN_TOP_HEIGHT + m_row_delay) * STIC_Y_SCALE; - + leftBorder = (STIC_OVERSCAN_LEFT_WIDTH + (m_left_edge_inhibit ? STIC_CARD_WIDTH : 0)) * STIC_X_SCALE; rightBorder = (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1 - 1) * STIC_X_SCALE; topBorder = (STIC_OVERSCAN_TOP_HEIGHT + (m_top_edge_inhibit ? STIC_CARD_HEIGHT : 0)) * STIC_Y_SCALE; bottomBorder = (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT) * STIC_Y_SCALE - 1; - + for (y = 0; y < spritePixelHeight; y++) { for (x = 0; x < width; x++) @@ -449,7 +449,7 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) //if this sprite pixel is not on, then don't paint it if (!m_sprite_buffers[i][x][y]) continue; - + nextX = leftX + x; //if the next pixel location is on the border, then we //have a border collision and we can ignore painting it @@ -459,9 +459,9 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) borderCollision = TRUE; continue; } - + currentPixel = intv_get_pixel(bitmap, nextX, nextY); - + //check for foreground collision if (currentPixel & FOREGROUND_BIT) { @@ -469,7 +469,7 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) if (s->behind_foreground) continue; } - + if (s->visible) { intv_set_pixel(bitmap, nextX, nextY, s->color | (currentPixel & FOREGROUND_BIT)); @@ -477,7 +477,7 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) } nextY++; } - + //update the collision bits if (s->coll) { @@ -506,18 +506,18 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) int row,col; int fgcolor,bgcolor = 0; int code; - + int colora, colorb, colorc, colord; - + int n_bit; int p_bit; int g_bit; - + int j; - + int x0 = STIC_OVERSCAN_LEFT_WIDTH + m_col_delay; int y0 = STIC_OVERSCAN_TOP_HEIGHT + m_row_delay; - + if (m_color_stack_mode == 1) { m_color_stack_offset = 0; @@ -526,11 +526,11 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) for(col = 0; col < STIC_BACKTAB_WIDTH; col++) { value = m_ram16[offs]; - + n_bit = value & STIC_CSTM_ADV; p_bit = value & STIC_CSTM_FG3; g_bit = value & STIC_CSTM_SEL; - + if (p_bit && (!g_bit)) // colored squares mode { colora = value & STIC_CSQM_A; @@ -554,24 +554,24 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) m_color_stack_offset += 1; m_color_stack_offset &= (STIC_CSRS - 1); } - + if (p_bit) // pastel color set fgcolor = (value & STIC_CSTM_FG20) + 8; else fgcolor = value & STIC_CSTM_FG20; - + bgcolor = m_stic_registers[STIC_CSR + m_color_stack_offset]; code = (value & STIC_CSTM_C)>>3; - + if (g_bit) // read from gram { code &= (STIC_CSTM_C50 >> 3); // keep from going outside the array //if (m_gramdirtybytes[code] == 1) { decodechar(machine().gfx[1], - code, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); m_gramdirtybytes[code] = 0; } // Draw GRAM char @@ -580,12 +580,12 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) bgcolor*16+fgcolor, 0,0, (x0 + col * STIC_CARD_WIDTH) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT) * STIC_Y_SCALE, 0,transparency,bgcolor); - + for(j=0;j<8;j++) { //intv_set_pixel(bitmap, (x0 + col * STIC_CARD_WIDTH + j) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT + 7) * STIC_Y_SCALE + 1, 1); } - + } else // read from grom { @@ -594,7 +594,7 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) bgcolor*16+fgcolor, 0,0, (x0 + col * STIC_CARD_WIDTH) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT) * STIC_Y_SCALE, 0,transparency,bgcolor); - + for(j=0;j<8;j++) { //intv_set_pixel(bitmap, (x0 + col * STIC_CARD_WIDTH + j) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT + 7) * STIC_Y_SCALE + 1, 2); @@ -616,15 +616,15 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) fgcolor = value & STIC_FBM_FG; bgcolor = ((value & STIC_FBM_BG2) >> 11) + ((value & STIC_FBM_BG310) >> 9); code = (value & STIC_FBM_C) >> 3; - + if (value & STIC_FBM_SEL) // read for GRAM { //if (m_gramdirtybytes[code] == 1) { decodechar(machine().gfx[1], - code, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); m_gramdirtybytes[code] = 0; } // Draw GRAM char @@ -656,7 +656,7 @@ void stic_device::draw_sprites(bitmap_ind16 &bitmap, int behind_foreground) int code; int x0 = STIC_OVERSCAN_LEFT_WIDTH + m_col_delay - STIC_CARD_WIDTH; int y0 = STIC_OVERSCAN_TOP_HEIGHT + m_row_delay - STIC_CARD_HEIGHT; - + for (int i = STIC_MOBS - 1; i >= 0; --i) { intv_sprite_type *s = &m_sprite[i]; @@ -671,47 +671,47 @@ void stic_device::draw_sprites(bitmap_ind16 &bitmap, int behind_foreground) //if (m_gramdirtybytes[code] == 1) { decodechar(machine().gfx[1], - code, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); m_gramdirtybytes[code] = 0; } // Draw GRAM char drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[1], - code, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE, - 0x8000 * s->xsize, 0x8000 * s->ysize,0); + code, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE, + 0x8000 * s->xsize, 0x8000 * s->ysize,0); } else { //if ((m_gramdirtybytes[code] == 1) || (m_gramdirtybytes[code+1] == 1)) { decodechar(machine().gfx[1], - code, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); decodechar(machine().gfx[1], - code+1, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code+1, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); m_gramdirtybytes[code] = 0; m_gramdirtybytes[code+1] = 0; } // Draw GRAM char drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[1], - code, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT, + 0x8000*s->xsize, 0x8000*s->ysize,0); drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[1], - code+1, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code+1, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT, + 0x8000*s->xsize, 0x8000*s->ysize,0); } } else @@ -720,26 +720,26 @@ void stic_device::draw_sprites(bitmap_ind16 &bitmap, int behind_foreground) { // Draw GROM char drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[0], - code, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE, + 0x8000*s->xsize, 0x8000*s->ysize,0); } else { drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[0], - code, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT, + 0x8000*s->xsize, 0x8000*s->ysize,0); drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[0], - code+1, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code+1, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT, + 0x8000*s->xsize, 0x8000*s->ysize,0); } } } @@ -751,7 +751,7 @@ void stic_device::draw_borders(bitmap_ind16 &bitmap) { intv_plot_box(bitmap, 0, 0, (STIC_OVERSCAN_LEFT_WIDTH + (m_left_edge_inhibit ? STIC_CARD_WIDTH : m_col_delay)) * STIC_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT + STIC_OVERSCAN_BOTTOM_HEIGHT) * STIC_Y_SCALE, m_border_color); intv_plot_box(bitmap, (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1) * STIC_X_SCALE, 0, STIC_OVERSCAN_RIGHT_WIDTH, (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT + STIC_OVERSCAN_BOTTOM_HEIGHT) * STIC_Y_SCALE, m_border_color); - + intv_plot_box(bitmap, 0, 0, (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1 + STIC_OVERSCAN_RIGHT_WIDTH) * STIC_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT + (m_top_edge_inhibit ? STIC_CARD_HEIGHT : m_row_delay)) * STIC_Y_SCALE, m_border_color); intv_plot_box(bitmap, 0, (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT) * STIC_Y_SCALE, (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1 + STIC_OVERSCAN_RIGHT_WIDTH) * STIC_X_SCALE, STIC_OVERSCAN_BOTTOM_HEIGHT * STIC_Y_SCALE, m_border_color); } @@ -765,12 +765,12 @@ void stic_device::screenrefresh() render_background(m_bitmap); // Render the sprites into their buffers render_sprites(); - for (int i = 0; i < STIC_MOBS; i++) + for (int i = 0; i < STIC_MOBS; i++) m_sprite[i].collision = 0; // Copy the sprites to the background copy_sprites_to_background(m_bitmap); determine_sprite_collisions(); - for (int i = 0; i < STIC_MOBS; i++) + for (int i = 0; i < STIC_MOBS; i++) m_stic_registers[STIC_MCR + i] |= m_sprite[i].collision; /* draw the screen borders if enabled */ draw_borders(m_bitmap); @@ -951,7 +951,7 @@ WRITE16_MEMBER( stic_device::write ) //logerror("unmapped write to STIC register %02X: %04X\n", offset, data); break; } - + if (offset < sizeof(m_stic_registers) / sizeof(m_stic_registers[0])) m_stic_registers[offset] = data; } diff --git a/src/mess/video/stic.h b/src/mess/video/stic.h index e5c83699a07..fa8a8a8a1ee 100644 --- a/src/mess/video/stic.h +++ b/src/mess/video/stic.h @@ -476,7 +476,7 @@ public: // construction/destruction stic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); virtual ~stic_device(); - + DECLARE_READ16_MEMBER(read); DECLARE_READ16_MEMBER(gram_read); DECLARE_READ16_MEMBER(grom_read) { if (offset > 0x800) printf("help! %X\n", offset); return (0xff00 | m_grom_region->base()[offset]); } @@ -488,17 +488,17 @@ public: int read_stic_handshake() { return m_stic_handshake; } void set_x_scale(int val) { m_x_scale = val; } void set_y_scale(int val) { m_y_scale = val; } - + // device-level overrides virtual void device_start(); virtual const rom_entry *device_rom_region() const; virtual void device_reset(); - + void screenrefresh(); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: - + required_memory_region m_grom_region; void intv_set_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color); @@ -514,14 +514,14 @@ private: void copy_sprites_to_background(bitmap_ind16 &bitmap); void render_background(bitmap_ind16 &bitmap); void draw_borders(bitmap_ind16 &bitmap); - + #ifdef UNUSED_CODE void draw_background(bitmap_ind16 &bitmap, int transparency); void draw_sprites(bitmap_ind16 &bitmap, int behind_foreground); #endif - + bitmap_ind16 m_bitmap; - + intv_sprite_type m_sprite[STIC_MOBS]; UINT8 m_sprite_buffers[STIC_MOBS][STIC_CARD_WIDTH * 2][STIC_CARD_HEIGHT * 4 * 2 * 2]; UINT16 m_backtab_buffer[STIC_BACKTAB_HEIGHT][STIC_BACKTAB_WIDTH]; @@ -539,7 +539,7 @@ private: UINT8 m_gramdirty; UINT8 m_gram[512]; - UINT8 m_gramdirtybytes[512]; + UINT8 m_gramdirtybytes[512]; }; // device type definition diff --git a/src/mess/video/vic4567.c b/src/mess/video/vic4567.c index 7eb911b67ae..88262ed9d41 100644 --- a/src/mess/video/vic4567.c +++ b/src/mess/video/vic4567.c @@ -159,7 +159,7 @@ void vic3_device::device_config_complete() const vic3_interface *intf = reinterpret_cast<const vic3_interface *>(static_config()); if (intf != NULL) *static_cast<vic3_interface *>(this) = *intf; - + // or initialize to defaults if none provided else { @@ -184,33 +184,33 @@ void vic3_device::device_config_complete() void vic3_device::device_start() { int width, height; - + m_cpu = machine().device(cpu_tag); m_main_screen = machine().device<screen_device>(screen_tag); width = m_main_screen->width(); height = m_main_screen->height(); - + m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height); - + m_type = vic_type; - + m_dma_read.resolve(dma_read, *this); m_dma_read_color.resolve(dma_read_color, *this); m_interrupt.resolve(irq, *this); - + m_port_changed.resolve(port_changed, *this); - + m_c64_mem_r.resolve(c64_mem_r, *this); - + m_lightpen_button_cb.resolve(button_cb, *this); m_lightpen_x_cb.resolve(x_cb, *this); m_lightpen_y_cb.resolve(y_cb, *this); - + m_screen[0] = auto_alloc_array(machine(), UINT8, 216 * 656 / 8); - + for (int i = 1; i < 216; i++) m_screen[i] = m_screen[i - 1] + 656 / 8; - + for (int i = 0; i < 256; i++) { m_foreground[i] = 0; @@ -223,7 +223,7 @@ void vic3_device::device_start() if ((i & 0xc0) > 0x40) m_foreground[i] |= 0xc0; } - + for (int i = 0; i < 256; i++) { m_expandx[i] = 0; @@ -244,7 +244,7 @@ void vic3_device::device_start() if (i & 0x80) m_expandx[i] |= 0xc000; } - + for (int i = 0; i < 256; i++) { m_expandx_multi[i] = 0; @@ -265,24 +265,24 @@ void vic3_device::device_start() if (i & 0x80) m_expandx_multi[i] |= 0xa000; } - + save_item(NAME(m_reg)); - + save_item(NAME(m_on)); - + //save_item(NAME(m_bitmap)); - + save_item(NAME(m_lines)); - + save_item(NAME(m_chargenaddr)); save_item(NAME(m_videoaddr)); save_item(NAME(m_bitmapaddr)); - + save_item(NAME(m_x_begin)); save_item(NAME(m_x_end)); save_item(NAME(m_y_begin)); save_item(NAME(m_y_end)); - + save_item(NAME(m_c64_bitmap)); save_item(NAME(m_bitmapmulti)); save_item(NAME(m_mono)); @@ -290,23 +290,23 @@ void vic3_device::device_start() save_item(NAME(m_ecmcolor)); save_item(NAME(m_colors)); save_item(NAME(m_spritemulti)); - + save_item(NAME(m_lastline)); save_item(NAME(m_rasterline)); save_item(NAME(m_interlace)); - + save_item(NAME(m_columns)); save_item(NAME(m_rows)); - + save_item(NAME(m_shift)); save_item(NAME(m_foreground)); save_item(NAME(m_multi_collision)); - + save_item(NAME(m_palette_red)); save_item(NAME(m_palette_green)); save_item(NAME(m_palette_blue)); save_item(NAME(m_palette_dirty)); - + for (int i = 0; i < 8; i++) { save_item(NAME(m_sprites[i].x), i); @@ -332,32 +332,32 @@ void vic3_device::device_start() void vic3_device::device_reset() { memset(m_reg, 0, ARRAY_LENGTH(m_reg)); - + m_on = 1; - + m_interlace = 0; m_columns = 640; m_rows = 200; m_lines = VIC2_LINES; - + memset(&m_sprites, 0, sizeof(m_sprites)); - + m_chargenaddr = 0; m_videoaddr = 0; m_bitmapaddr = 0; - + m_x_begin = 0; m_x_end = 0; m_y_begin = 0; m_y_end = 0; - + for (int i = 0; i < 2; i++) { m_c64_bitmap[i] = 0; m_mono[i] = 0; m_ecmcolor[i] = 0; } - + for (int i = 0; i < 4; i++) { m_bitmapmulti[i] = 0; @@ -365,16 +365,16 @@ void vic3_device::device_reset() m_colors[i] = 0; m_spritemulti[i] = 0; } - + m_lastline = 0; m_rasterline = 0; - + memset(m_shift, 0, ARRAY_LENGTH(m_shift)); memset(m_multi_collision, 0, ARRAY_LENGTH(m_multi_collision)); memset(m_palette_red, 0, ARRAY_LENGTH(m_palette_red)); memset(m_palette_green, 0, ARRAY_LENGTH(m_palette_green)); memset(m_palette_blue, 0, ARRAY_LENGTH(m_palette_blue)); - + m_palette_dirty = 0; } @@ -535,7 +535,7 @@ void vic3_device::draw_sprite_code_multi( int y, int xbegin, int code, int prior if ((y < YPOS) || (y >= (VIC2_STARTVISIBLELINES + VIC2_VISIBLELINES)) || (xbegin <= 1) || (xbegin >= (VIC2_STARTVISIBLECOLUMNS + VIC2_VISIBLECOLUMNS))) return; - + for (x = 0, mask = 0xc0, shift = 6; x < 8; x += 2, mask >>= 2, shift -= 2) { if (code & mask) @@ -1499,7 +1499,7 @@ WRITE8_MEMBER( vic3_device::port_w ) break; case 0x30: m_reg[offset] = data; - if (!m_port_changed.isnull()) + if (!m_port_changed.isnull()) { DBG_LOG(2, "vic write", ("%.2x:%.2x\n", offset, data)); m_reg[offset] = data; @@ -2058,5 +2058,3 @@ UINT32 vic3_device::video_update( bitmap_ind16 &bitmap, const rectangle &cliprec copybitmap(bitmap, *m_bitmap, 0, 0, 0, 0, cliprect); return 0; } - - diff --git a/src/mess/video/vic4567.h b/src/mess/video/vic4567.h index 67c0727d891..27187276fee 100644 --- a/src/mess/video/vic4567.h +++ b/src/mess/video/vic4567.h @@ -47,10 +47,10 @@ struct vic3_interface struct vic3_sprite { int x, y; - + int repeat; /* expand, line once drawn */ int line; /* 0 not painting, else painting */ - + /* buffer for currently painted line */ int paintedline[8]; UINT8 bitmap[8][SPRITE_BASE_X_SIZE * 2 / 8 + 1 /*for simplier sprite collision detection*/]; @@ -151,7 +151,7 @@ public: DECLARE_WRITE8_MEMBER(port_w); DECLARE_WRITE8_MEMBER(palette_w); DECLARE_READ8_MEMBER(port_r); - + void raster_interrupt_gen(); UINT32 video_update(bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -184,62 +184,62 @@ private: void draw_bitplanes(); TIMER_CALLBACK_MEMBER(timer_timeout); - + vic3_type m_type; - + screen_device *m_main_screen; // screen which sets bitmap properties - + device_t *m_cpu; - + UINT8 m_reg[0x80]; int m_on; /* rastering of the screen */ - + int m_lines; - + UINT16 m_chargenaddr, m_videoaddr, m_bitmapaddr; - + bitmap_ind16 *m_bitmap; int m_x_begin, m_x_end; int m_y_begin, m_y_end; - + UINT16 m_c64_bitmap[2], m_bitmapmulti[4], m_mono[2], m_multi[4], m_ecmcolor[2], m_colors[4], m_spritemulti[4]; - + int m_lastline, m_rasterline; - + int m_interlace; int m_columns, m_rows; - + /* background/foreground for sprite collision */ UINT8 *m_screen[216], m_shift[216]; - + /* convert multicolor byte to background/foreground for sprite collision */ UINT8 m_foreground[256]; UINT16 m_expandx[256]; UINT16 m_expandx_multi[256]; - + /* converts sprite multicolor info to info for background collision checking */ UINT8 m_multi_collision[256]; - + vic3_sprite m_sprites[8]; - + /* DMA */ devcb_resolved_read8 m_dma_read; devcb_resolved_read8 m_dma_read_color; - + /* IRQ */ devcb_resolved_write_line m_interrupt; - + /* Port Changed */ devcb_resolved_write8 m_port_changed; - + /* lightpen */ devcb_resolved_read8 m_lightpen_button_cb; devcb_resolved_read8 m_lightpen_x_cb; devcb_resolved_read8 m_lightpen_y_cb; - + /* C64 memory access */ devcb_resolved_read8 m_c64_mem_r; - + /* palette - vic3 specific items (the ones above are used for VIC II as well) */ UINT8 m_palette_red[0x100]; UINT8 m_palette_green[0x100]; diff --git a/src/mess/video/vtvideo.c b/src/mess/video/vtvideo.c index 61647564972..cf20bdc7052 100644 --- a/src/mess/video/vtvideo.c +++ b/src/mess/video/vtvideo.c @@ -56,7 +56,7 @@ void vt100_video_device::device_config_complete() const vt_video_interface *intf = reinterpret_cast<const vt_video_interface *>(static_config()); if (intf != NULL) *static_cast<vt_video_interface *>(this) = *intf; - + // or initialize to defaults if none provided else { @@ -76,18 +76,18 @@ void vt100_video_device::device_start() /* resolve callbacks */ m_in_ram_func.resolve(m_in_ram_cb, *this); m_clear_video_interrupt.resolve(m_clear_video_cb, *this); - + /* get the screen device */ m_screen = machine().device<screen_device>(m_screen_tag); assert(m_screen != NULL); - + m_gfx = machine().root_device().memregion(m_char_rom_tag)->base(); assert(m_gfx != NULL); - + // LBA7 is scan line frequency update machine().scheduler().timer_pulse(attotime::from_nsec(31778), timer_expired_delegate(FUNC(vt100_video_device::lba7_change),this)); - + save_item(NAME(m_lba7)); save_item(NAME(m_scroll_latch)); save_item(NAME(m_blink_flip_flop)); @@ -108,15 +108,15 @@ void vt100_video_device::device_reset() { palette_set_color_rgb(machine(), 0, 0x00, 0x00, 0x00); // black palette_set_color_rgb(machine(), 1, 0xff, 0xff, 0xff); // white - + m_height = 25; m_lba7 = 0; - + m_scroll_latch = 0; m_blink_flip_flop = 0; m_reverse_field = 0; m_basic_attribute = 0; - + m_columns = 80; m_frequency = 60; m_interlaced = 1; @@ -151,22 +151,22 @@ READ8_MEMBER( vt100_video_device::lba7_r ) WRITE8_MEMBER( vt100_video_device::dc012_w ) { - if (!(data & 0x08)) + if (!(data & 0x08)) { - if (!(data & 0x04)) + if (!(data & 0x04)) { // set lower part scroll m_scroll_latch = (m_scroll_latch & 0x0c) | (data & 0x03); - } - else + } + else { // set higher part scroll m_scroll_latch = (m_scroll_latch & 0x03) | ((data & 0x03) << 2); } - } - else + } + else { - switch (data & 0x0f) + switch (data & 0x0f) { case 0x08: // toggle blink flip flop @@ -206,31 +206,31 @@ WRITE8_MEMBER( vt100_video_device::dc012_w ) WRITE8_MEMBER( vt100_video_device::dc011_w ) { - if (!BIT(data, 5)) + if (!BIT(data, 5)) { UINT8 col = m_columns; - if (!BIT(data, 4)) + if (!BIT(data, 4)) { m_columns = 80; - } - else + } + else { m_columns = 132; } - if (col != m_columns) + if (col != m_columns) { recompute_parameters(); } m_interlaced = 1; - } - else + } + else { - if (!BIT(data, 4)) + if (!BIT(data, 4)) { m_frequency = 60; m_skip_lines = 2; - } - else + } + else { m_frequency = 50; m_skip_lines = 5; @@ -252,7 +252,7 @@ void vt100_video_device::display_char(bitmap_ind16 &bitmap, UINT8 code, int x, i for (int i = 0; i < 10; i++) { - switch (display_type) + switch (display_type) { case 0 : // bottom half, double height j = (i >> 1) + 5; break; @@ -268,7 +268,7 @@ void vt100_video_device::display_char(bitmap_ind16 &bitmap, UINT8 code, int x, i line = m_gfx[(code & 0x7f) * 16 + j]; - if (m_basic_attribute == 1) + if (m_basic_attribute == 1) { if ((code & 0x80) == 0x80) invert = 1; @@ -280,26 +280,26 @@ void vt100_video_device::display_char(bitmap_ind16 &bitmap, UINT8 code, int x, i { prevbit = bit; bit = BIT((line << b), 7); - if (double_width) + if (double_width) { bitmap.pix16(y * 10 + i, x * 20 + b * 2) = (bit | prevbit) ^ invert; bitmap.pix16(y * 10 + i, x * 20 + b * 2 + 1) = bit ^ invert; - } - else + } + else { bitmap.pix16(y * 10 + i, x * 10 + b) = (bit | prevbit) ^ invert; } } prevbit = bit; // char interleave is filled with last bit - if (double_width) + if (double_width) { bitmap.pix16(y * 10 + i, x * 20 + 16) = (bit | prevbit) ^ invert; bitmap.pix16(y * 10 + i, x * 20 + 17) = bit ^ invert; bitmap.pix16(y * 10 + i, x * 20 + 18) = bit ^ invert; bitmap.pix16(y * 10 + i, x * 20 + 19) = bit ^ invert; - } - else + } + else { bitmap.pix16(y * 10 + i, x * 10 + 8) = (bit | prevbit) ^ invert; bitmap.pix16(y * 10 + i, x * 10 + 9) = bit ^ invert; @@ -319,16 +319,16 @@ void vt100_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &cli UINT8 display_type = 3; // binary 11 UINT16 temp = 0; - if (m_in_ram_func(0) != 0x7f) + if (m_in_ram_func(0) != 0x7f) return; - while (line < (m_height + m_skip_lines)) + while (line < (m_height + m_skip_lines)) { code = m_in_ram_func(addr + xpos); - if (code == 0x7f) + if (code == 0x7f) { // end of line, fill empty till end of line - if (line >= m_skip_lines) + if (line >= m_skip_lines) { for (x = xpos; x < ((display_type == 2) ? (m_columns / 2) : m_columns); x++) { @@ -342,22 +342,22 @@ void vt100_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &cli if (addr & 0x1000) addr &= 0xfff; else addr |= 0x2000; scroll_region = (temp >> 15) & 1; display_type = (temp >> 13) & 3; - if (line >= m_skip_lines) + if (line >= m_skip_lines) { ypos++; } xpos = 0; line++; - } - else + } + else { // display regular char - if (line >= m_skip_lines) + if (line >= m_skip_lines) { display_char(bitmap, code, xpos, ypos, scroll_region, display_type); } xpos++; - if (xpos > m_columns) + if (xpos > m_columns) { line++; xpos = 0; @@ -375,7 +375,7 @@ void rainbow_video_device::display_char(bitmap_ind16 &bitmap, UINT8 code, int x, for (int i = 0; i < 10; i++) { - switch (display_type) + switch (display_type) { case 0 : // bottom half, double height j = (i >> 1) + 5; break; @@ -390,9 +390,9 @@ void rainbow_video_device::display_char(bitmap_ind16 &bitmap, UINT8 code, int x, if (j == 0) j = 15; else j = j - 1; line = m_gfx[code * 16 + j]; - if (m_basic_attribute == 1) + if (m_basic_attribute == 1) { - if ((code & 0x80) == 0x80) + if ((code & 0x80) == 0x80) { line = line ^ 0xff; } @@ -401,25 +401,25 @@ void rainbow_video_device::display_char(bitmap_ind16 &bitmap, UINT8 code, int x, for (int b = 0; b < 8; b++) { bit = BIT((line << b), 7); - if (double_width) + if (double_width) { bitmap.pix16(y * 10 + i, x * 20 + b * 2) = bit; bitmap.pix16(y * 10 + i, x * 20 + b * 2 + 1) = bit; - } - else + } + else { bitmap.pix16(y * 10 + i, x * 10 + b) = bit; } } // char interleave is filled with last bit - if (double_width) + if (double_width) { bitmap.pix16(y * 10 + i, x * 20 + 16) = bit; bitmap.pix16(y * 10 + i, x * 20 + 17) = bit; bitmap.pix16(y * 10 + i, x * 20 + 18) = bit; bitmap.pix16(y * 10 + i, x * 20 + 19) = bit; - } - else + } + else { bitmap.pix16(y * 10 + i, x * 10 + 8) = bit; bitmap.pix16(y * 10 + i, x * 10 + 9) = bit; @@ -440,13 +440,13 @@ void rainbow_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &c UINT8 display_type = 3; // binary 11 UINT16 temp = 0; - while (line < (m_height + m_skip_lines)) + while (line < (m_height + m_skip_lines)) { code = m_in_ram_func(addr + xpos); - if (code == 0xff) + if (code == 0xff) { // end of line, fill empty till end of line - if (line >= m_skip_lines) + if (line >= m_skip_lines) { for (x = xpos; x < ((display_type == 2) ? (m_columns / 2) : m_columns); x++) { @@ -462,22 +462,22 @@ void rainbow_video_device::video_update(bitmap_ind16 &bitmap, const rectangle &c temp = m_in_ram_func(attr_addr); scroll_region = (temp) & 1; display_type = (temp>> 1) & 3; - if (line >= m_skip_lines) + if (line >= m_skip_lines) { ypos++; } xpos = 0; line++; - } - else + } + else { // display regular char - if (line >= m_skip_lines) + if (line >= m_skip_lines) { display_char(bitmap, code, xpos, ypos, scroll_region, display_type); } xpos++; - if (xpos > m_columns) + if (xpos > m_columns) { line++; xpos = 0; diff --git a/src/mess/video/vtvideo.h b/src/mess/video/vtvideo.h index 8c7b1323058..956a84d175b 100644 --- a/src/mess/video/vtvideo.h +++ b/src/mess/video/vtvideo.h @@ -19,7 +19,7 @@ struct vt_video_interface { const char *m_screen_tag; /* screen we are acting on */ const char *m_char_rom_tag; /* character rom region */ - + /* this gets called for every memory read */ devcb_read8 m_in_ram_cb; devcb_write8 m_clear_video_cb; @@ -54,12 +54,12 @@ protected: devcb_resolved_read8 m_in_ram_func; devcb_resolved_write8 m_clear_video_interrupt; - + screen_device *m_screen; /* screen */ UINT8 *m_gfx; /* content of char rom */ - + int m_lba7; - + // dc012 attributes UINT8 m_scroll_latch; UINT8 m_blink_flip_flop; |
