mirror of
https://github.com/holub/mame
synced 2025-06-22 12:28:33 +03:00
n64.cpp: Actually remove machine().device from this driver (nw)
This commit is contained in:
parent
349cb3cd64
commit
f3065f4da2
@ -306,7 +306,6 @@ void n64_mess_state::mempak_format(uint8_t* pak)
|
||||
DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart)
|
||||
{
|
||||
int i, length;
|
||||
n64_periphs *periphs = machine().device<n64_periphs>("rcp");
|
||||
uint8_t *cart = memregion("user2")->base();
|
||||
|
||||
if (!image.loaded_through_softlist())
|
||||
@ -318,7 +317,7 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart)
|
||||
length = image.get_software_region_length("rom");
|
||||
memcpy(cart, image.get_software_region("rom"), length);
|
||||
}
|
||||
periphs->cart_length = length;
|
||||
m_rcp_periphs->cart_length = length;
|
||||
|
||||
if (cart[0] == 0x37 && cart[1] == 0x80)
|
||||
{
|
||||
@ -349,11 +348,11 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart)
|
||||
}
|
||||
}
|
||||
|
||||
periphs->m_nvram_image = &image.device();
|
||||
m_rcp_periphs->m_nvram_image = &image.device();
|
||||
|
||||
logerror("cart length = %d\n", length);
|
||||
|
||||
device_image_interface *battery_image = dynamic_cast<device_image_interface *>(periphs->m_nvram_image);
|
||||
device_image_interface *battery_image = dynamic_cast<device_image_interface *>(m_rcp_periphs->m_nvram_image);
|
||||
if(battery_image)
|
||||
{
|
||||
//printf("Loading\n");
|
||||
@ -363,16 +362,16 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart)
|
||||
{
|
||||
memcpy(m_sram, data, 0x20000);
|
||||
}
|
||||
memcpy(periphs->m_save_data.eeprom, data + 0x20000, 0x800);
|
||||
memcpy(periphs->m_save_data.mempak[0], data + 0x20800, 0x8000);
|
||||
memcpy(periphs->m_save_data.mempak[1], data + 0x28800, 0x8000);
|
||||
memcpy(m_rcp_periphs->m_save_data.eeprom, data + 0x20000, 0x800);
|
||||
memcpy(m_rcp_periphs->m_save_data.mempak[0], data + 0x20800, 0x8000);
|
||||
memcpy(m_rcp_periphs->m_save_data.mempak[1], data + 0x28800, 0x8000);
|
||||
}
|
||||
|
||||
if(periphs->m_save_data.mempak[0][0] == 0) // Init if new
|
||||
if (m_rcp_periphs->m_save_data.mempak[0][0] == 0) // Init if new
|
||||
{
|
||||
memset(periphs->m_save_data.eeprom, 0, 0x800);
|
||||
mempak_format(periphs->m_save_data.mempak[0]);
|
||||
mempak_format(periphs->m_save_data.mempak[1]);
|
||||
memset(m_rcp_periphs->m_save_data.eeprom, 0, 0x800);
|
||||
mempak_format(m_rcp_periphs->m_save_data.mempak[0]);
|
||||
mempak_format(m_rcp_periphs->m_save_data.mempak[1]);
|
||||
}
|
||||
|
||||
return image_init_result::PASS;
|
||||
@ -381,7 +380,7 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart)
|
||||
MACHINE_START_MEMBER(n64_mess_state,n64dd)
|
||||
{
|
||||
machine_start();
|
||||
machine().device<n64_periphs>("rcp")->dd_present = true;
|
||||
m_rcp_periphs->dd_present = true;
|
||||
uint8_t *ipl = memregion("ddipl")->base();
|
||||
|
||||
for (int i = 0; i < 0x400000; i += 4)
|
||||
@ -411,19 +410,18 @@ image_init_result n64_mess_state::disk_load(device_image_interface &image)
|
||||
{
|
||||
image.fseek(0, SEEK_SET);
|
||||
image.fread(memregion("disk")->base(), image.length());
|
||||
machine().device<n64_periphs>("rcp")->disk_present = true;
|
||||
m_rcp_periphs->disk_present = true;
|
||||
return image_init_result::PASS;
|
||||
}
|
||||
|
||||
void n64_mess_state::disk_unload(device_image_interface &image)
|
||||
{
|
||||
machine().device<n64_periphs>("rcp")->disk_present = false;
|
||||
m_rcp_periphs->disk_present = false;
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(n64_mess_state::n64_reset_poll)
|
||||
{
|
||||
n64_periphs *periphs = machine().device<n64_periphs>("rcp");
|
||||
periphs->poll_reset_button((ioport("RESET")->read() & 1) ? true : false);
|
||||
m_rcp_periphs->poll_reset_button((ioport("RESET")->read() & 1) ? true : false);
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(n64_mess_state::n64)
|
||||
|
Loading…
Reference in New Issue
Block a user