diff options
| author | 2016-09-25 22:25:46 +0200 | |
|---|---|---|
| committer | 2016-09-25 22:26:36 +0200 | |
| commit | c81a76166d52d7b918180062807b9b068fddd63e (patch) | |
| tree | 4f0ad56c495f09fad6b5593dc1ebc86f74a76b80 | |
| parent | 33b2c733955112083b2912d4115eb0465026b4d0 (diff) | |
ti99: More savestate enabling and cleanups. (nw)
27 files changed, 397 insertions, 144 deletions
diff --git a/src/devices/bus/ti99_peb/bwg.cpp b/src/devices/bus/ti99_peb/bwg.cpp index 5587c931b6e..d54c6ae7060 100644 --- a/src/devices/bus/ti99_peb/bwg.cpp +++ b/src/devices/bus/ti99_peb/bwg.cpp @@ -93,7 +93,7 @@ snug_bwg_device::snug_bwg_device(const machine_config &mconfig, const char *tag, m_DSEL(0), m_SIDSEL(), m_motor_on_timer(nullptr), m_dsrrom(nullptr), m_buffer_ram(*this, BUFFER), m_current_floppy(nullptr), m_wd1773(*this, FDC_TAG), - m_clock(*this, CLOCK_TAG), m_debug_dataout(false) { } + m_clock(*this, CLOCK_TAG) { } /* Operate the wait state logic. @@ -565,6 +565,27 @@ void snug_bwg_device::device_start(void) m_dsrrom = memregion(DSRROM)->base(); m_motor_on_timer = timer_alloc(MOTOR_TIMER); m_cru_base = 0x1100; + + save_item(NAME(m_DRQ)); + save_item(NAME(m_IRQ)); + save_item(NAME(m_dip1)); + save_item(NAME(m_dip2)); + save_item(NAME(m_dip34)); + save_item(NAME(m_ram_page)); + save_item(NAME(m_rom_page)); + save_item(NAME(m_WAITena)); + save_item(NAME(m_inDsrArea)); + save_item(NAME(m_WDsel)); + save_item(NAME(m_WDsel0)); + save_item(NAME(m_RTCsel)); + save_item(NAME(m_lastK)); + save_item(NAME(m_dataregLB)); + save_item(NAME(m_rtc_enabled)); + save_item(NAME(m_MOTOR_ON)); + save_item(NAME(m_lastval)); + save_item(NAME(m_address)); + save_item(NAME(m_DSEL)); + save_item(NAME(m_SIDSEL)); } void snug_bwg_device::device_reset() @@ -595,7 +616,6 @@ void snug_bwg_device::device_reset() m_DSEL = 0; m_WAITena = false; m_selected = false; - m_debug_dataout = false; m_rtc_enabled = false; m_dataregLB = false; m_lastK = false; diff --git a/src/devices/bus/ti99_peb/bwg.h b/src/devices/bus/ti99_peb/bwg.h index 6178a20d457..e61b4769dea 100644 --- a/src/devices/bus/ti99_peb/bwg.h +++ b/src/devices/bus/ti99_peb/bwg.h @@ -60,7 +60,7 @@ private: void set_drive(); // Holds the status of the DRQ and IRQ lines. - line_state m_DRQ, m_IRQ; + int m_DRQ, m_IRQ; // DIP switch state int m_dip1, m_dip2, m_dip34; @@ -95,7 +95,7 @@ private: bool m_rtc_enabled; // Signal motor_on. When TRUE, makes all drives turning. - line_state m_MOTOR_ON; + int m_MOTOR_ON; // Needed for triggering the motor monoflop UINT8 m_lastval; @@ -111,7 +111,7 @@ private: int m_DSEL; // Signal SIDSEL. 0 or 1, indicates the selected head. - line_state m_SIDSEL; + int m_SIDSEL; // count 4.23s from rising edge of motor_on emu_timer* m_motor_on_timer; @@ -133,8 +133,5 @@ private: // Link to the real-time clock on the board. required_device<mm58274c_device> m_clock; - - // Debugging - bool m_debug_dataout; }; #endif diff --git a/src/devices/bus/ti99_peb/evpc.cpp b/src/devices/bus/ti99_peb/evpc.cpp index 1f3b00c0e19..14671574e20 100644 --- a/src/devices/bus/ti99_peb/evpc.cpp +++ b/src/devices/bus/ti99_peb/evpc.cpp @@ -382,6 +382,14 @@ void snug_enhanced_video_device::device_start() m_dsrrom = memregion(DSRROM)->base(); m_novram = std::make_unique<UINT8[]>(NOVRAM_SIZE); m_console_conn = downcast<evpc_clock_connector*>(machine().device(EVPC_CONN_TAG)); + save_item(NAME(m_address)); + save_item(NAME(m_dsr_page)); + save_item(NAME(m_inDsrArea)); + save_item(NAME(m_novram_accessed)); + save_item(NAME(m_palette_accessed)); + save_item(NAME(m_RAMEN)); + save_item(NAME(m_sound_accessed)); + save_item(NAME(m_video_accessed)); } void snug_enhanced_video_device::device_reset() diff --git a/src/devices/bus/ti99_peb/horizon.cpp b/src/devices/bus/ti99_peb/horizon.cpp index 137fb8298be..f97f0447302 100644 --- a/src/devices/bus/ti99_peb/horizon.cpp +++ b/src/devices/bus/ti99_peb/horizon.cpp @@ -364,6 +364,18 @@ void horizon_ramdisk_device::device_start(void) { m_cru_horizon = 0; m_cru_phoenix = 0; + + save_item(NAME(m_select6_value)); + save_item(NAME(m_select_all)); + save_item(NAME(m_page)); + save_item(NAME(m_cru_horizon)); + save_item(NAME(m_cru_phoenix)); + save_item(NAME(m_timode)); + save_item(NAME(m_32k_installed)); + save_item(NAME(m_split_mode)); + save_item(NAME(m_rambo_mode)); + save_item(NAME(m_hideswitch)); + save_item(NAME(m_use_rambo)); } void horizon_ramdisk_device::device_reset(void) diff --git a/src/devices/bus/ti99_peb/hsgpl.cpp b/src/devices/bus/ti99_peb/hsgpl.cpp index 77ea46fa971..966f7aed727 100644 --- a/src/devices/bus/ti99_peb/hsgpl.cpp +++ b/src/devices/bus/ti99_peb/hsgpl.cpp @@ -132,8 +132,8 @@ #define TRACE_WRITE 0 #define TRACE_IGNORE 0 -#define RAMSIZE 0x020000 -#define GRAMSIZE 0x020000 +#define RAM6_TAG "cartram128k" +#define GRAM_TAG "gram128k" #define DSR_EEPROM "u9_dsr" #define GROM_B_EEPROM "u4_grom" @@ -141,10 +141,30 @@ #define ROM6_EEPROM "u6_rom6" snug_high_speed_gpl_device::snug_high_speed_gpl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) -: ti_expansion_card_device(mconfig, TI99_HSGPL, "SNUG High-speed GPL card", tag, owner, clock, "ti99_hsgpl", __FILE__), m_dsr_eeprom(nullptr), -m_rom6_eeprom(nullptr), m_grom_a_eeprom(nullptr), m_grom_b_eeprom(nullptr), m_ram6_memory(nullptr), m_gram_memory(nullptr), m_dsr_enabled(false), -m_gram_enabled(false), m_bank_inhibit(false), m_dsr_page(0), m_card_enabled(false), m_write_enabled(false), m_supercart_enabled(false), m_led_on(false), -m_mbx_enabled(false), m_ram_enabled(false), m_flash_mode(false), m_current_grom_port(0), m_current_bank(0), m_module_bank(0), m_waddr_LSB(false), m_raddr_LSB(false), m_grom_address(0) + : ti_expansion_card_device(mconfig, TI99_HSGPL, "SNUG High-speed GPL card", tag, owner, clock, "ti99_hsgpl", __FILE__), + m_dsr_eeprom(*this, DSR_EEPROM), + m_rom6_eeprom(*this, ROM6_EEPROM), + m_grom_a_eeprom(*this, GROM_A_EEPROM), + m_grom_b_eeprom(*this, GROM_B_EEPROM), + m_ram6_memory(*this, RAM6_TAG), + m_gram_memory(*this, GRAM_TAG), + m_dsr_enabled(false), + m_gram_enabled(false), + m_bank_inhibit(false), + m_dsr_page(0), + m_card_enabled(false), + m_write_enabled(false), + m_supercart_enabled(false), + m_led_on(false), + m_mbx_enabled(false), + m_ram_enabled(false), + m_flash_mode(false), + m_current_grom_port(0), + m_current_bank(0), + m_module_bank(0), + m_waddr_LSB(false), + m_raddr_LSB(false), + m_grom_address(0) { } @@ -304,7 +324,7 @@ void snug_high_speed_gpl_device::cartspace_readz(address_space& space, offs_t of { if (m_module_bank==16 || m_module_bank==17) { - *value = m_ram6_memory[(offset & 0x1fff) | (m_current_bank<<13) | ((m_module_bank & 0x000f)<<15)]; + *value = m_ram6_memory->pointer()[(offset & 0x1fff) | (m_current_bank<<13) | ((m_module_bank & 0x000f)<<15)]; } else { @@ -355,7 +375,7 @@ void snug_high_speed_gpl_device::grom_readz(address_space& space, offs_t offset, { if ((port < 2) && (m_gram_enabled)) { - *value = m_gram_memory[m_grom_address | (port<<16)]; + *value = m_gram_memory->pointer()[m_grom_address | (port<<16)]; m_module_bank = port + 16; if (TRACE_PORT) if (bNew) logerror("GRAM read access at %04x (GRMENA=1) - switch to bank %d\n", offset & 0xffff, m_module_bank); } @@ -403,7 +423,7 @@ void snug_high_speed_gpl_device::grom_readz(address_space& space, offs_t offset, // 9880, 9884 if (port==32 || port==33) { - *value = m_gram_memory[m_grom_address | ((port-32)<<16)]; + *value = m_gram_memory->pointer()[m_grom_address | ((port-32)<<16)]; m_module_bank = port - 16; if (TRACE_PORT) if (bNew) logerror("GRAM read access at %04x - switch to bank %d\n", offset & 0xffff, m_module_bank); } @@ -411,8 +431,8 @@ void snug_high_speed_gpl_device::grom_readz(address_space& space, offs_t offset, { if (port==48 || port==49) { -// *value = m_ram6_memory[m_grom_address]; - *value = m_ram6_memory[m_grom_address | ((port-48)<<16)]; +// *value = m_ram6_memory->pointer()[m_grom_address]; + *value = m_ram6_memory->pointer()[m_grom_address | ((port-48)<<16)]; if (TRACE_PORT) if (bNew) logerror("RAM read access at %04x\n", offset & 0xffff); } else @@ -472,7 +492,7 @@ void snug_high_speed_gpl_device::cartspace_write(address_space& space, offs_t of { if ((m_module_bank < 2) && (m_ram_enabled)) { - m_ram6_memory[(offset & 0x1fff) | (m_current_bank<<13) | (m_module_bank<<15) ] = data; + m_ram6_memory->pointer()[(offset & 0x1fff) | (m_current_bank<<13) | (m_module_bank<<15) ] = data; } else { // keep in mind that these lines are also reached for port < 2 @@ -491,7 +511,7 @@ void snug_high_speed_gpl_device::cartspace_write(address_space& space, offs_t of { if (m_module_bank==16 || m_module_bank==17) { - m_ram6_memory[(offset & 0x1fff) | (m_current_bank<<13) | ((m_module_bank-16)<<15)] = data; + m_ram6_memory->pointer()[(offset & 0x1fff) | (m_current_bank<<13) | ((m_module_bank-16)<<15)] = data; } else { @@ -543,7 +563,7 @@ void snug_high_speed_gpl_device::grom_write(address_space& space, offs_t offset, { if ((port < 2) && (m_gram_enabled)) { - m_gram_memory[m_grom_address | (port<<16)] = data; + m_gram_memory->pointer()[m_grom_address | (port<<16)] = data; m_module_bank = port + 16; if (TRACE_PORT) if (bNew) logerror("GRAM write access at %04x (GRMENA=1) - switch to bank %d\n", offset & 0xffff, port); } @@ -581,7 +601,7 @@ void snug_high_speed_gpl_device::grom_write(address_space& space, offs_t offset, { if (port==32 || port==33) { - m_gram_memory[m_grom_address | ((port-32)<<16)] = data; + m_gram_memory->pointer()[m_grom_address | ((port-32)<<16)] = data; m_module_bank = port - 16; if (TRACE_PORT) if (bNew) logerror("GRAM write access at %04x - switch to bank %d\n", offset & 0xffff, m_module_bank); } @@ -589,8 +609,8 @@ void snug_high_speed_gpl_device::grom_write(address_space& space, offs_t offset, { if (port==48 || port==49) { -// m_ram6_memory[m_grom_address] = data; - m_ram6_memory[m_grom_address | ((port-48)<<16)] = data; +// m_ram6_memory->pointer()[m_grom_address] = data; + m_ram6_memory->pointer()[m_grom_address | ((port-48)<<16)] = data; if (TRACE_PORT) if (bNew) logerror("RAM write access at %04x\n", offset & 0xffff); } else @@ -615,8 +635,23 @@ void snug_high_speed_gpl_device::grom_write(address_space& space, offs_t offset, void snug_high_speed_gpl_device::device_start() { - m_ram6_memory = std::make_unique<UINT8[]>(RAMSIZE); - m_gram_memory = std::make_unique<UINT8[]>(GRAMSIZE); + save_item(NAME(m_dsr_enabled)); + save_item(NAME(m_gram_enabled)); + save_item(NAME(m_bank_inhibit)); + save_item(NAME(m_dsr_page)); + save_item(NAME(m_card_enabled)); + save_item(NAME(m_write_enabled)); + save_item(NAME(m_supercart_enabled)); + save_item(NAME(m_led_on)); + save_item(NAME(m_mbx_enabled)); + save_item(NAME(m_ram_enabled)); + save_item(NAME(m_flash_mode)); + save_item(NAME(m_current_grom_port)); + save_item(NAME(m_current_bank)); + save_item(NAME(m_module_bank)); + save_item(NAME(m_waddr_LSB)); + save_item(NAME(m_raddr_LSB)); + save_item(NAME(m_grom_address)); } void snug_high_speed_gpl_device::device_reset() @@ -643,18 +678,8 @@ void snug_high_speed_gpl_device::device_reset() m_module_bank = 0; } -void snug_high_speed_gpl_device::device_config_complete(void) -{ - m_dsr_eeprom = subdevice<at29c040a_device>(DSR_EEPROM); - m_rom6_eeprom = subdevice<at29c040a_device>(ROM6_EEPROM); - m_grom_a_eeprom = subdevice<at29c040a_device>(GROM_A_EEPROM); - m_grom_b_eeprom = subdevice<at29c040a_device>(GROM_B_EEPROM); -} - void snug_high_speed_gpl_device::device_stop() { - m_ram6_memory = nullptr; - m_gram_memory = nullptr; } // Flash setting is used to flash an empty HSGPL DSR ROM @@ -670,6 +695,12 @@ MACHINE_CONFIG_FRAGMENT( ti99_hsgpl ) MCFG_AT29C040A_ADD( GROM_B_EEPROM ) MCFG_AT29C040A_ADD( GROM_A_EEPROM ) MCFG_AT29C040A_ADD( ROM6_EEPROM ) + MCFG_RAM_ADD(RAM6_TAG) + MCFG_RAM_DEFAULT_SIZE("128k") + MCFG_RAM_DEFAULT_VALUE(0) + MCFG_RAM_ADD(GRAM_TAG) + MCFG_RAM_DEFAULT_SIZE("128k") + MCFG_RAM_DEFAULT_VALUE(0) MACHINE_CONFIG_END machine_config_constructor snug_high_speed_gpl_device::device_mconfig_additions() const diff --git a/src/devices/bus/ti99_peb/hsgpl.h b/src/devices/bus/ti99_peb/hsgpl.h index dfb755c67b4..04ea2b99e8e 100644 --- a/src/devices/bus/ti99_peb/hsgpl.h +++ b/src/devices/bus/ti99_peb/hsgpl.h @@ -5,7 +5,7 @@ SNUG HSGPL card emulation. See hsgpl.c for documentation - Raphael Nabet, 2003. + Original code by Raphael Nabet, 2003. Michael Zapf October 2010: Rewritten as device @@ -19,6 +19,7 @@ #include "emu.h" #include "peribox.h" #include "machine/at29x.h" +#include "machine/ram.h" extern const device_type TI99_HSGPL; @@ -36,19 +37,18 @@ protected: virtual void device_start(void) override; virtual void device_reset(void) override; virtual void device_stop(void) override; - virtual void device_config_complete(void) override; virtual ioport_constructor device_input_ports() const override; virtual machine_config_constructor device_mconfig_additions() const override; private: - at29c040a_device* m_dsr_eeprom; - at29c040a_device* m_rom6_eeprom; - at29c040a_device* m_grom_a_eeprom; - at29c040a_device* m_grom_b_eeprom; + required_device<at29c040a_device> m_dsr_eeprom; + required_device<at29c040a_device> m_rom6_eeprom; + required_device<at29c040a_device> m_grom_a_eeprom; + required_device<at29c040a_device> m_grom_b_eeprom; - std::unique_ptr<UINT8[]> m_ram6_memory; - std::unique_ptr<UINT8[]> m_gram_memory; + required_device<ram_device> m_ram6_memory; + required_device<ram_device> m_gram_memory; void dsrspace_readz(address_space& space, offs_t offset, UINT8* value, UINT8 mem_mask); void cartspace_readz(address_space& space, offs_t offset, UINT8* value, UINT8 mem_mask); diff --git a/src/devices/bus/ti99_peb/memex.cpp b/src/devices/bus/ti99_peb/memex.cpp index f35b7cf5892..021fb19b96e 100644 --- a/src/devices/bus/ti99_peb/memex.cpp +++ b/src/devices/bus/ti99_peb/memex.cpp @@ -14,7 +14,7 @@ #include "memex.h" -#define RAMREGION "ram2M" +#define RAMREGION "ram2meg" #define TRACE_CONFIG 0 enum @@ -31,8 +31,7 @@ enum geneve_memex_device::geneve_memex_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : ti_expansion_card_device(mconfig, TI99_MEMEX, "Geneve memory expansion card", tag, owner, clock, "ti99_memex", __FILE__), - m_ram(*this, RAMREGION), - m_genmod(0) + m_ram(*this, RAMREGION) { } @@ -45,33 +44,27 @@ bool geneve_memex_device::access_enabled(offs_t offset) // Some traditional cards will not decode the AMx lines, so // we may have to lock out those areas int page = (offset >> 13)&0xff; - int index; - // SW2: "off" locks - // 10xxx010 - // 10111010 also locked when "on" + // SW2: 10xxx010 locked when SW2=off + // 10111010 locked when SW2=on if (page == 0xba) return false; - if ((page & 0xc7)==0x82 && m_dip_switch[1]==false) + if ((page & 0xc7)==0x82 && ((m_switches & MDIP2)==0)) { - if (TRACE_CONFIG) logerror("memex blocks page %02x; dip1=%d\n", page, m_dip_switch[1]); + if (TRACE_CONFIG) logerror("memex blocks page %02x; dip2=%d\n", page, (m_switches & MDIP2)!=0); return false; } - // SW3: 111010xx 0=enabled 1=locked out - // SW4: 111011xx - // SW5: 111100xx - // SW6: 111101xx - // SW7: 111110xx - // SW8: 111111xx + // Switch page + // SW3: 111010xx enabled for SWx=0,blocked for SWx=1 + // SW4: 111011xx + // SW5: 111100xx + // SW6: 111101xx + // SW7: 111110xx + // SW8: 111111xx - index = ((page >> 2)&0x3f); - if (index >= 0x3a && index <= 0x3f) + if (page >= 0xe8 && page <= 0xff) { - if (m_dip_switch[index - 0x38]==0) return true; - else - { - return false; - } + return ((m_switches & (4<< (((page>>2) & 0x0f)-10))) == 0); } return true; } @@ -91,9 +84,7 @@ READ8Z_MEMBER( geneve_memex_device::readz ) // The card is accessed for all addresses in the address space if (access_enabled(offset)) - { *value = m_ram->pointer()[offset]; - } } /* @@ -106,26 +97,20 @@ WRITE8_MEMBER( geneve_memex_device::write ) // The card is accessed for all addresses in the address space if (access_enabled(offset)) - { m_ram->pointer()[offset] = data; - } } /**************************************************************************/ void geneve_memex_device::device_start() { + save_item(NAME(m_switches)); } void geneve_memex_device::device_reset() { - UINT8 dips = ioport("MEMEXDIPS")->read(); - if (TRACE_CONFIG) logerror("memex dips = %02x\n", dips); - for (auto & elem : m_dip_switch) - { - elem = ((dips & 0x01)!=0x00); - dips = dips >> 1; - } + m_switches = ioport("MEMEXDIPS")->read(); + if (TRACE_CONFIG) logerror("memex dips = %02x\n", m_switches); } INPUT_PORTS_START( memex ) diff --git a/src/devices/bus/ti99_peb/memex.h b/src/devices/bus/ti99_peb/memex.h index f9954cc9512..b457fb78c95 100644 --- a/src/devices/bus/ti99_peb/memex.h +++ b/src/devices/bus/ti99_peb/memex.h @@ -37,10 +37,8 @@ protected: private: bool access_enabled(offs_t offset); - required_device<ram_device> m_ram; - UINT8 m_dip_switch[8]; - int m_genmod; + UINT8 m_switches; }; #endif diff --git a/src/devices/bus/ti99_peb/myarcmem.cpp b/src/devices/bus/ti99_peb/myarcmem.cpp index df970874bbc..51e5655d40a 100644 --- a/src/devices/bus/ti99_peb/myarcmem.cpp +++ b/src/devices/bus/ti99_peb/myarcmem.cpp @@ -164,6 +164,8 @@ WRITE8_MEMBER(myarc_memory_expansion_device::cruwrite) void myarc_memory_expansion_device::device_start() { m_dsrrom = memregion(DSRROM)->base(); + save_item(NAME(m_bank)); + save_item(NAME(m_size)); } void myarc_memory_expansion_device::device_reset() diff --git a/src/devices/bus/ti99_peb/pcode.cpp b/src/devices/bus/ti99_peb/pcode.cpp index 0d4153f5616..5e8a4bf2e1c 100644 --- a/src/devices/bus/ti99_peb/pcode.cpp +++ b/src/devices/bus/ti99_peb/pcode.cpp @@ -273,6 +273,16 @@ void ti_pcode_card_device::device_start() m_grom[6] = downcast<tmc0430_device*>(subdevice(PGROM6_TAG)); m_grom[7] = downcast<tmc0430_device*>(subdevice(PGROM7_TAG)); m_rom = memregion(PCODE_ROM_TAG)->base(); + + save_item(NAME(m_bank_select)); + save_item(NAME(m_active)); + save_item(NAME(m_clock_count)); + save_item(NAME(m_clockhigh)); + save_item(NAME(m_inDsrArea)); + save_item(NAME(m_isrom0)); + save_item(NAME(m_isrom12)); + save_item(NAME(m_isgrom)); + save_item(NAME(m_address)); } void ti_pcode_card_device::device_reset() diff --git a/src/devices/bus/ti99_peb/peribox.h b/src/devices/bus/ti99_peb/peribox.h index 498d44da8d8..b5a4c55e074 100644 --- a/src/devices/bus/ti99_peb/peribox.h +++ b/src/devices/bus/ti99_peb/peribox.h @@ -234,7 +234,7 @@ protected: // When TRUE, card is accessible. Indicated by a LED. bool m_selected; - // When TRUE, GenMod is selected. + // When TRUE, GenMod is selected. Modified by peribox_slot_device. bool m_genmod; // CRU base. Used to configure the address by which a card is selected. diff --git a/src/devices/bus/ti99_peb/samsmem.cpp b/src/devices/bus/ti99_peb/samsmem.cpp index 1490dd196e1..1261ac32ffc 100644 --- a/src/devices/bus/ti99_peb/samsmem.cpp +++ b/src/devices/bus/ti99_peb/samsmem.cpp @@ -119,6 +119,9 @@ machine_config_constructor sams_memory_expansion_device::device_mconfig_addition void sams_memory_expansion_device::device_start() { + save_pointer(NAME(m_mapper),16); + save_item(NAME(m_map_mode)); + save_item(NAME(m_mapper)); } void sams_memory_expansion_device::device_reset() diff --git a/src/devices/bus/ti99_peb/spchsyn.cpp b/src/devices/bus/ti99_peb/spchsyn.cpp index 798d552a564..e4971ed0763 100644 --- a/src/devices/bus/ti99_peb/spchsyn.cpp +++ b/src/devices/bus/ti99_peb/spchsyn.cpp @@ -121,6 +121,11 @@ void ti_speech_synthesizer_device::device_start() // Need to configure the speech ROM for inverse bit order speechrom_device* mem = subdevice<speechrom_device>("vsm"); mem->set_reverse_bit_order(true); + + // We don't need to save m_space because the calling method + // combined_rsq_wsq_w only needs the address space formally. + save_item(NAME(m_reading)); + save_item(NAME(m_sbe)); } void ti_speech_synthesizer_device::device_reset() diff --git a/src/devices/bus/ti99_peb/ti_fdc.cpp b/src/devices/bus/ti99_peb/ti_fdc.cpp index 70ce8954090..4cf7fe9ee4e 100644 --- a/src/devices/bus/ti99_peb/ti_fdc.cpp +++ b/src/devices/bus/ti99_peb/ti_fdc.cpp @@ -44,13 +44,27 @@ // ---------------------------------- #define FDC_TAG "fd1771" #define MOTOR_TIMER 1 +#define NONE -1 #define TI_FDC_TAG "ti_dssd_controller" ti_fdc_device::ti_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : ti_expansion_card_device(mconfig, TI99_FDC, "TI-99 Standard DSSD Floppy Controller", tag, owner, clock, "ti99_fdc", __FILE__), m_address(0), m_DRQ(), m_IRQ(), - m_lastval(0), m_DVENA(), m_inDsrArea(false), m_WAITena(false), m_WDsel(false), m_DSEL(0), m_SIDSEL(), m_motor_on_timer(nullptr), - m_fd1771(*this, FDC_TAG), m_dsrrom(nullptr), m_current_floppy(nullptr), m_debug_dataout(false) + : ti_expansion_card_device(mconfig, TI99_FDC, "TI-99 Standard DSSD Floppy Controller", tag, owner, clock, "ti99_fdc", __FILE__), + m_address(0), + m_DRQ(0), + m_IRQ(0), + m_lastval(0), + m_DVENA(0), + m_inDsrArea(false), + m_WAITena(false), + m_WDsel(false), + m_DSEL(0), + m_SIDSEL(0), + m_motor_on_timer(nullptr), + m_fd1771(*this, FDC_TAG), + m_dsrrom(nullptr), + m_current(NONE), + m_debug_dataout(false) { } /* @@ -279,7 +293,7 @@ WRITE8_MEMBER(ti_fdc_device::cruwrite) // Select side of disk (bit 7) m_SIDSEL = (data==1)? ASSERT_LINE : CLEAR_LINE; if (TRACE_CRU) logerror("tifdc: set side (bit 7) = %d\n", data); - if (m_current_floppy != nullptr) m_current_floppy->ss_w(data); + if (m_current != NONE) m_floppy[m_current]->ss_w(data); break; default: @@ -290,37 +304,35 @@ WRITE8_MEMBER(ti_fdc_device::cruwrite) void ti_fdc_device::set_drive() { - int i = -1; switch (m_DSEL) { case 0: - m_current_floppy = nullptr; + m_current = NONE; if (TRACE_CRU) logerror("tifdc: all drives deselected\n"); break; case 1: - i = 0; + m_current = 0; break; case 2: - i = 1; + m_current = 1; break; case 3: // The schematics do not reveal any countermeasures against multiple selection // so we assume that the highest value wins. - i = 1; + m_current = 1; logerror("tifdc: Warning - multiple drives selected\n"); break; case 4: - i = 2; + m_current = 2; break; default: - i = 2; + m_current = 2; logerror("tifdc: Warning - multiple drives selected\n"); break; } if (TRACE_CRU) logerror("tifdc: new DSEL = %d\n", m_DSEL); - if (i != -1) m_current_floppy = m_floppy[i]; - m_fd1771->set_floppy(m_current_floppy); + m_fd1771->set_floppy((m_current == NONE)? nullptr : m_floppy[m_current]); } /* @@ -369,6 +381,18 @@ void ti_fdc_device::device_start() m_cru_base = 0x1100; // In case we implement a callback after all: // m_fd1771->setup_ready_cb(wd_fdc_t::rline_cb(FUNC(ti_fdc_device::dvena_r), this)); + + save_item(NAME(m_address)); + save_item(NAME(m_DRQ)); + save_item(NAME(m_IRQ)); + save_item(NAME(m_lastval)); + save_item(NAME(m_DVENA)); + save_item(NAME(m_inDsrArea)); + save_item(NAME(m_WAITena)); + save_item(NAME(m_WDsel)); + save_item(NAME(m_DSEL)); + save_item(NAME(m_SIDSEL)); + save_item(NAME(m_current)); } void ti_fdc_device::device_reset() @@ -405,7 +429,8 @@ void ti_fdc_device::device_reset() logerror("tifdc: No floppy attached to connector %d\n", i); } - m_fd1771->set_floppy(m_current_floppy = m_floppy[0]); + m_current = 0; + m_fd1771->set_floppy(m_floppy[m_current]); } void ti_fdc_device::device_config_complete() diff --git a/src/devices/bus/ti99_peb/ti_fdc.h b/src/devices/bus/ti99_peb/ti_fdc.h index e71050d34e1..e0446c0c1a1 100644 --- a/src/devices/bus/ti99_peb/ti_fdc.h +++ b/src/devices/bus/ti99_peb/ti_fdc.h @@ -63,13 +63,13 @@ private: int m_address; // Holds the status of the DRQ and IRQ lines. - line_state m_DRQ, m_IRQ; + int m_DRQ, m_IRQ; // Needed for triggering the motor monoflop UINT8 m_lastval; // Signal DVENA. When TRUE, makes some drive turning. - line_state m_DVENA; + int m_DVENA; // Set when address is in card area bool m_inDsrArea; @@ -88,7 +88,7 @@ private: int m_DSEL; // Signal SIDSEL. 0 or 1, indicates the selected head. - line_state m_SIDSEL; + int m_SIDSEL; // count 4.23s from rising edge of motor_on emu_timer* m_motor_on_timer; @@ -103,7 +103,7 @@ private: floppy_image_device* m_floppy[3]; // Currently selected floppy drive - floppy_image_device* m_current_floppy; + int m_current; // Debugging bool m_debug_dataout; diff --git a/src/devices/bus/ti99_peb/ti_rs232.cpp b/src/devices/bus/ti99_peb/ti_rs232.cpp index 8678d34df33..2fde3f4c07a 100644 --- a/src/devices/bus/ti99_peb/ti_rs232.cpp +++ b/src/devices/bus/ti99_peb/ti_rs232.cpp @@ -1041,6 +1041,24 @@ void ti_rs232_pio_device::device_start() m_pio_write = true; // required for call_load of pio_attached_device m_pio_writable = false; m_pio_handshakein = false; + + // We don't save the receive buffers for persistent state + save_pointer(NAME(m_signals),2); + save_pointer(NAME(m_recv_mode),2); + save_pointer(NAME(m_time_hold),2); + save_item(NAME(m_pio_direction_in)); + save_item(NAME(m_pio_handshakeout)); + save_item(NAME(m_pio_handshakein)); + save_item(NAME(m_pio_spareout)); + save_item(NAME(m_pio_sparein)); + save_item(NAME(m_flag0)); + save_item(NAME(m_led)); + save_item(NAME(m_pio_out_buffer)); + save_item(NAME(m_pio_in_buffer)); + save_item(NAME(m_pio_readable)); + save_item(NAME(m_pio_writable)); + save_item(NAME(m_pio_write)); + save_item(NAME(m_ila)); } void ti_rs232_pio_device::device_stop() diff --git a/src/devices/bus/ti99_peb/tn_ide.cpp b/src/devices/bus/ti99_peb/tn_ide.cpp index 39686998a96..e7bbbc06a3f 100644 --- a/src/devices/bus/ti99_peb/tn_ide.cpp +++ b/src/devices/bus/ti99_peb/tn_ide.cpp @@ -306,6 +306,16 @@ void nouspikel_ide_interface_device::device_start() { m_rtc = subdevice<rtc65271_device>("ide_rtc"); m_sram_enable_dip = false; // TODO: what is this? + + save_item(NAME(m_ata_irq)); + save_item(NAME(m_cru_register)); + save_item(NAME(m_clk_irq)); + save_item(NAME(m_sram_enable)); + save_item(NAME(m_sram_enable_dip)); + save_item(NAME(m_cur_page)); + save_item(NAME(m_tms9995_mode)); + save_item(NAME(m_input_latch)); + save_item(NAME(m_output_latch)); } void nouspikel_ide_interface_device::device_reset() diff --git a/src/devices/bus/ti99_peb/tn_usbsm.cpp b/src/devices/bus/ti99_peb/tn_usbsm.cpp index 63662ce692a..b59fbdffe7d 100644 --- a/src/devices/bus/ti99_peb/tn_usbsm.cpp +++ b/src/devices/bus/ti99_peb/tn_usbsm.cpp @@ -29,7 +29,7 @@ * Implement USB controller and assorted USB devices * Save DSR FEEPROM to disk - Raphael Nabet, 2004. + Original code by Raphael Nabet, 2004. Michael Zapf September 2010: Rewritten as device @@ -43,6 +43,9 @@ #define STRATA_TAG "strata" +#define RAM1_TAG "ram512k_lb" +#define RAM2_TAG "ram512k_hb" + enum { IO_REGS_ENABLE = 0x02, @@ -52,11 +55,21 @@ enum }; nouspikel_usb_smartmedia_device::nouspikel_usb_smartmedia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) -: ti_expansion_card_device(mconfig, TI99_USBSM, "Nouspikel USB/Smartmedia card", tag, owner, clock, "ti99_usbsm", __FILE__), -m_feeprom_page(0), m_sram_page(0), m_cru_register(0), m_tms9995_mode(false), m_enable_io(false), m_enable_int(false), m_enable_sm(false), -m_write_flash(false), m_input_latch(0), m_output_latch(0), - m_smartmedia(*this, "smartmedia"), - m_flash(*this, STRATA_TAG) + : ti_expansion_card_device(mconfig, TI99_USBSM, "Nouspikel USB/Smartmedia card", tag, owner, clock, "ti99_usbsm", __FILE__), + m_feeprom_page(0), + m_sram_page(0), + m_cru_register(0), + m_tms9995_mode(false), + m_enable_io(false), + m_enable_int(false), + m_enable_sm(false), + m_write_flash(false), + m_input_latch(0), + m_output_latch(0), + m_ram_lb(*this, RAM1_TAG), + m_ram_hb(*this, RAM2_TAG), + m_smartmedia(*this, "smartmedia"), + m_flash(*this, STRATA_TAG) { } @@ -201,7 +214,8 @@ READ8Z_MEMBER(nouspikel_usb_smartmedia_device::readz) else { // SRAM - m_input_latch = m_ram[m_sram_page*0x800+((offset>>1)&0x07ff)]; + int ramaddr = m_sram_page*0x800+((offset>>1)&0x07ff); + m_input_latch = ((m_ram_hb->pointer()[ramaddr] & 0xff) << 8) | (m_ram_lb->pointer()[ramaddr] & 0xff); } } } @@ -266,7 +280,9 @@ WRITE8_MEMBER(nouspikel_usb_smartmedia_device::write) } else { // SRAM - m_ram[m_sram_page*0x800+((offset>>1) & 0x07ff)] = m_output_latch; + int ramaddr = m_sram_page*0x800+((offset>>1)&0x07ff); + m_ram_lb->pointer()[ramaddr] = (m_output_latch & 0xff); + m_ram_hb->pointer()[ramaddr] = (m_output_latch >> 8) & 0xff; } } } @@ -275,7 +291,16 @@ WRITE8_MEMBER(nouspikel_usb_smartmedia_device::write) void nouspikel_usb_smartmedia_device::device_start() { - m_ram.resize(0x80000/2); + save_item(NAME(m_feeprom_page)); + save_item(NAME(m_sram_page)); + save_item(NAME(m_cru_register)); + save_item(NAME(m_tms9995_mode)); + save_item(NAME(m_enable_io)); + save_item(NAME(m_enable_int)); + save_item(NAME(m_enable_sm)); + save_item(NAME(m_write_flash)); + save_item(NAME(m_input_latch)); + save_item(NAME(m_output_latch)); } void nouspikel_usb_smartmedia_device::device_reset() @@ -332,6 +357,12 @@ INPUT_PORTS_END MACHINE_CONFIG_FRAGMENT( tn_usbsm ) MCFG_DEVICE_ADD("smartmedia", SMARTMEDIA, 0) MCFG_STRATAFLASH_ADD(STRATA_TAG) + MCFG_RAM_ADD(RAM1_TAG) + MCFG_RAM_DEFAULT_SIZE("512k") + MCFG_RAM_DEFAULT_VALUE(0) + MCFG_RAM_ADD(RAM2_TAG) + MCFG_RAM_DEFAULT_SIZE("512k") + MCFG_RAM_DEFAULT_VALUE(0) MACHINE_CONFIG_END machine_config_constructor nouspikel_usb_smartmedia_device::device_mconfig_additions() const diff --git a/src/devices/bus/ti99_peb/tn_usbsm.h b/src/devices/bus/ti99_peb/tn_usbsm.h index 08d7f281fe8..6769783cd5a 100644 --- a/src/devices/bus/ti99_peb/tn_usbsm.h +++ b/src/devices/bus/ti99_peb/tn_usbsm.h @@ -3,7 +3,7 @@ /**************************************************************************** Nouspikel USB / SmartMedia interface card - See tn_usmsm.c for documentation + See tn_usbsm.c for documentation Michael Zapf @@ -18,6 +18,7 @@ #include "peribox.h" #include "machine/smartmed.h" #include "machine/strata.h" +#include "machine/ram.h" extern const device_type TI99_USBSM; @@ -51,8 +52,9 @@ private: UINT16 m_input_latch; UINT16 m_output_latch; - std::vector<UINT16> m_ram; + required_device<ram_device> m_ram_lb; + required_device<ram_device> m_ram_hb; required_device<smartmedia_image_device> m_smartmedia; required_device<strataflash_device> m_flash; }; diff --git a/src/devices/bus/ti99x/gromport.cpp b/src/devices/bus/ti99x/gromport.cpp index cb2b2f869ca..ac00f72df02 100644 --- a/src/devices/bus/ti99x/gromport.cpp +++ b/src/devices/bus/ti99x/gromport.cpp @@ -211,6 +211,8 @@ void gromport_device::device_start() { m_console_ready.resolve(); m_console_reset.resolve(); + + save_item(NAME(m_romgq)); } void gromport_device::device_reset() @@ -663,6 +665,10 @@ void multi_conn_device::device_start() { elem = nullptr; } + save_item(NAME(m_readrom)); + save_item(NAME(m_active_slot)); + save_item(NAME(m_fixed_slot)); + save_item(NAME(m_next_free_slot)); } void multi_conn_device::device_reset(void) @@ -1087,6 +1093,11 @@ void gkracker_device::device_start() m_grom_ptr = memregion(GKRACKER_ROM_TAG)->base(); m_cartridge = nullptr; for (int i=1; i < 6; i++) m_gk_switch[i] = 0; + save_pointer(NAME(m_gk_switch),6); + save_item(NAME(m_romspace_selected)); + save_item(NAME(m_ram_page)); + save_item(NAME(m_grom_address)); + save_item(NAME(m_waddr_LSB)); } void gkracker_device::device_reset() diff --git a/src/devices/bus/ti99x/handset.cpp b/src/devices/bus/ti99x/handset.cpp index 2a073636910..6e759b2115c 100644 --- a/src/devices/bus/ti99x/handset.cpp +++ b/src/devices/bus/ti99x/handset.cpp @@ -319,6 +319,12 @@ void ti99_handset_device::pulse_clock() void ti99_handset_device::device_start(void) { m_delay_timer = timer_alloc(DELAY_TIMER); + save_item(NAME(m_ack)); + save_item(NAME(m_clock_high)); + save_item(NAME(m_buf)); + save_item(NAME(m_buflen)); + save_pointer(NAME(previous_joy), MAX_HANDSETS); + save_pointer(NAME(previous_key), MAX_HANDSETS); } void ti99_handset_device::device_reset(void) @@ -496,6 +502,7 @@ ti99_twin_joystick::ti99_twin_joystick(const machine_config &mconfig, const char void ti99_twin_joystick::device_start(void) { + save_item(NAME(m_joystick)); } /* diff --git a/src/devices/bus/ti99x/mecmouse.cpp b/src/devices/bus/ti99x/mecmouse.cpp index 573fce594ff..56b370e55c5 100644 --- a/src/devices/bus/ti99x/mecmouse.cpp +++ b/src/devices/bus/ti99x/mecmouse.cpp @@ -175,6 +175,15 @@ void mecmouse_device::device_start(void) // has no clock line on the joystick port. The rate is not mentioned in // the specs; however, if it is too low, the mouse pointer will do jumps m_poll_timer->adjust(attotime::from_hz(100), 0, attotime::from_hz(100)); + + save_item(NAME(m_last_select)); + save_item(NAME(m_read_y_axis)); + save_item(NAME(m_x)); + save_item(NAME(m_y)); + save_item(NAME(m_x_buf)); + save_item(NAME(m_y_buf)); + save_item(NAME(m_last_mx)); + save_item(NAME(m_last_my)); } void mecmouse_device::device_reset(void) diff --git a/src/devices/imagedev/mfmhd.cpp b/src/devices/imagedev/mfmhd.cpp index ea7007d279a..faf49e95f23 100644 --- a/src/devices/imagedev/mfmhd.cpp +++ b/src/devices/imagedev/mfmhd.cpp @@ -367,6 +367,32 @@ void mfm_harddisk_device::device_start() // In 5 second periods, check whether the cache has dirty lines m_cache_timer->adjust(attotime::from_msec(5000), 0, attotime::from_msec(5000)); + + save_item(NAME(m_max_cylinders)); + save_item(NAME(m_phys_cylinders)); + save_item(NAME(m_actual_cylinders)); + save_item(NAME(m_max_heads)); + save_item(NAME(m_landing_zone)); + save_item(NAME(m_precomp_cyl)); + save_item(NAME(m_redwc_cyl)); + save_item(NAME(m_maxseek_time)); + save_item(NAME(m_seeknext_time)); + save_item(NAME(m_cell_size)); + save_item(NAME(m_trackimage_size)); + save_item(NAME(m_spinupms)); + save_item(NAME(m_rpm)); + save_item(NAME(m_interleave)); + save_item(NAME(m_cachelines)); + save_item(NAME(m_ready)); + save_item(NAME(m_current_cylinder)); + save_item(NAME(m_current_head)); + save_item(NAME(m_track_delta)); + save_item(NAME(m_step_phase)); + save_item(NAME(m_seek_complete)); + save_item(NAME(m_seek_inward)); + save_item(NAME(m_autotruncation)); + save_item(NAME(m_recalibrated)); + save_item(NAME(m_spinup_time)); } void mfm_harddisk_device::device_reset() @@ -1165,6 +1191,12 @@ mfm_harddisk_connector::~mfm_harddisk_connector() { } +void mfm_harddisk_connector::device_start() +{ + save_item(NAME(m_spinupms)); + save_item(NAME(m_cachesize)); +} + mfm_harddisk_device* mfm_harddisk_connector::get_device() { return dynamic_cast<mfm_harddisk_device *>(get_card_device()); diff --git a/src/devices/imagedev/mfmhd.h b/src/devices/imagedev/mfmhd.h index ed371f7d4c1..64d4f9cec97 100644 --- a/src/devices/imagedev/mfmhd.h +++ b/src/devices/imagedev/mfmhd.h @@ -217,7 +217,7 @@ public: void configure(mfmhd_enc_t encoding, int spinupms, int cache, mfmhd_format_type format); protected: - void device_start() override { }; + void device_start() override; void device_config_complete() override; private: diff --git a/src/mame/drivers/ti99_4p.cpp b/src/mame/drivers/ti99_4p.cpp index abc4933c457..ac3db386062 100644 --- a/src/mame/drivers/ti99_4p.cpp +++ b/src/mame/drivers/ti99_4p.cpp @@ -123,9 +123,11 @@ #include "imagedev/cassette.h" #include "bus/ti99x/joyport.h" #include "bus/ti99_peb/peribox.h" +#include "machine/ram.h" #define TMS9901_TAG "tms9901" #define SGCPU_TAG "sgcpu" +#define AMSRAM_TAG "amsram1meg" #define TRACE_ILLWRITE 0 #define TRACE_READY 0 @@ -143,7 +145,10 @@ public: m_tms9901(*this, TMS9901_TAG), m_cassette(*this, "cassette"), m_peribox(*this, PERIBOX_TAG), - m_joyport(*this, JOYPORT_TAG) { } + m_joyport(*this, JOYPORT_TAG), + m_scratchpad(*this, PADRAM_TAG), + m_amsram(*this, AMSRAM_TAG) + { } DECLARE_WRITE_LINE_MEMBER( ready_line ); DECLARE_WRITE_LINE_MEMBER( extint ); @@ -162,8 +167,6 @@ public: DECLARE_WRITE_LINE_MEMBER( clock_out ); DECLARE_WRITE_LINE_MEMBER( dbin_line ); - void datamux_clock_in(int clock); - // CRU (Communication Register Unit) handling DECLARE_READ8_MEMBER( cruread ); DECLARE_WRITE8_MEMBER( cruwrite ); @@ -181,34 +184,30 @@ public: DECLARE_WRITE_LINE_MEMBER(video_interrupt_in); +private: + void datamux_clock_in(int clock); + + // Devices required_device<tms9900_device> m_cpu; required_device<tms9901_device> m_tms9901; required_device<cassette_image_device> m_cassette; required_device<peribox_device> m_peribox; required_device<joyport_device> m_joyport; - - // Pointer to ROM0 - UINT16 *m_rom0; - - // AMS RAM (1 Mib) - std::vector<UINT16> m_ram; - - // Scratch pad ram (1 KiB) - std::vector<UINT16> m_scratchpad; - - // First joystick. 6 for TI-99/4A - int m_firstjoy; - -private: + required_device<ram_device> m_scratchpad; + required_device<ram_device> m_amsram; int decode_address(int address); DECLARE_READ16_MEMBER( debugger_read ); DECLARE_WRITE16_MEMBER( debugger_write ); - void ready_join(); - void set_keyboard_column(int number, int data); + // Pointer to EPROM + UINT16 *m_rom; + + // First joystick. 6 for TI-99/4A + int m_firstjoy; + int m_keyboard_column; int m_check_alphalock; @@ -240,7 +239,7 @@ private: bool m_muxready; // Incoming Ready level - line_state m_sysready; + int m_sysready; // Saves a pointer to the address space address_space* m_spacep; @@ -258,7 +257,7 @@ private: bool m_rom6_upper; // State of the DBIN line - line_state m_dbin; + int m_dbin; UINT8 m_lowbyte; UINT8 m_highbyte; @@ -267,15 +266,11 @@ private: // Mapper registers UINT8 m_mapper[16]; - // Pointer to EPROM - UINT16 *m_rom; - // Latch for 9901 INT2, INT1 lines int m_9901_int; void set_9901_int(int line, line_state state); int m_ready_prev; // for debugging purposes only - }; enum @@ -481,7 +476,7 @@ READ16_MEMBER( ti99_4p_state::memread ) else // transparent mode address = m_addr_buf; - value = m_ram[address>>1]; + value = ((m_amsram->pointer()[address] & 0xff) << 8) | (m_amsram->pointer()[address+1] & 0xff); break; case SGCPU_INTDSR: @@ -498,7 +493,8 @@ READ16_MEMBER( ti99_4p_state::memread ) case SGCPU_PADRAM: // Scratch pad RAM (16 bit) // 8000 ... 83ff (1K, 4 times the size of the internal RAM of the TI-99/4A) - value = m_scratchpad[(m_addr_buf & 0x03ff)>>1]; + value = ((m_scratchpad->pointer()[m_addr_buf & 0x03ff] & 0xff)<<8) + | (m_scratchpad->pointer()[(m_addr_buf & 0x03ff)+1] & 0xff); break; case SGCPU_PEB: @@ -539,7 +535,8 @@ WRITE16_MEMBER( ti99_4p_state::memwrite ) else // transparent mode address = m_addr_buf; - m_ram[address>>1] = data; + m_amsram->pointer()[address] = (data >> 8) & 0xff; + m_amsram->pointer()[address+1] = data & 0xff; break; case SGCPU_INTDSR: @@ -558,7 +555,8 @@ WRITE16_MEMBER( ti99_4p_state::memwrite ) case SGCPU_PADRAM: // Scratch pad RAM (16 bit) // 8000 ... 83ff (1K, 4 times the size of the internal RAM of the TI-99/4A) - m_scratchpad[(m_addr_buf & 0x03ff)>>1] = data; + m_scratchpad->pointer()[m_addr_buf & 0x03ff] = (data >> 8) & 0xff; + m_scratchpad->pointer()[(m_addr_buf & 0x03ff)+1] = data & 0xff; break; case SGCPU_PEB: @@ -932,9 +930,6 @@ WRITE8_MEMBER( ti99_4p_state::external_operation ) void ti99_4p_state::machine_start() { - m_ram.resize(0x80000/2); - m_scratchpad.resize(0x400/2); - m_peribox->senila(CLEAR_LINE); m_peribox->senilb(CLEAR_LINE); @@ -944,6 +939,30 @@ void ti99_4p_state::machine_start() m_muxready = true; m_rom = (UINT16*)(memregion("maincpu")->base()); + + save_item(NAME(m_firstjoy)); + save_item(NAME(m_keyboard_column)); + save_item(NAME(m_check_alphalock)); + save_item(NAME(m_internal_dsr)); + save_item(NAME(m_internal_rom6)); + save_item(NAME(m_rom6_bank)); + save_item(NAME(m_waitcount)); + save_item(NAME(m_map_mode)); + save_item(NAME(m_access_mapper)); + save_item(NAME(m_addr_buf)); + save_item(NAME(m_decode)); + save_item(NAME(m_muxready)); + save_item(NAME(m_sysready)); + save_item(NAME(m_internal_dsr_active)); + save_item(NAME(m_mapper_active)); + save_item(NAME(m_rom6_active)); + save_item(NAME(m_rom6_upper)); + save_item(NAME(m_dbin)); + save_item(NAME(m_lowbyte)); + save_item(NAME(m_highbyte)); + save_item(NAME(m_latch)); + save_pointer(NAME(m_mapper),16); + save_item(NAME(m_9901_int)); } /* @@ -1000,6 +1019,16 @@ static MACHINE_CONFIG_START( ti99_4p_60hz, ti99_4p_state ) // The SGCPU actually makes use of this pin which was unused before MCFG_PERIBOX_LCP_HANDLER( WRITELINE(ti99_4p_state, video_interrupt_in) ) + // Scratch pad RAM 1024 bytes (4 times the size of the TI-99/4A) + MCFG_RAM_ADD(PADRAM_TAG) + MCFG_RAM_DEFAULT_SIZE("1k") + MCFG_RAM_DEFAULT_VALUE(0) + + // AMS RAM 1 MiB + MCFG_RAM_ADD(AMSRAM_TAG) + MCFG_RAM_DEFAULT_SIZE("1M") + MCFG_RAM_DEFAULT_VALUE(0) + // Cassette drives MCFG_SPEAKER_STANDARD_MONO("cass_out") MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/ti99_4x.cpp b/src/mame/drivers/ti99_4x.cpp index 083412d9f5c..1d744f8d580 100644 --- a/src/mame/drivers/ti99_4x.cpp +++ b/src/mame/drivers/ti99_4x.cpp @@ -854,10 +854,12 @@ static MACHINE_CONFIG_START( ti99_4, ti99_4x_state ) // Scratch pad RAM 256 bytes MCFG_RAM_ADD(PADRAM_TAG) MCFG_RAM_DEFAULT_SIZE("256") + MCFG_RAM_DEFAULT_VALUE(0) // Optional RAM expansion MCFG_RAM_ADD(EXPRAM_TAG) MCFG_RAM_DEFAULT_SIZE("32K") + MCFG_RAM_DEFAULT_VALUE(0) // Software list MCFG_SOFTWARE_LIST_ADD("cart_list_ti99", "ti99_cart") @@ -972,10 +974,12 @@ static MACHINE_CONFIG_START( ti99_4a, ti99_4x_state ) // Scratch pad RAM 256 bytes MCFG_RAM_ADD(PADRAM_TAG) MCFG_RAM_DEFAULT_SIZE("256") + MCFG_RAM_DEFAULT_VALUE(0) // Optional RAM expansion MCFG_RAM_ADD(EXPRAM_TAG) MCFG_RAM_DEFAULT_SIZE("32K") + MCFG_RAM_DEFAULT_VALUE(0) // Software list MCFG_SOFTWARE_LIST_ADD("cart_list_ti99", "ti99_cart") @@ -1131,10 +1135,12 @@ static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state ) // Scratch pad RAM 256 bytes MCFG_RAM_ADD(PADRAM_TAG) MCFG_RAM_DEFAULT_SIZE("256") + MCFG_RAM_DEFAULT_VALUE(0) // Optional RAM expansion MCFG_RAM_ADD(EXPRAM_TAG) MCFG_RAM_DEFAULT_SIZE("32K") + MCFG_RAM_DEFAULT_VALUE(0) // EVPC connector MCFG_ADD_EVPC_CONNECTOR( EVPC_CONN_TAG, WRITELINE( ti99_4x_state, video_interrupt_evpc_in ) ) diff --git a/src/mame/drivers/ti99_8.cpp b/src/mame/drivers/ti99_8.cpp index afe2034aeb1..3697e70e7fa 100644 --- a/src/mame/drivers/ti99_8.cpp +++ b/src/mame/drivers/ti99_8.cpp @@ -751,8 +751,10 @@ static MACHINE_CONFIG_START( ti99_8, ti99_8_state ) // RAM MCFG_RAM_ADD(SRAM_TAG) MCFG_RAM_DEFAULT_SIZE("2K") + MCFG_RAM_DEFAULT_VALUE(0) MCFG_RAM_ADD(DRAM_TAG) MCFG_RAM_DEFAULT_SIZE("64K") + MCFG_RAM_DEFAULT_VALUE(0) /* Software list */ MCFG_SOFTWARE_LIST_ADD("cart_list_ti99", "ti99_cart") |
