From fccb3e2f473a56d874fddff8b1bba804ed3ba813 Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Fri, 17 Nov 2023 18:30:59 +0000 Subject: [PATCH] 6883sam.cpp: Moved to machine folder, for use in non coco/dragon machines. --- scripts/src/machine.lua | 12 ++++++++++++ src/{mame/trs => devices/machine}/6883sam.cpp | 4 ++-- src/{mame/trs => devices/machine}/6883sam.h | 8 ++++---- src/mame/trs/agvision.cpp | 2 +- src/mame/trs/coco12.h | 3 ++- src/mame/trs/gime.cpp | 5 ++--- src/mame/trs/gime.h | 2 +- 7 files changed, 24 insertions(+), 12 deletions(-) rename src/{mame/trs => devices/machine}/6883sam.cpp (98%) rename src/{mame/trs => devices/machine}/6883sam.h (98%) diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index 613501ae30b..53f71fad123 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -377,6 +377,18 @@ if (MACHINES["ACIA6850"]~=null) then } end +--------------------------------------------------- +-- +--@src/devices/machine/6883sam.h,MACHINES["6883SAM"] = true +--------------------------------------------------- + +if (MACHINES["6883SAM"]~=null) then + files { + MAME_DIR .. "src/devices/machine/6883sam.cpp", + MAME_DIR .. "src/devices/machine/6883sam.h", + } +end + --------------------------------------------------- -- --@src/devices/machine/68153bim.h,MACHINES["BIM68153"] = true diff --git a/src/mame/trs/6883sam.cpp b/src/devices/machine/6883sam.cpp similarity index 98% rename from src/mame/trs/6883sam.cpp rename to src/devices/machine/6883sam.cpp index 85782868f41..13e5dec2dd5 100644 --- a/src/mame/trs/6883sam.cpp +++ b/src/devices/machine/6883sam.cpp @@ -167,7 +167,7 @@ uint8_t sam6883_device::read(offs_t offset) if (offset < (mode_64k && (m_sam_state & SAM_STATE_TY) ? 0xff00 : 0x8000)) { // RAM reads: 0000–7FFF or 0000–FEFF - if (mode_64k && (m_sam_state & (SAM_STATE_TY|SAM_STATE_P1)) == SAM_STATE_P1) + if (mode_64k && (m_sam_state & (SAM_STATE_TY | SAM_STATE_P1)) == SAM_STATE_P1) offset |= 0x8000; return m_ram_space.read_byte(offset); } @@ -204,7 +204,7 @@ void sam6883_device::write(offs_t offset, uint8_t data) if (offset < 0x8000) { // RAM write space: 0000–7FFF (nominally space 7) - if (mode_64k && (m_sam_state & (SAM_STATE_TY|SAM_STATE_P1)) == SAM_STATE_P1) + if (mode_64k && (m_sam_state & (SAM_STATE_TY | SAM_STATE_P1)) == SAM_STATE_P1) offset |= 0x8000; m_ram_space.write_byte(offset, data); } diff --git a/src/mame/trs/6883sam.h b/src/devices/machine/6883sam.h similarity index 98% rename from src/mame/trs/6883sam.h rename to src/devices/machine/6883sam.h index 74ecbb8ea29..9fbf1f70a47 100644 --- a/src/mame/trs/6883sam.h +++ b/src/devices/machine/6883sam.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_TRS_6883SAM_H -#define MAME_TRS_6883SAM_H +#ifndef MAME_MACHINE_6883SAM_H +#define MAME_MACHINE_6883SAM_H #pragma once @@ -129,7 +129,7 @@ protected: virtual space_config_vector memory_space_config() const override; private: - // memory space configuratino + // memory space configuration address_space_config m_ram_config; address_space_config m_rom0_config; address_space_config m_rom1_config; @@ -216,4 +216,4 @@ private: DECLARE_DEVICE_TYPE(SAM6883, sam6883_device) -#endif // MAME_TRS_6883SAM_H +#endif // MAME_MACHINE_6883SAM_H diff --git a/src/mame/trs/agvision.cpp b/src/mame/trs/agvision.cpp index 8aede6f6689..c4eb3b3651b 100644 --- a/src/mame/trs/agvision.cpp +++ b/src/mame/trs/agvision.cpp @@ -41,10 +41,10 @@ #include "emu.h" -#include "6883sam.h" #include "bus/rs232/rs232.h" #include "cpu/m6809/m6809.h" #include "machine/6821pia.h" +#include "machine/6883sam.h" #include "machine/ram.h" #include "video/mc6847.h" #include "screen.h" diff --git a/src/mame/trs/coco12.h b/src/mame/trs/coco12.h index 820084e8294..91f9c0a62a6 100644 --- a/src/mame/trs/coco12.h +++ b/src/mame/trs/coco12.h @@ -14,7 +14,7 @@ #pragma once #include "coco.h" -#include "6883sam.h" +#include "machine/6883sam.h" #include "machine/mos6551.h" #include "sound/ay8910.h" #include "video/mc6847.h" @@ -59,6 +59,7 @@ public: void t4426(machine_config &config); void cd6809(machine_config &config); void ms1600(machine_config &config); + protected: virtual void device_start() override; diff --git a/src/mame/trs/gime.cpp b/src/mame/trs/gime.cpp index e8dac9ddb5c..967d26643d3 100644 --- a/src/mame/trs/gime.cpp +++ b/src/mame/trs/gime.cpp @@ -84,7 +84,6 @@ #include "emu.h" #include "gime.h" -#include "6883sam.h" #include "bus/coco/cococart.h" #include "machine/ram.h" @@ -989,7 +988,7 @@ inline void gime_device::write_gime_register(offs_t offset, uint8_t data) // alone won't affect the MMU; writes to $FFAx are required to "latch" // in the $FF9B value. // - // The reason that $FF9B is not mentioned in offical documentation + // The reason that $FF9B is not mentioned in official documentation // is because it is only meaningful in CoCo 3's with the 2MB upgrade break; @@ -1197,7 +1196,7 @@ void gime_device::change_gime_firq(uint8_t data) // ignored in lo-res mode. Specifically, $FF9D is masked with $E0, and // $FF9E is masked with $3F // -// John Kowalski confirms this behavior +// John Kowalski confirms this behaviour //------------------------------------------------- inline offs_t gime_device::get_video_base() diff --git a/src/mame/trs/gime.h b/src/mame/trs/gime.h index ddeb178fd75..bebe6480a42 100644 --- a/src/mame/trs/gime.h +++ b/src/mame/trs/gime.h @@ -15,7 +15,7 @@ #pragma once #include "video/mc6847.h" -#include "6883sam.h" +#include "machine/6883sam.h" #include "machine/ram.h"