Previous 199869 Revisions Next

r19863 Thursday 27th December, 2012 at 17:03:03 UTC by David Haywood
more (nw)
[src/mame]mame.mak
[src/mame/drivers]progolf.c
[src/mame/machine]decocpu6.c* decocpu6.h*

trunk/src/mame/machine/decocpu6.c
r0r19863
1/* apparently Deco CPU-6 used by ProGolf
2 just seems to be a bitswap on the opcodes like 222, but not the same one
3 not a complex scheme like CPU-7?
4*/
5
6
7#include "decocpu6.h"
8
9deco_cpu6_device::deco_cpu6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
10   m6502_device(mconfig, DECO_CPU6, "DECO CPU-6", tag, owner, clock)
11{
12}
13
14void deco_cpu6_device::device_start()
15{
16   mintf = new mi_decrypt;
17   init();
18}
19
20void deco_cpu6_device::device_reset()
21{
22   m6502_device::device_reset();
23}
24
25UINT8 deco_cpu6_device::mi_decrypt::read_decrypted(UINT16 adr)
26{
27   if (adr&1)
28      return BITSWAP8(direct->read_raw_byte(adr),6,4,7,5,3,2,1,0);
29   else
30      return direct->read_raw_byte(adr);
31}
32
trunk/src/mame/machine/decocpu6.h
r0r19863
1
2
3#include "emu.h"
4#include "cpu/m6502/m6502.h"
5
6class deco_cpu6_device : public m6502_device {
7public:
8   deco_cpu6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
9
10protected:
11   class mi_decrypt : public mi_default_normal {
12   public:
13      virtual ~mi_decrypt() {}
14      virtual UINT8 read_decrypted(UINT16 adr);
15   };
16
17   virtual void device_start();
18   virtual void device_reset();
19
20};
21
22static const device_type DECO_CPU6 = &device_creator<deco_cpu6_device>;
23
24
trunk/src/mame/mame.mak
r19862r19863
630630   $(DRIVERS)/dec8.o $(VIDEO)/dec8.o \
631631   $(MACHINE)/deco222.o \
632632   $(MACHINE)/decocpu7.o \
633   $(MACHINE)/decocpu6.o \
633634   $(DRIVERS)/deco_ld.o \
634635   $(DRIVERS)/deco_mlc.o $(VIDEO)/deco_mlc.o \
635636   $(DRIVERS)/deco156.o $(MACHINE)/deco156.o \
trunk/src/mame/drivers/progolf.c
r19862r19863
5555#include "sound/ay8910.h"
5656#include "video/mc6845.h"
5757#include "machine/deco222.h"
58#include "machine/decocpu6.h"
5859
5960class progolf_state : public driver_device
6061{
r19862r19863
8283   DECLARE_READ8_MEMBER(progolf_videoram_r);
8384   DECLARE_WRITE8_MEMBER(progolf_videoram_w);
8485   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
85   DECLARE_DRIVER_INIT(progolfa);
86   DECLARE_DRIVER_INIT(progolf);
8786   virtual void video_start();
8887   virtual void palette_init();
8988   UINT32 screen_update_progolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
r19862r19863
456455
457456static MACHINE_CONFIG_DERIVED( progolfa, progolf )
458457   MCFG_DEVICE_REMOVE("maincpu") /* different encrypted cpu to progolf */
459   MCFG_CPU_ADD("maincpu", M6502, 3000000/2) /* guess, 3 Mhz makes the game to behave worse? */
458   MCFG_CPU_ADD("maincpu", DECO_CPU6, 3000000/2) /* guess, 3 Mhz makes the game to behave worse? */
460459   MCFG_CPU_PROGRAM_MAP(main_cpu)
461460   MCFG_CPU_VBLANK_INT_DRIVER("screen", progolf_state,  progolf_interrupt)
462461MACHINE_CONFIG_END
r19862r19863
508507
509508
510509
511DRIVER_INIT_MEMBER(progolf_state,progolfa)
512{
513   int A;
514   address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
515   UINT8 *rom = machine().root_device().memregion("maincpu")->base();
516   UINT8* decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
517510
518   space.set_decrypted_region(0x0000,0xffff, decrypted);
519511
520   /* data is likely to not be encrypted, just the opcodes are. */
521   for (A = 0x0000 ; A < 0x10000 ; A++)
522   {
523      if (A & 1)
524         decrypted[A] = BITSWAP8(rom[A],6,4,7,5,3,2,1,0);
525      else
526         decrypted[A] = rom[A];
527   }
528}
529
530512// this uses DECO222 style encryption
531513GAME( 1981, progolf,  0,       progolf, progolf, driver_device, 0,       ROT270, "Data East Corporation", "18 Holes Pro Golf (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
532// this uses DECO CPU-6 as custom module CPU (the same as Zoar, are we sure? our Zoar has different encryption, CPU-6 style)
533GAME( 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 )
514// this uses DECO CPU-6 as custom module CPU (the same as Zoar, are we sure? our Zoar has different encryption, CPU-7 style)
515GAME( 1981, progolfa, progolf, progolfa,progolf, driver_device, 0,       ROT270, "Data East Corporation", "18 Holes Pro Golf (set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team