Previous 199869 Revisions Next

r31721 Thursday 21st August, 2014 at 02:05:14 UTC by R. Belmont
(MESS) Apple II series changes: [R. Belmont]
- Support 1 MB expansion for Laser 128ex2
- Give the IIc Plus the correct drive type, but it's still unhappy
- Promote apple2c4 to working since it runs fine now
[src/mess/drivers]apple2.c
[src/mess/includes]apple2.h
[src/mess/machine]apple2.c

trunk/src/mess/drivers/apple2.c
r31720r31721
192192#include "imagedev/flopdrv.h"
193193#include "imagedev/cassette.h"
194194#include "formats/ap2_dsk.h"
195#include "formats/ap_dsk35.h"
195196#include "includes/apple2.h"
196197#include "cpu/z80/z80.h"
198#include "machine/sonydriv.h"
197199#include "machine/appldriv.h"
198200
199201#include "bus/a2bus/a2bus.h"
r31720r31721
12461248   MCFG_RAM_EXTRA_OPTIONS("128K")
12471249MACHINE_CONFIG_END
12481250
1251const applefdc_interface a2cp_interface =
1252{
1253   sony_set_lines,         /* set_lines */
1254   sony_set_enable_lines,  /* set_enable_lines */
1255
1256   sony_read_data,         /* read_data */
1257   sony_write_data,    /* write_data */
1258   sony_read_status    /* read_status */
1259};
1260
1261static const floppy_interface apple2cp_floppy35_floppy_interface =
1262{
1263   FLOPPY_STANDARD_5_25_DSHD,
1264   LEGACY_FLOPPY_OPTIONS_NAME(apple35_iigs),
1265   "floppy_3_5"
1266};
1267
12491268static MACHINE_CONFIG_DERIVED( apple2cp, apple2c )
12501269   MCFG_MACHINE_START_OVERRIDE(apple2_state,apple2cp)
12511270
12521271   MCFG_A2BUS_SLOT_REMOVE("sl6")
1253   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_IWM_FDC, NULL)
1272   MCFG_IWM_ADD(IICP_IWM_TAG, a2cp_interface)
1273   MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(apple2cp_floppy35_floppy_interface)
12541274MACHINE_CONFIG_END
12551275
12561276static MACHINE_CONFIG_DERIVED( apple2c_iwm, apple2c )
r31720r31721
17661786COMP( 1988, las128e2, apple2c,  0,        laser128ex2, apple2e, driver_device,  0,        "Video Technology",  "Laser 128ex2 (version 6.1)", GAME_SUPPORTS_SAVE )
17671787COMP( 1985, apple2c0, apple2c,  0,        apple2c_iwm, apple2e, driver_device,  0,        "Apple Computer",    "Apple //c (UniDisk 3.5)", GAME_SUPPORTS_SAVE )
17681788COMP( 1986, apple2c3, apple2c,  0,        apple2c_iwm, apple2e, driver_device,  0,        "Apple Computer",    "Apple //c (Original Memory Expansion)", GAME_SUPPORTS_SAVE )
1769COMP( 1986, apple2c4, apple2c,  0,        apple2c_iwm, apple2e, driver_device,  0,        "Apple Computer",    "Apple //c (rev 4)", GAME_NOT_WORKING )
1789COMP( 1986, apple2c4, apple2c,  0,        apple2c_iwm, apple2e, driver_device,  0,        "Apple Computer",    "Apple //c (rev 4)", GAME_SUPPORTS_SAVE )
17701790COMP( 1988, apple2cp, apple2c,  0,        apple2cp,    apple2e, driver_device,  0,        "Apple Computer",    "Apple //c Plus", GAME_SUPPORTS_SAVE )
17711791COMP( 1984, ivelultr, apple2,   0,        apple2p,     apple2p, driver_device,  0,        "Ivasim",            "Ivel Ultra", GAME_SUPPORTS_SAVE )
17721792COMP( 1983, agat7,    apple2,   0,        apple2p,     apple2p, driver_device,  0,        "Agat",              "Agat-7", GAME_NOT_WORKING) // disk controller ROM JSRs to $FCA8 which is a delay on apple II, illegal instruction crash here :(
trunk/src/mess/machine/apple2.c
r31720r31721
366366            }
367367         }
368368      }
369     
370      if ((m_machinetype == APPLE_IICPLUS) && (slot == 6))
371      {
372         offset &= 0xf;
373         return m_iicpiwm->read(offset);
374      }
369375
376      if ((m_machinetype == LASER128) && (slot == 5))
377      {
378         offset &= 0xf;
379         UINT8 retval = m_exp_regs[offset];
380                     
381         if (offset == 3)
382         {
383            retval = m_exp_ram[m_exp_liveptr&m_exp_addrmask];
384            m_exp_liveptr++;
385            m_exp_regs[0] = m_exp_liveptr & 0xff;
386            m_exp_regs[1] = (m_exp_liveptr>>8) & 0xff;
387            m_exp_regs[2] = ((m_exp_liveptr>>16) & 0xff) | m_exp_bankhior;
388         }
389
390         return retval;
391      }
392
370393      if ((m_machinetype == LASER128) && (slot == 6))
371394      {
372395         offset &= 0xf;
r31720r31721
417440      }
418441   }
419442
443   if ((m_machinetype == APPLE_IICPLUS) && (slot == 6))
444   {
445      offset &= 0xf;
446      m_iicpiwm->write(offset, data);
447      return;
448   }
449
450   if ((m_machinetype == LASER128) && (slot == 5))
451   {
452      switch (offset & 0xf)
453      {
454         case 0:
455            m_exp_wptr &= ~0xff;
456            m_exp_wptr |= data;
457            m_exp_regs[0] = m_exp_wptr & 0xff;
458            m_exp_regs[1] = (m_exp_wptr>>8) & 0xff;
459            m_exp_regs[2] = ((m_exp_wptr>>16) & 0xff) | m_exp_bankhior;
460            m_exp_liveptr = m_exp_wptr;
461            break;
462
463         case 1:
464            m_exp_wptr &= ~0xff00;
465            m_exp_wptr |= (data<<8);
466            m_exp_regs[0] = m_exp_wptr & 0xff;
467            m_exp_regs[1] = (m_exp_wptr>>8) & 0xff;
468            m_exp_regs[2] = ((m_exp_wptr>>16) & 0xff) | m_exp_bankhior;
469            m_exp_liveptr = m_exp_wptr;
470            break;
471
472         case 2:
473            m_exp_wptr &= ~0xff0000;
474            m_exp_wptr |= (data<<16);
475            m_exp_regs[0] = m_exp_wptr & 0xff;
476            m_exp_regs[1] = (m_exp_wptr>>8) & 0xff;
477            m_exp_regs[2] = ((m_exp_wptr>>16) & 0xff) | m_exp_bankhior;
478            m_exp_liveptr = m_exp_wptr;
479            break;
480
481         case 3:
482   //            printf("Write %02x to RAM[%x]\n", data, m_liveptr);
483            m_exp_ram[(m_exp_liveptr&m_exp_addrmask)] = data;
484            m_exp_liveptr++;
485            m_exp_regs[0] = m_exp_liveptr & 0xff;
486            m_exp_regs[1] = (m_exp_liveptr>>8) & 0xff;
487            m_exp_regs[2] = ((m_exp_liveptr>>16) & 0xff) | m_exp_bankhior;
488            break;
489
490         default:
491            m_exp_regs[offset] = data;
492            break;
493      }
494   }
495
420496   if ((m_machinetype == LASER128) && (slot == 6))
421497   {
422498      offset &= 0xf;
r31720r31721
12181294
12191295   m_joystick_x1_time = m_joystick_y1_time = 0;
12201296   m_joystick_x2_time = m_joystick_y2_time = 0;
1297
1298   memset(m_exp_regs, 0, sizeof(UINT8) * 0x10);
1299   m_exp_wptr = m_exp_liveptr = 0;
1300
12211301}
12221302
12231303int apple2_state::a2_no_ctrl_reset()
r31720r31721
22512331
22522332   apple2_init_common();
22532333
2334   // 1 MB of expansion RAM in slot 5
2335   m_exp_ram = auto_alloc_array(machine(), UINT8, 1024*1024);
2336   memset(m_exp_ram, 0xff, 1024*1024);
2337
2338   m_exp_bankhior = 0xf0;
2339   m_exp_addrmask = 0xfffff;
2340
2341   // save memory expansion vars
2342   save_item(NAME(m_exp_regs));
2343   save_item(NAME(m_exp_wptr));
2344   save_item(NAME(m_exp_liveptr));
2345   save_item(NAME(m_exp_bankhior));
2346   save_item(NAME(m_exp_addrmask));
2347
22542348   /* setup memory */
22552349   memset(&mem_cfg, 0, sizeof(mem_cfg));
22562350   mem_cfg.first_bank = 1;
trunk/src/mess/includes/apple2.h
r31720r31721
2626
2727#define IIC_ACIA1_TAG "acia1"
2828#define IIC_ACIA2_TAG "acia2"
29#define IICP_IWM_TAG   "iwm"
2930
3031#define LASER128_UDC_TAG "l128udc"
3132
r31720r31721
142143      m_cassette(*this, "cassette"),
143144      m_acia1(*this, IIC_ACIA1_TAG),
144145      m_acia2(*this, IIC_ACIA2_TAG),
145      m_laserudc(*this, LASER128_UDC_TAG)
146      m_laserudc(*this, LASER128_UDC_TAG),
147      m_iicpiwm(*this, IICP_IWM_TAG)
146148   { }
147149
148150   required_device<cpu_device> m_maincpu;
r31720r31721
161163
162164   optional_device<mos6551_device> m_acia1, m_acia2;
163165   optional_device<applefdc_base_device> m_laserudc;
166   optional_device<iwm_device> m_iicpiwm;
164167
165168   UINT32 m_flags, m_flags_mask;
166169   INT32 m_a2_cnxx_slot;
r31720r31721
360363   void apple2eplus_init_common(void *apple2cp_ce00_ram);
361364   INT8 apple2_slotram_r(address_space &space, int slotnum, int offset);
362365   int a2_no_ctrl_reset();
366
367private:
368   // Laser 128EX2 slot 5 Apple Memory Expansion emulation vars
369   UINT8 m_exp_bankhior;
370   int m_exp_addrmask;
371   UINT8 m_exp_regs[0x10];
372   UINT8 *m_exp_ram;
373   int m_exp_wptr, m_exp_liveptr;
363374};
364375/*----------- defined in drivers/apple2.c -----------*/
365376INPUT_PORTS_EXTERN( apple2ep );

Previous 199869 Revisions Next


© 1997-2024 The MAME Team