diff options
author | 2016-11-19 05:35:54 +1100 | |
---|---|---|
committer | 2016-11-19 05:38:48 +1100 | |
commit | 8179a84458204a5e767446fcf7d10f032a40fd0c (patch) | |
tree | 16105e1667f811dcb24dbf0fc255166cb06df5c2 /src/emu/distate.h | |
parent | 1b489fe83034072149fb0637b20c7ba57dc72a7a (diff) |
Introduce u8/u16/u32/u64/s8/s16/s32/s64
* New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h"
* Get rid of import of cstdint types to global namespace (C99 does this anyway)
* Remove the cstdint types from everything in emu
* Get rid of U64/S64 macros
* Fix a bug in dps16 caused by incorrect use of macro
* Fix debugcon not checking for "do " prefix case-insensitively
* Fix a lot of messed up tabulation
* More constexpr
* Fix up many __names
Diffstat (limited to 'src/emu/distate.h')
-rw-r--r-- | src/emu/distate.h | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/emu/distate.h b/src/emu/distate.h index 67c706b390a..503b76c5832 100644 --- a/src/emu/distate.h +++ b/src/emu/distate.h @@ -14,8 +14,8 @@ #error Dont include this file directly; include emu.h instead. #endif -#ifndef __DISTATE_H__ -#define __DISTATE_H__ +#ifndef MAME_EMU_DISTATE_H +#define MAME_EMU_DISTATE_H //************************************************************************** @@ -46,13 +46,13 @@ class device_state_entry friend class device_state_interface; public: // construction/destruction - device_state_entry(int index, const char *symbol, void *dataptr, uint8_t size, device_state_interface *dev); + device_state_entry(int index, const char *symbol, void *dataptr, u8 size, device_state_interface *dev); device_state_entry(int index, device_state_interface *dev); public: // post-construction modifiers - device_state_entry &mask(uint64_t _mask) { m_datamask = _mask; format_from_mask(); return *this; } - device_state_entry &signed_mask(uint64_t _mask) { m_datamask = _mask; m_flags |= DSF_IMPORT_SEXT; format_from_mask(); return *this; } + device_state_entry &mask(u64 _mask) { m_datamask = _mask; format_from_mask(); return *this; } + device_state_entry &signed_mask(u64 _mask) { m_datamask = _mask; m_flags |= DSF_IMPORT_SEXT; format_from_mask(); return *this; } device_state_entry &formatstr(const char *_format); device_state_entry &callimport() { m_flags |= DSF_IMPORT; return *this; } device_state_entry &callexport() { m_flags |= DSF_EXPORT; return *this; } @@ -68,12 +68,12 @@ public: protected: // device state flags - static const uint8_t DSF_NOSHOW = 0x01; // don't display this entry in the registers view - static const uint8_t DSF_IMPORT = 0x02; // call the import function after writing new data - static const uint8_t DSF_IMPORT_SEXT = 0x04; // sign-extend the data when writing new data - static const uint8_t DSF_EXPORT = 0x08; // call the export function prior to fetching the data - static const uint8_t DSF_CUSTOM_STRING = 0x10; // set if the format has a custom string - static const uint8_t DSF_DIVIDER = 0x20; // set if this is a divider entry + static constexpr u8 DSF_NOSHOW = 0x01; // don't display this entry in the registers view + static constexpr u8 DSF_IMPORT = 0x02; // call the import function after writing new data + static constexpr u8 DSF_IMPORT_SEXT = 0x04; // sign-extend the data when writing new data + static constexpr u8 DSF_EXPORT = 0x08; // call the export function prior to fetching the data + static constexpr u8 DSF_CUSTOM_STRING = 0x10; // set if the format has a custom string + static constexpr u8 DSF_DIVIDER = 0x20; // set if this is a divider entry // helpers bool needs_custom_string() const { return ((m_flags & DSF_CUSTOM_STRING) != 0); } @@ -81,28 +81,28 @@ protected: // return the current value -- only for our friends who handle export bool needs_export() const { return ((m_flags & DSF_EXPORT) != 0); } - uint64_t value() const; + u64 value() const; std::string format(const char *string, bool maxout = false) const; // set the current value -- only for our friends who handle import bool needs_import() const { return ((m_flags & DSF_IMPORT) != 0); } - void set_value(uint64_t value) const; + void set_value(u64 value) const; void set_value(const char *string) const; // statics - static const uint64_t k_decimal_divisor[20]; // divisors for outputting decimal values + static const u64 k_decimal_divisor[20]; // divisors for outputting decimal values // public state description device_state_interface *m_device_state; // link to parent device state - uint32_t m_index; // index by which this item is referred + u32 m_index; // index by which this item is referred generic_ptr m_dataptr; // pointer to where the data lives - uint64_t m_datamask; // mask that applies to the data - uint8_t m_datasize; // size of the data - uint8_t m_flags; // flags for this data + u64 m_datamask; // mask that applies to the data + u8 m_datasize; // size of the data + u8 m_flags; // flags for this data std::string m_symbol; // symbol for display; all lower-case version for expressions std::string m_format; // supported formats bool m_default_format; // true if we are still using default format - uint64_t m_sizemask; // mask derived from the data size + u64 m_sizemask; // mask derived from the data size }; @@ -121,16 +121,16 @@ public: const std::vector<std::unique_ptr<device_state_entry>> &state_entries() const { return m_state_list; } // state getters - uint64_t state_int(int index); + u64 state_int(int index); std::string state_string(int index) const; int state_string_max_length(int index); offs_t pc() { return state_int(STATE_GENPC); } offs_t pcbase() { return state_int(STATE_GENPCBASE); } offs_t sp() { return state_int(STATE_GENSP); } - uint64_t flags() { return state_int(STATE_GENFLAGS); } + u64 flags() { return state_int(STATE_GENFLAGS); } // state setters - void set_state_int(int index, uint64_t value); + void set_state_int(int index, u64 value); void set_state_string(int index, const char *string); void set_pc(offs_t pc) { set_state_int(STATE_GENPC, pc); } @@ -147,7 +147,7 @@ public: // protected eventually { return state_add(index, symbol, &data, sizeof(data)); } - device_state_entry &state_add(int index, const char *symbol, void *data, uint8_t size); + device_state_entry &state_add(int index, const char *symbol, void *data, u8 size); // add a new divider entry device_state_entry &state_add_divider(int index); @@ -166,8 +166,8 @@ protected: const device_state_entry *state_find_entry(int index) const; // constants - static const int FAST_STATE_MIN = -4; // range for fast state - static const int FAST_STATE_MAX = 256; // lookups + static constexpr int FAST_STATE_MIN = -4; // range for fast state + static constexpr int FAST_STATE_MAX = 256; // lookups // state std::vector<std::unique_ptr<device_state_entry>> m_state_list; // head of state list @@ -206,4 +206,4 @@ inline offs_t device_t::safe_pcbase() const } -#endif /* __DISTATE_H__ */ +#endif /* MAME_EMU_DISTATE_H */ |