diff --git a/src/mess/drivers/abc1600.c b/src/mess/drivers/abc1600.c index 21a85ff3a1d..07d037cc420 100644 --- a/src/mess/drivers/abc1600.c +++ b/src/mess/drivers/abc1600.c @@ -1851,14 +1851,16 @@ void abc1600_state::machine_start() // interrupt callback m_maincpu->set_irq_acknowledge_callback(abc1600_int_ack); + // allocate memory + m_segment_ram.allocate(0x400); + m_page_ram.allocate(0x400); + // HACK fill segment RAM with non-zero values or no boot memset(m_segment_ram, 0xcd, 0x400); // state saving save_item(NAME(m_ifc2)); save_item(NAME(m_task)); - save_item(NAME(m_segment_ram)); - save_item(NAME(m_page_ram)); save_item(NAME(m_dmamap)); save_item(NAME(m_dmadis)); save_item(NAME(m_sysscc)); diff --git a/src/mess/drivers/mpz80.c b/src/mess/drivers/mpz80.c index eba9ef5c0fe..2329b323c5a 100644 --- a/src/mess/drivers/mpz80.c +++ b/src/mess/drivers/mpz80.c @@ -706,7 +706,7 @@ SLOT_INTERFACE_END void mpz80_state::machine_start() { - m_map_ram = auto_alloc_array_clear(machine(), UINT8, 0x200); + m_map_ram.allocate(0x200); } diff --git a/src/mess/drivers/pc1512.c b/src/mess/drivers/pc1512.c index 9b9da408e5a..4cba8f670c2 100644 --- a/src/mess/drivers/pc1512.c +++ b/src/mess/drivers/pc1512.c @@ -1002,19 +1002,6 @@ void pc1512_state::update_fdc_drq() m_dmac->dreq2_w(0); } -static const floppy_interface floppy_intf = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - FLOPPY_STANDARD_5_25_DSDD, - LEGACY_FLOPPY_OPTIONS_NAME(pc), - "floppy_5_25", - NULL -}; - WRITE_LINE_MEMBER( pc1512_state::fdc_int_w ) { m_dint = state; diff --git a/src/mess/drivers/tiki100.c b/src/mess/drivers/tiki100.c index e39d11debbb..01d5159810a 100644 --- a/src/mess/drivers/tiki100.c +++ b/src/mess/drivers/tiki100.c @@ -374,8 +374,9 @@ INPUT_PORTS_END /* Video */ -UINT32 tiki100_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 tiki100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { + const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); UINT16 addr = (m_scroll << 7); int sx, y, pixel, mode = (m_mode >> 4) & 0x03; @@ -392,7 +393,7 @@ UINT32 tiki100_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, { int x = (sx * 8) + pixel; - bitmap.pix16(y, x) = 0; + bitmap.pix32(y, x) = palette[0]; } break; @@ -402,7 +403,7 @@ UINT32 tiki100_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, int x = (sx * 8) + pixel; int color = BIT(data, 0); - bitmap.pix16(y, x) = color; + bitmap.pix32(y, x) = palette[color]; data >>= 1; } @@ -414,8 +415,8 @@ UINT32 tiki100_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, int x = (sx * 8) + (pixel * 2); int color = data & 0x03; - bitmap.pix16(y, x) = color; - bitmap.pix16(y, x + 1) = color; + bitmap.pix32(y, x) = palette[color]; + bitmap.pix32(y, x + 1) = palette[color]; data >>= 2; } @@ -427,10 +428,10 @@ UINT32 tiki100_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, int x = (sx * 8) + (pixel * 4); int color = data & 0x0f; - bitmap.pix16(y, x) = color; - bitmap.pix16(y, x + 1) = color; - bitmap.pix16(y, x + 2) = color; - bitmap.pix16(y, x + 3) = color; + bitmap.pix32(y, x) = palette[color]; + bitmap.pix32(y, x + 1) = palette[color]; + bitmap.pix32(y, x + 2) = palette[color]; + bitmap.pix32(y, x + 3) = palette[color]; data >>= 4; } @@ -546,7 +547,7 @@ static const z80_daisy_config tiki100_daisy_chain[] = void tiki100_state::machine_start() { /* allocate video RAM */ - m_video_ram = auto_alloc_array(machine(), UINT8, TIKI100_VIDEORAM_SIZE); + m_video_ram.allocate(TIKI100_VIDEORAM_SIZE); /* setup memory banking */ UINT8 *ram = m_ram->pointer(); @@ -565,7 +566,6 @@ void tiki100_state::machine_start() /* register for state saving */ save_item(NAME(m_rome)); save_item(NAME(m_vire)); - save_pointer(NAME(m_video_ram), TIKI100_VIDEORAM_SIZE); save_item(NAME(m_scroll)); save_item(NAME(m_mode)); save_item(NAME(m_palette)); @@ -641,5 +641,5 @@ ROM_END /* System Drivers */ /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ -COMP( 1984, kontiki, 0, 0, tiki100, tiki100, driver_device, 0, "Kontiki Data A/S", "KONTIKI 100", GAME_SUPPORTS_SAVE ) -COMP( 1984, tiki100, kontiki, 0, tiki100, tiki100, driver_device, 0, "Tiki Data A/S", "TIKI 100", GAME_SUPPORTS_SAVE ) +COMP( 1984, kontiki, 0, 0, tiki100, tiki100, driver_device, 0, "Kontiki Data A/S", "KONTIKI 100", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +COMP( 1984, tiki100, kontiki, 0, tiki100, tiki100, driver_device, 0, "Tiki Data A/S", "TIKI 100", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c index 8fab8d20a8b..a025384f6b5 100644 --- a/src/mess/drivers/trs80m2.c +++ b/src/mess/drivers/trs80m2.c @@ -629,7 +629,7 @@ void trs80m2_state::video_start() m_char_rom = memregion(MC6845_TAG)->base(); // allocate memory - m_video_ram = auto_alloc_array(machine(), UINT8, 0x800); + m_video_ram.allocate(0x800); } UINT32 trs80m2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) diff --git a/src/mess/drivers/xor100.c b/src/mess/drivers/xor100.c index 3c47790bf4b..dd58fed5417 100644 --- a/src/mess/drivers/xor100.c +++ b/src/mess/drivers/xor100.c @@ -159,6 +159,16 @@ WRITE8_MEMBER( xor100_state::i8251_b_data_w ) m_terminal->write(space, 0, data); } +READ8_MEMBER( xor100_state::fdc_r ) +{ + return m_fdc->gen_r(offset) ^ 0xff; +} + +WRITE8_MEMBER( xor100_state::fdc_w ) +{ + m_fdc->gen_w(offset, data ^ 0xff); +} + READ8_MEMBER( xor100_state::fdc_wait_r ) { /* @@ -178,8 +188,8 @@ READ8_MEMBER( xor100_state::fdc_wait_r ) if (!m_fdc_irq && !m_fdc_drq) { - /* TODO: this is really connected to the Z80 _RDY line */ - m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + fatalerror("Z80 WAIT not supported by MAME core\n"); + m_maincpu->set_input_line(Z80_INPUT_LINE_WAIT, ASSERT_LINE); } return !m_fdc_irq << 7; @@ -263,7 +273,7 @@ static ADDRESS_MAP_START( xor100_io, AS_IO, 8, xor100_state ) AM_RANGE(0x0a, 0x0a) AM_READ(prom_disable_r) AM_RANGE(0x0b, 0x0b) AM_READ_PORT("DSW0") AM_WRITE(baud_w) AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write) - AM_RANGE(0xf8, 0xfb) AM_DEVREADWRITE(WD1795_TAG, fd1795_t, read, write) // TODO inverted data bus + AM_RANGE(0xf8, 0xfb) AM_READWRITE(fdc_r, fdc_w) AM_RANGE(0xfc, 0xfc) AM_READWRITE(fdc_wait_r, fdc_dcont_w) AM_RANGE(0xfd, 0xfd) AM_WRITE(fdc_dsel_w) ADDRESS_MAP_END @@ -484,8 +494,8 @@ void xor100_state::fdc_intrq_w(bool state) if (state) { - /* TODO: this is really connected to the Z80 _RDY line */ - m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + fatalerror("Z80 WAIT not supported by MAME core\n"); + m_maincpu->set_input_line(Z80_INPUT_LINE_WAIT, ASSERT_LINE); } } @@ -495,8 +505,8 @@ void xor100_state::fdc_drq_w(bool state) if (state) { - /* TODO: this is really connected to the Z80 _RDY line */ - m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + fatalerror("Z80 WAIT not supported by MAME core\n"); + m_maincpu->set_input_line(Z80_INPUT_LINE_WAIT, ASSERT_LINE); } } diff --git a/src/mess/includes/abc1600.h b/src/mess/includes/abc1600.h index 04cddb7032d..b5296b51e37 100644 --- a/src/mess/includes/abc1600.h +++ b/src/mess/includes/abc1600.h @@ -73,7 +73,10 @@ public: m_bus0i(*this, BUS0I_TAG), m_bus0x(*this, BUS0X_TAG), m_bus1(*this, BUS1_TAG), - m_bus2(*this, BUS2_TAG) + m_bus2(*this, BUS2_TAG), + m_segment_ram(*this, "segment_ram"), + m_page_ram(*this, "page_ram"), + m_video_ram(*this, "video_ram") { } required_device m_maincpu; @@ -93,6 +96,9 @@ public: required_device m_bus0x; required_device m_bus1; required_device m_bus2; + optional_shared_ptr m_segment_ram; + optional_shared_ptr m_page_ram; + optional_shared_ptr m_video_ram; virtual void machine_start(); virtual void machine_reset(); @@ -196,8 +202,6 @@ public: // memory access controller int m_ifc2; UINT8 m_task; - UINT8 m_segment_ram[0x400]; - UINT16 m_page_ram[0x400]; // DMA UINT8 m_dmamap[8]; @@ -218,7 +222,6 @@ public: const UINT8 *m_wrmsk_rom; // write mask ROM const UINT8 *m_shinf_rom; // shifter info ROM const UINT8 *m_drmsk_rom; // data read mask ROM - UINT16 *m_video_ram; // video RAM int m_endisp; // enable display int m_clocks_disabled; // clocks disabled UINT16 m_gmdi; // video RAM data latch @@ -244,7 +247,6 @@ public: int m_rmc; // row match count int m_cmc; // column match count int m_amm; // active mover mask - UINT32 screen_update_abc1600(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mess/includes/abc80.h b/src/mess/includes/abc80.h index 0cb162e4b2a..8c8f0b8bf4d 100644 --- a/src/mess/includes/abc80.h +++ b/src/mess/includes/abc80.h @@ -71,6 +71,7 @@ public: m_kb(*this, ABC80_KEYBOARD_TAG), m_ram(*this, RAM_TAG), m_rs232(*this, RS232_TAG), + m_video_ram(*this, "video_ram"), m_tape_in(1), m_tape_in_latch(1) { } @@ -83,6 +84,7 @@ public: required_device m_kb; required_device m_ram; required_device m_rs232; + optional_shared_ptr m_video_ram; enum { @@ -123,7 +125,6 @@ public: int m_pio_astb; // video state - UINT8 *m_video_ram; UINT8 m_latch; int m_blink; diff --git a/src/mess/includes/mikromik.h b/src/mess/includes/mikromik.h index 839b10a9a61..0aae038acd0 100644 --- a/src/mess/includes/mikromik.h +++ b/src/mess/includes/mikromik.h @@ -61,12 +61,11 @@ public: required_device m_ram; required_shared_ptr m_video_ram; - virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( mmu_r ); DECLARE_WRITE8_MEMBER( mmu_w ); @@ -102,7 +101,7 @@ public: const UINT8 *m_key_rom; // video state - bitmap_ind16 m_bitmap; + bitmap_rgb32 m_bitmap; const UINT8 *m_char_rom; int m_llen; @@ -116,7 +115,7 @@ public: int m_recall; int m_dack3; int m_tc; - UINT32 screen_update_mm1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_mm1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(kbclk_tick); DECLARE_FLOPPY_FORMATS( floppy_formats ); }; diff --git a/src/mess/includes/mpz80.h b/src/mess/includes/mpz80.h index 59924b62563..e41455bc74c 100644 --- a/src/mess/includes/mpz80.h +++ b/src/mess/includes/mpz80.h @@ -27,6 +27,7 @@ public: m_ram(*this, RAM_TAG), m_terminal(*this, TERMINAL_TAG), m_s100(*this, S100_TAG), + m_map_ram(*this, "map_ram"), m_nmi(1), m_pint(1), m_int_pend(0), @@ -44,6 +45,7 @@ public: required_device m_ram; required_device m_terminal; required_device m_s100; + optional_shared_ptr m_map_ram; virtual void machine_start(); virtual void machine_reset(); @@ -94,7 +96,6 @@ public: int m_trap_int; int m_trap_stop; int m_trap_aux; - UINT8 *m_map_ram; DECLARE_DRIVER_INIT(mpz80); }; diff --git a/src/mess/includes/pc1512.h b/src/mess/includes/pc1512.h index 86e4831debb..7d6264ae089 100644 --- a/src/mess/includes/pc1512.h +++ b/src/mess/includes/pc1512.h @@ -8,8 +8,6 @@ #include "cpu/i86/i86.h" #include "cpu/mcs48/mcs48.h" #include "formats/pc_dsk.h" -#include "formats/mfi_dsk.h" -#include "imagedev/flopdrv.h" #include "machine/am9517a.h" #include "machine/ctronics.h" #include "machine/ins8250.h" @@ -59,6 +57,7 @@ public: m_floppy0(*this, PC_FDC_XT_TAG ":0:525dd" ), m_floppy1(*this, PC_FDC_XT_TAG ":1:525dd" ), m_bus(*this, ISA_BUS_TAG), + m_video_ram(*this, "video_ram"), m_pit1(0), m_pit2(0), m_status1(0), @@ -94,6 +93,7 @@ public: required_device m_floppy0; optional_device m_floppy1; required_device m_bus; + optional_shared_ptr m_video_ram; virtual void machine_start(); virtual void machine_reset(); @@ -196,8 +196,7 @@ public: UINT8 m_printer_control; // video state - UINT8 *m_video_ram; - UINT8 *m_char_rom; + const UINT8 *m_char_rom; int m_toggle; int m_lpen; int m_blink; diff --git a/src/mess/includes/prof80.h b/src/mess/includes/prof80.h index ee34debbc3a..396085a9fec 100644 --- a/src/mess/includes/prof80.h +++ b/src/mess/includes/prof80.h @@ -7,7 +7,6 @@ #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/z80/z80daisy.h" -#include "imagedev/flopdrv.h" #include "machine/ecbbus.h" #include "machine/ecb_grip.h" #include "machine/ram.h" @@ -18,7 +17,6 @@ #define Z80_TAG "z1" #define UPD765_TAG "z38" #define UPD1990A_TAG "z43" -#define SCREEN_TAG "screen" // ------------------------------------------------------------------------ diff --git a/src/mess/includes/tiki100.h b/src/mess/includes/tiki100.h index 170022db235..a088e3f570a 100644 --- a/src/mess/includes/tiki100.h +++ b/src/mess/includes/tiki100.h @@ -40,7 +40,8 @@ public: m_fdc(*this, FD1797_TAG), m_ram(*this, RAM_TAG), m_floppy0(*this, FD1797_TAG":0"), - m_floppy1(*this, FD1797_TAG":1") + m_floppy1(*this, FD1797_TAG":1"), + m_video_ram(*this, "video_ram") { } required_device m_maincpu; @@ -49,10 +50,11 @@ public: required_device m_ram; required_device m_floppy0; required_device m_floppy1; + optional_shared_ptr m_video_ram; virtual void machine_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( gfxram_r ); DECLARE_WRITE8_MEMBER( gfxram_w ); @@ -72,7 +74,6 @@ public: int m_vire; /* video state */ - UINT8 *m_video_ram; UINT8 m_scroll; UINT8 m_mode; UINT8 m_palette; diff --git a/src/mess/includes/tmc600.h b/src/mess/includes/tmc600.h index 658e8bf447f..4f15dccd04d 100644 --- a/src/mess/includes/tmc600.h +++ b/src/mess/includes/tmc600.h @@ -31,13 +31,16 @@ public: m_vis(*this, CDP1869_TAG), m_cassette(*this, CASSETTE_TAG), m_ram(*this, RAM_TAG), - m_page_ram(*this, "page_ram") + m_page_ram(*this, "page_ram"), + m_color_ram(*this, "color_ram") { } required_device m_maincpu; required_device m_vis; required_device m_cassette; required_device m_ram; + required_shared_ptr m_page_ram; + optional_shared_ptr m_color_ram; virtual void machine_start(); @@ -60,9 +63,7 @@ public: int m_vismac_bkg_latch; // background color latch int m_blink; // cursor blink - required_shared_ptr m_page_ram; // page memory - UINT8 *m_color_ram; // color memory - UINT8 *m_char_rom; // character generator ROM + const UINT8 *m_char_rom; // keyboard state int m_keylatch; // key latch diff --git a/src/mess/includes/trs80m2.h b/src/mess/includes/trs80m2.h index c5c7b44c105..acd8ea71f1b 100644 --- a/src/mess/includes/trs80m2.h +++ b/src/mess/includes/trs80m2.h @@ -51,7 +51,8 @@ public: m_floppy3(*this, FD1791_TAG":3"), m_floppy(NULL), m_ram(*this, RAM_TAG), - m_kb(*this, TRS80M2_KEYBOARD_TAG) + m_kb(*this, TRS80M2_KEYBOARD_TAG), + m_video_ram(*this, "video_ram") { } required_device m_maincpu; @@ -68,6 +69,7 @@ public: floppy_image_device *m_floppy; required_device m_ram; required_device m_kb; + optional_shared_ptr m_video_ram; virtual void machine_start(); virtual void machine_reset(); @@ -114,8 +116,7 @@ public: int m_kbirq; // video state - UINT8 *m_video_ram; - UINT8 *m_char_rom; + const UINT8 *m_char_rom; int m_blnkvid; int m_80_40_char_en; int m_de; diff --git a/src/mess/includes/v1050.h b/src/mess/includes/v1050.h index d582a31d142..083521524be 100644 --- a/src/mess/includes/v1050.h +++ b/src/mess/includes/v1050.h @@ -78,7 +78,8 @@ public: m_timer_ack(*this, TIMER_ACK_TAG), m_timer_rst(*this, TIMER_RST_TAG), m_sasibus(*this, SASIBUS_TAG ":host"), - m_video_ram(*this, "video_ram") + m_video_ram(*this, "video_ram"), + m_attr_ram(*this, "attr_ram") { } required_device m_maincpu; @@ -99,6 +100,8 @@ public: required_device m_timer_ack; required_device m_timer_rst; required_device m_sasibus; + required_shared_ptr m_video_ram; + optional_shared_ptr m_attr_ram; virtual void machine_start(); virtual void machine_reset(); @@ -164,8 +167,6 @@ public: UINT8 m_bank; // bank register // video state - required_shared_ptr m_video_ram; // video RAM - UINT8 *m_attr_ram; // attribute RAM UINT8 m_attr; // attribute latch // sasi state diff --git a/src/mess/includes/xor100.h b/src/mess/includes/xor100.h index 6e382ded43d..764762f737a 100644 --- a/src/mess/includes/xor100.h +++ b/src/mess/includes/xor100.h @@ -69,6 +69,8 @@ public: DECLARE_READ8_MEMBER( prom_disable_r ); DECLARE_WRITE8_MEMBER( baud_w ); DECLARE_WRITE8_MEMBER( i8251_b_data_w ); + DECLARE_READ8_MEMBER( fdc_r ); + DECLARE_WRITE8_MEMBER( fdc_w ); DECLARE_READ8_MEMBER( fdc_wait_r ); DECLARE_WRITE8_MEMBER( fdc_dcont_w ); DECLARE_WRITE8_MEMBER( fdc_dsel_w ); diff --git a/src/mess/machine/64h156.c b/src/mess/machine/64h156.c index 289358a4a0f..09169c5bbba 100644 --- a/src/mess/machine/64h156.c +++ b/src/mess/machine/64h156.c @@ -388,8 +388,9 @@ c64h156_device::c64h156_device(const machine_config &mconfig, const char *tag, d device_execute_interface(mconfig, *this), m_icount(0), m_image(*this->owner(), FLOPPY_0), + m_track_buffer(*this, "track_buffer"), + m_speed_buffer(*this, "speed_buffer"), m_side(0), - m_track_buffer(NULL), m_track_len(0), m_buffer_pos(0), m_bit_pos(0), @@ -429,8 +430,8 @@ void c64h156_device::device_start() m_icountptr = &m_icount; // allocate track buffer - m_track_buffer = auto_alloc_array(machine(), UINT8, G64_BUFFER_SIZE); - m_speed_buffer = auto_alloc_array(machine(), UINT8, G64_SPEED_BLOCK_SIZE); + m_track_buffer.allocate(G64_BUFFER_SIZE); + m_speed_buffer.allocate(G64_SPEED_BLOCK_SIZE); // resolve callbacks m_out_atn_func.resolve(m_out_atn_cb, *this); @@ -440,8 +441,6 @@ void c64h156_device::device_start() // register for state saving save_item(NAME(m_shift)); save_item(NAME(m_side)); - save_pointer(NAME(m_track_buffer), G64_BUFFER_SIZE); - save_pointer(NAME(m_speed_buffer), G64_SPEED_BLOCK_SIZE); save_item(NAME(m_track_len)); save_item(NAME(m_buffer_pos)); save_item(NAME(m_bit_pos)); diff --git a/src/mess/machine/64h156.h b/src/mess/machine/64h156.h index 8ecdd37836b..d403b86b2b4 100644 --- a/src/mess/machine/64h156.h +++ b/src/mess/machine/64h156.h @@ -145,12 +145,12 @@ private: devcb_resolved_write_line m_out_byte_func; required_device m_image; + optional_shared_ptr m_track_buffer; // track data buffer + optional_shared_ptr m_speed_buffer; // speed block buffer // track UINT16 m_shift; int m_side; // disk side - UINT8 *m_track_buffer; // track data buffer - UINT8 *m_speed_buffer; // speed block buffer int m_track_len; // track length offs_t m_buffer_pos; // current byte position within track buffer int m_bit_pos; // current bit position within track buffer byte diff --git a/src/mess/machine/adam_fdc.c b/src/mess/machine/adam_fdc.c index cbbb5a4ce79..b9ce14608bb 100644 --- a/src/mess/machine/adam_fdc.c +++ b/src/mess/machine/adam_fdc.c @@ -174,12 +174,13 @@ ioport_constructor adam_fdc_device::device_input_ports() const adam_fdc_device::adam_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, ADAM_FDC, "Adam FDC", tag, owner, clock), - device_adamnet_card_interface(mconfig, *this), - m_maincpu(*this, M6801_TAG), - m_fdc(*this, WD2793_TAG), - m_floppy0(*this, WD2793_TAG":0"), - m_ram(*this, "ram"), - m_image0(NULL) + device_adamnet_card_interface(mconfig, *this), + m_maincpu(*this, M6801_TAG), + m_fdc(*this, WD2793_TAG), + m_floppy0(*this, WD2793_TAG":0"), + m_floppy(NULL), + m_ram(*this, "ram"), + m_sw3(*this, "SW3") { } @@ -190,7 +191,7 @@ adam_fdc_device::adam_fdc_device(const machine_config &mconfig, const char *tag, void adam_fdc_device::device_start() { - m_fdc->setup_intrq_cb(wd2793_t::line_cb(FUNC(adam_fdc_device::fdc_intrq_w), this)); + m_fdc->setup_intrq_cb(wd_fdc_t::line_cb(FUNC(adam_fdc_device::fdc_intrq_w), this)); } @@ -236,7 +237,7 @@ READ8_MEMBER( adam_fdc_device::p1_r ) data |= m_fdc->drq_r() ? 0x04 : 0x00; // drive select - data |= ioport("SW3")->read() << 7; + data |= m_sw3->read() << 7; return data; } @@ -270,17 +271,17 @@ WRITE8_MEMBER( adam_fdc_device::p1_w ) m_fdc->dden_w(BIT(data, 3)); // drive select - m_image0 = NULL; + m_floppy = NULL; if (BIT(data, 5)) { - m_image0 = m_floppy0->get_device(); + m_floppy = m_floppy0->get_device(); } - m_fdc->set_floppy(m_image0); + m_fdc->set_floppy(m_floppy); // motor enable - if (m_image0) m_image0->mon_w(!BIT(data, 6)); + if (m_floppy) m_floppy->mon_w(!BIT(data, 6)); } diff --git a/src/mess/machine/adam_fdc.h b/src/mess/machine/adam_fdc.h index 838d604b8b3..9ea79f41847 100644 --- a/src/mess/machine/adam_fdc.h +++ b/src/mess/machine/adam_fdc.h @@ -15,9 +15,6 @@ #include "emu.h" #include "cpu/m6800/m6800.h" #include "formats/adam_dsk.h" -#include "formats/hxcmfm_dsk.h" -#include "formats/mfi_dsk.h" -#include "imagedev/floppy.h" #include "machine/adamnet.h" #include "machine/wd_fdc.h" @@ -62,9 +59,9 @@ protected: required_device m_maincpu; required_device m_fdc; required_device m_floppy0; + floppy_image_device *m_floppy; required_shared_ptr m_ram; - - floppy_image_device *m_image0; + required_ioport m_sw3; }; diff --git a/src/mess/machine/cbmipt.c b/src/mess/machine/cbmipt.c index d1199887609..17e634dbe29 100644 --- a/src/mess/machine/cbmipt.c +++ b/src/mess/machine/cbmipt.c @@ -1047,6 +1047,7 @@ SLOT_INTERFACE_START( cbm_iec_devices ) SLOT_INTERFACE("c1581", C1581) SLOT_INTERFACE("cmdhd", CMD_HD) SLOT_INTERFACE("fd2000", FD2000) + SLOT_INTERFACE("fd4000", FD4000) SLOT_INTERFACE("interpod", INTERPOD) SLOT_INTERFACE("minichief", MINI_CHIEF) SLOT_INTERFACE("serialbox", SERIAL_BOX) diff --git a/src/mess/machine/comx_fd.c b/src/mess/machine/comx_fd.c index 709bf99275b..fc685900004 100644 --- a/src/mess/machine/comx_fd.c +++ b/src/mess/machine/comx_fd.c @@ -163,8 +163,8 @@ void comx_fd_device::device_start() m_rom = memregion("c000")->base(); // initialize floppy controller - m_fdc->setup_intrq_cb(wd1770_t::line_cb(FUNC(comx_fd_device::intrq_w), this)); - m_fdc->setup_drq_cb(wd1770_t::line_cb(FUNC(comx_fd_device::drq_w), this)); + m_fdc->setup_intrq_cb(wd_fdc_t::line_cb(FUNC(comx_fd_device::intrq_w), this)); + m_fdc->setup_drq_cb(wd_fdc_t::line_cb(FUNC(comx_fd_device::drq_w), this)); m_fdc->dden_w(1); // state saving diff --git a/src/mess/machine/comx_ram.c b/src/mess/machine/comx_ram.c index 681f45856e1..902a05d8e70 100644 --- a/src/mess/machine/comx_ram.c +++ b/src/mess/machine/comx_ram.c @@ -36,7 +36,8 @@ const device_type COMX_RAM = &device_creator; comx_ram_device::comx_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, COMX_RAM, "COMX-35 RAM Card", tag, owner, clock), - device_comx_expansion_card_interface(mconfig, *this) + device_comx_expansion_card_interface(mconfig, *this), + m_ram(*this, "ram") { } @@ -47,10 +48,7 @@ comx_ram_device::comx_ram_device(const machine_config &mconfig, const char *tag, void comx_ram_device::device_start() { - m_ram = auto_alloc_array(machine(), UINT8, RAM_SIZE); - - // state saving - save_pointer(NAME(m_ram), RAM_SIZE); + m_ram.allocate(RAM_SIZE); } @@ -73,7 +71,7 @@ UINT8 comx_ram_device::comx_mrd_r(address_space &space, offs_t offset, int *extr if (offset >= 0xc000 && offset < 0xd000) { - data = m_ram[(m_ram_bank << 12) | (offset & 0xfff)]; + data = m_ram[(m_bank << 12) | (offset & 0xfff)]; } return data; @@ -88,7 +86,7 @@ void comx_ram_device::comx_mwr_w(address_space &space, offs_t offset, UINT8 data { if (offset >= 0xc000 && offset < 0xd000) { - m_ram[(m_ram_bank << 12) | (offset & 0xfff)] = data; + m_ram[(m_bank << 12) | (offset & 0xfff)] = data; } } @@ -101,6 +99,6 @@ void comx_ram_device::comx_io_w(address_space &space, offs_t offset, UINT8 data) { if (offset == 1) { - m_ram_bank = (data >> 4) & 0x03; + m_bank = (data >> 4) & 0x03; } } diff --git a/src/mess/machine/comx_ram.h b/src/mess/machine/comx_ram.h index f63c2521162..805677cb1c7 100644 --- a/src/mess/machine/comx_ram.h +++ b/src/mess/machine/comx_ram.h @@ -43,8 +43,9 @@ protected: virtual void comx_io_w(address_space &space, offs_t offset, UINT8 data); private: - UINT8 *m_ram; - int m_ram_bank; + optional_shared_ptr m_ram; + + int m_bank; }; diff --git a/src/mess/machine/wangpc_emb.c b/src/mess/machine/wangpc_emb.c index 0fdfdea3854..50f919f17dd 100644 --- a/src/mess/machine/wangpc_emb.c +++ b/src/mess/machine/wangpc_emb.c @@ -46,7 +46,8 @@ const device_type WANGPC_EMB = &device_creator; wangpc_emb_device::wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, WANGPC_EMB, "Wang PC-PM031-B", tag, owner, clock), - device_wangpcbus_card_interface(mconfig, *this) + device_wangpcbus_card_interface(mconfig, *this), + m_ram(*this, "ram") { } @@ -58,10 +59,9 @@ wangpc_emb_device::wangpc_emb_device(const machine_config &mconfig, const char * void wangpc_emb_device::device_start() { // allocate memory - m_ram = auto_alloc_array(machine(), UINT16, RAM_SIZE); + m_ram.allocate(RAM_SIZE); // state saving - save_pointer(NAME(m_ram), RAM_SIZE); save_item(NAME(m_option)); save_item(NAME(m_parity_error)); save_item(NAME(m_parity_odd)); diff --git a/src/mess/machine/wangpc_emb.h b/src/mess/machine/wangpc_emb.h index 855a55c37f1..ec52808ace5 100644 --- a/src/mess/machine/wangpc_emb.h +++ b/src/mess/machine/wangpc_emb.h @@ -44,7 +44,7 @@ protected: virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data); private: - UINT16 *m_ram; + optional_shared_ptr m_ram; UINT16 m_option; int m_parity_error; int m_parity_odd; diff --git a/src/mess/machine/wangpc_lvc.c b/src/mess/machine/wangpc_lvc.c index 2117687971e..a30f1863af0 100644 --- a/src/mess/machine/wangpc_lvc.c +++ b/src/mess/machine/wangpc_lvc.c @@ -189,6 +189,7 @@ wangpc_lvc_device::wangpc_lvc_device(const machine_config &mconfig, const char * device_t(mconfig, WANGPC_LVC, "Wang PC Low Resolution Video Card", tag, owner, clock), device_wangpcbus_card_interface(mconfig, *this), m_crtc(*this, MC6845_TAG), + m_video_ram(*this, "video_ram"), m_option(0), m_irq(CLEAR_LINE) { @@ -202,10 +203,9 @@ wangpc_lvc_device::wangpc_lvc_device(const machine_config &mconfig, const char * void wangpc_lvc_device::device_start() { // allocate memory - m_video_ram = auto_alloc_array(machine(), UINT16, RAM_SIZE); + m_video_ram.allocate(RAM_SIZE); // state saving - save_pointer(NAME(m_video_ram), RAM_SIZE); save_item(NAME(m_option)); save_item(NAME(m_scroll)); save_item(NAME(m_irq)); diff --git a/src/mess/machine/wangpc_lvc.h b/src/mess/machine/wangpc_lvc.h index 1625fac148a..5139b63f961 100644 --- a/src/mess/machine/wangpc_lvc.h +++ b/src/mess/machine/wangpc_lvc.h @@ -54,11 +54,10 @@ protected: private: inline void set_irq(int state); - // internal state required_device m_crtc; + optional_shared_ptr m_video_ram; rgb_t m_palette[16]; - UINT16 *m_video_ram; UINT8 m_option; UINT16 m_scroll; int m_irq; diff --git a/src/mess/machine/wangpc_mvc.c b/src/mess/machine/wangpc_mvc.c index f79baa6905f..67efa674f7e 100644 --- a/src/mess/machine/wangpc_mvc.c +++ b/src/mess/machine/wangpc_mvc.c @@ -209,6 +209,9 @@ wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char * device_t(mconfig, WANGPC_MVC, "Wang PC Medium Resolution Video Card", tag, owner, clock), device_wangpcbus_card_interface(mconfig, *this), m_crtc(*this, MC6845_TAG), + m_video_ram(*this, "video_ram"), + m_char_ram(*this, "char_ram"), + m_bitmap_ram(*this, "bitmap_ram"), m_option(0), m_irq(CLEAR_LINE) { @@ -222,14 +225,11 @@ wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char * void wangpc_mvc_device::device_start() { // allocate memory - m_video_ram = auto_alloc_array(machine(), UINT16, VIDEO_RAM_SIZE); - m_char_ram = auto_alloc_array(machine(), UINT16, CHAR_RAM_SIZE); - m_bitmap_ram = auto_alloc_array(machine(), UINT16, BITMAP_RAM_SIZE); + m_video_ram.allocate(VIDEO_RAM_SIZE); + m_char_ram.allocate(CHAR_RAM_SIZE); + m_bitmap_ram.allocate(BITMAP_RAM_SIZE); // state saving - save_pointer(NAME(m_video_ram), VIDEO_RAM_SIZE); - save_pointer(NAME(m_char_ram), CHAR_RAM_SIZE); - save_pointer(NAME(m_bitmap_ram), BITMAP_RAM_SIZE); save_item(NAME(m_option)); save_item(NAME(m_irq)); } diff --git a/src/mess/machine/wangpc_mvc.h b/src/mess/machine/wangpc_mvc.h index ea9d8cd372b..d63da459bb3 100644 --- a/src/mess/machine/wangpc_mvc.h +++ b/src/mess/machine/wangpc_mvc.h @@ -54,12 +54,11 @@ protected: private: inline void set_irq(int state); - // internal state required_device m_crtc; + optional_shared_ptr m_video_ram; + optional_shared_ptr m_char_ram; + optional_shared_ptr m_bitmap_ram; - UINT16 *m_video_ram; - UINT16 *m_char_ram; - UINT16 *m_bitmap_ram; UINT8 m_option; int m_irq; }; diff --git a/src/mess/machine/wangpc_rtc.c b/src/mess/machine/wangpc_rtc.c index 35ffa95f04b..bd017e00ad6 100644 --- a/src/mess/machine/wangpc_rtc.c +++ b/src/mess/machine/wangpc_rtc.c @@ -265,7 +265,8 @@ wangpc_rtc_device::wangpc_rtc_device(const machine_config &mconfig, const char * m_dmac(*this, AM9517A_TAG), m_ctc0(*this, Z80CTC_0_TAG), m_ctc1(*this, Z80CTC_1_TAG), - m_sio(*this, Z80SIO_TAG) + m_sio(*this, Z80SIO_TAG), + m_char_ram(*this, "char_ram") { } @@ -276,6 +277,7 @@ wangpc_rtc_device::wangpc_rtc_device(const machine_config &mconfig, const char * void wangpc_rtc_device::device_start() { + m_char_ram.allocate(0x100); } diff --git a/src/mess/machine/wangpc_rtc.h b/src/mess/machine/wangpc_rtc.h index 37f5bf24a6d..dc1dbe99867 100644 --- a/src/mess/machine/wangpc_rtc.h +++ b/src/mess/machine/wangpc_rtc.h @@ -58,8 +58,7 @@ private: required_device m_ctc0; required_device m_ctc1; required_device m_sio; - - UINT8 m_char_ram[256]; + optional_shared_ptr m_char_ram; }; diff --git a/src/mess/machine/wangpc_tig.c b/src/mess/machine/wangpc_tig.c index 03b5bea2b9e..a23ad133a00 100644 --- a/src/mess/machine/wangpc_tig.c +++ b/src/mess/machine/wangpc_tig.c @@ -206,7 +206,7 @@ void wangpc_tig_device::device_reset() // screen_update - //------------------------------------------------- -UINT32 wangpc_tig_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 wangpc_tig_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_hgdc0->screen_update(screen, bitmap, cliprect); m_hgdc1->screen_update(screen, bitmap, cliprect); diff --git a/src/mess/machine/wangpc_tig.h b/src/mess/machine/wangpc_tig.h index c091cff615b..b6e2fb80f12 100644 --- a/src/mess/machine/wangpc_tig.h +++ b/src/mess/machine/wangpc_tig.h @@ -35,7 +35,7 @@ public: // optional information overrides virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides diff --git a/src/mess/video/abc1600.c b/src/mess/video/abc1600.c index 6e95b7d0b99..59454bb9e95 100644 --- a/src/mess/video/abc1600.c +++ b/src/mess/video/abc1600.c @@ -1051,7 +1051,7 @@ static const mc6845_interface crtc_intf = void abc1600_state::video_start() { // allocate video RAM - m_video_ram = auto_alloc_array(machine(), UINT16, VIDEORAM_SIZE); + m_video_ram.allocate(VIDEORAM_SIZE); // find memory regions m_wrmsk_rom = memregion("wrmsk")->base(); @@ -1059,7 +1059,6 @@ void abc1600_state::video_start() m_drmsk_rom = memregion("drmsk")->base(); // state saving - save_pointer(NAME(m_video_ram), VIDEORAM_SIZE); save_item(NAME(m_endisp)); save_item(NAME(m_clocks_disabled)); save_item(NAME(m_gmdi)); diff --git a/src/mess/video/abc80.c b/src/mess/video/abc80.c index be7ede0f0cd..d00c2bf71ac 100644 --- a/src/mess/video/abc80.c +++ b/src/mess/video/abc80.c @@ -180,7 +180,7 @@ void abc80_state::video_start() m_vsync_on_timer->adjust(screen->time_until_pos(16, 0), 0, screen->frame_period()); // allocate memory - m_video_ram = auto_alloc_array(machine(), UINT8, 0x400); + m_video_ram.allocate(0x400); // find memory regions m_char_rom = memregion("chargen")->base(); diff --git a/src/mess/video/crtc_ega.h b/src/mess/video/crtc_ega.h index 0550a519758..a763f909c1d 100644 --- a/src/mess/video/crtc_ega.h +++ b/src/mess/video/crtc_ega.h @@ -8,7 +8,6 @@ #define __CRTC_EGA__ #include "emu.h" -#include "machine/devhelpr.h" #define CRTC_EGA_INTERFACE(name) \ const crtc_ega_interface (name) = diff --git a/src/mess/video/pc1512.c b/src/mess/video/pc1512.c index e394a281499..c19e92b8d02 100644 --- a/src/mess/video/pc1512.c +++ b/src/mess/video/pc1512.c @@ -551,7 +551,7 @@ void pc1512_state::video_start() m_char_rom = memregion(AMS40041_TAG)->base(); // allocate memory - m_video_ram = auto_alloc_array(machine(), UINT8, 0x10000); + m_video_ram.allocate(0x10000); } diff --git a/src/mess/video/pc1640.c b/src/mess/video/pc1640.c index a768c401bd5..578672ab35d 100644 --- a/src/mess/video/pc1640.c +++ b/src/mess/video/pc1640.c @@ -369,7 +369,7 @@ static const mc6845_interface crtc_intf = void pc1640_state::video_start() { // allocate memory - m_video_ram = auto_alloc_array(machine(), UINT8, 0x20000); + m_video_ram.allocate(0x20000); } diff --git a/src/mess/video/tmc600.c b/src/mess/video/tmc600.c index 4f3580fdfe7..991d786e080 100644 --- a/src/mess/video/tmc600.c +++ b/src/mess/video/tmc600.c @@ -110,14 +110,12 @@ static CDP1869_INTERFACE( vis_intf ) void tmc600_state::video_start() { // allocate memory - m_color_ram = auto_alloc_array(machine(), UINT8, TMC600_PAGE_RAM_SIZE); + m_color_ram.allocate(TMC600_PAGE_RAM_SIZE); // find memory regions m_char_rom = memregion("chargen")->base(); // register for state saving - save_pointer(NAME(m_color_ram), TMC600_PAGE_RAM_SIZE); - save_item(NAME(m_vismac_reg_latch)); save_item(NAME(m_vismac_color_latch)); save_item(NAME(m_vismac_bkg_latch)); diff --git a/src/mess/video/v1050.c b/src/mess/video/v1050.c index b1b8f9d1208..a68c4e8d71a 100644 --- a/src/mess/video/v1050.c +++ b/src/mess/video/v1050.c @@ -53,7 +53,6 @@ WRITE8_MEMBER( v1050_state::videoram_w ) static MC6845_UPDATE_ROW( v1050_update_row ) { v1050_state *state = device->machine().driver_data(); - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); int column, bit; @@ -80,7 +79,7 @@ static MC6845_UPDATE_ROW( v1050_update_row ) /* display blank */ if (attr & V1050_ATTR_BLANK) color = 0; - bitmap.pix32(y, x) = palette[color]; + bitmap.pix32(y, x) = RGB_MONOCHROME_GREEN_HIGHLIGHT[color]; data <<= 1; } @@ -108,25 +107,15 @@ static const mc6845_interface crtc_intf = NULL }; -/* Palette */ - -static PALETTE_INIT( v1050 ) -{ - palette_set_color(machine, 0, RGB_BLACK); /* black */ - palette_set_color_rgb(machine, 1, 0x00, 0xc0, 0x00); /* green */ - palette_set_color_rgb(machine, 2, 0x00, 0xff, 0x00); /* bright green */ -} - /* Video Start */ void v1050_state::video_start() { /* allocate memory */ - m_attr_ram = auto_alloc_array(machine(), UINT8, V1050_VIDEORAM_SIZE); + m_attr_ram.allocate(V1050_VIDEORAM_SIZE); /* register for state saving */ save_item(NAME(m_attr)); - save_pointer(NAME(m_attr_ram), V1050_VIDEORAM_SIZE); } /* Machine Drivers */ @@ -141,7 +130,4 @@ MACHINE_CONFIG_FRAGMENT( v1050_video ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_SIZE(640, 400) MCFG_SCREEN_VISIBLE_AREA(0,640-1, 0, 400-1) - - MCFG_PALETTE_LENGTH(3) - MCFG_PALETTE_INIT(v1050) MACHINE_CONFIG_END