diff options
| author | 2026-04-25 16:08:02 +0100 | |
|---|---|---|
| committer | 2026-04-25 11:08:02 -0400 | |
| commit | 49971e37c7814313985f7fee54387dbf7a1cd9c5 (patch) | |
| tree | 95f0d3ac160e9886e698f11e91eee5bbc03b7adc /scripts | |
| parent | d3c426df8f0baed9379f6425fdd6c7cdf17b3054 (diff) | |
Refactor 28-series EEPROM code (#15237)
* Refactor 28-series EEPROM code
Refactor 28-series EEPROM code:
- Separate out a generic `eeprom28_device` template
- Create Xicor x28 instantiations with appropriate template parameters.
Add functionality to the `eeprom28_device` template to implement Atmel-style
- Identification Page
- Hardware Chip Erase
- Software Chip Erase
Add a templated `eeprom28_nvram_device` subclass that adds an `device_nvram_interface` implementation.
Add `at28.{h,cpp}` specializations implementing known Atmel AT28 devices.
Both X28 and AT28 devices are made available both with and without nvram support.
This also replaces the existing `at28c64b` implementation. This has two current users in the codebase, both of which are Apple II cards. I have very little experience with that, sadly. But with many thanks to @rb6502 I was able to test this in the `booti` device, which helped me identify and fix something I had missed in the ee28 implementation: while the EEPROM is buffering data, reads from the page being buffered will be sourced from the buffer, so will include whatever is currently being buffered. I've gathered more detailed results of testing and am happy to share those on request.
I'm using C++20 concepts to elide some member functions from the templates; and macros to simplify declaring device classes and types both with and without NVRAM.
All of this works, and adds what I think is quite complete support for a number of similar real-world devices in a way that I hope is reasonable documented and maintainable. I've tried to keep this in line with MAME's guidelines and coding standards and what I've observed as existing practices, but I'm sure there are things I've missed or got wrong. So any feedback or guidance would be greatly appreciated.
* ee28.* -> eeprom28.*
improve logging macros
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/src/machine.lua | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index a63d1b12a82..21c4b9b1ec6 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -166,6 +166,20 @@ end --------------------------------------------------- -- +--@src/devices/machine/at28.h,MACHINES["AT28"] = true +--------------------------------------------------- + +if MACHINES["AT28"] then + files { + MAME_DIR .. "src/devices/machine/at28.cpp", + MAME_DIR .. "src/devices/machine/at28.h", + MAME_DIR .. "src/devices/machine/ee28.ipp", + MAME_DIR .. "src/devices/machine/ee28.h", + } +end + +--------------------------------------------------- +-- --@src/devices/machine/autoconfig.h,MACHINES["AUTOCONFIG"] = true --------------------------------------------------- @@ -897,18 +911,6 @@ end --------------------------------------------------- -- ---@src/devices/machine/at28c64b.h,MACHINES["AT28C64B"] = true ---------------------------------------------------- - -if MACHINES["AT28C64B"] then - files { - MAME_DIR .. "src/devices/machine/at28c64b.cpp", - MAME_DIR .. "src/devices/machine/at28c64b.h", - } -end - ---------------------------------------------------- --- --@src/devices/machine/at29x.h,MACHINES["AT29X"] = true --------------------------------------------------- @@ -4204,8 +4206,9 @@ end if MACHINES["X28"] then files { MAME_DIR .. "src/devices/machine/x28.cpp", - MAME_DIR .. "src/devices/machine/x28.ipp", MAME_DIR .. "src/devices/machine/x28.h", + MAME_DIR .. "src/devices/machine/ee28.ipp", + MAME_DIR .. "src/devices/machine/ee28.h", } end |
