mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
make it a bit more obvious cupidon.c is a video based system, not a screenless fruit machine one (nw)
This commit is contained in:
parent
c1cef2a6e9
commit
0b1d95bef8
@ -142,6 +142,8 @@ void m68340cpu_device::device_start()
|
||||
m68340SERIAL->reset();
|
||||
m68340TIMER->reset();
|
||||
|
||||
start_68340_sim();
|
||||
|
||||
m68340_base = 0x00000000;
|
||||
|
||||
internal = &this->space(AS_PROGRAM);
|
||||
|
@ -32,7 +32,9 @@ public:
|
||||
|
||||
UINT32 m68340_base;
|
||||
|
||||
|
||||
UINT16 m_avr;
|
||||
UINT16 m_picr;
|
||||
UINT16 m_pitr;
|
||||
|
||||
READ32_MEMBER( m68340_internal_base_r );
|
||||
WRITE32_MEMBER( m68340_internal_base_w );
|
||||
@ -49,7 +51,10 @@ public:
|
||||
READ32_MEMBER( m68340_internal_timer_r );
|
||||
WRITE32_MEMBER( m68340_internal_timer_w );
|
||||
|
||||
|
||||
emu_timer *m_irq_timer;
|
||||
TIMER_CALLBACK_MEMBER(periodic_interrupt_timer_callback);
|
||||
void start_68340_sim(void);
|
||||
void do_timer_irq(void);
|
||||
protected:
|
||||
|
||||
virtual void device_start();
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "68340.h"
|
||||
|
||||
|
||||
|
||||
READ16_MEMBER( m68340cpu_device::m68340_internal_sim_r )
|
||||
{
|
||||
m68340cpu_device *m68k = this;
|
||||
@ -164,6 +165,7 @@ WRITE16_MEMBER( m68340cpu_device::m68340_internal_sim_w )
|
||||
|
||||
case m68340SIM_AVR_RSR:
|
||||
logerror("%08x m68340_internal_sim_w %04x, %04x (%04x) (AVR, RSR - Auto Vector Register, Reset Status Register)\n", pc, offset*2,data,mem_mask);
|
||||
COMBINE_DATA(&m_avr);
|
||||
break;
|
||||
|
||||
case m68340SIM_SWIV_SYPCR:
|
||||
@ -172,10 +174,18 @@ WRITE16_MEMBER( m68340cpu_device::m68340_internal_sim_w )
|
||||
|
||||
case m68340SIM_PICR:
|
||||
logerror("%08x m68340_internal_sim_w %04x, %04x (%04x) (PICR - Periodic Interrupt Control Register)\n", pc, offset*2,data,mem_mask);
|
||||
COMBINE_DATA(&m_picr);
|
||||
break;
|
||||
|
||||
case m68340SIM_PITR:
|
||||
logerror("%08x m68340_internal_sim_w %04x, %04x (%04x) (PITR - Periodic Interrupt Timer Register)\n", pc, offset*2,data,mem_mask);
|
||||
COMBINE_DATA(&m_pitr);
|
||||
if (m_pitr !=0 ) // hack
|
||||
{
|
||||
//logerror("timer set\n");
|
||||
m_irq_timer->adjust(cycles_to_attotime(20000)); // hack
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case m68340SIM_SWSR:
|
||||
@ -297,6 +307,40 @@ WRITE32_MEMBER( m68340cpu_device::m68340_internal_sim_cs_w )
|
||||
|
||||
}
|
||||
|
||||
void m68340cpu_device::do_timer_irq(void)
|
||||
{
|
||||
//logerror("do_timer_irq\n");
|
||||
int timer_irq_level = (m_picr & 0x0700)>>8;
|
||||
int timer_irq_vector = (m_picr & 0x00ff)>>0;
|
||||
|
||||
if (timer_irq_level) // 0 is irq disabled
|
||||
{
|
||||
int use_autovector = (m_avr >> timer_irq_level)&1;
|
||||
|
||||
if (use_autovector)
|
||||
{
|
||||
//logerror("irq with autovector\n");
|
||||
set_input_line(timer_irq_level, HOLD_LINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
//logerror("irq without autovector\n");
|
||||
set_input_line_and_vector(timer_irq_level, HOLD_LINE, timer_irq_vector);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(m68340cpu_device::periodic_interrupt_timer_callback)
|
||||
{
|
||||
do_timer_irq();
|
||||
m_irq_timer->adjust(cycles_to_attotime(20000)); // hack
|
||||
}
|
||||
|
||||
void m68340cpu_device::start_68340_sim(void)
|
||||
{
|
||||
m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68340cpu_device::periodic_interrupt_timer_callback),this));
|
||||
}
|
||||
|
||||
void m68340_sim::reset(void)
|
||||
{
|
||||
|
@ -54,6 +54,5 @@ class m68340_sim
|
||||
UINT32 m_am[4];
|
||||
UINT32 m_ba[4];
|
||||
|
||||
|
||||
void reset(void);
|
||||
};
|
||||
|
@ -1,44 +1,99 @@
|
||||
/* Cupidon - Russian Fruit Machines? */
|
||||
/* Cupidon - Russian Video Fruit Machines? */
|
||||
|
||||
/*
|
||||
seems to be Kupidon in the ROMs?
|
||||
|
||||
these act a bit like the pluto5 ones but with a video system, possibly a variant on that?
|
||||
|
||||
needs 68340 peripherals (irq controller + timer at least) to be fleshed out.
|
||||
|
||||
video might be vga-like?
|
||||
*/
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/68340.h"
|
||||
|
||||
// looks similar to the pluto / astra stuff in terms of accesses, but these are much bigger (video based?) roms
|
||||
// needs 68340 peripherals (irq controller + timer at least) to be fleshed out.
|
||||
|
||||
|
||||
class cupidon_state : public driver_device
|
||||
{
|
||||
public:
|
||||
cupidon_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu")
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxram(*this, "gfxram")
|
||||
{ }
|
||||
|
||||
protected:
|
||||
|
||||
// devices
|
||||
required_device<m68340cpu_device> m_maincpu;
|
||||
public:
|
||||
required_shared_ptr<UINT32> m_gfxram;
|
||||
|
||||
UINT32 screen_update_cupidon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
DECLARE_DRIVER_INIT(cupidon);
|
||||
DECLARE_DRIVER_INIT(funnyfm);
|
||||
|
||||
DECLARE_READ32_MEMBER( cupidon_return_ffffffff )
|
||||
{
|
||||
return -1; // or it hits an illegal opcode (sleep on the 68340?)
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
};
|
||||
|
||||
UINT32 cupidon_state::screen_update_cupidon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
|
||||
int count = 0;
|
||||
|
||||
for (int ytile=0;ytile<16;ytile++)
|
||||
{
|
||||
|
||||
|
||||
for (int xtile=0;xtile<32;xtile++)
|
||||
{
|
||||
|
||||
for (int y=0;y<16;y++)
|
||||
{
|
||||
UINT16* destline = &bitmap.pix16(ytile*16 + y);
|
||||
|
||||
for (int x=0;x<8;x++)
|
||||
{
|
||||
UINT32 gfx = m_gfxram[count];
|
||||
|
||||
destline[(xtile*16)+(x*2)+0] = (gfx >> 16)&0xffff;
|
||||
destline[(xtile*16)+(x*2)+1] = (gfx >> 0)&0xffff;
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// could be pumped through the get_cs function (if they use the memory protection features we might have to) but that's slow...
|
||||
static ADDRESS_MAP_START( cupidon_map, AS_PROGRAM, 32, cupidon_state )
|
||||
AM_RANGE(0x0000000, 0x07fffff) AM_ROM
|
||||
AM_RANGE(0x0000000, 0x07fffff) AM_ROM AM_MIRROR(0x1000000)
|
||||
|
||||
AM_RANGE(0x1000000, 0x100ffff) AM_RAM
|
||||
AM_RANGE(0x1800000, 0x1800003) AM_READ(cupidon_return_ffffffff)
|
||||
AM_RANGE(0x2000074, 0x2000077) AM_RAM // port
|
||||
|
||||
// AM_RANGE(0x2000040, 0x200004f) AM_RAM
|
||||
|
||||
|
||||
// might just be 4mb of VRAM
|
||||
AM_RANGE(0x3000000, 0x33bffff) AM_RAM
|
||||
AM_RANGE(0x33c0000, 0x33fffff) AM_RAM AM_SHARE("gfxram") // seems to upload graphics to here, tiles etc. if you skip the loop after the romtest in funnyfm
|
||||
// AM_RANGE(0x3400000, 0x3400fff) AM_RAM
|
||||
// AM_RANGE(0x3F80000, 0x3F80003) AM_RAM
|
||||
AM_RANGE(0x3FF0400, 0x3FF0403) AM_RAM // register? gangrose likes to read this?
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static INPUT_PORTS_START( cupidon )
|
||||
@ -46,11 +101,20 @@ INPUT_PORTS_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_START( cupidon, cupidon_state )
|
||||
MCFG_CPU_ADD("maincpu", M68340, 16000000) // The access to 3FF00 at the start would suggest this is a 68340
|
||||
MCFG_CPU_ADD("maincpu", M68340, 16000000) // The access to 3FF00 at the start would suggest this is a 68340 so probably 16 or 25 mhz?
|
||||
MCFG_CPU_PROGRAM_MAP(cupidon_map)
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(64*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(cupidon_state, screen_update_cupidon)
|
||||
|
||||
MCFG_PALETTE_LENGTH(0x10000)
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
/* unknown sound */
|
||||
/* unknown sound, probably DAC driven using 68340 DMA */
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -103,13 +167,17 @@ DRIVER_INIT_MEMBER(cupidon_state,cupidon)
|
||||
{
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(cupidon_state,funnyfm)
|
||||
{
|
||||
}
|
||||
|
||||
/* (c) date is from string in ROM, revision date is noted next to sets - Spellings are as found in ROM */
|
||||
GAME( 2004, tsarevna ,0, cupidon, cupidon, cupidon_state, cupidon, ROT0, "Kupidon","Tsarevna (v1.29)", GAME_IS_SKELETON ) // 12 Oct 2005
|
||||
GAME( 2004, tsarevnaa ,tsarevna, cupidon, cupidon, cupidon_state, cupidon, ROT0, "Kupidon","Tsarevna (v1.31)", GAME_IS_SKELETON ) // 17 Jan 2007
|
||||
|
||||
GAME( 2004, gangrose ,0, cupidon, cupidon, cupidon_state, cupidon, ROT0, "Kupidon","Gangster's Roses (v4.70)", GAME_IS_SKELETON ) // 01 Sep 2004
|
||||
|
||||
GAME( 2004, funnyfm ,0, cupidon, cupidon, cupidon_state, cupidon, ROT0, "Kupidon","Funny Farm (v1.17)", GAME_IS_SKELETON ) // 02 Mar 2005
|
||||
GAME( 2004, funnyfm ,0, cupidon, cupidon, cupidon_state, funnyfm, ROT0, "Kupidon","Funny Farm (v1.17)", GAME_IS_SKELETON ) // 02 Mar 2005
|
||||
GAME( 2004, funnyfma ,funnyfm, cupidon, cupidon, cupidon_state, cupidon, ROT0, "Kupidon","Funny Farm (v1.26)", GAME_IS_SKELETON ) // 08 Aug 2005
|
||||
GAME( 2004, funnyfmb ,funnyfm, cupidon, cupidon, cupidon_state, cupidon, ROT0, "Kupidon","Funny Farm (v1.30)", GAME_IS_SKELETON ) // 16 May 2006
|
||||
|
||||
|
@ -54,6 +54,11 @@ public:
|
||||
DECLARE_READ32_MEMBER(mpu5_mem_r);
|
||||
DECLARE_WRITE32_MEMBER(mpu5_mem_w);
|
||||
|
||||
DECLARE_READ32_MEMBER(asic_r32);
|
||||
DECLARE_READ8_MEMBER(asic_r8);
|
||||
DECLARE_WRITE32_MEMBER(asic_w32);
|
||||
DECLARE_WRITE8_MEMBER(asic_w8);
|
||||
|
||||
protected:
|
||||
|
||||
// devices
|
||||
@ -61,14 +66,44 @@ protected:
|
||||
virtual void machine_start();
|
||||
};
|
||||
|
||||
READ8_MEMBER(mpu5_state::asic_r8)
|
||||
{
|
||||
int pc = space.device().safe_pc();
|
||||
logerror("%08x maincpu read from ASIC - offset %01x\n", pc, offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
READ32_MEMBER(mpu5_state::asic_r32)
|
||||
{
|
||||
UINT32 retdata = 0;
|
||||
if (mem_mask&0xff000000) retdata |= asic_r8(space,(offset*4)+0) <<24;
|
||||
if (mem_mask&0x00ff0000) retdata |= asic_r8(space,(offset*4)+1) <<16;
|
||||
if (mem_mask&0x0000ff00) retdata |= asic_r8(space,(offset*4)+2) <<8;
|
||||
if (mem_mask&0x000000ff) retdata |= asic_r8(space,(offset*4)+3) <<0;
|
||||
return retdata;
|
||||
}
|
||||
|
||||
READ32_MEMBER(mpu5_state::mpu5_mem_r)
|
||||
{
|
||||
int pc = space.device().safe_pc();
|
||||
int cs = m68340_get_cs(m_maincpu, offset * 4);
|
||||
int addr = offset *4;
|
||||
int cs = m68340_get_cs(m_maincpu, addr);
|
||||
|
||||
switch ( cs )
|
||||
{
|
||||
|
||||
case 2:
|
||||
if ((addr & 0xf0) == 0xf0)
|
||||
{
|
||||
return asic_r32(space, offset&3,mem_mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
offset &=0x3fff;
|
||||
return (m_mainram[offset]);
|
||||
@ -85,13 +120,43 @@ READ32_MEMBER(mpu5_state::mpu5_mem_r)
|
||||
return 0x0000;
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(mpu5_state::asic_w8)
|
||||
{
|
||||
int pc = space.device().safe_pc();
|
||||
logerror("%08x maincpu write to ASIC - offset %01x data %02x\n", pc, offset, data);
|
||||
}
|
||||
|
||||
|
||||
WRITE32_MEMBER(mpu5_state::asic_w32)
|
||||
{
|
||||
if (mem_mask&0xff000000) asic_w8(space,(offset*4)+0, (data>>24)&0xff);
|
||||
if (mem_mask&0x00ff0000) asic_w8(space,(offset*4)+1, (data>>16)&0xff);
|
||||
if (mem_mask&0x0000ff00) asic_w8(space,(offset*4)+2, (data>>8) &0xff);
|
||||
if (mem_mask&0x000000ff) asic_w8(space,(offset*4)+3, (data>>0) &0xff);
|
||||
}
|
||||
|
||||
WRITE32_MEMBER(mpu5_state::mpu5_mem_w)
|
||||
{
|
||||
int pc = space.device().safe_pc();
|
||||
int cs = m68340_get_cs(m_maincpu, offset * 4);
|
||||
int addr = offset *4;
|
||||
int cs = m68340_get_cs(m_maincpu, addr);
|
||||
|
||||
switch ( cs )
|
||||
{
|
||||
|
||||
case 2:
|
||||
if ((addr & 0xf0) == 0xf0)
|
||||
{
|
||||
asic_w32(space, offset&3,data,mem_mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror("%08x maincpu write access offset %08x data %08x mem_mask %08x cs %d\n", pc, offset*4, data, mem_mask, cs);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 4:
|
||||
offset &=0x3fff;
|
||||
COMBINE_DATA(&m_mainram[offset]);
|
||||
|
Loading…
Reference in New Issue
Block a user