trunk/src/mame/machine/decocpu6.c
| r0 | r19863 | |
| 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 | |
| 9 | deco_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 | |
| 14 | void deco_cpu6_device::device_start() |
| 15 | { |
| 16 | mintf = new mi_decrypt; |
| 17 | init(); |
| 18 | } |
| 19 | |
| 20 | void deco_cpu6_device::device_reset() |
| 21 | { |
| 22 | m6502_device::device_reset(); |
| 23 | } |
| 24 | |
| 25 | UINT8 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/drivers/progolf.c
| r19862 | r19863 | |
| 55 | 55 | #include "sound/ay8910.h" |
| 56 | 56 | #include "video/mc6845.h" |
| 57 | 57 | #include "machine/deco222.h" |
| 58 | #include "machine/decocpu6.h" |
| 58 | 59 | |
| 59 | 60 | class progolf_state : public driver_device |
| 60 | 61 | { |
| r19862 | r19863 | |
| 82 | 83 | DECLARE_READ8_MEMBER(progolf_videoram_r); |
| 83 | 84 | DECLARE_WRITE8_MEMBER(progolf_videoram_w); |
| 84 | 85 | DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); |
| 85 | | DECLARE_DRIVER_INIT(progolfa); |
| 86 | | DECLARE_DRIVER_INIT(progolf); |
| 87 | 86 | virtual void video_start(); |
| 88 | 87 | virtual void palette_init(); |
| 89 | 88 | UINT32 screen_update_progolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| r19862 | r19863 | |
| 456 | 455 | |
| 457 | 456 | static MACHINE_CONFIG_DERIVED( progolfa, progolf ) |
| 458 | 457 | 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? */ |
| 460 | 459 | MCFG_CPU_PROGRAM_MAP(main_cpu) |
| 461 | 460 | MCFG_CPU_VBLANK_INT_DRIVER("screen", progolf_state, progolf_interrupt) |
| 462 | 461 | MACHINE_CONFIG_END |
| r19862 | r19863 | |
| 508 | 507 | |
| 509 | 508 | |
| 510 | 509 | |
| 511 | | DRIVER_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); |
| 517 | 510 | |
| 518 | | space.set_decrypted_region(0x0000,0xffff, decrypted); |
| 519 | 511 | |
| 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 | | |
| 530 | 512 | // this uses DECO222 style encryption |
| 531 | 513 | 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 ) |
| 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) |
| 533 | | 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 ) |
| 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) |
| 515 | GAME( 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 ) |