Previous 15994 Revisions Next

r12820 Saturday 10th September, 2011 at 02:22:52 UTC by R. Belmont
mac: add NuBus Radius Two-Page Display (1152x880 monochrome) card [R. Belmont]
[src/mess]mess.mak mess_dev.lst
[src/mess/drivers]mac.c
[src/mess/video]nubus_radiustpd.c* nubus_radiustpd.h*

src/mess/video/nubus_radiustpd.c
r0r12820
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
19static SCREEN_UPDATE( radiustpd );
20
21MACHINE_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)
28MACHINE_CONFIG_END
29
30ROM_START( radiustpd )
31   ROM_REGION(0x8000, RADIUSTPD_ROM_REGION, 0)
32   ROM_LOAD( "tpd_v22.bin",  0x0000, 0x8000, CRC(7dc5ed05) SHA1(4abb64e49201e966c17a255a94b670564b229934) )
33ROM_END
34
35//**************************************************************************
36//  GLOBAL VARIABLES
37//**************************************************************************
38
39const device_type NUBUS_RADIUSTPD = &device_creator<nubus_radiustpd_device>;
40
41
42//-------------------------------------------------
43//  machine_config_additions - device-specific
44//  machine configurations
45//-------------------------------------------------
46
47machine_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
56const 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
69nubus_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
77nubus_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
89void 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
117void 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
131void 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
147static 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
184WRITE32_MEMBER( nubus_radiustpd_device::radiustpd_w )
185{
186//   printf("TPD: write %08x to %x, mask %08x\n", data, offset, mem_mask);
187}
188
189READ32_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
212WRITE32_MEMBER( nubus_radiustpd_device::vram_w )
213{
214   data ^= 0xffffffff;
215   COMBINE_DATA(&m_vram32[offset]);
216}
217
218READ32_MEMBER( nubus_radiustpd_device::vram_r )
219{
220   return m_vram32[offset] ^ 0xffffffff;
221}
src/mess/video/nubus_radiustpd.h
r0r12820
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
15class nubus_radiustpd_device :
16      public device_t,
17      public device_nubus_card_interface,
18      public device_slot_card_interface
19{
20public:
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
29protected:
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
40public:
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
51extern const device_type NUBUS_RADIUSTPD;
52
53#endif  /* __NUBUS_RADIUSTPD_H__ */
src/mess/mess_dev.lst
r12819r12820
9797NUBUS_M2HIRES
9898NUBUS_SPEC8S3
9999NUBUS_ASNTMC3B
100NUBUS_RADIUSTPD
100101PC1512_KEYBOARD
101102S1410
102103SED1330
src/mess/mess.mak
r12819r12820
661661   $(MESS_VIDEO)/nubus_specpdq.o \
662662   $(MESS_VIDEO)/nubus_m2hires.o \
663663   $(MESS_VIDEO)/nubus_spec8.o \
664   $(MESS_VIDEO)/nubus_radiustpd.o \
664665    $(MESS_MACHINE)/nubus_asntmc3b.o \
665666    $(MESS_MACHINE)/dp8390x.o \
666667
src/mess/drivers/mac.c
r12819r12820
5959#include "video/nubus_specpdq.h"
6060#include "video/nubus_m2hires.h"
6161#include "video/nubus_spec8.h"
62//#include "video/nubus_thundergx.h"
63#include "video/nubus_radiustpd.h"
6264#include "machine/nubus_asntmc3b.h"
6365#include "includes/mac.h"
6466
r12819r12820
736738    AM_RANGE(0xfcff0000, 0xfcffffff) AM_ROM AM_REGION("bootrom", 0xf0000)
737739ADDRESS_MAP_END
738740*/
741#if 0
742static ADDRESS_MAP_START(quadra700_map, AS_PROGRAM, 32, mac_state )
743   AM_RANGE(0x40000000, 0x400fffff) AM_ROM AM_REGION("bootrom", 0) AM_MIRROR(0x0ff00000)
739744
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)
757ADDRESS_MAP_END
758#endif
759
740760static ADDRESS_MAP_START(pwrmac_map, AS_PROGRAM, 64, mac_state )
741761   AM_RANGE(0x00000000, 0x007fffff) AM_RAM   // 8 MB standard
742762
r12819r12820
811831   SLOT_INTERFACE("specpdq", NUBUS_SPECPDQ)   /* SuperMac Spectrum PDQ */
812832   SLOT_INTERFACE("m2hires", NUBUS_M2HIRES)   /* Apple Macintosh II Hi-Resolution Card */
813833   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 */
814836   SLOT_INTERFACE("asmc3b", NUBUS_ASNTMC3B)   /* Asante MC3B Ethernet card */
815837SLOT_INTERFACE_END
816838
r12819r12820
15191541   MCFG_RAM_DEFAULT_SIZE("8M")
15201542   MCFG_RAM_EXTRA_OPTIONS("16M,32M,64M,128M")
15211543MACHINE_CONFIG_END
1544#if 0
1545static MACHINE_CONFIG_START( macqd700, mac_state )
15221546
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")
1589MACHINE_CONFIG_END
1590#endif
15231591static INPUT_PORTS_START( macplus )
15241592   PORT_START("MOUSE0") /* Mouse - button */
15251593   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1)
r12819r12820
19482016   ROM_REGION32_BE(0x100000, "bootrom", 0)
19492017   ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) )
19502018ROM_END
1951
2019#if 0
2020ROM_START( macqd700 )
2021   ROM_REGION32_BE(0x100000, "bootrom", 0)
2022   ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) )
2023ROM_END
2024#endif
19522025ROM_START( macpb160 )
19532026   ROM_REGION32_BE(0x100000, "bootrom", 0)
19542027   ROM_LOAD( "e33b2724.rom", 0x000000, 0x100000, CRC(536c60f4) SHA1(c0510682ae6d973652d7e17f3c3b27629c47afac) )
r12819r12820
19862059COMP( 1991, macpb100, 0,        0,  macprtb,  macadb,   macprtb,     "Apple Computer", "Macintosh PowerBook 100", GAME_NOT_WORKING )
19872060COMP( 1991, macpb140, 0,        0,  macpb140, macadb,   macpb140,     "Apple Computer", "Macintosh PowerBook 140", GAME_NOT_WORKING )
19882061COMP( 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 )
19892063COMP( 1991, macclas2, 0,      0,   macclas2, macadb,   macclassic2,  "Apple Computer", "Macintosh Classic II",  GAME_NOT_WORKING )
19902064COMP( 1991, maclc2,   0,      0,   maclc2,   maciici,  maclc2,         "Apple Computer", "Macintosh LC II",  GAME_NOT_WORKING )
19912065COMP( 1992, macpb145, macpb140, 0,  macpb145, macadb,   macpb140,     "Apple Computer", "Macintosh PowerBook 145", GAME_NOT_WORKING )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team