Previous 199869 Revisions Next

r20853 Saturday 9th February, 2013 at 01:55:38 UTC by R. Belmont
(MESS) Apple II: Support 8 meg AE RamWorks III card for IIe. [R. Belmont]
[src/mess]mess.mak
[src/mess/drivers]apple2.c
[src/mess/includes]apple2.h
[src/mess/machine]a2eramworks3.c* a2eramworks3.h* ay3600.c

trunk/src/mess/machine/a2eramworks3.c
r0r20853
1/*********************************************************************
2
3    a2eramworks3.c
4
5    Applied Engineering RamWorks III
6 
7
8*********************************************************************/
9
10#include "emu.h"
11#include "includes/apple2.h"
12#include "machine/a2eramworks3.h"
13
14
15/***************************************************************************
16    PARAMETERS
17***************************************************************************/
18
19//**************************************************************************
20//  GLOBAL VARIABLES
21//**************************************************************************
22
23const device_type A2EAUX_RAMWORKS3 = &device_creator<a2eaux_ramworks3_device>;
24
25//**************************************************************************
26//  LIVE DEVICE
27//**************************************************************************
28
29a2eaux_ramworks3_device::a2eaux_ramworks3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
30      device_t(mconfig, A2EAUX_RAMWORKS3, "Applied Engineering RamWorks III", tag, owner, clock),
31      device_a2eauxslot_card_interface(mconfig, *this)
32{
33   m_shortname = "a2erwks3";
34}
35
36a2eaux_ramworks3_device::a2eaux_ramworks3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
37      device_t(mconfig, type, name, tag, owner, clock),
38      device_a2eauxslot_card_interface(mconfig, *this)
39{
40   m_shortname = "a2erwks3";
41}
42
43//-------------------------------------------------
44//  device_start - device-specific startup
45//-------------------------------------------------
46
47void a2eaux_ramworks3_device::device_start()
48{
49   set_a2eauxslot_device();
50}
51
52void a2eaux_ramworks3_device::device_reset()
53{
54   m_bank = 0;
55}
56
57UINT8 a2eaux_ramworks3_device::read_auxram(UINT16 offset)
58{
59   return m_ram[offset+m_bank];
60}
61
62void a2eaux_ramworks3_device::write_auxram(UINT16 offset, UINT8 data)
63{
64   m_ram[offset+m_bank] = data;
65}
66
67UINT8 *a2eaux_ramworks3_device::get_vram_ptr()
68{
69   return &m_ram[0];
70}
71
72/*
73    These cards are split into 64k logical banks.
74 
75    On a RW3:
76    Banks 00-0F is the first MB
77    Banks 10-17 are the next 512K
78    Banks 30-37 are the next 512K
79    Banks 50-57 are the next 512K
80    Banks 70-77 are the next 512K
81 
82    However, the software will recognize and correctly use a configuration in which
83    all of banks 00-7F are populated for a total of 8 megabytes.  So that's what we do.
84*/
85void a2eaux_ramworks3_device::write_c07x(address_space &space, UINT8 offset, UINT8 data)
86{
87   // write to C073?
88   if (offset == 3)
89   {
90      m_bank = 0x10000 * (data & 0x7f);
91   }
92}
93
Property changes on: trunk/src/mess/machine/a2eramworks3.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/mess/machine/a2eramworks3.h
r0r20853
1/*********************************************************************
2
3    a2eramworks3.c
4
5    Applied Engineering RamWorks III
6
7*********************************************************************/
8
9#ifndef __A2EAUX_RAMWORKS3__
10#define __A2EAUX_RAMWORKS3__
11
12#include "emu.h"
13#include "machine/a2eauxslot.h"
14
15//**************************************************************************
16//  TYPE DEFINITIONS
17//**************************************************************************
18
19class a2eaux_ramworks3_device:
20   public device_t,
21   public device_a2eauxslot_card_interface
22{
23public:
24   // construction/destruction
25   a2eaux_ramworks3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
26   a2eaux_ramworks3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
27
28protected:
29   virtual void device_start();
30   virtual void device_reset();
31
32   virtual UINT8 read_auxram(UINT16 offset);
33   virtual void write_auxram(UINT16 offset, UINT8 data);
34   virtual UINT8 *get_vram_ptr();
35   virtual bool allow_dhr() { return true; }
36   virtual void write_c07x(address_space &space, UINT8 offset, UINT8 data);
37
38private:
39   UINT8 m_ram[8*1024*1024];
40   int m_bank;
41};
42
43// device type definition
44extern const device_type A2EAUX_RAMWORKS3;
45
46#endif  /* __A2EAUX_RAMWORKS3__ */
47
Property changes on: trunk/src/mess/machine/a2eramworks3.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/ay3600.c
r20852r20853
280280    HELPER FUNCTIONS
281281***************************************************************************/
282282
283INLINE int a2_has_keypad(running_machine &machine)
283INLINE int a2_has_keypad(apple2_state *state)
284284{
285   return machine.root_device().ioport("keypad_1") != NULL;
285   return (state->m_kpad1 != NULL);
286286}
287287
288INLINE int a2_has_reset_dip(running_machine &machine)
288INLINE int a2_has_reset_dip(apple2_state *state)
289289{
290   return machine.root_device().ioport("reset_dip") != NULL;
290   return (state->m_resetdip != NULL);
291291}
292292
293INLINE int a2_has_repeat(running_machine &machine)
293INLINE int a2_has_repeat(apple2_state *state)
294294{
295   return machine.root_device().ioport("keyb_repeat") != NULL;
295   return (state->m_kbprepeat != NULL);
296296}
297297
298INLINE int a2_has_capslock(running_machine &machine)
298INLINE int a2_has_capslock(apple2_state *state)
299299{
300   return !a2_has_repeat(machine); /* BUG: Doesn't work with Ace */
300   return !a2_has_repeat(state); /* BUG: Doesn't work with Ace */
301301}
302302
303INLINE int a2_no_ctrl_reset(running_machine &machine)
303INLINE int a2_no_ctrl_reset(apple2_state *state)
304304{
305   return ((a2_has_repeat(machine) && !a2_has_reset_dip(machine)) ||
306         (a2_has_reset_dip(machine) && !machine.root_device().ioport("reset_dip")->read()));
305   return ((a2_has_repeat(state) && !a2_has_reset_dip(state)) ||
306         (a2_has_reset_dip(state) && !state->m_resetdip->read()));
307307}
308308
309309
r20852r20853
362362   /* check for these special cases because they affect the emulated key codes */
363363
364364   /* only repeat keys on a 2/2+ if special REPT key is pressed */
365   if (a2_has_repeat(machine))
366      state->m_time_until_repeat = machine.root_device().ioport("keyb_repeat")->read() & 0x01 ? 0 : ~0;
365   if (a2_has_repeat(state))
366      state->m_time_until_repeat = state->m_kbprepeat->read() & 0x01 ? 0 : ~0;
367367
368368   /* check caps lock and set LED here */
369369   if (state->apple2_pressed_specialkey(SPECIALKEY_CAPSLOCK))
r20852r20853
425425
426426   /* reset key check */
427427   if (state->apple2_pressed_specialkey(SPECIALKEY_RESET) &&
428      (a2_no_ctrl_reset(machine) || switchkey & A2_KEY_CONTROL))
428      (a2_no_ctrl_reset(state) || switchkey & A2_KEY_CONTROL))
429429   {
430430         if (!state->m_reset_flag)
431431         {
r20852r20853
443443   }
444444
445445   /* run through real keys and see what's being pressed */
446   num_ports = a2_has_keypad(machine) ? 9 : 7;
446   num_ports = a2_has_keypad(state) ? 9 : 7;
447447
448448   state->m_keymodreg &= ~A2_KEYMOD_KEYPAD;
449449
r20852r20853
453453
454454      for (bit = 0; bit < 8; bit++)
455455      {
456         if (a2_has_capslock(machine))
456         if (a2_has_capslock(state))
457457         {
458458            curkey = ay3600_key_remap_2e[caps_lock][port*8+bit][switchkey];
459459            curkey_unmodified = ay3600_key_remap_2e[caps_lock][port*8+bit][0];
trunk/src/mess/includes/apple2.h
r20852r20853
138138      m_kbrepeat(*this, "keyb_repeat"),
139139      m_resetdip(*this, "reset_dip"),
140140      m_kpad1(*this, "keypad_1"),
141      m_kpad2(*this, "keypad_2")
141      m_kpad2(*this, "keypad_2"),
142      m_kbprepeat(*this, "keyb_repeat")
142143   { }
143144
144145   required_device<cpu_device> m_maincpu;
r20852r20853
151152   optional_ioport m_kbrepeat;
152153   optional_ioport m_resetdip;
153154   optional_ioport m_kpad1, m_kpad2;
155   optional_ioport m_kbprepeat;
154156
155157   UINT32 m_flags, m_flags_mask;
156158   INT32 m_a2_cnxx_slot;
trunk/src/mess/drivers/apple2.c
r20852r20853
214214#include "machine/a2midi.h"
215215#include "machine/a2estd80col.h"
216216#include "machine/a2eext80col.h"
217#include "machine/a2eramworks3.h"
217218
218219/***************************************************************************
219220    PARAMETERS
r20852r20853
639640static SLOT_INTERFACE_START(apple2eaux_cards)
640641   SLOT_INTERFACE("std80", A2EAUX_STD80COL) /* Apple IIe Standard 80 Column Card */
641642   SLOT_INTERFACE("ext80", A2EAUX_EXT80COL) /* Apple IIe Extended 80 Column Card */
643   SLOT_INTERFACE("rw3", A2EAUX_RAMWORKS3)  /* Applied Engineering RamWorks III */
642644SLOT_INTERFACE_END
643645
644646static MACHINE_CONFIG_START( apple2_common, apple2_state )
r20852r20853
731733
732734static MACHINE_CONFIG_DERIVED( tk2000, apple2_common )
733735   MCFG_MACHINE_START_OVERRIDE(apple2_state,tk2000)
734   MCFG_VIDEO_START_OVERRIDE(apple2_state,apple2e)
736   MCFG_VIDEO_START_OVERRIDE(apple2_state,apple2c)
735737   /* internal ram */
736738   MCFG_RAM_ADD(RAM_TAG)
737739   MCFG_RAM_DEFAULT_SIZE("64K")
trunk/src/mess/mess.mak
r20852r20853
697697   $(MESS_MACHINE)/a2midi.o \
698698   $(MESS_MACHINE)/a2estd80col.o \
699699   $(MESS_MACHINE)/a2eext80col.o \
700   $(MESS_MACHINE)/a2eramworks3.o \
700701   $(MESS_MACHINE)/lisa.o      \
701702   $(MESS_DRIVERS)/lisa.o      \
702703   $(MESS_MACHINE)/nubus.o     \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team