mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
machine/pxa255.cpp: add basic screen visible area configuration
Some checks failed
CI (Linux) / build-linux (-U_FORTIFY_SOURCE, gcc, gcc, g++, mametiny, tiny) (push) Has been cancelled
CI (Linux) / build-linux (clang, clang, clang++, mame, mame) (push) Has been cancelled
CI (macOS) / build-macos (push) Has been cancelled
CI (Windows) / build-windows (clang, clang, clang++, mametiny, tiny) (push) Has been cancelled
CI (Windows) / build-windows (gcc, gcc, g++, mame, mame) (push) Has been cancelled
XML/JSON validation / validate (push) Has been cancelled
Some checks failed
CI (Linux) / build-linux (-U_FORTIFY_SOURCE, gcc, gcc, g++, mametiny, tiny) (push) Has been cancelled
CI (Linux) / build-linux (clang, clang, clang++, mame, mame) (push) Has been cancelled
CI (macOS) / build-macos (push) Has been cancelled
CI (Windows) / build-windows (clang, clang, clang++, mametiny, tiny) (push) Has been cancelled
CI (Windows) / build-windows (gcc, gcc, g++, mame, mame) (push) Has been cancelled
XML/JSON validation / validate (push) Has been cancelled
This commit is contained in:
parent
7cee552e3d
commit
48a24099e1
2 changed files with 25 additions and 7 deletions
|
@ -39,6 +39,7 @@ pxa255_periphs_device::pxa255_periphs_device(const machine_config &mconfig, cons
|
|||
, m_maincpu(*this, finder_base::DUMMY_TAG)
|
||||
, m_dmadac(*this, "dac%u", 1U)
|
||||
, m_palette(*this, "palette")
|
||||
, m_screen(*this, "screen")
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -253,12 +254,14 @@ void pxa255_periphs_device::device_reset()
|
|||
|
||||
void pxa255_periphs_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_refresh_hz(60);
|
||||
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
|
||||
screen.set_size(1024, 1024);
|
||||
screen.set_visarea(0, 295, 0, 479);
|
||||
screen.set_screen_update(FUNC(pxa255_periphs_device::screen_update));
|
||||
// TODO: should be SCREEN_TYPE_LCD, but that dislikes dynamic configure
|
||||
// will stay stuck at 296x480 aspect ratio.
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_refresh_hz(60);
|
||||
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
|
||||
m_screen->set_size(1024, 1024);
|
||||
m_screen->set_visarea(0, 295, 0, 479);
|
||||
m_screen->set_screen_update(FUNC(pxa255_periphs_device::screen_update));
|
||||
|
||||
PALETTE(config, m_palette).set_entries(256);
|
||||
|
||||
|
@ -1462,10 +1465,24 @@ template <int Which>
|
|||
void pxa255_periphs_device::lcd_lccr_w(offs_t offset, u32 data, u32 mem_mask)
|
||||
{
|
||||
LOGMASKED(LOG_LCD, "%s: lcd_lccr_w: LCD Control Register %d = %08x & %08x\n", machine().describe_context(), Which, data, mem_mask);
|
||||
|
||||
if (Which == 0)
|
||||
m_lcd_regs.lccr[Which] = data & 0x00fffeff;
|
||||
else
|
||||
{
|
||||
m_lcd_regs.lccr[Which] = data;
|
||||
if (Which == 1 || Which == 2)
|
||||
{
|
||||
const u16 lpp = (m_lcd_regs.lccr[2] & LCCR2_LPP);
|
||||
const u16 ppl = (m_lcd_regs.lccr[1] & LCCR1_PPL);
|
||||
|
||||
if (lpp && ppl)
|
||||
{
|
||||
rectangle rect(0, ppl, 0, lpp);
|
||||
m_screen->configure(1024, 1024, rect, HZ_TO_ATTOSECONDS(60));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <int Which>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "cpu/arm7/arm7.h"
|
||||
#include "sound/dmadac.h"
|
||||
#include "emupal.h"
|
||||
|
||||
#include "screen.h"
|
||||
|
||||
class pxa255_periphs_device : public device_t
|
||||
{
|
||||
|
@ -469,6 +469,7 @@ protected:
|
|||
required_device<cpu_device> m_maincpu;
|
||||
required_device_array<dmadac_sound_device, 2> m_dmadac;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<screen_device> m_screen;
|
||||
|
||||
std::unique_ptr<u32[]> m_lcd_palette; // 0x100
|
||||
std::unique_ptr<u8[]> m_lcd_framebuffer; // 0x100000
|
||||
|
|
Loading…
Reference in a new issue