src/mess/video/nubus_radiustpd.c
| r0 | r12820 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Radius Two Page Display (1280x960?) |
| 4 | |
| 5 | Fsx8000a = DAC data |
| 6 | Fsx8000e = DAC control |
| 7 | Fsx00000 = VRAM (offset 0x200, stride 0x1b0) |
| 8 | |
| 9 | ***************************************************************************/ |
| 10 | |
| 11 | #include "emu.h" |
| 12 | #include "video/nubus_radiustpd.h" |
| 13 | |
| 14 | #define RADIUSTPD_SCREEN_NAME "tpd_screen" |
| 15 | #define RADIUSTPD_ROM_REGION "tpd_rom" |
| 16 | |
| 17 | #define VRAM_SIZE (0x40000) // 256k. 1152x880 1 bit per pixel fits nicely. |
| 18 | |
| 19 | static SCREEN_UPDATE( radiustpd ); |
| 20 | |
| 21 | MACHINE_CONFIG_FRAGMENT( radiustpd ) |
| 22 | MCFG_SCREEN_ADD( RADIUSTPD_SCREEN_NAME, RASTER) |
| 23 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 24 | MCFG_SCREEN_UPDATE(radiustpd) |
| 25 | MCFG_SCREEN_SIZE(1280, 960) |
| 26 | MCFG_SCREEN_REFRESH_RATE(70) |
| 27 | MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 880-1) |
| 28 | MACHINE_CONFIG_END |
| 29 | |
| 30 | ROM_START( radiustpd ) |
| 31 | ROM_REGION(0x8000, RADIUSTPD_ROM_REGION, 0) |
| 32 | ROM_LOAD( "tpd_v22.bin", 0x0000, 0x8000, CRC(7dc5ed05) SHA1(4abb64e49201e966c17a255a94b670564b229934) ) |
| 33 | ROM_END |
| 34 | |
| 35 | //************************************************************************** |
| 36 | // GLOBAL VARIABLES |
| 37 | //************************************************************************** |
| 38 | |
| 39 | const device_type NUBUS_RADIUSTPD = &device_creator<nubus_radiustpd_device>; |
| 40 | |
| 41 | |
| 42 | //------------------------------------------------- |
| 43 | // machine_config_additions - device-specific |
| 44 | // machine configurations |
| 45 | //------------------------------------------------- |
| 46 | |
| 47 | machine_config_constructor nubus_radiustpd_device::device_mconfig_additions() const |
| 48 | { |
| 49 | return MACHINE_CONFIG_NAME( radiustpd ); |
| 50 | } |
| 51 | |
| 52 | //------------------------------------------------- |
| 53 | // rom_region - device-specific ROM region |
| 54 | //------------------------------------------------- |
| 55 | |
| 56 | const rom_entry *nubus_radiustpd_device::device_rom_region() const |
| 57 | { |
| 58 | return ROM_NAME( radiustpd ); |
| 59 | } |
| 60 | |
| 61 | //************************************************************************** |
| 62 | // LIVE DEVICE |
| 63 | //************************************************************************** |
| 64 | |
| 65 | //------------------------------------------------- |
| 66 | // nubus_radiustpd_device - constructor |
| 67 | //------------------------------------------------- |
| 68 | |
| 69 | nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 70 | device_t(mconfig, NUBUS_RADIUSTPD, "Radius Two Page Display video card", tag, owner, clock), |
| 71 | device_nubus_card_interface(mconfig, *this), |
| 72 | device_slot_card_interface(mconfig, *this) |
| 73 | { |
| 74 | m_shortname = "nb_rtpd"; |
| 75 | } |
| 76 | |
| 77 | nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 78 | device_t(mconfig, type, name, tag, owner, clock), |
| 79 | device_nubus_card_interface(mconfig, *this), |
| 80 | device_slot_card_interface(mconfig, *this) |
| 81 | { |
| 82 | m_shortname = "nb_rtpd"; |
| 83 | } |
| 84 | |
| 85 | //------------------------------------------------- |
| 86 | // device_start - device-specific startup |
| 87 | //------------------------------------------------- |
| 88 | |
| 89 | void nubus_radiustpd_device::device_start() |
| 90 | { |
| 91 | UINT32 slotspace; |
| 92 | |
| 93 | // set_nubus_device makes m_slot valid |
| 94 | set_nubus_device(); |
| 95 | install_declaration_rom(this, RADIUSTPD_ROM_REGION, true, true); |
| 96 | |
| 97 | slotspace = get_slotspace(); |
| 98 | |
| 99 | printf("[radiustpd %p] slotspace = %x\n", this, slotspace); |
| 100 | |
| 101 | m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE); |
| 102 | m_vram32 = (UINT32 *)m_vram; |
| 103 | |
| 104 | m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_radiustpd_device::vram_r), this), write32_delegate(FUNC(nubus_radiustpd_device::vram_w), this)); |
| 105 | m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_radiustpd_device::vram_r), this), write32_delegate(FUNC(nubus_radiustpd_device::vram_w), this)); |
| 106 | m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_radiustpd_device::radiustpd_r), this), write32_delegate(FUNC(nubus_radiustpd_device::radiustpd_w), this)); |
| 107 | m_nubus->install_device(slotspace+0x980000, slotspace+0x9effff, read32_delegate(FUNC(nubus_radiustpd_device::radiustpd_r), this), write32_delegate(FUNC(nubus_radiustpd_device::radiustpd_w), this)); |
| 108 | |
| 109 | m_timer = timer_alloc(0, NULL); |
| 110 | m_screen = NULL; // can we look this up now? |
| 111 | } |
| 112 | |
| 113 | //------------------------------------------------- |
| 114 | // device_reset - device-specific reset |
| 115 | //------------------------------------------------- |
| 116 | |
| 117 | void nubus_radiustpd_device::device_reset() |
| 118 | { |
| 119 | m_count = 0; |
| 120 | m_clutoffs = 0; |
| 121 | m_vbl_disable = 1; |
| 122 | m_mode = 0; |
| 123 | memset(m_vram, 0, VRAM_SIZE); |
| 124 | memset(m_palette, 0, sizeof(m_palette)); |
| 125 | |
| 126 | m_palette[1] = MAKE_RGB(255, 255, 255); |
| 127 | m_palette[0] = MAKE_RGB(0, 0, 0); |
| 128 | } |
| 129 | |
| 130 | |
| 131 | void nubus_radiustpd_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) |
| 132 | { |
| 133 | if (!m_vbl_disable) |
| 134 | { |
| 135 | raise_slot_irq(); |
| 136 | } |
| 137 | |
| 138 | m_timer->adjust(m_screen->time_until_pos(479, 0), 0); |
| 139 | } |
| 140 | |
| 141 | /*************************************************************************** |
| 142 | |
| 143 | Two Page Display section |
| 144 | |
| 145 | ***************************************************************************/ |
| 146 | |
| 147 | static SCREEN_UPDATE( radiustpd ) |
| 148 | { |
| 149 | UINT32 *scanline; |
| 150 | int x, y; |
| 151 | nubus_radiustpd_device *card = downcast<nubus_radiustpd_device *>(screen->owner()); |
| 152 | UINT8 pixels, *vram; |
| 153 | |
| 154 | // first time? kick off the VBL timer |
| 155 | if (!card->m_screen) |
| 156 | { |
| 157 | card->m_screen = screen; |
| 158 | card->m_timer->adjust(card->m_screen->time_until_pos(479, 0), 0); |
| 159 | } |
| 160 | |
| 161 | vram = card->m_vram + 0x200; |
| 162 | |
| 163 | for (y = 0; y < 880; y++) |
| 164 | { |
| 165 | scanline = BITMAP_ADDR32(bitmap, y, 0); |
| 166 | for (x = 0; x < 1152/8; x++) |
| 167 | { |
| 168 | pixels = vram[(y * (1152/8)) + (BYTE4_XOR_BE(x))]; |
| 169 | |
| 170 | *scanline++ = card->m_palette[((pixels>>7)&0x1)]; |
| 171 | *scanline++ = card->m_palette[((pixels>>6)&0x1)]; |
| 172 | *scanline++ = card->m_palette[((pixels>>5)&0x1)]; |
| 173 | *scanline++ = card->m_palette[((pixels>>4)&0x1)]; |
| 174 | *scanline++ = card->m_palette[((pixels>>3)&0x1)]; |
| 175 | *scanline++ = card->m_palette[((pixels>>2)&0x1)]; |
| 176 | *scanline++ = card->m_palette[((pixels>>1)&0x1)]; |
| 177 | *scanline++ = card->m_palette[(pixels&1)]; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | return 0; |
| 182 | } |
| 183 | |
| 184 | WRITE32_MEMBER( nubus_radiustpd_device::radiustpd_w ) |
| 185 | { |
| 186 | // printf("TPD: write %08x to %x, mask %08x\n", data, offset, mem_mask); |
| 187 | } |
| 188 | |
| 189 | READ32_MEMBER( nubus_radiustpd_device::radiustpd_r ) |
| 190 | { |
| 191 | // printf("TPD: read @ %x, mask %08x\n", offset, mem_mask); |
| 192 | |
| 193 | if (offset == 0) |
| 194 | { |
| 195 | lower_slot_irq(); |
| 196 | m_vbl_disable = true; |
| 197 | } |
| 198 | |
| 199 | if (offset == 0x8000) |
| 200 | { |
| 201 | m_vbl_disable = false; |
| 202 | } |
| 203 | |
| 204 | if (offset == 0x18000) |
| 205 | { |
| 206 | return 0xffffffff; |
| 207 | } |
| 208 | |
| 209 | return 0; |
| 210 | } |
| 211 | |
| 212 | WRITE32_MEMBER( nubus_radiustpd_device::vram_w ) |
| 213 | { |
| 214 | data ^= 0xffffffff; |
| 215 | COMBINE_DATA(&m_vram32[offset]); |
| 216 | } |
| 217 | |
| 218 | READ32_MEMBER( nubus_radiustpd_device::vram_r ) |
| 219 | { |
| 220 | return m_vram32[offset] ^ 0xffffffff; |
| 221 | } |
src/mess/video/nubus_radiustpd.h
| r0 | r12820 | |
| 1 | #pragma once |
| 2 | |
| 3 | #ifndef __NUBUS_RADIUSTPD_H__ |
| 4 | #define __NUBUS_RADIUSTPD_H__ |
| 5 | |
| 6 | #include "emu.h" |
| 7 | #include "machine/nubus.h" |
| 8 | |
| 9 | //************************************************************************** |
| 10 | // TYPE DEFINITIONS |
| 11 | //************************************************************************** |
| 12 | |
| 13 | // ======================> nubus_radiustpd_device |
| 14 | |
| 15 | class nubus_radiustpd_device : |
| 16 | public device_t, |
| 17 | public device_nubus_card_interface, |
| 18 | public device_slot_card_interface |
| 19 | { |
| 20 | public: |
| 21 | // construction/destruction |
| 22 | nubus_radiustpd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 23 | nubus_radiustpd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 24 | |
| 25 | // optional information overrides |
| 26 | virtual machine_config_constructor device_mconfig_additions() const; |
| 27 | virtual const rom_entry *device_rom_region() const; |
| 28 | |
| 29 | protected: |
| 30 | // device-level overrides |
| 31 | virtual void device_start(); |
| 32 | virtual void device_reset(); |
| 33 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 34 | |
| 35 | DECLARE_READ32_MEMBER(radiustpd_r); |
| 36 | DECLARE_WRITE32_MEMBER(radiustpd_w); |
| 37 | DECLARE_READ32_MEMBER(vram_r); |
| 38 | DECLARE_WRITE32_MEMBER(vram_w); |
| 39 | |
| 40 | public: |
| 41 | UINT8 *m_vram; |
| 42 | UINT32 *m_vram32; |
| 43 | UINT32 m_mode, m_vbl_disable, m_toggle; |
| 44 | UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; |
| 45 | screen_device *m_screen; |
| 46 | emu_timer *m_timer; |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | // device type definition |
| 51 | extern const device_type NUBUS_RADIUSTPD; |
| 52 | |
| 53 | #endif /* __NUBUS_RADIUSTPD_H__ */ |
src/mess/drivers/mac.c
| r12819 | r12820 | |
| 59 | 59 | #include "video/nubus_specpdq.h" |
| 60 | 60 | #include "video/nubus_m2hires.h" |
| 61 | 61 | #include "video/nubus_spec8.h" |
| 62 | //#include "video/nubus_thundergx.h" |
| 63 | #include "video/nubus_radiustpd.h" |
| 62 | 64 | #include "machine/nubus_asntmc3b.h" |
| 63 | 65 | #include "includes/mac.h" |
| 64 | 66 | |
| r12819 | r12820 | |
| 736 | 738 | AM_RANGE(0xfcff0000, 0xfcffffff) AM_ROM AM_REGION("bootrom", 0xf0000) |
| 737 | 739 | ADDRESS_MAP_END |
| 738 | 740 | */ |
| 741 | #if 0 |
| 742 | static ADDRESS_MAP_START(quadra700_map, AS_PROGRAM, 32, mac_state ) |
| 743 | AM_RANGE(0x40000000, 0x400fffff) AM_ROM AM_REGION("bootrom", 0) AM_MIRROR(0x0ff00000) |
| 739 | 744 | |
| 745 | AM_RANGE(0x50000000, 0x50001fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 746 | AM_RANGE(0x50002000, 0x50003fff) AM_READWRITE16(mac_via2_r, mac_via2_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 747 | // 50008000 = Ethernet MAC ID PROM |
| 748 | // 5000a000 = Sonic (DP83932) ethernet |
| 749 | // 5000f000 = SCSI cf96, 5000f402 = SCSI #2 cf96 |
| 750 | AM_RANGE(0x5000c000, 0x5000dfff) AM_READWRITE16(mac_scc_r, mac_scc_2_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 751 | AM_RANGE(0x50016000, 0x50017fff) AM_READWRITE16(mac_iwm_r, mac_iwm_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 752 | AM_RANGE(0x5001e000, 0x5001ffff) AM_DEVREADWRITE8("asc", asc_device, read, write, 0xffffffff) AM_MIRROR(0x00f00000) |
| 753 | |
| 754 | AM_RANGE(0x50040000, 0x50041fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 755 | // f9800000 = VDAC / DAFB |
| 756 | AM_RANGE(0xf9000000, 0xf91fffff) AM_RAM AM_BASE(m_vram) |
| 757 | ADDRESS_MAP_END |
| 758 | #endif |
| 759 | |
| 740 | 760 | static ADDRESS_MAP_START(pwrmac_map, AS_PROGRAM, 64, mac_state ) |
| 741 | 761 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM // 8 MB standard |
| 742 | 762 | |
| r12819 | r12820 | |
| 811 | 831 | SLOT_INTERFACE("specpdq", NUBUS_SPECPDQ) /* SuperMac Spectrum PDQ */ |
| 812 | 832 | SLOT_INTERFACE("m2hires", NUBUS_M2HIRES) /* Apple Macintosh II Hi-Resolution Card */ |
| 813 | 833 | SLOT_INTERFACE("spec8s3", NUBUS_SPEC8S3) /* SuperMac Spectrum/8 Series III */ |
| 834 | // SLOT_INTERFACE("thundergx", NUBUS_THUNDERGX) /* Radius Thunder GX (not yet) */ |
| 835 | SLOT_INTERFACE("radiustpd", NUBUS_RADIUSTPD) /* Radius Two Page Display */ |
| 814 | 836 | SLOT_INTERFACE("asmc3b", NUBUS_ASNTMC3B) /* Asante MC3B Ethernet card */ |
| 815 | 837 | SLOT_INTERFACE_END |
| 816 | 838 | |
| r12819 | r12820 | |
| 1519 | 1541 | MCFG_RAM_DEFAULT_SIZE("8M") |
| 1520 | 1542 | MCFG_RAM_EXTRA_OPTIONS("16M,32M,64M,128M") |
| 1521 | 1543 | MACHINE_CONFIG_END |
| 1544 | #if 0 |
| 1545 | static MACHINE_CONFIG_START( macqd700, mac_state ) |
| 1522 | 1546 | |
| 1547 | /* basic machine hardware */ |
| 1548 | MCFG_CPU_ADD("maincpu", M68040, 25000000) |
| 1549 | MCFG_CPU_PROGRAM_MAP(quadra700_map) |
| 1550 | |
| 1551 | MCFG_PALETTE_LENGTH(256) |
| 1552 | |
| 1553 | /* sound hardware */ |
| 1554 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1555 | MCFG_ASC_ADD("asc", C15M, ASC_TYPE_ASC, mac_asc_irq) |
| 1556 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 1557 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 1558 | |
| 1559 | /* nvram */ |
| 1560 | MCFG_NVRAM_HANDLER(mac) |
| 1561 | |
| 1562 | /* devices */ |
| 1563 | MCFG_NUBUS_BUS_ADD("nubus", "maincpu", nubus_intf) |
| 1564 | MCFG_NUBUS_SLOT_ADD("nubus","nb9", mac_nubus_cards, "cb264", NULL) |
| 1565 | MCFG_NUBUS_SLOT_ADD("nubus","nba", mac_nubus_cards, NULL, NULL) |
| 1566 | MCFG_NUBUS_SLOT_ADD("nubus","nbb", mac_nubus_cards, NULL, NULL) |
| 1567 | MCFG_NUBUS_SLOT_ADD("nubus","nbc", mac_nubus_cards, NULL, NULL) |
| 1568 | MCFG_NUBUS_SLOT_ADD("nubus","nbd", mac_nubus_cards, NULL, NULL) |
| 1569 | MCFG_NUBUS_SLOT_ADD("nubus","nbe", mac_nubus_cards, NULL, NULL) |
| 1570 | |
| 1571 | MCFG_NCR5380_ADD("ncr5380", C7M, macplus_5380intf) |
| 1572 | |
| 1573 | MCFG_IWM_ADD("fdc", mac_iwm_interface) |
| 1574 | MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface) |
| 1575 | |
| 1576 | MCFG_SCC8530_ADD("scc", C7M) |
| 1577 | MCFG_SCC8530_IRQ(mac_scc_irq) |
| 1578 | |
| 1579 | MCFG_VIA6522_ADD("via6522_0", C7M/10, mac_via6522_adb_intf) |
| 1580 | MCFG_VIA6522_ADD("via6522_1", C7M/10, mac_via6522_2_intf) |
| 1581 | |
| 1582 | MCFG_HARDDISK_ADD( "harddisk1" ) |
| 1583 | MCFG_HARDDISK_ADD( "harddisk2" ) |
| 1584 | |
| 1585 | /* internal ram */ |
| 1586 | MCFG_RAM_ADD(RAM_TAG) |
| 1587 | MCFG_RAM_DEFAULT_SIZE("4M") |
| 1588 | MCFG_RAM_EXTRA_OPTIONS("8M,32M,64M,96M,128M,160M,192M,256M") |
| 1589 | MACHINE_CONFIG_END |
| 1590 | #endif |
| 1523 | 1591 | static INPUT_PORTS_START( macplus ) |
| 1524 | 1592 | PORT_START("MOUSE0") /* Mouse - button */ |
| 1525 | 1593 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1) |
| r12819 | r12820 | |
| 1948 | 2016 | ROM_REGION32_BE(0x100000, "bootrom", 0) |
| 1949 | 2017 | ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) ) |
| 1950 | 2018 | ROM_END |
| 1951 | | |
| 2019 | #if 0 |
| 2020 | ROM_START( macqd700 ) |
| 2021 | ROM_REGION32_BE(0x100000, "bootrom", 0) |
| 2022 | ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) ) |
| 2023 | ROM_END |
| 2024 | #endif |
| 1952 | 2025 | ROM_START( macpb160 ) |
| 1953 | 2026 | ROM_REGION32_BE(0x100000, "bootrom", 0) |
| 1954 | 2027 | ROM_LOAD( "e33b2724.rom", 0x000000, 0x100000, CRC(536c60f4) SHA1(c0510682ae6d973652d7e17f3c3b27629c47afac) ) |
| r12819 | r12820 | |
| 1986 | 2059 | COMP( 1991, macpb100, 0, 0, macprtb, macadb, macprtb, "Apple Computer", "Macintosh PowerBook 100", GAME_NOT_WORKING ) |
| 1987 | 2060 | COMP( 1991, macpb140, 0, 0, macpb140, macadb, macpb140, "Apple Computer", "Macintosh PowerBook 140", GAME_NOT_WORKING ) |
| 1988 | 2061 | COMP( 1991, macpb170, macpb140, 0, macpb170, macadb, macpb140, "Apple Computer", "Macintosh PowerBook 170", GAME_NOT_WORKING ) |
| 2062 | //COMP( 1991, macqd700, macpb140, 0, macqd700, macadb, macquadra700, "Apple Computer", "Macintosh Quadra 700", GAME_NOT_WORKING ) |
| 1989 | 2063 | COMP( 1991, macclas2, 0, 0, macclas2, macadb, macclassic2, "Apple Computer", "Macintosh Classic II", GAME_NOT_WORKING ) |
| 1990 | 2064 | COMP( 1991, maclc2, 0, 0, maclc2, maciici, maclc2, "Apple Computer", "Macintosh LC II", GAME_NOT_WORKING ) |
| 1991 | 2065 | COMP( 1992, macpb145, macpb140, 0, macpb145, macadb, macpb140, "Apple Computer", "Macintosh PowerBook 145", GAME_NOT_WORKING ) |