summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/smartmed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/smartmed.cpp')
-rw-r--r--src/devices/machine/smartmed.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/devices/machine/smartmed.cpp b/src/devices/machine/smartmed.cpp
index d541f7ca52b..608122981af 100644
--- a/src/devices/machine/smartmed.cpp
+++ b/src/devices/machine/smartmed.cpp
@@ -27,16 +27,16 @@
/* machine-independent big-endian 32-bit integer */
struct UINT32BE
{
- UINT8 bytes[4];
+ uint8_t bytes[4];
};
-static inline UINT32 get_UINT32BE(UINT32BE word)
+static inline uint32_t get_UINT32BE(UINT32BE word)
{
return (word.bytes[0] << 24) | (word.bytes[1] << 16) | (word.bytes[2] << 8) | word.bytes[3];
}
#ifdef UNUSED_FUNCTION
-static inline void set_UINT32BE(UINT32BE *word, UINT32 data)
+static inline void set_UINT32BE(UINT32BE *word, uint32_t data)
{
word->bytes[0] = (data >> 24) & 0xff;
word->bytes[1] = (data >> 16) & 0xff;
@@ -48,7 +48,7 @@ static inline void set_UINT32BE(UINT32BE *word, UINT32 data)
/* SmartMedia image header */
struct SM_disk_image_header
{
- UINT8 version;
+ uint8_t version;
UINT32BE page_data_size;
UINT32BE page_total_size;
UINT32BE num_pages;
@@ -57,11 +57,11 @@ struct SM_disk_image_header
struct disk_image_format_2_header
{
- UINT8 data1[3];
- UINT8 padding1[256-3];
- UINT8 data2[16];
- UINT8 data3[16];
- UINT8 padding2[768-32];
+ uint8_t data1[3];
+ uint8_t padding1[256-3];
+ uint8_t data2[16];
+ uint8_t data3[16];
+ uint8_t padding2[768-32];
};
enum
@@ -72,7 +72,7 @@ enum
const device_type NAND = &device_creator<nand_device>;
-nand_device::nand_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+nand_device::nand_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, NAND, "NAND Flash Memory", tag, owner, clock, "nand", __FILE__),
m_page_data_size(0),
m_page_total_size(0),
@@ -88,7 +88,7 @@ nand_device::nand_device(const machine_config &mconfig, const char *tag, device_
memset(m_id, 0, sizeof(m_id));
}
-nand_device::nand_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
+nand_device::nand_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
m_page_data_size(0),
m_page_total_size(0),
@@ -119,7 +119,7 @@ void nand_device::device_start()
m_accumulated_status = 0;
m_mp_opcode = 0;
m_mode_3065 = 0;
- m_pagereg = std::make_unique<UINT8[]>(m_page_total_size);
+ m_pagereg = std::make_unique<uint8_t[]>(m_page_total_size);
#ifdef SMARTMEDIA_IMAGE_SAVE
m_image_format = 0;
@@ -150,8 +150,8 @@ image_init_result smartmedia_image_device::smartmedia_format_1()
m_page_total_size = get_UINT32BE(custom_header.page_total_size);
m_num_pages = get_UINT32BE(custom_header.num_pages);
m_log2_pages_per_block = get_UINT32BE(custom_header.log2_pages_per_block);
- m_data_ptr = auto_alloc_array(machine(), UINT8, m_page_total_size*m_num_pages);
- m_data_uid_ptr = std::make_unique<UINT8[]>(256 + 16);
+ m_data_ptr = auto_alloc_array(machine(), uint8_t, m_page_total_size*m_num_pages);
+ m_data_uid_ptr = std::make_unique<uint8_t[]>(256 + 16);
m_mode = SM_M_INIT;
m_pointer_mode = SM_PM_A;
m_page_addr = 0;
@@ -160,7 +160,7 @@ image_init_result smartmedia_image_device::smartmedia_format_1()
if (!is_readonly())
m_status |= 0x80;
m_accumulated_status = 0;
- m_pagereg = std::make_unique<UINT8[]>(m_page_total_size);
+ m_pagereg = std::make_unique<uint8_t[]>(m_page_total_size);
memset( m_id, 0, sizeof( m_id));
m_id_len = 0;
m_col_address_cycles = 1;
@@ -189,7 +189,7 @@ image_init_result smartmedia_image_device::smartmedia_format_1()
return image_init_result::PASS;
}
-int smartmedia_image_device::detect_geometry( UINT8 id1, UINT8 id2)
+int smartmedia_image_device::detect_geometry( uint8_t id1, uint8_t id2)
{
int result = FALSE;
@@ -245,8 +245,8 @@ image_init_result smartmedia_image_device::smartmedia_format_2()
return image_init_result::FAIL;
}
- m_data_ptr = auto_alloc_array(machine(), UINT8, m_page_total_size*m_num_pages);
- m_data_uid_ptr = std::make_unique<UINT8[]>(256 + 16);
+ m_data_ptr = auto_alloc_array(machine(), uint8_t, m_page_total_size*m_num_pages);
+ m_data_uid_ptr = std::make_unique<uint8_t[]>(256 + 16);
m_mode = SM_M_INIT;
m_pointer_mode = SM_PM_A;
m_page_addr = 0;
@@ -255,7 +255,7 @@ image_init_result smartmedia_image_device::smartmedia_format_2()
if (!is_readonly())
m_status |= 0x80;
m_accumulated_status = 0;
- m_pagereg = std::make_unique<UINT8[]>(m_page_total_size);
+ m_pagereg = std::make_unique<uint8_t[]>(m_page_total_size);
m_id_len = 3;
memcpy( m_id, custom_header.data1, m_id_len);
m_mp_opcode = 0;
@@ -282,7 +282,7 @@ image_init_result smartmedia_image_device::smartmedia_format_2()
image_init_result smartmedia_image_device::call_load()
{
image_init_result result;
- UINT64 position;
+ uint64_t position;
// try format 1
position = ftell();
result = smartmedia_format_1();
@@ -343,7 +343,7 @@ void smartmedia_image_device::call_unload()
m_byte_addr = 0;
m_status = 0xC0;
m_accumulated_status = 0;
- m_pagereg = std::make_unique<UINT8[]>(m_page_total_size);
+ m_pagereg = std::make_unique<uint8_t[]>(m_page_total_size);
memset( m_id, 0, sizeof( m_id));
m_id_len = 0;
m_mp_opcode = 0;
@@ -376,13 +376,13 @@ int nand_device::is_busy()
void nand_device::set_data_ptr(void *ptr)
{
- m_data_ptr = (UINT8 *)ptr;
+ m_data_ptr = (uint8_t *)ptr;
}
/*
write a byte to SmartMedia command port
*/
-void nand_device::command_w(UINT8 data)
+void nand_device::command_w(uint8_t data)
{
if (!is_present())
return;
@@ -593,7 +593,7 @@ void nand_device::command_w(UINT8 data)
/*
write a byte to SmartMedia address port
*/
-void nand_device::address_w(UINT8 data)
+void nand_device::address_w(uint8_t data)
{
if (!is_present())
return;
@@ -671,9 +671,9 @@ void nand_device::address_w(UINT8 data)
/*
read a byte from SmartMedia data port
*/
-UINT8 nand_device::data_r()
+uint8_t nand_device::data_r()
{
- UINT8 reply = 0;
+ uint8_t reply = 0;
if (!is_present())
return 0;
@@ -732,7 +732,7 @@ UINT8 nand_device::data_r()
/*
write a byte to SmartMedia data port
*/
-void nand_device::data_w(UINT8 data)
+void nand_device::data_w(uint8_t data)
{
if (!is_present())
return;
@@ -779,7 +779,7 @@ void nand_device::device_reset()
const device_type SMARTMEDIA = &device_creator<smartmedia_image_device>;
-smartmedia_image_device::smartmedia_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+smartmedia_image_device::smartmedia_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nand_device(mconfig, SMARTMEDIA, "SmartMedia Flash ROM", tag, owner, clock, "smartmedia", __FILE__),
device_image_interface(mconfig, *this)
{