summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/sharc/sharc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/sharc/sharc.h')
-rw-r--r--src/devices/cpu/sharc/sharc.h135
1 files changed, 67 insertions, 68 deletions
diff --git a/src/devices/cpu/sharc/sharc.h b/src/devices/cpu/sharc/sharc.h
index b644147983f..a55fa5facf7 100644
--- a/src/devices/cpu/sharc/sharc.h
+++ b/src/devices/cpu/sharc/sharc.h
@@ -1,9 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Ville Linde
-#pragma once
+#ifndef MAME_CPU_SHARC_SHARC_H
+#define MAME_CPU_SHARC_SHARC_H
-#ifndef __SHARC_H__
-#define __SHARC_H__
+#pragma once
#include "cpu/drcfe.h"
#include "cpu/drcuml.h"
@@ -14,65 +14,6 @@
#define SHARC_INPUT_FLAG3 6
-enum SHARC_BOOT_MODE
-{
- BOOT_MODE_EPROM,
- BOOT_MODE_HOST,
- BOOT_MODE_LINK,
- BOOT_MODE_NOBOOT
-};
-
-
-struct alignas(16) SHARC_DAG
-{
- uint32_t i[8];
- uint32_t m[8];
- uint32_t b[8];
- uint32_t l[8];
-};
-
-union SHARC_REG
-{
- int32_t r;
- float f;
-};
-
-struct SHARC_DMA_REGS
-{
- uint32_t control;
- uint32_t int_index;
- uint32_t int_modifier;
- uint32_t int_count;
- uint32_t chain_ptr;
- uint32_t gen_purpose;
- uint32_t ext_index;
- uint32_t ext_modifier;
- uint32_t ext_count;
-};
-
-struct SHARC_LADDR
-{
- uint32_t addr;
- uint32_t code;
- uint32_t loop_type;
-};
-
-struct SHARC_DMA_OP
-{
- uint32_t src;
- uint32_t dst;
- uint32_t chain_ptr;
- int32_t src_modifier;
- int32_t dst_modifier;
- int32_t src_count;
- int32_t dst_count;
- int32_t pmode;
- int32_t chained_direction;
- emu_timer *timer;
- bool active;
-};
-
-
// STKY flags
#define AUS 0x1 /* ALU floating-point underflow */
#define AVS 0x2 /* ALU floating-point overflow */
@@ -133,7 +74,7 @@ struct SHARC_DMA_OP
#define MCFG_SHARC_BOOT_MODE(boot_mode) \
- adsp21062_device::set_boot_mode(*device, boot_mode);
+ adsp21062_device::set_boot_mode(*device, adsp21062_device::boot_mode);
class sharc_frontend;
@@ -142,11 +83,20 @@ class adsp21062_device : public cpu_device
friend class sharc_frontend;
public:
+ enum sharc_boot_mode
+ {
+ BOOT_MODE_EPROM,
+ BOOT_MODE_HOST,
+ BOOT_MODE_LINK,
+ BOOT_MODE_NOBOOT
+ };
+
+
// construction/destruction
adsp21062_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock);
// static configuration helpers
- static void set_boot_mode(device_t &device, const SHARC_BOOT_MODE boot_mode) { downcast<adsp21062_device &>(device).m_boot_mode = boot_mode; }
+ static void set_boot_mode(device_t &device, const sharc_boot_mode boot_mode) { downcast<adsp21062_device &>(device).m_boot_mode = boot_mode; }
void set_flag_input(int flag_num, int state);
void external_iop_write(uint32_t address, uint32_t data);
@@ -276,6 +226,56 @@ protected:
virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
private:
+ struct alignas(16) SHARC_DAG
+ {
+ uint32_t i[8];
+ uint32_t m[8];
+ uint32_t b[8];
+ uint32_t l[8];
+ };
+
+ union SHARC_REG
+ {
+ int32_t r;
+ float f;
+ };
+
+ struct SHARC_DMA_REGS
+ {
+ uint32_t control;
+ uint32_t int_index;
+ uint32_t int_modifier;
+ uint32_t int_count;
+ uint32_t chain_ptr;
+ uint32_t gen_purpose;
+ uint32_t ext_index;
+ uint32_t ext_modifier;
+ uint32_t ext_count;
+ };
+
+ struct SHARC_LADDR
+ {
+ uint32_t addr;
+ uint32_t code;
+ uint32_t loop_type;
+ };
+
+ struct SHARC_DMA_OP
+ {
+ uint32_t src;
+ uint32_t dst;
+ uint32_t chain_ptr;
+ int32_t src_modifier;
+ int32_t dst_modifier;
+ int32_t src_count;
+ int32_t dst_count;
+ int32_t pmode;
+ int32_t chained_direction;
+ emu_timer *timer;
+ bool active;
+ };
+
+
address_space_config m_program_config;
address_space_config m_data_config;
@@ -425,7 +425,7 @@ private:
sharc_internal_state* m_core;
- SHARC_BOOT_MODE m_boot_mode;
+ sharc_boot_mode m_boot_mode;
// UML stuff
drc_cache m_cache;
@@ -652,7 +652,6 @@ private:
};
-extern const device_type ADSP21062;
-
+DECLARE_DEVICE_TYPE(ADSP21062, adsp21062_device)
-#endif /* __SHARC_H__ */
+#endif // MAME_CPU_SHARC_SHARC_H