summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nubus/pds30_cb264.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nubus/pds30_cb264.cpp')
-rw-r--r--src/devices/bus/nubus/pds30_cb264.cpp41
1 files changed, 17 insertions, 24 deletions
diff --git a/src/devices/bus/nubus/pds30_cb264.cpp b/src/devices/bus/nubus/pds30_cb264.cpp
index 388aa5f54d5..692ebc18c51 100644
--- a/src/devices/bus/nubus/pds30_cb264.cpp
+++ b/src/devices/bus/nubus/pds30_cb264.cpp
@@ -28,7 +28,7 @@ ROM_END
// GLOBAL VARIABLES
//**************************************************************************
-DEFINE_DEVICE_TYPE(PDS030_CB264SE30, nubus_cb264se30_device, "pd3_c264", "RasterOps Colorboard 264/SE30")
+DEFINE_DEVICE_TYPE(PDS030_CB264SE30, nubus_cb264se30_device, "pd3_c264", "RasterOps ColorBoard 264/SE30")
//-------------------------------------------------
@@ -39,9 +39,7 @@ void nubus_cb264se30_device::device_add_mconfig(machine_config &config)
{
screen_device &screen(SCREEN(config, CB264SE30_SCREEN_NAME, SCREEN_TYPE_RASTER));
screen.set_screen_update(FUNC(nubus_cb264se30_device::screen_update));
- screen.set_raw(25175000, 800, 0, 640, 525, 0, 480);
- screen.set_size(1024, 768);
- screen.set_visarea(0, 640-1, 0, 480-1);
+ screen.set_raw(30.24_MHz_XTAL, 864, 0, 640, 525, 0, 480);
}
//-------------------------------------------------
@@ -71,7 +69,7 @@ nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, de
device_t(mconfig, type, tag, owner, clock),
device_video_interface(mconfig, *this),
device_nubus_card_interface(mconfig, *this),
- m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr)
+ m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr)
{
set_screen(*this, CB264SE30_SCREEN_NAME);
}
@@ -84,19 +82,18 @@ void nubus_cb264se30_device::device_start()
{
uint32_t slotspace;
- install_declaration_rom(this, CB264SE30_ROM_REGION);
+ install_declaration_rom(CB264SE30_ROM_REGION);
slotspace = get_slotspace();
// printf("[cb264se30 %p] slotspace = %x\n", this, slotspace);
- m_vram.resize(VRAM_SIZE);
- m_vram32 = (uint32_t *)&m_vram[0];
+ m_vram.resize(VRAM_SIZE / sizeof(uint32_t));
nubus().install_device(slotspace, slotspace+VRAM_SIZE-1, read32s_delegate(*this, FUNC(nubus_cb264se30_device::vram_r)), write32s_delegate(*this, FUNC(nubus_cb264se30_device::vram_w)));
nubus().install_device(slotspace+0xf00000, slotspace+0xfeffff, read32s_delegate(*this, FUNC(nubus_cb264se30_device::cb264se30_r)), write32s_delegate(*this, FUNC(nubus_cb264se30_device::cb264se30_w)));
- m_timer = timer_alloc(0, nullptr);
+ m_timer = timer_alloc(FUNC(nubus_cb264se30_device::vbl_tick), this);
m_timer->adjust(screen().time_until_pos(479, 0), 0);
}
@@ -110,7 +107,7 @@ void nubus_cb264se30_device::device_reset()
m_clutoffs = 0;
m_vbl_disable = 1;
m_mode = 4;
- memset(&m_vram[0], 0, VRAM_SIZE);
+ std::fill(m_vram.begin(), m_vram.end(), 0);
memset(m_palette, 0, sizeof(m_palette));
m_palette[0] = rgb_t(255, 255, 255);
@@ -118,7 +115,7 @@ void nubus_cb264se30_device::device_reset()
}
-void nubus_cb264se30_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(nubus_cb264se30_device::vbl_tick)
{
if (!m_vbl_disable)
{
@@ -136,7 +133,7 @@ void nubus_cb264se30_device::device_timer(emu_timer &timer, device_timer_id tid,
uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint8_t const *const vram = &m_vram[8*1024];
+ auto const vram8 = util::big_endian_cast<uint8_t const>(&m_vram[0]) + (8*1024);
switch (m_mode)
{
@@ -146,7 +143,7 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
- uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram8[(y * 1024) + x];
*scanline++ = m_palette[(pixels&0x80)];
*scanline++ = m_palette[((pixels<<1)&0x80)];
@@ -166,7 +163,7 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/4; x++)
{
- uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram8[(y * 1024) + x];
*scanline++ = m_palette[(pixels&0xc0)];
*scanline++ = m_palette[((pixels<<2)&0xc0)];
@@ -182,7 +179,7 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/2; x++)
{
- uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram8[(y * 1024) + x];
*scanline++ = m_palette[(pixels&0xf0)];
*scanline++ = m_palette[((pixels&0x0f)<<4)];
@@ -196,20 +193,16 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640; x++)
{
- uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram8[(y * 1024) + x];
*scanline++ = m_palette[pixels];
}
}
break;
case 4: // 24 bpp
+ for (int y = 0; y < 480; y++)
{
- uint32_t const *const vram32 = (uint32_t *)&m_vram[0];
-
- for (int y = 0; y < 480; y++)
- {
- std::copy_n(&vram32[y * 1024], 640, &bitmap.pix(y));
- }
+ std::copy_n(&m_vram[y * 1024], 640, &bitmap.pix(y));
}
break;
@@ -298,10 +291,10 @@ uint32_t nubus_cb264se30_device::cb264se30_r(offs_t offset, uint32_t mem_mask)
void nubus_cb264se30_device::vram_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
- COMBINE_DATA(&m_vram32[offset]);
+ COMBINE_DATA(&m_vram[offset]);
}
uint32_t nubus_cb264se30_device::vram_r(offs_t offset, uint32_t mem_mask)
{
- return m_vram32[offset];
+ return m_vram[offset];
}