mirror of
https://github.com/holub/mame
synced 2025-05-28 16:43:04 +03:00
Replaced NVRAM_HANDLER in leland with an NVRAM device.
This commit is contained in:
parent
7676f5ae3e
commit
61f221209f
@ -28,6 +28,7 @@
|
||||
#include "emu.h"
|
||||
#include "cpu/i86/i86.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "includes/leland.h"
|
||||
#include "sound/2151intf.h"
|
||||
@ -47,8 +48,7 @@
|
||||
static ADDRESS_MAP_START( master_map_program, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x9fff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0xa000, 0xdfff) AM_ROMBANK("bank2")
|
||||
AM_RANGE(0xa000, 0xdfff) AM_WRITE(ataxx_battery_ram_w)
|
||||
AM_RANGE(0xa000, 0xdfff) AM_ROMBANK("bank2") AM_WRITE(ataxx_battery_ram_w) AM_SHARE("battery")
|
||||
AM_RANGE(0xe000, 0xf7ff) AM_RAM
|
||||
AM_RANGE(0xf800, 0xffff) AM_READWRITE(ataxx_paletteram_and_misc_r, ataxx_paletteram_and_misc_w) AM_BASE_GENERIC(paletteram)
|
||||
ADDRESS_MAP_END
|
||||
@ -329,7 +329,7 @@ static MACHINE_CONFIG_START( ataxx, driver_device )
|
||||
MDRV_MACHINE_RESET(ataxx)
|
||||
|
||||
MDRV_EEPROM_ADD("eeprom", eeprom_intf)
|
||||
MDRV_NVRAM_HANDLER(leland)
|
||||
MDRV_NVRAM_ADD_0FILL("battery")
|
||||
|
||||
/* video hardware */
|
||||
MDRV_FRAGMENT_ADD(ataxx_video)
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "emu.h"
|
||||
#include "cpu/i86/i86.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "includes/leland.h"
|
||||
#include "sound/ay8910.h"
|
||||
@ -64,8 +65,7 @@
|
||||
static ADDRESS_MAP_START( master_map_program, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x9fff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0xa000, 0xdfff) AM_ROMBANK("bank2")
|
||||
AM_RANGE(0xa000, 0xdfff) AM_WRITE(leland_battery_ram_w)
|
||||
AM_RANGE(0xa000, 0xdfff) AM_ROMBANK("bank2") AM_WRITE(leland_battery_ram_w) AM_SHARE("battery")
|
||||
AM_RANGE(0xe000, 0xefff) AM_RAM
|
||||
AM_RANGE(0xf000, 0xf3ff) AM_READWRITE(leland_gated_paletteram_r, leland_gated_paletteram_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0xf800, 0xf801) AM_WRITE(leland_master_video_addr_w)
|
||||
@ -745,9 +745,9 @@ static MACHINE_CONFIG_START( leland, driver_device )
|
||||
|
||||
MDRV_MACHINE_START(leland)
|
||||
MDRV_MACHINE_RESET(leland)
|
||||
MDRV_NVRAM_HANDLER(leland)
|
||||
|
||||
MDRV_EEPROM_ADD("eeprom", eeprom_intf)
|
||||
MDRV_NVRAM_ADD_0FILL("battery")
|
||||
|
||||
/* video hardware */
|
||||
MDRV_FRAGMENT_ADD(leland_video)
|
||||
|
@ -363,7 +363,7 @@ WRITE8_HANDLER( indyheat_analog_w )
|
||||
MACHINE_START( leland )
|
||||
{
|
||||
/* allocate extra stuff */
|
||||
battery_ram = auto_alloc_array(machine, UINT8, LELAND_BATTERY_RAM_SIZE);
|
||||
battery_ram = reinterpret_cast<UINT8 *>(memory_get_shared(*machine, "battery"));
|
||||
|
||||
/* start scanline interrupts going */
|
||||
master_int_timer = timer_alloc(machine, leland_interrupt_callback, NULL);
|
||||
@ -416,7 +416,7 @@ MACHINE_RESET( leland )
|
||||
MACHINE_START( ataxx )
|
||||
{
|
||||
/* set the odd data banks */
|
||||
battery_ram = auto_alloc_array(machine, UINT8, LELAND_BATTERY_RAM_SIZE);
|
||||
battery_ram = reinterpret_cast<UINT8 *>(memory_get_shared(*machine, "battery"));
|
||||
extra_tram = auto_alloc_array(machine, UINT8, ATAXX_EXTRA_TRAM_SIZE);
|
||||
|
||||
/* start scanline interrupts going */
|
||||
@ -912,17 +912,6 @@ WRITE8_HANDLER( ataxx_battery_ram_w )
|
||||
}
|
||||
|
||||
|
||||
NVRAM_HANDLER( leland )
|
||||
{
|
||||
if (read_or_write)
|
||||
mame_fwrite(file, battery_ram, LELAND_BATTERY_RAM_SIZE);
|
||||
else if (file)
|
||||
mame_fread(file, battery_ram, LELAND_BATTERY_RAM_SIZE);
|
||||
else
|
||||
memset(battery_ram, 0x00, LELAND_BATTERY_RAM_SIZE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user