bus/pci/promotion: add Alliance VGA core stub

This commit is contained in:
angelosa 2024-02-22 02:18:18 +01:00
parent 249a6a793f
commit 5f7912858d
5 changed files with 147 additions and 4 deletions

View File

@ -833,6 +833,18 @@ if (VIDEOS["PC_VGA"]~=null) then
}
end
--------------------------------------------------
--
--@src/devices/video/pc_vga_ati.h,VIDEOS["PC_VGA_ALLIANCE"] = true
--------------------------------------------------
if (VIDEOS["PC_VGA_ALLIANCE"]~=null) then
files {
MAME_DIR .. "src/devices/video/pc_vga_alliance.cpp",
MAME_DIR .. "src/devices/video/pc_vga_alliance.h",
}
end
--------------------------------------------------
--
--@src/devices/video/pc_vga_ati.h,VIDEOS["PC_VGA_ATI"] = true

View File

@ -73,10 +73,11 @@ void promotion3210_device::device_add_mconfig(machine_config &config)
screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480);
screen.set_screen_update(m_vga, FUNC(vga_device::screen_update));
VGA(config, m_vga, 0);
PROMOTION_VGA(config, m_vga, 0);
m_vga->set_screen("screen");
// TODO: configurable between 1 and 4 MB (2x EDO slots on board)
m_vga->set_vram_size(4*1024*1024);
// Only known OEM Board (Miro) has 1MB
m_vga->set_vram_size(1*1024*1024);
// AT&T ATT20C408-13 PrecisionDAC
// Reused by ATI Mach64?
@ -102,6 +103,7 @@ void promotion3210_device::device_reset()
// TODO: to be checked
command = 0x0000;
status = 0x0000;
command_mask = 0x23;
remap_cb();
}

View File

@ -8,7 +8,7 @@
#include "pci_slot.h"
#include "video/pc_vga.h"
#include "video/pc_vga_alliance.h"
class promotion3210_device : public pci_card_device
@ -35,7 +35,7 @@ protected:
virtual void config_map(address_map &map) override;
required_device<vga_device> m_vga;
required_device<promotion_vga_device> m_vga;
required_memory_region m_vga_rom;
private:
u8 vram_r(offs_t offset);

View File

@ -0,0 +1,89 @@
// license:BSD-3-Clause
// copyright-holders:
#include "emu.h"
#include "pc_vga_alliance.h"
#include "screen.h"
#define VERBOSE (LOG_GENERAL)
//#define LOG_OUTPUT_FUNC osd_printf_info
#include "logmacro.h"
DEFINE_DEVICE_TYPE(PROMOTION_VGA, promotion_vga_device, "promotion_vga", "Alliance ProMotion VGA i/f")
promotion_vga_device::promotion_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: svga_device(mconfig, PROMOTION_VGA, tag, owner, clock)
{
m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(promotion_vga_device::crtc_map), this));
m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(promotion_vga_device::sequencer_map), this));
// TODO: ATT20C408-13 RAMDAC (with bit 9 of address space), BIOS does extensive signature checks at POST
}
static INPUT_PORTS_START(promotion_vga_sense)
PORT_START("VGA_SENSE")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // read at POST
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
ioport_constructor promotion_vga_device::device_input_ports() const
{
return INPUT_PORTS_NAME(promotion_vga_sense);
}
void promotion_vga_device::device_start()
{
svga_device::device_start();
}
void promotion_vga_device::device_reset()
{
svga_device::device_reset();
m_remap_blt = 0;
m_remap_mem = 0;
}
// TODO: lock mechanism
void promotion_vga_device::crtc_map(address_map &map)
{
svga_device::crtc_map(map);
// TODO: $19-$1e for extended regs
}
// TODO: lock mechanism
void promotion_vga_device::sequencer_map(address_map &map)
{
svga_device::sequencer_map(map);
map(0x10, 0xff).unmaprw();
map(0x1b, 0x1b).lrw8(
NAME([this]() { return (m_remap_blt & 0x7) << 3 | (m_remap_mem & 0x7); }),
NAME([this] (offs_t offset, u8 data) {
m_remap_blt = (data >> 3) & 0x7;
m_remap_mem = (data >> 0) & 0x7;
LOG("aT1B: Remap control %02x (host blt %01x promotion %01x)\n", data, m_remap_blt, m_remap_mem);
})
);
}
uint8_t promotion_vga_device::mem_r(offs_t offset)
{
if (m_remap_mem == 1 && (offset & 0x1f800) == 0x00000)
{
LOG("aT Ext Reg: [%03x] R\n", offset );
return 0xff;
}
return svga_device::mem_r(offset);
}
void promotion_vga_device::mem_w(offs_t offset, uint8_t data)
{
if (m_remap_mem == 1 && (offset & 0x1f800) == 0x00000)
{
LOG("aT Ext Reg: [%03x] W %02x\n", offset, data );
return;
}
svga_device::mem_w(offset, data);
}

View File

@ -0,0 +1,40 @@
// license:BSD-3-Clause
// copyright-holders:
#ifndef MAME_VIDEO_PC_VGA_PROMOTION_H
#define MAME_VIDEO_PC_VGA_PROMOTION_H
#pragma once
#include "video/pc_vga.h"
#include "screen.h"
class promotion_vga_device : public svga_device
{
public:
static constexpr feature_type imperfect_features() { return feature::GRAPHICS; }
promotion_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual uint8_t mem_r(offs_t offset) override;
virtual void mem_w(offs_t offset, uint8_t data) override;
protected:
virtual void device_start() override;
virtual void device_reset() override;
virtual void crtc_map(address_map &map) override;
virtual void sequencer_map(address_map &map) override;
virtual ioport_constructor device_input_ports() const override;
private:
u8 m_remap_blt = 0;
u8 m_remap_mem = 0;
};
DECLARE_DEVICE_TYPE(PROMOTION_VGA, promotion_vga_device)
#endif // MAME_VIDEO_PC_VGA_PROMOTION_H