From 49d312af88b91e276fa0c906b5717591b6136883 Mon Sep 17 00:00:00 2001 From: angelosa Date: Thu, 5 Sep 2019 21:29:13 +0200 Subject: archimds.cpp: fixed cursor enable and variable size, used by caverns to display score and main player sprite [Angelo Salese] --- hash/archimedes.xml | 31 +++++++++++++++++++++---------- src/mame/drivers/aa310.cpp | 28 ++++++++++++++++++---------- src/mame/includes/archimds.h | 4 +++- src/mame/machine/archimds.cpp | 17 +++++++++++------ src/mame/video/archimds.cpp | 4 ++++ 5 files changed, 57 insertions(+), 27 deletions(-) diff --git a/hash/archimedes.xml b/hash/archimedes.xml index 4f98544512e..74a7b7b6d5c 100644 --- a/hash/archimedes.xml +++ b/hash/archimedes.xml @@ -189,7 +189,8 @@ Zalaga by ProAction (RiscPC & StrongARM) Zelanites: The Onslaught by Micro Power (RiscOS2) --> - + + 2067 BC 1992 Oregan Software @@ -211,7 +212,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Aggressor 1992 Atomic Software @@ -222,7 +224,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Air Supremacy 1991 Superior Software/Acornsoft @@ -233,7 +236,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Aldebaran 1991 Evolution Trading @@ -244,7 +248,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Alerion 1994 Archimedes World @@ -255,7 +260,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Alien Attack 1992 Archimedes World @@ -521,7 +527,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Break 147 1991 Fourth Dimension @@ -532,7 +539,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Bubble Fair 1991 Eterna @@ -631,7 +639,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Caverns 1991 Minerva @@ -2818,7 +2827,9 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + + Xenon 2: Megablast 1993 Eclipse diff --git a/src/mame/drivers/aa310.cpp b/src/mame/drivers/aa310.cpp index dabde26e350..94a2db5dc95 100644 --- a/src/mame/drivers/aa310.cpp +++ b/src/mame/drivers/aa310.cpp @@ -365,16 +365,24 @@ static INPUT_PORTS_START( aa310 ) PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_CHANGED_MEMBER(DEVICE_SELF, aa310_state, send_mouse_input, 0) PORT_RESET PORT_REVERSE // standard Atari/Commodore DB9 - // TODO: player 2 - PORT_START("via1a") /* VIA #1 PORT A */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + // TODO: find a software that actually reads the ports, verify directions (most likely wrong) + PORT_START("joy_p1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("joy_p2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) INPUT_PORTS_END FLOPPY_FORMATS_MEMBER( aa310_state::floppy_formats ) diff --git a/src/mame/includes/archimds.h b/src/mame/includes/archimds.h index 96d7d173684..ea3ecb87623 100644 --- a/src/mame/includes/archimds.h +++ b/src/mame/includes/archimds.h @@ -60,6 +60,7 @@ public: m_region_vram(*this, "vram"), m_screen(*this, "screen"), m_palette(*this, "palette"), + m_joy(*this, "joy_p%u",1), m_dac(*this, { "dac0", "dac1", "dac2", "dac3", "dac4", "dac5", "dac6", "dac7" }) { } @@ -91,7 +92,7 @@ public: uint8_t m_i2c_clk; int16_t m_memc_pages[0x2000]; // the logical RAM area is 32 megs, and the smallest page size is 4k uint32_t m_vidc_regs[256]; - uint8_t m_cursor_vram[0x200]; + uint8_t m_cursor_vram[0x8000]; // size -> max(VCER) - min(VCSR) * 32 = 0x7fe0 uint8_t m_ioc_regs[0x80/4]; uint8_t m_vidc_bpp_mode; uint8_t m_vidc_interlace; @@ -110,6 +111,7 @@ protected: required_memory_region m_region_vram; required_device m_screen; required_device m_palette; + optional_ioport_array<2> m_joy; required_device_array m_dac; private: diff --git a/src/mame/machine/archimds.cpp b/src/mame/machine/archimds.cpp index cb9251a4c88..c4ce617e579 100644 --- a/src/mame/machine/archimds.cpp +++ b/src/mame/machine/archimds.cpp @@ -121,7 +121,6 @@ void archimedes_state::vidc_video_tick() address_space &space = m_maincpu->space(AS_PROGRAM); static uint8_t *vram = m_region_vram->base(); uint32_t size; - uint32_t m_vidc_ccur; uint32_t offset_ptr; size = (m_vidc_vidend - m_vidc_vidstart + 0x10) & 0x1fffff; @@ -142,8 +141,10 @@ void archimedes_state::vidc_video_tick() if(m_cursor_enabled == true) { - for(m_vidc_ccur = 0;m_vidc_ccur < 0x200;m_vidc_ccur++) - m_cursor_vram[m_vidc_ccur] = (space.read_byte(m_vidc_cinit+m_vidc_ccur)); + uint32_t ccur_size = (m_vidc_regs[VIDC_VCER] - m_vidc_regs[VIDC_VCSR]) * 32; + + for(uint32_t ccur = 0; ccur < ccur_size; ccur++) + m_cursor_vram[ccur] = (space.read_byte(m_vidc_cinit+ccur)); } if(m_video_dma_on) @@ -294,6 +295,9 @@ void archimedes_state::archimedes_reset() m_vidc_vblank_time = 10000; // set a stupidly high time so it doesn't fire off m_vbl_timer->adjust(attotime::never); + + m_cursor_enabled = false; + memset(m_cursor_vram, 0, sizeof(m_cursor_vram)); } void archimedes_state::archimedes_init() @@ -757,8 +761,8 @@ READ32_MEMBER(archimedes_state::archimedes_ioc_r) case 0x50: return 0; //fdc type, new model returns 5 here case 0x70: return 0x0F; case 0x74: return 0xFF; // unknown -// case 0x78: /* joystick */ -// case 0x7c: + case 0x78: // joystick DB9 ports + case 0x7c: return m_joy[offset & 1].read_safe(0xff); } } @@ -1042,7 +1046,6 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_w) switch ((data >> 17) & 7) { case 0: /* video init */ - m_cursor_enabled = false; m_vidc_vidinit = 0x2000000 | ((data>>2)&0x7fff)*16; //printf("MEMC: VIDINIT %08x\n",m_vidc_vidinit); break; @@ -1092,6 +1095,8 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_w) m_vidc_vidcur = 0; m_vid_timer->adjust(m_screen->time_until_pos(m_vidc_vblank_time+1)); } + else + m_cursor_enabled = false; if ((data>>11) & 1) { diff --git a/src/mame/video/archimds.cpp b/src/mame/video/archimds.cpp index 9e46b00bafe..7b18dc83f30 100644 --- a/src/mame/video/archimds.cpp +++ b/src/mame/video/archimds.cpp @@ -182,6 +182,10 @@ uint32_t archimedes_state::screen_update(screen_device &screen, bitmap_rgb32 &bi { count = 0; int cursor_h = m_vidc_regs[VIDC_VCER] - m_vidc_regs[VIDC_VCSR]; + + if (cursor_h <= 0) + return 0; + for(y=0; y