1 // license:BSD-3-Clause 2 // copyright-holders:Curt Coder 3 /********************************************************************** 4 5 StarPoint Software StarDOS cartridge emulation 6 7 **********************************************************************/ 8 9 #ifndef MAME_BUS_C4_STARDOS_H 10 #define MAME_BUS_C4_STARDOS_H 11 12 #pragma once 13 14 15 #include "exp.h" 16 #include "machine/6821pia.h" 17 18 19 20 //************************************************************************** 21 // TYPE DEFINITIONS 22 //************************************************************************** 23 24 // ======================> c64_stardos_cartridge_device 25 26 class c64_stardos_cartridge_device : public device_t, 27 public device_c64_expansion_card_interface 28 { 29 public: 30 // construction/destruction 31 c64_stardos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); 32 33 // optional information overrides 34 virtual ioport_constructor device_input_ports() const override; 35 36 protected: 37 // device-level overrides 38 virtual void device_start() override; 39 40 // device_c64_expansion_card_interface overrides 41 virtual uint8_t c64_cd_r(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; 42 virtual void c64_cd_w(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; 43 virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; 44 virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override; 45 46 private: 47 inline void charge_io1_capacitor(); 48 inline void charge_io2_capacitor(); 49 50 int m_io1_charge; 51 int m_io2_charge; 52 }; 53 54 55 // device type definition 56 DECLARE_DEVICE_TYPE(C64_STARDOS, c64_stardos_cartridge_device) 57 58 59 #endif // MAME_BUS_C4_STARDOS_H 60