Previous 15994 Revisions Next

r13613 Sunday 18th December, 2011 at 04:10:07 UTC by R. Belmont
mac: match dumped Egret ROM versions to known machines. II/IIx/IIcx now default to Apple 4*8 video card instead of RasterOps board to better represent a common config and boot faster. [R. Belmont]
[src/mess/drivers]mac.c
[src/mess/includes]mac.h
[src/mess/machine]egret.c egret.h

src/mess/machine/egret.c
r13612r13613
5656const device_type EGRET = &device_creator<egret_device>;
5757
5858ROM_START( egret )
59   ROM_REGION(0x1100, EGRET_CPU_TAG, 0)
60   ROM_LOAD( "341s0851.bin", 0x0000, 0x1100, CRC(ea9ea6e4) SHA1(8b0dae3ec66cdddbf71567365d2c462688aeb571) )
59   ROM_REGION(0x4400, EGRET_CPU_TAG, 0)
60    ROM_LOAD( "341s0851.bin", 0x1100, 0x1100, CRC(ea9ea6e4) SHA1(8b0dae3ec66cdddbf71567365d2c462688aeb571) )
61    ROM_LOAD( "341s0850.bin", 0x2200, 0x1100, CRC(4906ecd0) SHA1(95e08ba0c5d4b242f115f104aba9905dbd3fd87c) )
62    ROM_LOAD( "344s0100.bin", 0x3300, 0x1100, CRC(59e2b6b6) SHA1(540e752b7da521f1bdb16e0ad7c5f46ddc92d4e9) )
6163ROM_END
6264
6365//-------------------------------------------------
r13612r13613
339341{
340342}
341343
344//-------------------------------------------------
345//  static_set_type - configuration helper to set
346//  the chip type
347//-------------------------------------------------
342348
349void egret_device::static_set_type(device_t &device, int type)
350{
351   egret_device &egret = downcast<egret_device &>(device);
352   egret.rom_offset = type;
353}
354
343355//-------------------------------------------------
344356//  device_start - device-specific startup
345357//-------------------------------------------------
r13612r13613
367379   save_item(NAME(pram_loaded));
368380   save_item(NAME(pram));
369381   save_item(NAME(disk_pram));
382
383   astring tempstring;
384   UINT8 *rom = device().machine().region(device().subtag(tempstring, EGRET_CPU_TAG))->base();
385
386    if (rom)               
387    {
388        memcpy(rom, rom+rom_offset, 0x1100);
389    }
370390}
371391
372392
src/mess/machine/egret.h
r13612r13613
1313
1414#define EGRET_TAG   "egret"
1515
16#define EGRET_TYPE_101      0x1100
17#define EGRET_TYPE_101_EARLY   0x2200
18#define EGRET_TYPE_100      0x3300
1619
17
1820//**************************************************************************
1921//  INTERFACE CONFIGURATION MACROS
2022//**************************************************************************
2123
22#define MCFG_EGRET_ADD() \
23    MCFG_DEVICE_ADD(EGRET_TAG, EGRET, 0)
24#define MCFG_EGRET_ADD(_type) \
25    MCFG_DEVICE_ADD(EGRET_TAG, EGRET, 0) \
26    MCFG_EGRET_TYPE(_type)
2427
28#define MCFG_EGRET_REPLACE(_type) \
29    MCFG_DEVICE_REPLACE(EGRET_TAG, EGRET, 0) \
30    MCFG_EGRET_TYPE(_type)
2531
32#define MCFG_EGRET_TYPE(_type) \
33    egret_device::static_set_type(*device, _type);
2634
2735//**************************************************************************
2836//  TYPE DEFINITIONS
r13612r13613
3442{
3543public:
3644    // construction/destruction
37   egret_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
45    egret_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3846
39   // device_config_nvram_interface overrides
40   virtual void nvram_default();
41   virtual void nvram_read(emu_file &file);
42   virtual void nvram_write(emu_file &file);
47    // inline configuration helpers
48    static void static_set_type(device_t &device, int type);
4349
44   DECLARE_READ8_MEMBER( ddr_r );
45   DECLARE_WRITE8_MEMBER( ddr_w );
46   DECLARE_READ8_MEMBER( ports_r );
47   DECLARE_WRITE8_MEMBER( ports_w );
48   DECLARE_READ8_MEMBER( pll_r );
49   DECLARE_WRITE8_MEMBER( pll_w );
50   DECLARE_READ8_MEMBER( timer_ctrl_r );
51   DECLARE_WRITE8_MEMBER( timer_ctrl_w );
52   DECLARE_READ8_MEMBER( timer_counter_r );
53   DECLARE_WRITE8_MEMBER( timer_counter_w );
54   DECLARE_READ8_MEMBER( onesec_r );
55   DECLARE_WRITE8_MEMBER( onesec_w );
56   DECLARE_READ8_MEMBER( pram_r );
57   DECLARE_WRITE8_MEMBER( pram_w );
50    // device_config_nvram_interface overrides
51    virtual void nvram_default();
52    virtual void nvram_read(emu_file &file);
53    virtual void nvram_write(emu_file &file);
5854
55    DECLARE_READ8_MEMBER( ddr_r );
56    DECLARE_WRITE8_MEMBER( ddr_w );
57    DECLARE_READ8_MEMBER( ports_r );
58    DECLARE_WRITE8_MEMBER( ports_w );
59    DECLARE_READ8_MEMBER( pll_r );
60    DECLARE_WRITE8_MEMBER( pll_w );
61    DECLARE_READ8_MEMBER( timer_ctrl_r );
62    DECLARE_WRITE8_MEMBER( timer_ctrl_w );
63    DECLARE_READ8_MEMBER( timer_counter_r );
64    DECLARE_WRITE8_MEMBER( timer_counter_w );
65    DECLARE_READ8_MEMBER( onesec_r );
66    DECLARE_WRITE8_MEMBER( onesec_w );
67    DECLARE_READ8_MEMBER( pram_r );
68    DECLARE_WRITE8_MEMBER( pram_w );
69
5970    // interface routines
6071    UINT8 get_xcvr_session() { return xcvr_session; }
6172    void set_via_full(UINT8 val) { via_full = val; }
r13612r13613
6475    void set_via_data(UINT8 dat) { via_data = dat; }
6576    UINT8 get_via_clock() { return via_clock; }
6677
78    int rom_offset;
79
6780protected:
6881    // device-level overrides
6982    virtual void device_start();
r13612r13613
7285    virtual machine_config_constructor device_mconfig_additions() const;
7386    virtual const rom_entry *device_rom_region() const;
7487
75   required_device<cpu_device> m_maincpu;
88    required_device<cpu_device> m_maincpu;
7689
77   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
90    virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7891
7992private:
80   UINT8 ddrs[3];
81   UINT8 ports[3];
82   UINT8 pll_ctrl;
83   UINT8 timer_ctrl;
84   UINT8 timer_counter;
85   UINT8 onesec;
93    UINT8 ddrs[3];
94    UINT8 ports[3];
95    UINT8 pll_ctrl;
96    UINT8 timer_ctrl;
97    UINT8 timer_counter;
98    UINT8 onesec;
8699    UINT8 xcvr_session, via_full, sys_session, via_data, via_clock, last_adb;
87100    UINT64 last_adb_time;
88   bool egret_controls_power;
89   bool adb_in;
90   int reset_line;
101    bool egret_controls_power;
102    bool adb_in;
103    int reset_line;
91104    emu_timer *m_timer;
92105    UINT8 pram[0x100], disk_pram[0x100];
93106    bool pram_loaded;
94107
95   void send_port(address_space &space, UINT8 offset, UINT8 data);
108    void send_port(address_space &space, UINT8 offset, UINT8 data);
96109};
97110
98111// device type definition
src/mess/includes/mac.h
r13612r13613
329329    // this is shared among all video setups with vram
330330   UINT32 *m_vram;
331331
332   // Egret/Caboose/Cuda stuff
333   UINT8 m_egregs[0x20];
334
335332   // interrupts
336333   int m_scc_interrupt, m_via_interrupt, m_via2_interrupt, m_scsi_interrupt, m_asc_interrupt, m_last_taken_interrupt;
337334
src/mess/drivers/mac.c
r13612r13613
10411041
10421042   /* devices */
10431043   MCFG_NUBUS_BUS_ADD("nubus", "maincpu", nubus_intf)
1044   MCFG_NUBUS_SLOT_ADD("nubus","nb9", mac_nubus_cards, "cb264", NULL)
1044   MCFG_NUBUS_SLOT_ADD("nubus","nb9", mac_nubus_cards, "48gc", NULL)
10451045   MCFG_NUBUS_SLOT_ADD("nubus","nba", mac_nubus_cards, NULL, NULL)
10461046   MCFG_NUBUS_SLOT_ADD("nubus","nbb", mac_nubus_cards, NULL, NULL)
10471047   MCFG_NUBUS_SLOT_ADD("nubus","nbc", mac_nubus_cards, NULL, NULL)
r13612r13613
11581158   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
11591159   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
11601160
1161   MCFG_EGRET_ADD()
1161   MCFG_EGRET_ADD(EGRET_TYPE_101_EARLY)
11621162   MCFG_QUANTUM_PERFECT_CPU("maincpu")
11631163MACHINE_CONFIG_END
11641164
r13612r13613
11921192   MCFG_ASC_REPLACE("asc", C15M, ASC_TYPE_SONORA, mac_asc_irq)
11931193   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
11941194   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
1195
1196   MCFG_EGRET_REPLACE(EGRET_TYPE_101)
11951197MACHINE_CONFIG_END
11961198
11971199static MACHINE_CONFIG_DERIVED( maciivx, maclc )
r13612r13613
12141216   MCFG_RAM_MODIFY(RAM_TAG)
12151217   MCFG_RAM_DEFAULT_SIZE("4M")
12161218   MCFG_RAM_EXTRA_OPTIONS("8M,12M,16M,20M,24M,28M,32M,36M,40M,44M,48M,52M,56M,60M,64M")
1219
1220   MCFG_EGRET_REPLACE(EGRET_TYPE_101)
12171221MACHINE_CONFIG_END
12181222
12191223static MACHINE_CONFIG_DERIVED( maciivi, maclc )
r13612r13613
12361240   MCFG_RAM_MODIFY(RAM_TAG)
12371241   MCFG_RAM_DEFAULT_SIZE("4M")
12381242   MCFG_RAM_EXTRA_OPTIONS("8M,12M,16M,20M,24M,28M,32M,36M,40M,44M,48M,52M,56M,60M,64M")
1243
1244   MCFG_EGRET_REPLACE(EGRET_TYPE_101)
12391245MACHINE_CONFIG_END
12401246
12411247static MACHINE_CONFIG_DERIVED( maciix, macii )
r13612r13613
14861492   MCFG_RAM_MODIFY(RAM_TAG)
14871493   MCFG_RAM_DEFAULT_SIZE("10M")
14881494   MCFG_RAM_EXTRA_OPTIONS("2M,4M,6M,8M,10M")
1495
1496   MCFG_EGRET_REPLACE(EGRET_TYPE_101)
14891497MACHINE_CONFIG_END
14901498
14911499static MACHINE_CONFIG_DERIVED( maciici, macii )
r13612r13613
15481556   MCFG_RAM_MODIFY(RAM_TAG)
15491557   MCFG_RAM_DEFAULT_SIZE("2M")
15501558   MCFG_RAM_EXTRA_OPTIONS("4M,8M,16M,32M,48M,64M,128M")
1551    MCFG_EGRET_ADD()
1559    MCFG_EGRET_ADD(EGRET_TYPE_100)
15521560   MCFG_QUANTUM_PERFECT_CPU("maincpu")
15531561MACHINE_CONFIG_END
15541562

Previous 15994 Revisions Next


© 1998-2018 The MESS Team