mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
more of the same (nw)
This commit is contained in:
parent
cfab26ad9c
commit
3a5e495ede
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -4687,6 +4687,8 @@ src/mame/machine/deco222.h svneol=native#text/plain
|
||||
src/mame/machine/decocass.c svneol=native#text/plain
|
||||
src/mame/machine/decocass_tape.c svneol=native#text/plain
|
||||
src/mame/machine/decocass_tape.h svneol=native#text/plain
|
||||
src/mame/machine/decocpu7.c svneol=native#text/plain
|
||||
src/mame/machine/decocpu7.h svneol=native#text/plain
|
||||
src/mame/machine/decocrpt.c svneol=native#text/plain
|
||||
src/mame/machine/decoprot.c svneol=native#text/plain
|
||||
src/mame/machine/docastle.c svneol=native#text/plain
|
||||
|
@ -142,6 +142,8 @@ A few notes:
|
||||
#include "sound/ay8910.h"
|
||||
#include "sound/discrete.h"
|
||||
#include "includes/btime.h"
|
||||
#include "machine/decocpu7.h"
|
||||
#include "machine/deco222.h"
|
||||
|
||||
#define MASTER_CLOCK XTAL_12MHz
|
||||
#define HCLK (MASTER_CLOCK/2)
|
||||
@ -156,103 +158,6 @@ enum
|
||||
AUDIO_ENABLE_AY8910 /* via ay-8910 port A */
|
||||
};
|
||||
|
||||
class deco_cpu7_device : public m6502_device {
|
||||
public:
|
||||
deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
protected:
|
||||
class mi_decrypt : public mi_default_normal {
|
||||
public:
|
||||
bool had_written;
|
||||
|
||||
virtual ~mi_decrypt() {}
|
||||
virtual UINT8 read_decrypted(UINT16 adr);
|
||||
virtual void write(UINT16 adr, UINT8 val);
|
||||
};
|
||||
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
};
|
||||
|
||||
static const device_type DECO_CPU7 = &device_creator<deco_cpu7_device>;
|
||||
|
||||
deco_cpu7_device::deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
m6502_device(mconfig, DECO_CPU7, "DECO CPU-7", tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
void deco_cpu7_device::device_start()
|
||||
{
|
||||
mintf = new mi_decrypt;
|
||||
init();
|
||||
}
|
||||
|
||||
void deco_cpu7_device::device_reset()
|
||||
{
|
||||
m6502_device::device_reset();
|
||||
static_cast<mi_decrypt *>(mintf)->had_written = false;
|
||||
}
|
||||
|
||||
UINT8 deco_cpu7_device::mi_decrypt::read_decrypted(UINT16 adr)
|
||||
{
|
||||
UINT8 res = direct->read_raw_byte(adr);
|
||||
if(had_written) {
|
||||
had_written = false;
|
||||
if((adr & 0x0104) == 0x0104)
|
||||
res = BITSWAP8(res, 6,5,3,4,2,7,1,0);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
void deco_cpu7_device::mi_decrypt::write(UINT16 adr, UINT8 val)
|
||||
{
|
||||
program->write_byte(adr, val);
|
||||
had_written = true;
|
||||
}
|
||||
|
||||
|
||||
class deco_c10707_device : public m6502_device {
|
||||
public:
|
||||
deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
protected:
|
||||
class mi_decrypt : public mi_default_normal {
|
||||
public:
|
||||
bool had_written;
|
||||
|
||||
virtual ~mi_decrypt() {}
|
||||
virtual UINT8 read_decrypted(UINT16 adr);
|
||||
};
|
||||
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
};
|
||||
|
||||
static const device_type DECO_C10707 = &device_creator<deco_c10707_device>;
|
||||
|
||||
deco_c10707_device::deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
m6502_device(mconfig, DECO_C10707, "DECO C10707", tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
void deco_c10707_device::device_start()
|
||||
{
|
||||
mintf = new mi_decrypt;
|
||||
init();
|
||||
}
|
||||
|
||||
void deco_c10707_device::device_reset()
|
||||
{
|
||||
m6502_device::device_reset();
|
||||
static_cast<mi_decrypt *>(mintf)->had_written = false;
|
||||
}
|
||||
|
||||
UINT8 deco_c10707_device::mi_decrypt::read_decrypted(UINT16 adr)
|
||||
{
|
||||
return BITSWAP8(direct->read_raw_byte(adr) ,7,5,6,4,3,2,1,0);;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(btime_state::audio_nmi_enable_w)
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ Twenty four 8116 rams.
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "video/mc6845.h"
|
||||
|
||||
#include "machine/deco222.h"
|
||||
|
||||
class progolf_state : public driver_device
|
||||
{
|
||||
@ -422,7 +422,7 @@ void progolf_state::palette_init()
|
||||
|
||||
static MACHINE_CONFIG_START( progolf, progolf_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M6502, 3000000/2) /* guess, 3 Mhz makes the game to behave worse? */
|
||||
MCFG_CPU_ADD("maincpu", DECO_222, 3000000/2) /* guess, 3 Mhz makes the game to behave worse? */
|
||||
MCFG_CPU_PROGRAM_MAP(main_cpu)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", progolf_state, progolf_interrupt)
|
||||
|
||||
@ -454,6 +454,13 @@ static MACHINE_CONFIG_START( progolf, progolf_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( progolfa, progolf )
|
||||
MCFG_DEVICE_REMOVE("maincpu") /* different encrypted cpu to progolf */
|
||||
MCFG_CPU_ADD("maincpu", M6502, 3000000/2) /* guess, 3 Mhz makes the game to behave worse? */
|
||||
MCFG_CPU_PROGRAM_MAP(main_cpu)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", progolf_state, progolf_interrupt)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
ROM_START( progolf )
|
||||
ROM_REGION( 0x10000, "maincpu", 0 )
|
||||
@ -500,19 +507,6 @@ ROM_START( progolfa )
|
||||
ROM_END
|
||||
|
||||
|
||||
DRIVER_INIT_MEMBER(progolf_state,progolf)
|
||||
{
|
||||
int A;
|
||||
address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
|
||||
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
|
||||
UINT8* decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
|
||||
|
||||
space.set_decrypted_region(0x0000,0xffff, decrypted);
|
||||
|
||||
/* Swap bits 5 & 6 for opcodes */
|
||||
for (A = 0xb000 ; A < 0x10000 ; A++)
|
||||
decrypted[A] = BITSWAP8(rom[A],7,5,6,4,3,2,1,0);
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(progolf_state,progolfa)
|
||||
{
|
||||
@ -533,6 +527,7 @@ DRIVER_INIT_MEMBER(progolf_state,progolfa)
|
||||
}
|
||||
}
|
||||
|
||||
/* Maybe progolf is a bootleg? progolfa uses DECO CPU-6 as custom module CPU (the same as Zoar) */
|
||||
GAME( 1981, progolf, 0, progolf, progolf, progolf_state, progolf, ROT270, "Data East Corporation", "18 Holes Pro Golf (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
|
||||
GAME( 1981, progolfa, progolf, progolf, progolf, progolf_state, progolfa, ROT270, "Data East Corporation", "18 Holes Pro Golf (set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
|
||||
// this uses DECO222 style encryption
|
||||
GAME( 1981, progolf, 0, progolf, progolf, driver_device, 0, ROT270, "Data East Corporation", "18 Holes Pro Golf (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
|
||||
// this uses DECO CPU-6 as custom module CPU (the same as Zoar, are we sure? our Zoar has different encryption, CPU-6 style)
|
||||
GAME( 1981, progolfa, progolf, progolfa,progolf, progolf_state, progolfa, ROT270, "Data East Corporation", "18 Holes Pro Golf (set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
|
||||
|
@ -1,4 +1,8 @@
|
||||
|
||||
/* Data East encrypted CPU 222, aka C10707?
|
||||
also sometimes implemented as basic logic outside the CPU on early revs and bootlegs */
|
||||
|
||||
|
||||
#include "deco222.h"
|
||||
|
||||
|
||||
@ -25,3 +29,25 @@ UINT8 deco_222_device::mi_decrypt::read_decrypted(UINT16 adr)
|
||||
}
|
||||
|
||||
|
||||
|
||||
deco_c10707_device::deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
m6502_device(mconfig, DECO_C10707, "DECO C10707", tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
void deco_c10707_device::device_start()
|
||||
{
|
||||
mintf = new mi_decrypt;
|
||||
init();
|
||||
}
|
||||
|
||||
void deco_c10707_device::device_reset()
|
||||
{
|
||||
m6502_device::device_reset();
|
||||
static_cast<mi_decrypt *>(mintf)->had_written = false;
|
||||
}
|
||||
|
||||
UINT8 deco_c10707_device::mi_decrypt::read_decrypted(UINT16 adr)
|
||||
{
|
||||
return BITSWAP8(direct->read_raw_byte(adr) ,7,5,6,4,3,2,1,0);
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/hd6309/hd6309.h"
|
||||
#include "cpu/m6809/m6809.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
|
||||
class deco_222_device : public m6502_device {
|
||||
@ -22,4 +20,27 @@ protected:
|
||||
|
||||
};
|
||||
|
||||
static const device_type DECO_222 = &device_creator<deco_222_device>;
|
||||
static const device_type DECO_222 = &device_creator<deco_222_device>;
|
||||
|
||||
|
||||
|
||||
class deco_c10707_device : public m6502_device {
|
||||
public:
|
||||
deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
protected:
|
||||
class mi_decrypt : public mi_default_normal {
|
||||
public:
|
||||
bool had_written;
|
||||
|
||||
virtual ~mi_decrypt() {}
|
||||
virtual UINT8 read_decrypted(UINT16 adr);
|
||||
};
|
||||
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
};
|
||||
|
||||
static const device_type DECO_C10707 = &device_creator<deco_c10707_device>;
|
||||
|
||||
|
36
src/mame/machine/decocpu7.c
Normal file
36
src/mame/machine/decocpu7.c
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
#include "decocpu7.h"
|
||||
|
||||
deco_cpu7_device::deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
m6502_device(mconfig, DECO_CPU7, "DECO CPU-7", tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
void deco_cpu7_device::device_start()
|
||||
{
|
||||
mintf = new mi_decrypt;
|
||||
init();
|
||||
}
|
||||
|
||||
void deco_cpu7_device::device_reset()
|
||||
{
|
||||
m6502_device::device_reset();
|
||||
static_cast<mi_decrypt *>(mintf)->had_written = false;
|
||||
}
|
||||
|
||||
UINT8 deco_cpu7_device::mi_decrypt::read_decrypted(UINT16 adr)
|
||||
{
|
||||
UINT8 res = direct->read_raw_byte(adr);
|
||||
if(had_written) {
|
||||
had_written = false;
|
||||
if((adr & 0x0104) == 0x0104)
|
||||
res = BITSWAP8(res, 6,5,3,4,2,7,1,0);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
void deco_cpu7_device::mi_decrypt::write(UINT16 adr, UINT8 val)
|
||||
{
|
||||
program->write_byte(adr, val);
|
||||
had_written = true;
|
||||
}
|
25
src/mame/machine/decocpu7.h
Normal file
25
src/mame/machine/decocpu7.h
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
|
||||
class deco_cpu7_device : public m6502_device {
|
||||
public:
|
||||
deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
protected:
|
||||
class mi_decrypt : public mi_default_normal {
|
||||
public:
|
||||
bool had_written;
|
||||
|
||||
virtual ~mi_decrypt() {}
|
||||
virtual UINT8 read_decrypted(UINT16 adr);
|
||||
virtual void write(UINT16 adr, UINT8 val);
|
||||
};
|
||||
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
};
|
||||
|
||||
static const device_type DECO_CPU7 = &device_creator<deco_cpu7_device>;
|
||||
|
@ -629,6 +629,7 @@ $(MAMEOBJ)/dataeast.a: \
|
||||
$(DRIVERS)/dec0.o $(MACHINE)/dec0.o $(VIDEO)/dec0.o \
|
||||
$(DRIVERS)/dec8.o $(VIDEO)/dec8.o \
|
||||
$(MACHINE)/deco222.o \
|
||||
$(MACHINE)/decocpu7.o \
|
||||
$(DRIVERS)/deco_ld.o \
|
||||
$(DRIVERS)/deco_mlc.o $(VIDEO)/deco_mlc.o \
|
||||
$(DRIVERS)/deco156.o $(MACHINE)/deco156.o \
|
||||
|
Loading…
Reference in New Issue
Block a user