mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
harddriv.cpp, mccs1850.cpp: Use multibyte.h helpers
This commit is contained in:
parent
747a76dc4b
commit
e81d9d36f8
@ -21,6 +21,7 @@
|
||||
#include "harddisk.h"
|
||||
#include "romload.h"
|
||||
|
||||
#include "multibyte.h"
|
||||
#include "opresolv.h"
|
||||
|
||||
|
||||
@ -299,14 +300,14 @@ std::error_condition harddisk_image_device::internal_load_hd()
|
||||
// check for 2MG format
|
||||
if (!memcmp(header, "2IMG", 4))
|
||||
{
|
||||
skip = header[0x18] | (header[0x19] << 8) | (header[0x1a] << 16) | (header[0x1b] << 24);
|
||||
skip = get_u32le(&header[0x18]);
|
||||
osd_printf_verbose("harddriv: detected 2MG, creator is %c%c%c%c, data at %08x\n", header[4], header[5], header[6], header[7], skip);
|
||||
}
|
||||
// check for HDI format
|
||||
else if (is_filetype("hdi"))
|
||||
{
|
||||
skip = header[0x8] | (header[0x9] << 8) | (header[0xa] << 16) | (header[0xb] << 24);
|
||||
uint32_t data_size = header[0xc] | (header[0xd] << 8) | (header[0xe] << 16) | (header[0xf] << 24);
|
||||
skip = get_u32le(&header[0x8]);
|
||||
uint32_t data_size = get_u32le(&header[0xc]);
|
||||
if (data_size == length() - skip)
|
||||
{
|
||||
osd_printf_verbose("harddriv: detected Anex86 HDI, data at %08x\n", skip);
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include "emu.h"
|
||||
#include "mccs1850.h"
|
||||
|
||||
#include "multibyte.h"
|
||||
|
||||
//#define VERBOSE 0
|
||||
#include "logmacro.h"
|
||||
|
||||
@ -158,10 +160,7 @@ inline uint8_t mccs1850_device::read_register(offs_t offset)
|
||||
case REGISTER_COUNTER_LATCH:
|
||||
case REGISTER_COUNTER_LATCH+3: // Required by the NeXT power on test
|
||||
// load counter value into latch
|
||||
m_ram[REGISTER_COUNTER_LATCH] = m_counter >> 24;
|
||||
m_ram[REGISTER_COUNTER_LATCH + 1] = m_counter >> 16;
|
||||
m_ram[REGISTER_COUNTER_LATCH + 2] = m_counter >> 8;
|
||||
m_ram[REGISTER_COUNTER_LATCH + 3] = m_counter;
|
||||
put_u32be(&m_ram[REGISTER_COUNTER_LATCH], m_counter);
|
||||
break;
|
||||
|
||||
case REGISTER_TEST_1:
|
||||
@ -247,7 +246,7 @@ inline void mccs1850_device::write_register(offs_t offset, uint8_t data)
|
||||
|
||||
TIMER_CALLBACK_MEMBER(mccs1850_device::advance_seconds)
|
||||
{
|
||||
uint32_t alarm = (m_ram[REGISTER_ALARM_LATCH] << 24) | (m_ram[REGISTER_ALARM_LATCH + 1] << 16) | (m_ram[REGISTER_ALARM_LATCH + 2] << 8) | m_ram[REGISTER_ALARM_LATCH + 3];
|
||||
uint32_t alarm = get_u32be(&m_ram[REGISTER_ALARM_LATCH]);
|
||||
|
||||
m_counter++;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user