diff options
author | 2018-10-27 10:04:51 +0900 | |
---|---|---|
committer | 2018-10-27 10:04:51 +0900 | |
commit | a990050f8f3ea9eb9863f8c3d8196ece26263d56 (patch) | |
tree | ff447c9d490cb7a42f726822e0fd66883b0fc2d8 /src/devices/machine/serflash.h | |
parent | 0d01ce1c25dcfc20ef7aa1aa1593d7793001ac56 (diff) |
serflash.cpp : Updates
Support address for when overall size is more/less than 0x8400000 bytes, or Flash page size is more/less than 2048+64
Fix block erase command, Add notes, Fix overflow
Diffstat (limited to 'src/devices/machine/serflash.h')
-rw-r--r-- | src/devices/machine/serflash.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/devices/machine/serflash.h b/src/devices/machine/serflash.h index cae78e0f6f4..20077b00263 100644 --- a/src/devices/machine/serflash.h +++ b/src/devices/machine/serflash.h @@ -20,10 +20,12 @@ public: // custom initialization for default state typedef device_delegate<void (serflash_device &, void *, size_t)> init_delegate; - // construction/destruction serflash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + // configuration + void set_flash_page_size(uint16_t size) { m_flash_page_size = size; } + DECLARE_READ8_MEMBER( flash_ready_r ); DECLARE_READ8_MEMBER( flash_io_r ); DECLARE_WRITE8_MEMBER( flash_addr_w ); @@ -37,8 +39,6 @@ public: DECLARE_WRITE8_MEMBER(n3d_flash_addr_w); protected: - static constexpr unsigned FLASH_PAGE_SIZE = 2048+64; - enum class flash_state_t : u8 { IDLE = 0, READ, READ_ID, READ_STATUS, BLOCK_ERASE, PAGE_PROGRAM }; // device-level overrides @@ -56,6 +56,8 @@ protected: size_t m_length; uint8_t* m_region; + uint32_t m_row_num; + uint16_t m_flash_page_size; flash_state_t m_flash_state; @@ -67,9 +69,10 @@ protected: uint8_t m_flash_addr_seq; uint8_t m_flash_read_seq; - uint16_t m_flash_row, m_flash_col; + uint32_t m_flash_row; + uint16_t m_flash_col; int m_flash_page_addr; - uint16_t m_flash_page_index; + uint32_t m_flash_page_index; std::vector<uint8_t> m_flashwritemap; @@ -78,7 +81,7 @@ protected: uint32_t m_flash_addr; - uint8_t m_flash_page_data[FLASH_PAGE_SIZE]; + std::vector<uint8_t> m_flash_page_data; }; |