1 // license:GPL-2.0+
2 // copyright-holders:Dirk Best
3 /***************************************************************************
4
5 Datel Action Replay
6
7 Freezer cartridge for Amiga 500 and Amiga 2000
8
9 Skeleton device, just loads the ROMs and generates the NMI
10 for now.
11
12 Hardware notes:
13 - http://www.mways.co.uk/amiga/howtocode/text/actionreplay.php
14
15 ***************************************************************************/
16
17 #include "emu.h"
18 #include "action_replay.h"
19
20
21 //**************************************************************************
22 // DEVICE DEFINITIONS
23 //**************************************************************************
24
25 DEFINE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK1, bus::amiga::zorro, action_replay_mk1_device, "zorro_ar1", "Datel Action Replay MK-I")
26 DEFINE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK2, bus::amiga::zorro, action_replay_mk2_device, "zorro_ar2", "Datel Action Replay MK-II")
27 DEFINE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK3, bus::amiga::zorro, action_replay_mk3_device, "zorro_ar3", "Datel Action Replay MK-III")
28
29
30 namespace bus { namespace amiga { namespace zorro {
31
32 //-------------------------------------------------
33 // input_ports - device-specific input ports
34 //-------------------------------------------------
35
36 static INPUT_PORTS_START( ar_button )
37 PORT_START("freeze")
PORT_CODE(KEYCODE_F12)38 PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, action_replay_device_base, freeze, 0)
39 INPUT_PORTS_END
40
41 ioport_constructor action_replay_device_base::device_input_ports() const
42 {
43 return INPUT_PORTS_NAME( ar_button );
44 }
45
46 //-------------------------------------------------
47 // rom_region - device-specific ROM region
48 //-------------------------------------------------
49
50 ROM_START( ar_mk1 )
51 ROM_REGION(0x10000, "firmware", 0)
52 ROM_DEFAULT_BIOS("v150")
53 ROM_SYSTEM_BIOS(0, "v100", "Version 1.00")
54 ROMX_LOAD("ar1_v100.bin", 0x0000, 0x10000, BAD_DUMP CRC(2d921771) SHA1(1ead9dda2dad29146441f5ef7218375022e01248), ROM_BIOS(0))
55 ROM_SYSTEM_BIOS(1, "v150", "Version 1.50")
56 ROMX_LOAD("ar1_v150.bin", 0x0000, 0x10000, BAD_DUMP CRC(f82c4258) SHA1(843b433b2c56640e045d5fdc854dc6b1a4964e7c), ROM_BIOS(1))
57 ROM_END
58
device_rom_region() const59 const tiny_rom_entry *action_replay_mk1_device::device_rom_region() const
60 {
61 return ROM_NAME( ar_mk1 );
62 }
63
64 ROM_START( ar_mk2 )
65 ROM_REGION(0x20000, "firmware", 0)
66 ROM_DEFAULT_BIOS("v214")
67 ROM_SYSTEM_BIOS(0, "v205", "Version 2.05")
68 ROMX_LOAD("ar2_v205.bin", 0x0000, 0x20000, BAD_DUMP CRC(4051eef8) SHA1(9df22b1d3285b522c223697c83d144d04e961a4a), ROM_BIOS(0))
69 ROM_SYSTEM_BIOS(1, "v212", "Version 2.12")
70 ROMX_LOAD("ar2_v212.bin", 0x0000, 0x20000, BAD_DUMP CRC(d29bdd86) SHA1(76c2900457badf22b742f0af48b78937e8b67694), ROM_BIOS(1))
71 ROM_SYSTEM_BIOS(2, "v214", "Version 2.14")
72 ROMX_LOAD("ar2_v214.bin", 0x0000, 0x20000, BAD_DUMP CRC(1bb3d0a8) SHA1(14b1f5a69efb6f4e2331970e6ca0f33c0f04ac91), ROM_BIOS(2))
73 ROM_END
74
device_rom_region() const75 const tiny_rom_entry *action_replay_mk2_device::device_rom_region() const
76 {
77 return ROM_NAME( ar_mk2 );
78 }
79
80 ROM_START( ar_mk3 )
81 ROM_REGION(0x40000, "firmware", 0)
82 ROM_DEFAULT_BIOS("v309")
83 ROM_SYSTEM_BIOS(0, "v309", "Version 3.09")
84 ROMX_LOAD("ar3_v309.evn", 0x00000, 0x20000, CRC(2b84519f) SHA1(7841873bf009d8341dfa2794b3751bacf86adcc8), ROM_SKIP(1) | ROM_BIOS(0))
85 ROMX_LOAD("ar3_v309.odd", 0x00001, 0x20000, CRC(1d35bd56) SHA1(6464be1626b519499e76e4e3409e8016515d48b6), ROM_SKIP(1) | ROM_BIOS(0))
86 ROM_SYSTEM_BIOS(1, "v317", "Version 3.17")
87 ROMX_LOAD("ar3_v314.bin", 0x0000, 0x40000, BAD_DUMP CRC(009f7768) SHA1(0439d6ccc2a0e5c2e83fcf2389dc4d4a440a4c62), ROM_BIOS(1))
88 ROM_END
89
device_rom_region() const90 const tiny_rom_entry *action_replay_mk3_device::device_rom_region() const
91 {
92 return ROM_NAME( ar_mk3 );
93 }
94
95
96 //**************************************************************************
97 // LIVE DEVICE
98 //**************************************************************************
99
100 //-------------------------------------------------
101 // action_replay_device_base - constructor
102 //-------------------------------------------------
103
action_replay_device_base(const machine_config & mconfig,device_type type,const char * tag,device_t * owner,uint32_t clock)104 action_replay_device_base::action_replay_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
105 device_t(mconfig, type, tag, owner, clock),
106 device_exp_card_interface(mconfig, *this),
107 m_button(*this, "freeze")
108 {
109 }
110
action_replay_mk1_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)111 action_replay_mk1_device::action_replay_mk1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
112 action_replay_device_base(mconfig, ZORRO_ACTION_REPLAY_MK1, tag, owner, clock)
113 {
114 }
115
action_replay_mk2_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)116 action_replay_mk2_device::action_replay_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
117 action_replay_device_base(mconfig, ZORRO_ACTION_REPLAY_MK2, tag, owner, clock)
118 {
119 }
120
action_replay_mk3_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)121 action_replay_mk3_device::action_replay_mk3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
122 action_replay_device_base(mconfig, ZORRO_ACTION_REPLAY_MK3, tag, owner, clock)
123 {
124 }
125
126 //-------------------------------------------------
127 // device_start - device-specific startup
128 //-------------------------------------------------
129
device_start()130 void action_replay_device_base::device_start()
131 {
132 }
133
134 //-------------------------------------------------
135 // device_reset - device-specific reset
136 //-------------------------------------------------
137
device_reset()138 void action_replay_device_base::device_reset()
139 {
140 }
141
142
143 //**************************************************************************
144 // IMPLEMENTATION
145 //**************************************************************************
146
INPUT_CHANGED_MEMBER(action_replay_device_base::freeze)147 INPUT_CHANGED_MEMBER( action_replay_device_base::freeze )
148 {
149 // pushing the freeze button generates an nmi
150 m_slot->ipl_w(newval == 1 ? 7 : 0);
151 }
152
153 } } } // namespace bus::amiga::zorro
154