src/mess/machine/laser128.c
| r0 | r15385 | |
| 1 | /********************************************************************* |
| 2 | |
| 3 | laser128.c |
| 4 | |
| 5 | Helper to implement the Laser 128's built-in slot peripherals |
| 6 | |
| 7 | *********************************************************************/ |
| 8 | |
| 9 | #include "laser128.h" |
| 10 | #include "includes/apple2.h" |
| 11 | |
| 12 | /*************************************************************************** |
| 13 | PARAMETERS |
| 14 | ***************************************************************************/ |
| 15 | |
| 16 | //************************************************************************** |
| 17 | // GLOBAL VARIABLES |
| 18 | //************************************************************************** |
| 19 | |
| 20 | const device_type A2BUS_LASER128 = &device_creator<a2bus_laser128_device>; |
| 21 | |
| 22 | MACHINE_CONFIG_FRAGMENT( a2laser128 ) |
| 23 | MACHINE_CONFIG_END |
| 24 | |
| 25 | /*************************************************************************** |
| 26 | FUNCTION PROTOTYPES |
| 27 | ***************************************************************************/ |
| 28 | |
| 29 | //------------------------------------------------- |
| 30 | // machine_config_additions - device-specific |
| 31 | // machine configurations |
| 32 | //------------------------------------------------- |
| 33 | |
| 34 | machine_config_constructor a2bus_laser128_device::device_mconfig_additions() const |
| 35 | { |
| 36 | return MACHINE_CONFIG_NAME( a2laser128 ); |
| 37 | } |
| 38 | |
| 39 | //************************************************************************** |
| 40 | // LIVE DEVICE |
| 41 | //************************************************************************** |
| 42 | |
| 43 | a2bus_laser128_device::a2bus_laser128_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 44 | device_t(mconfig, type, name, tag, owner, clock), |
| 45 | device_a2bus_card_interface(mconfig, *this) |
| 46 | { |
| 47 | m_shortname = "a2laser128"; |
| 48 | } |
| 49 | |
| 50 | a2bus_laser128_device::a2bus_laser128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 51 | device_t(mconfig, A2BUS_LASER128, "VTech Laser 128 Internal Device", tag, owner, clock), |
| 52 | device_a2bus_card_interface(mconfig, *this) |
| 53 | { |
| 54 | m_shortname = "a2laser128"; |
| 55 | } |
| 56 | |
| 57 | //------------------------------------------------- |
| 58 | // device_start - device-specific startup |
| 59 | //------------------------------------------------- |
| 60 | |
| 61 | void a2bus_laser128_device::device_start() |
| 62 | { |
| 63 | // set_a2bus_device makes m_slot valid |
| 64 | set_a2bus_device(); |
| 65 | } |
| 66 | |
| 67 | void a2bus_laser128_device::device_reset() |
| 68 | { |
| 69 | m_rom = device().machine().root_device().memregion("maincpu")->base(); |
| 70 | m_slot7_bank = 0; |
| 71 | } |
| 72 | |
| 73 | UINT8 a2bus_laser128_device::read_c0nx(address_space &space, UINT8 offset) |
| 74 | { |
| 75 | return 0x00; |
| 76 | } |
| 77 | |
| 78 | void a2bus_laser128_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) |
| 79 | { |
| 80 | } |
| 81 | |
| 82 | UINT8 a2bus_laser128_device::read_cnxx(address_space &space, UINT8 offset) |
| 83 | { |
| 84 | return m_rom[offset + (m_slot * 0x100) + 0x4000]; |
| 85 | } |
| 86 | |
| 87 | UINT8 a2bus_laser128_device::read_c800(address_space &space, UINT16 offset) |
| 88 | { |
| 89 | switch (m_slot) |
| 90 | { |
| 91 | case 1: |
| 92 | return m_rom[(offset & 0x7ff) + 0x4800]; |
| 93 | |
| 94 | case 2: |
| 95 | return m_rom[(offset & 0x7ff) + 0x5800]; |
| 96 | |
| 97 | case 5: |
| 98 | return m_rom[(offset & 0x7ff) + 0x5000]; |
| 99 | |
| 100 | case 6: |
| 101 | return m_rom[(offset & 0x7ff) + 0x7800]; |
| 102 | |
| 103 | case 7: |
| 104 | return m_rom[(offset & 0x7ff) + 0x5c00 + m_slot7_bank]; |
| 105 | } |
| 106 | |
| 107 | return 0xff; |
| 108 | } |
| 109 | |
| 110 | void a2bus_laser128_device::write_c800(address_space &space, UINT16 offset, UINT8 data) |
| 111 | { |
| 112 | } |
| 113 | |
| 114 | bool a2bus_laser128_device::take_c800() |
| 115 | { |
| 116 | if ((m_slot == 1) || (m_slot == 2) || (m_slot == 5) || (m_slot == 7)) |
| 117 | { |
| 118 | return true; |
| 119 | } |
| 120 | |
| 121 | return false; |
| 122 | } |
| 123 | |
src/mess/machine/laser128.h
| r0 | r15385 | |
| 1 | /********************************************************************* |
| 2 | |
| 3 | laser128.h |
| 4 | |
| 5 | Helper to implement the Laser 128's built-in slot peripherals |
| 6 | |
| 7 | *********************************************************************/ |
| 8 | |
| 9 | #ifndef __A2BUS_LASER128__ |
| 10 | #define __A2BUS_LASER128__ |
| 11 | |
| 12 | #include "emu.h" |
| 13 | #include "machine/a2bus.h" |
| 14 | |
| 15 | //************************************************************************** |
| 16 | // TYPE DEFINITIONS |
| 17 | //************************************************************************** |
| 18 | |
| 19 | class a2bus_laser128_device: |
| 20 | public device_t, |
| 21 | public device_a2bus_card_interface |
| 22 | { |
| 23 | public: |
| 24 | // construction/destruction |
| 25 | a2bus_laser128_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 26 | a2bus_laser128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 27 | |
| 28 | // optional information overrides |
| 29 | virtual machine_config_constructor device_mconfig_additions() const; |
| 30 | |
| 31 | protected: |
| 32 | virtual void device_start(); |
| 33 | virtual void device_reset(); |
| 34 | |
| 35 | // overrides of standard a2bus slot functions |
| 36 | virtual UINT8 read_c0nx(address_space &space, UINT8 offset); |
| 37 | virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data); |
| 38 | virtual UINT8 read_cnxx(address_space &space, UINT8 offset); |
| 39 | virtual UINT8 read_c800(address_space &space, UINT16 offset); |
| 40 | virtual void write_c800(address_space &space, UINT16 offset, UINT8 data); |
| 41 | virtual bool take_c800(); |
| 42 | |
| 43 | private: |
| 44 | UINT8 *m_rom; |
| 45 | int m_slot7_bank; |
| 46 | }; |
| 47 | |
| 48 | // device type definition |
| 49 | extern const device_type A2BUS_LASER128; |
| 50 | |
| 51 | #endif /* __A2BUS_LASER128__ */ |
| 52 | |
src/mess/machine/apple2.c
| r15384 | r15385 | |
| 449 | 449 | } |
| 450 | 450 | else |
| 451 | 451 | { |
| 452 | | return apple2_slotram_r(space, slotnum, offset); |
| 452 | if (m_machinetype == LASER128) |
| 453 | { |
| 454 | UINT8 *rom = space.machine().root_device().memregion("maincpu")->base(); |
| 455 | |
| 456 | return rom[(offset&0x1ff) + 0x4200]; |
| 457 | } |
| 458 | else |
| 459 | { |
| 460 | return apple2_slotram_r(space, slotnum, offset); |
| 461 | } |
| 453 | 462 | } |
| 454 | 463 | |
| 455 | 464 | // else fall through to floating bus |
| r15384 | r15385 | |
| 1852 | 1861 | apple2_reset(machine); |
| 1853 | 1862 | } |
| 1854 | 1863 | |
| 1864 | MACHINE_START( laser128 ) |
| 1865 | { |
| 1866 | apple2_memmap_config mem_cfg; |
| 1867 | apple2_state *state = machine.driver_data<apple2_state>(); |
| 1868 | |
| 1869 | state->m_flags_mask = 0; |
| 1870 | state->m_machinetype = LASER128; |
| 1871 | |
| 1872 | apple2_init_common(machine); |
| 1873 | |
| 1874 | /* setup memory */ |
| 1875 | memset(&mem_cfg, 0, sizeof(mem_cfg)); |
| 1876 | mem_cfg.first_bank = 1; |
| 1877 | mem_cfg.memmap = apple2_memmap_entries; |
| 1878 | mem_cfg.auxmem = (UINT8*)NULL; |
| 1879 | apple2_setup_memory(machine, &mem_cfg); |
| 1880 | |
| 1881 | /* perform initial reset */ |
| 1882 | apple2_reset(machine); |
| 1883 | } |
| 1884 | |
| 1855 | 1885 | MACHINE_START( apple2orig ) |
| 1856 | 1886 | { |
| 1857 | 1887 | apple2_memmap_config mem_cfg; |
src/mess/drivers/apple2.c
| r15384 | r15385 | |
| 207 | 207 | #include "machine/a2themill.h" |
| 208 | 208 | #include "machine/a2sam.h" |
| 209 | 209 | #include "machine/a2alfam2.h" |
| 210 | #include "machine/laser128.h" |
| 210 | 211 | |
| 211 | 212 | /*************************************************************************** |
| 212 | 213 | PARAMETERS |
| r15384 | r15385 | |
| 628 | 629 | // SLOT_INTERFACE("scsi", A2BUS_SCSI) /* Apple II SCSI Card */ |
| 629 | 630 | SLOT_INTERFACE_END |
| 630 | 631 | |
| 632 | static SLOT_INTERFACE_START(laser128_internal) |
| 633 | SLOT_INTERFACE("l128int", A2BUS_LASER128) |
| 634 | SLOT_INTERFACE_END |
| 635 | |
| 631 | 636 | static SLOT_INTERFACE_START(apple2eaux_cards) |
| 632 | 637 | SLOT_INTERFACE_END |
| 633 | 638 | |
| r15384 | r15385 | |
| 785 | 790 | MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_IWM_FDC, NULL) |
| 786 | 791 | MACHINE_CONFIG_END |
| 787 | 792 | |
| 793 | static MACHINE_CONFIG_DERIVED( laser128, apple2c ) |
| 794 | MCFG_MACHINE_START(laser128) |
| 788 | 795 | |
| 796 | MCFG_A2BUS_SLOT_REMOVE("sl6") |
| 797 | |
| 798 | MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl1", A2BUS_LASER128, NULL) |
| 799 | MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl2", A2BUS_LASER128, NULL) |
| 800 | MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl3", A2BUS_LASER128, NULL) |
| 801 | MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl4", A2BUS_LASER128, NULL) |
| 802 | MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl5", A2BUS_LASER128, NULL) |
| 803 | MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_IWM_FDC, NULL) // slots 6 and 7 are hacks for now |
| 804 | // MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl7", A2BUS_LASER128, NULL) |
| 805 | MACHINE_CONFIG_END |
| 806 | |
| 789 | 807 | /*************************************************************************** |
| 790 | 808 | |
| 791 | 809 | Game driver(s) |
| r15384 | r15385 | |
| 1038 | 1056 | ROM_LOAD("las128ex.256", 0x0000, 0x8000, CRC(B67C8BA1) SHA1(8BD5F82A501B1CF9D988C7207DA81E514CA254B0)) |
| 1039 | 1057 | ROM_END |
| 1040 | 1058 | |
| 1059 | ROM_START(las128e2) |
| 1060 | ROM_REGION(0x2000,"gfx1",0) |
| 1061 | ROM_LOAD ( "341-0265-a.chr", 0x0000, 0x1000, BAD_DUMP CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10)) // need to dump real laser rom |
| 1062 | ROM_LOAD ( "341-0265-a.chr", 0x1000, 0x1000, BAD_DUMP CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10)) // need to dump real laser rom |
| 1041 | 1063 | |
| 1064 | ROM_REGION(0x8700,"maincpu",0) |
| 1065 | ROM_LOAD( "laser 128ex2 v6.1 rom.bin", 0x000000, 0x008000, CRC(7f911c90) SHA1(125754c1bd777d4c510f5239b96178c6f2e3236b) ) |
| 1066 | ROM_END |
| 1067 | |
| 1042 | 1068 | ROM_START(apple2cp) |
| 1043 | 1069 | ROM_REGION(0x2000,"gfx1",0) |
| 1044 | 1070 | ROM_LOAD ( "341-0265-a.chr", 0x0000, 0x1000,CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10)) |
| r15384 | r15385 | |
| 1073 | 1099 | COMP( 1984, tk2000, apple2c, 0, tk2000, apple2e, 0, "Microdigital", "TK2000" , GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 1074 | 1100 | COMP( 1989, prav8c, apple2c, 0, apple2c, apple2e, 0, "Pravetz", "Pravetz 8C", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 1075 | 1101 | COMP( 1983, las3000, apple2, 0, apple2p, apple2p, 0, "Video Technology", "Laser 3000", GAME_NOT_WORKING ) |
| 1076 | | COMP( 1987, laser128, apple2c, 0, apple2c, apple2e, 0, "Video Technology", "Laser 128 (rev 4)", GAME_NOT_WORKING ) |
| 1077 | | COMP( 1987, las128ex, apple2c, 0, apple2c, apple2e, 0, "Video Technology", "Laser 128ex (rev 4a)", GAME_NOT_WORKING ) |
| 1102 | COMP( 1987, laser128, apple2c, 0, laser128, apple2e, 0, "Video Technology", "Laser 128 (version 4.2)", GAME_NOT_WORKING ) |
| 1103 | COMP( 1988, las128ex, apple2c, 0, laser128, apple2e, 0, "Video Technology", "Laser 128ex (version 4.5)", GAME_NOT_WORKING ) |
| 1078 | 1104 | COMP( 1985, apple2c0, apple2c, 0, apple2c_iwm, apple2e, 0, "Apple Computer", "Apple //c (UniDisk 3.5)", GAME_SUPPORTS_SAVE ) |
| 1079 | 1105 | COMP( 1986, apple2c3, apple2c, 0, apple2c_iwm, apple2e, 0, "Apple Computer", "Apple //c (Original Memory Expansion)", GAME_SUPPORTS_SAVE ) |
| 1080 | 1106 | COMP( 1986, apple2c4, apple2c, 0, apple2c_iwm, apple2e, 0, "Apple Computer", "Apple //c (rev 4)", GAME_NOT_WORKING ) |