Previous 15994 Revisions Next

r12436 Monday 1st August, 2011 at 03:03:33 UTC by R. Belmont
Mac: added emulation of Moniterm Viking 1024x758 monochrome video card [R. Belmont]
[src/mess]mess.mak
[src/mess/drivers]mac.c
[src/mess/video]nubus_cb264.c nubus_vikbw.c* nubus_vikbw.h*

src/mess/video/nubus_cb264.c
r12435r12436
126126
127127/***************************************************************************
128128
129  Monochrome Display Adapter (MDA) section
129  ColorBoard 264 section
130130
131131***************************************************************************/
132132
src/mess/video/nubus_vikbw.c
r0r12436
1/***************************************************************************
2
3  Viking 1024x768 fixed-resolution monochrome board
4 
5  Apparently incompatible with System 7.0 and later(!)
6 
7***************************************************************************/
8
9#include "emu.h"
10#include "video/nubus_vikbw.h"
11
12#define VIKBW_SCREEN_NAME   "vikbw_screen"
13#define VIKBW_ROM_REGION      "vikbw_rom"
14
15#define VRAM_SIZE   (0x18000)  // 1024x768 @ 1bpp is 98,304 bytes (0x18000)
16
17static SCREEN_UPDATE( vikbw );
18
19MACHINE_CONFIG_FRAGMENT( vikbw )
20   MCFG_SCREEN_ADD( VIKBW_SCREEN_NAME, RASTER)
21   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
22   MCFG_SCREEN_UPDATE(vikbw)
23   MCFG_SCREEN_SIZE(1024,768)
24   MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1)
25   MCFG_SCREEN_REFRESH_RATE(70)
26MACHINE_CONFIG_END
27
28ROM_START( vikbw )
29   ROM_REGION(0x2000, VIKBW_ROM_REGION, 0)
30   ROM_LOAD( "viking.bin",   0x000000, 0x002000, CRC(92cf04d1) SHA1(d08349edfc82a0bd5ea848e053e1712092308f74) )
31ROM_END
32
33//**************************************************************************
34//  GLOBAL VARIABLES
35//**************************************************************************
36
37const device_type NUBUS_VIKBW = &device_creator<nubus_vikbw_device>;
38
39
40//-------------------------------------------------
41//  machine_config_additions - device-specific
42//  machine configurations
43//-------------------------------------------------
44
45machine_config_constructor nubus_vikbw_device::device_mconfig_additions() const
46{
47   return MACHINE_CONFIG_NAME( vikbw );
48}
49
50//-------------------------------------------------
51//  rom_region - device-specific ROM region
52//-------------------------------------------------
53
54const rom_entry *nubus_vikbw_device::device_rom_region() const
55{
56   return ROM_NAME( vikbw );
57}
58
59//**************************************************************************
60//  LIVE DEVICE
61//**************************************************************************
62
63//-------------------------------------------------
64//  nubus_vikbw_device - constructor
65//-------------------------------------------------
66
67nubus_vikbw_device::nubus_vikbw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
68        device_t(mconfig, NUBUS_VIKBW, "NUBUS_VIKBW", tag, owner, clock),
69      device_nubus_card_interface(mconfig, *this),
70      device_slot_card_interface(mconfig, *this)
71{
72   m_shortname = "nb_vikbw";
73}
74
75nubus_vikbw_device::nubus_vikbw_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
76        device_t(mconfig, type, name, tag, owner, clock),
77      device_nubus_card_interface(mconfig, *this),
78      device_slot_card_interface(mconfig, *this)
79{
80   m_shortname = "nb_vikbw";
81}
82
83//-------------------------------------------------
84//  device_start - device-specific startup
85//-------------------------------------------------
86
87void nubus_vikbw_device::device_start()
88{
89   UINT32 slotspace;
90
91   // set_nubus_device makes m_slot valid
92   set_nubus_device();
93   install_declaration_rom(this, VIKBW_ROM_REGION);
94
95   slotspace = get_slotspace();
96
97//   printf("[vikbw %p] slotspace = %x\n", this, slotspace);
98
99   m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
100   install_bank(slotspace, slotspace+VRAM_SIZE-1, 0, 0, "bank_vikbw1", m_vram);
101   install_bank(slotspace+0x40000, slotspace+0x40000+VRAM_SIZE-1, 0, 0, "bank_vikbw", m_vram);
102
103   m_nubus->install_device(slotspace+0x40000+VRAM_SIZE, slotspace+0x40000+VRAM_SIZE+0x3ffff, read32_delegate(FUNC(nubus_vikbw_device::viking_r), this), write32_delegate(FUNC(nubus_vikbw_device::viking_w), this));
104}
105
106//-------------------------------------------------
107//  device_reset - device-specific reset
108//-------------------------------------------------
109
110void nubus_vikbw_device::device_reset()
111{
112   m_vbl_disable = 1;
113   memset(m_vram, 0, VRAM_SIZE);
114
115   m_palette[0] = MAKE_RGB(255, 255, 255);
116   m_palette[1] = MAKE_RGB(0, 0, 0);
117}
118
119/***************************************************************************
120
121  Viking 1024x768 B&W card section
122
123***************************************************************************/
124
125static SCREEN_UPDATE( vikbw )
126{
127   UINT32 *scanline;
128   int x, y;
129   nubus_vikbw_device *card = downcast<nubus_vikbw_device *>(screen->owner());
130   UINT8 pixels;
131
132   if (!card->m_vbl_disable)
133   {
134      card->m_nubus->set_irq_line(card->m_slot, ASSERT_LINE);
135   }
136
137   for (y = 0; y < 768; y++)
138   {
139      scanline = BITMAP_ADDR32(bitmap, y, 0);
140      for (x = 0; x < 1024/8; x++)
141      {
142         pixels = card->m_vram[(y * 128) + (BYTE4_XOR_BE(x))];
143
144         *scanline++ = card->m_palette[(pixels>>7)&1];
145         *scanline++ = card->m_palette[(pixels>>6)&1];
146         *scanline++ = card->m_palette[(pixels>>5)&1];
147         *scanline++ = card->m_palette[(pixels>>4)&1];
148         *scanline++ = card->m_palette[(pixels>>3)&1];
149         *scanline++ = card->m_palette[(pixels>>2)&1];
150         *scanline++ = card->m_palette[(pixels>>1)&1];
151         *scanline++ = card->m_palette[(pixels&1)];
152      }
153   }
154
155   return 0;
156}
157
158WRITE32_MEMBER( nubus_vikbw_device::viking_w )
159{
160//   printf("viking_w: %08x @ %x (mask %08x)\n", data, offset, mem_mask);
161
162   if (offset == 0 && data == 0)
163   {
164      m_vbl_disable = 0;
165   }
166   else if (offset == 0xa000)
167   {
168      m_nubus->set_irq_line(m_slot, CLEAR_LINE);
169   }
170}
171
172READ32_MEMBER( nubus_vikbw_device::viking_r )
173{
174//   printf("viking_r: @ %x (mask %08x)\n", offset, mem_mask);
175   return 0;
176}
177
src/mess/video/nubus_vikbw.h
r0r12436
1#pragma once
2
3#ifndef __NUBUS_VIKBW_H__
4#define __NUBUS_VIKBW_H__
5
6#include "emu.h"
7#include "machine/nubus.h"
8
9//**************************************************************************
10//  TYPE DEFINITIONS
11//**************************************************************************
12
13// ======================> nubus_vikbw_device
14
15class nubus_vikbw_device :
16      public device_t,
17      public device_nubus_card_interface,
18      public device_slot_card_interface
19{
20public:
21        // construction/destruction
22        nubus_vikbw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23      nubus_vikbw_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
34        DECLARE_READ32_MEMBER(viking_r);
35        DECLARE_WRITE32_MEMBER(viking_w);
36
37public:
38        UINT8 *m_vram;
39        UINT32 m_vbl_disable, m_palette[2];
40};
41
42
43// device type definition
44extern const device_type NUBUS_VIKBW;
45
46#endif  /* __NUBUS_VIKBW_H__ */
47
src/mess/drivers/mac.c
r12435r12436
5555#include "sound/cdda.h"
5656#include "video/nubus_48gc.h"
5757#include "video/nubus_cb264.h"
58#include "video/nubus_vikbw.h"
5859#include "includes/mac.h"
5960
6061#define C7M   (7833600)
r12435r12436
801802static SLOT_INTERFACE_START(mac_nubus_cards)
802803   SLOT_INTERFACE("48gc", NUBUS_48GC)
803804   SLOT_INTERFACE("cb264", NUBUS_CB264)
805   SLOT_INTERFACE("vikbw", NUBUS_VIKBW)
804806SLOT_INTERFACE_END
805807
806808/***************************************************************************
src/mess/mess.mak
r12435r12436
646646    $(MESS_MACHINE)/egret.o     \
647647   $(MESS_VIDEO)/nubus_48gc.o    \
648648   $(MESS_VIDEO)/nubus_cb264.o \
649   $(MESS_VIDEO)/nubus_vikbw.o \
649650
650651$(MESSOBJ)/applied.a:         \
651652   $(MESS_VIDEO)/mbee.o      \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team