Previous 199869 Revisions Next

r20002 Wednesday 2nd January, 2013 at 02:15:20 UTC by R. Belmont
And the rest of that commit (nw)
[src/mess/machine]cuda.c cuda.h egret.c egret.h

trunk/src/mess/machine/cuda.c
r20001r20002
132132
133133                adb_in = (data & 0x80) ? true : false;
134134
135            mac_state *mac = machine().driver_data<mac_state>();
136            mac->adb_linechange(((data & 0x80) >> 7) ^ 1, (int)(machine().time().as_ticks(1000000) - last_adb_time));
135                m_adb_dtime = (int)(machine().time().as_ticks(1000000) - last_adb_time);
136            m_out_adb_func(((data & 0x80) >> 7) ^ 1);
137137
138138            last_adb = data & 0x80;
139139            last_adb_time = machine().time().as_ticks(1000000);
r20001r20002
405405void cuda_device::device_start()
406406{
407407    m_out_reset_func.resolve(m_out_reset_cb, *this);
408    m_out_adb_func.resolve(m_out_adb_cb, *this);
408409
409410   m_timer = timer_alloc(0, NULL);
410411    m_prog_timer = timer_alloc(1, NULL);
r20001r20002
426427   save_item(NAME(via_clock));
427428   save_item(NAME(adb_in));
428429   save_item(NAME(reset_line));
430    save_item(NAME(m_adb_dtime));
429431   save_item(NAME(pram_loaded));
430432   save_item(NAME(pram));
431433   save_item(NAME(disk_pram));
trunk/src/mess/machine/cuda.h
r20001r20002
55
66#include "emu.h"
77
8
9
108//**************************************************************************
119//  MACROS / CONSTANTS
1210//**************************************************************************
r20001r20002
3735#define MCFG_CUDA_TYPE(_type) \
3836    cuda_device::static_set_type(*device, _type);
3937
38#define MCFG_CUDA_REMOVE() \
39    MCFG_DEVICE_REMOVE(CUDA_TAG)
40
4041//**************************************************************************
4142//  TYPE DEFINITIONS
4243//**************************************************************************
r20001r20002
4445struct cuda_interface
4546{
4647    devcb_write_line    m_out_reset_cb;
48    devcb_write_line    m_out_adb_cb;
4749};
4850
4951// ======================> cuda_device
r20001r20002
8587    void set_via_data(UINT8 dat) { via_data = dat; }
8688    UINT8 get_via_clock() { return via_clock; }
8789    void set_adb_line(int linestate) { adb_in = (linestate == ASSERT_LINE) ? true : false; }
90    int get_adb_dtime() { return m_adb_dtime; }
8891
8992    int rom_offset;
9093
r20001r20002
112115    bool cuda_controls_power;
113116    bool adb_in;
114117    int reset_line;
118    int m_adb_dtime;
115119    emu_timer *m_timer, *m_prog_timer;
116120    UINT8 pram[0x100], disk_pram[0x100];
117121    bool pram_loaded;
r20001r20002
119123    void send_port(address_space &space, UINT8 offset, UINT8 data);
120124
121125   devcb_resolved_write_line   m_out_reset_func;
126    devcb_resolved_write_line   m_out_adb_func;
122127};
123128
124129// device type definition
trunk/src/mess/machine/egret.c
r20001r20002
130130            // allow the linechange handler to override us
131131                adb_in = (data & 0x80) ? true : false;
132132
133            mac_state *mac = machine().driver_data<mac_state>();
134            mac->adb_linechange(((data & 0x80) >> 7) ^ 1, (int)(machine().time().as_ticks(1000000) - last_adb_time));
133            m_adb_dtime = (int)(machine().time().as_ticks(1000000) - last_adb_time);
134            m_out_adb_func(((data & 0x80) >> 7) ^ 1);
135135
136136            last_adb = data & 0x80;
137137            last_adb_time = machine().time().as_ticks(1000000);
r20001r20002
177177            // falling edge, should reset the machine too
178178            if ((ports[2] & 8) && !(data&8))
179179            {
180               mac_state *mac = machine().driver_data<mac_state>();
181
182               // force the memory overlay
183               mac->set_memory_overlay(0);
184               mac->set_memory_overlay(1);
185
186180               // if PRAM's waiting to be loaded, transfer it now
187181               if (!pram_loaded)
188182               {
r20001r20002
191185               }
192186            }
193187
194            machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, (reset_line & 8) ? ASSERT_LINE : CLEAR_LINE);
188            m_out_reset_func((reset_line & 8) ? ASSERT_LINE : CLEAR_LINE);
195189         }
196190         break;
197191   }
r20001r20002
356350   egret.rom_offset = type;
357351}
358352
353void egret_device::device_config_complete()
354{
355    m_shortname = "egret";
356
357   // inherit a copy of the static data
358   const egret_interface *intf = reinterpret_cast<const egret_interface *>(static_config());
359   if (intf != NULL)
360   {
361      *static_cast<egret_interface *>(this) = *intf;
362   }
363   // or initialize to defaults if none provided
364   else
365   {
366      memset(&m_out_reset_cb, 0, sizeof(m_out_reset_cb));
367      memset(&m_out_adb_cb, 0, sizeof(m_out_adb_cb));
368   }
369}
370
359371//-------------------------------------------------
360372//  device_start - device-specific startup
361373//-------------------------------------------------
362374
363375void egret_device::device_start()
364376{
377    m_out_reset_func.resolve(m_out_reset_cb, *this);
378    m_out_adb_func.resolve(m_out_adb_cb, *this);
379
365380   m_timer = timer_alloc(0, NULL);
366381   save_item(NAME(ddrs[0]));
367382   save_item(NAME(ddrs[1]));
r20001r20002
380395   save_item(NAME(via_clock));
381396   save_item(NAME(adb_in));
382397   save_item(NAME(reset_line));
398   save_item(NAME(m_adb_dtime));
383399   save_item(NAME(pram_loaded));
384400   save_item(NAME(pram));
385401   save_item(NAME(disk_pram));
trunk/src/mess/machine/egret.h
r20001r20002
2121//  INTERFACE CONFIGURATION MACROS
2222//**************************************************************************
2323
24#define MCFG_EGRET_ADD(_type) \
24#define MCFG_EGRET_ADD(_type, _config) \
2525    MCFG_DEVICE_ADD(EGRET_TAG, EGRET, 0) \
26    MCFG_DEVICE_CONFIG(_config) \
2627    MCFG_EGRET_TYPE(_type)
2728
28#define MCFG_EGRET_REPLACE(_type) \
29#define MCFG_EGRET_REPLACE(_type, _config) \
2930    MCFG_DEVICE_REPLACE(EGRET_TAG, EGRET, 0) \
31    MCFG_DEVICE_CONFIG(_config) \
3032    MCFG_EGRET_TYPE(_type)
3133
3234#define MCFG_EGRET_TYPE(_type) \
r20001r20002
3941//  TYPE DEFINITIONS
4042//**************************************************************************
4143
44struct egret_interface
45{
46    devcb_write_line    m_out_reset_cb;
47    devcb_write_line    m_out_adb_cb;
48};
49
4250// ======================> egret_device
4351
44class egret_device :  public device_t, public device_nvram_interface
52class egret_device :  public device_t, public device_nvram_interface, public egret_interface
4553{
4654public:
4755    // construction/destruction
r20001r20002
7886    void set_via_data(UINT8 dat) { via_data = dat; }
7987    UINT8 get_via_clock() { return via_clock; }
8088    void set_adb_line(int linestate) { adb_in = (linestate == ASSERT_LINE) ? true : false; }
89    int get_adb_dtime() { return m_adb_dtime; }
8190
8291    int rom_offset;
8392
r20001r20002
8594    // device-level overrides
8695    virtual void device_start();
8796    virtual void device_reset();
88    virtual void device_config_complete() { m_shortname = "egret"; }
97    virtual void device_config_complete();
8998    virtual machine_config_constructor device_mconfig_additions() const;
9099    virtual const rom_entry *device_rom_region() const;
91100
r20001r20002
105114    bool egret_controls_power;
106115    bool adb_in;
107116    int reset_line;
117    int m_adb_dtime;
108118    emu_timer *m_timer;
109119    UINT8 pram[0x100], disk_pram[0x100];
110120    bool pram_loaded;
111121
112122    void send_port(address_space &space, UINT8 offset, UINT8 data);
123
124   devcb_resolved_write_line   m_out_reset_func;
125    devcb_resolved_write_line   m_out_adb_func;
113126};
114127
115128// device type definition

Previous 199869 Revisions Next


© 1997-2024 The MAME Team