archimds.cpp: fixed cursor enable and variable size, used by caverns to display score and main player sprite [Angelo Salese]

This commit is contained in:
angelosa 2019-09-05 21:29:13 +02:00
parent f6068c5886
commit 49d312af88
5 changed files with 57 additions and 27 deletions

View File

@ -189,7 +189,8 @@ Zalaga by ProAction (RiscPC & StrongARM)
Zelanites: The Onslaught by Micro Power (RiscOS2)
-->
<software name="2067bc">
<!-- Boot OK, !Control throws a "sprite doesn't exist" exception -->
<software name="2067bc" supported="partial">
<description>2067 BC</description>
<year>1992</year>
<publisher>Oregan Software</publisher>
@ -211,7 +212,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2)
</part>
</software>
<software name="aggress">
<!-- jumps to lalaland, has trainer -->
<software name="aggress" supported="no">
<description>Aggressor</description>
<year>1992</year>
<publisher>Atomic Software</publisher>
@ -222,7 +224,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2)
</part>
</software>
<software name="airsuprm">
<!-- boot OK -->
<software name="airsuprm" supported="yes">
<description>Air Supremacy</description>
<year>1991</year>
<publisher>Superior Software/Acornsoft</publisher>
@ -233,7 +236,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2)
</part>
</software>
<software name="aldebaran">
<!-- no key seems to work on title screen -->
<software name="aldebaran" supported="no">
<description>Aldebaran</description>
<year>1991</year>
<publisher>Evolution Trading</publisher>
@ -244,7 +248,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2)
</part>
</software>
<software name="alerion">
<!-- boot OK -->
<software name="alerion" supported="yes">
<description>Alerion</description>
<year>1994</year>
<publisher>Archimedes World</publisher>
@ -255,7 +260,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2)
</part>
</software>
<software name="alienatt">
<!-- boot OK, has a vertical line gap on player ship when moving left/right -->
<software name="alienatt" supported="partial">
<description>Alien Attack</description>
<year>1992</year>
<publisher>Archimedes World</publisher>
@ -521,7 +527,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2)
</part>
</software>
<software name="break147">
<!-- boot OK -->
<software name="break147" supported="yes">
<description>Break 147</description>
<year>1991</year>
<publisher>Fourth Dimension</publisher>
@ -532,7 +539,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2)
</part>
</software>
<software name="bublfair">
<!-- No key works for "insert coin" -->
<software name="bublfair" supported="no">
<description>Bubble Fair</description>
<year>1991</year>
<publisher>Eterna</publisher>
@ -631,7 +639,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2)
</part>
</software>
<software name="caverns">
<!-- Boot OK -->
<software name="caverns" supported="yes">
<description>Caverns</description>
<year>1991</year>
<publisher>Minerva</publisher>
@ -2818,7 +2827,9 @@ Zelanites: The Onslaught by Micro Power (RiscOS2)
</part>
</software>
<software name="xenon2">
<!-- Requires multi-drive floppy -->
<!-- (swap disk prompt doesn't really appear on screen but it's there) -->
<software name="xenon2" supported="partial">
<description>Xenon 2: Megablast</description>
<year>1993</year>
<publisher>Eclipse</publisher>

View File

@ -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 )

View File

@ -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<screen_device> m_screen;
required_device<palette_device> m_palette;
optional_ioport_array<2> m_joy;
required_device_array<dac_16bit_r2r_twos_complement_device, 8> m_dac;
private:

View File

@ -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)
{

View File

@ -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<cursor_h; y++)
{
for(x=0;x<32;x+=4)