Previous 199869 Revisions Next

r19862 Thursday 27th December, 2012 at 16:41:57 UTC by David Haywood
more of the same (nw)
[src/mame]mame.mak
[src/mame/drivers]btime.c progolf.c
[src/mame/machine]deco222.c deco222.h decocpu7.c* decocpu7.h*

trunk/src/mame/drivers/btime.c
r19861r19862
142142#include "sound/ay8910.h"
143143#include "sound/discrete.h"
144144#include "includes/btime.h"
145#include "machine/decocpu7.h"
146#include "machine/deco222.h"
145147
146148#define MASTER_CLOCK      XTAL_12MHz
147149#define HCLK             (MASTER_CLOCK/2)
r19861r19862
156158   AUDIO_ENABLE_AY8910         /* via ay-8910 port A */
157159};
158160
159class deco_cpu7_device : public m6502_device {
160public:
161   deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
162161
163protected:
164   class mi_decrypt : public mi_default_normal {
165   public:
166      bool had_written;
167
168      virtual ~mi_decrypt() {}
169      virtual UINT8 read_decrypted(UINT16 adr);
170      virtual void write(UINT16 adr, UINT8 val);
171   };
172
173   virtual void device_start();
174   virtual void device_reset();
175
176};
177
178static const device_type DECO_CPU7 = &device_creator<deco_cpu7_device>;
179
180deco_cpu7_device::deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
181   m6502_device(mconfig, DECO_CPU7, "DECO CPU-7", tag, owner, clock)
182{
183}
184
185void deco_cpu7_device::device_start()
186{
187   mintf = new mi_decrypt;
188   init();
189}
190
191void deco_cpu7_device::device_reset()
192{
193   m6502_device::device_reset();
194   static_cast<mi_decrypt *>(mintf)->had_written = false;
195}
196
197UINT8 deco_cpu7_device::mi_decrypt::read_decrypted(UINT16 adr)
198{
199   UINT8 res = direct->read_raw_byte(adr);
200   if(had_written) {
201      had_written = false;
202      if((adr & 0x0104) == 0x0104)
203         res = BITSWAP8(res, 6,5,3,4,2,7,1,0);
204   }
205   return res;
206}
207
208void deco_cpu7_device::mi_decrypt::write(UINT16 adr, UINT8 val)
209{
210   program->write_byte(adr, val);
211   had_written = true;
212}
213
214
215class deco_c10707_device : public m6502_device {
216public:
217   deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
218
219protected:
220   class mi_decrypt : public mi_default_normal {
221   public:
222      bool had_written;
223
224      virtual ~mi_decrypt() {}
225      virtual UINT8 read_decrypted(UINT16 adr);
226   };
227
228   virtual void device_start();
229   virtual void device_reset();
230
231};
232
233static const device_type DECO_C10707 = &device_creator<deco_c10707_device>;
234
235deco_c10707_device::deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
236   m6502_device(mconfig, DECO_C10707, "DECO C10707", tag, owner, clock)
237{
238}
239
240void deco_c10707_device::device_start()
241{
242   mintf = new mi_decrypt;
243   init();
244}
245
246void deco_c10707_device::device_reset()
247{
248   m6502_device::device_reset();
249   static_cast<mi_decrypt *>(mintf)->had_written = false;
250}
251
252UINT8 deco_c10707_device::mi_decrypt::read_decrypted(UINT16 adr)
253{
254   return BITSWAP8(direct->read_raw_byte(adr) ,7,5,6,4,3,2,1,0);;
255}
256
257162WRITE8_MEMBER(btime_state::audio_nmi_enable_w)
258163{
259164   /* for most games, this serves as the NMI enable for the audio CPU; however,
trunk/src/mame/drivers/progolf.c
r19861r19862
5454#include "cpu/m6502/m6502.h"
5555#include "sound/ay8910.h"
5656#include "video/mc6845.h"
57#include "machine/deco222.h"
5758
58
5959class progolf_state : public driver_device
6060{
6161public:
r19861r19862
422422
423423static MACHINE_CONFIG_START( progolf, progolf_state )
424424   /* basic machine hardware */
425   MCFG_CPU_ADD("maincpu", M6502, 3000000/2) /* guess, 3 Mhz makes the game to behave worse? */
425   MCFG_CPU_ADD("maincpu", DECO_222, 3000000/2) /* guess, 3 Mhz makes the game to behave worse? */
426426   MCFG_CPU_PROGRAM_MAP(main_cpu)
427427   MCFG_CPU_VBLANK_INT_DRIVER("screen", progolf_state,  progolf_interrupt)
428428
r19861r19862
454454   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
455455MACHINE_CONFIG_END
456456
457static MACHINE_CONFIG_DERIVED( progolfa, progolf )
458   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? */
460   MCFG_CPU_PROGRAM_MAP(main_cpu)
461   MCFG_CPU_VBLANK_INT_DRIVER("screen", progolf_state,  progolf_interrupt)
462MACHINE_CONFIG_END
457463
464
458465ROM_START( progolf )
459466   ROM_REGION( 0x10000, "maincpu", 0 )
460467   ROM_LOAD( "g4-m.2a",      0xb000, 0x1000, CRC(8f06ebc0) SHA1(c012dcaf06cbd9e49f3ae819d9cbed4df8751cec) )
r19861r19862
500507ROM_END
501508
502509
503DRIVER_INIT_MEMBER(progolf_state,progolf)
504{
505   int A;
506   address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
507   UINT8 *rom = machine().root_device().memregion("maincpu")->base();
508   UINT8* decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
509510
510   space.set_decrypted_region(0x0000,0xffff, decrypted);
511
512   /* Swap bits 5 & 6 for opcodes */
513   for (A = 0xb000 ; A < 0x10000 ; A++)
514      decrypted[A] = BITSWAP8(rom[A],7,5,6,4,3,2,1,0);
515}
516
517511DRIVER_INIT_MEMBER(progolf_state,progolfa)
518512{
519513   int A;
r19861r19862
533527   }
534528}
535529
536/* Maybe progolf is a bootleg? progolfa uses DECO CPU-6 as custom module CPU (the same as Zoar) */
537GAME( 1981, progolf,  0,       progolf, progolf, progolf_state, progolf,  ROT270, "Data East Corporation", "18 Holes Pro Golf (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
538GAME( 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 )
530// this uses DECO222 style encryption
531GAME( 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 )
trunk/src/mame/machine/decocpu7.c
r0r19862
1
2#include "decocpu7.h"
3
4deco_cpu7_device::deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
5   m6502_device(mconfig, DECO_CPU7, "DECO CPU-7", tag, owner, clock)
6{
7}
8
9void deco_cpu7_device::device_start()
10{
11   mintf = new mi_decrypt;
12   init();
13}
14
15void deco_cpu7_device::device_reset()
16{
17   m6502_device::device_reset();
18   static_cast<mi_decrypt *>(mintf)->had_written = false;
19}
20
21UINT8 deco_cpu7_device::mi_decrypt::read_decrypted(UINT16 adr)
22{
23   UINT8 res = direct->read_raw_byte(adr);
24   if(had_written) {
25      had_written = false;
26      if((adr & 0x0104) == 0x0104)
27         res = BITSWAP8(res, 6,5,3,4,2,7,1,0);
28   }
29   return res;
30}
31
32void deco_cpu7_device::mi_decrypt::write(UINT16 adr, UINT8 val)
33{
34   program->write_byte(adr, val);
35   had_written = true;
36}
trunk/src/mame/machine/decocpu7.h
r0r19862
1
2#include "emu.h"
3#include "cpu/m6502/m6502.h"
4
5class deco_cpu7_device : public m6502_device {
6public:
7   deco_cpu7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8
9protected:
10   class mi_decrypt : public mi_default_normal {
11   public:
12      bool had_written;
13
14      virtual ~mi_decrypt() {}
15      virtual UINT8 read_decrypted(UINT16 adr);
16      virtual void write(UINT16 adr, UINT8 val);
17   };
18
19   virtual void device_start();
20   virtual void device_reset();
21
22};
23
24static const device_type DECO_CPU7 = &device_creator<deco_cpu7_device>;
25
trunk/src/mame/machine/deco222.c
r19861r19862
11
2/* Data East encrypted CPU 222, aka C10707?
3 also sometimes implemented as basic logic outside the CPU on early revs and bootlegs */
4
5
26#include "deco222.h"
37
48
r19861r19862
2529}
2630
2731
32
33deco_c10707_device::deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
34   m6502_device(mconfig, DECO_C10707, "DECO C10707", tag, owner, clock)
35{
36}
37
38void deco_c10707_device::device_start()
39{
40   mintf = new mi_decrypt;
41   init();
42}
43
44void deco_c10707_device::device_reset()
45{
46   m6502_device::device_reset();
47   static_cast<mi_decrypt *>(mintf)->had_written = false;
48}
49
50UINT8 deco_c10707_device::mi_decrypt::read_decrypted(UINT16 adr)
51{
52   return BITSWAP8(direct->read_raw_byte(adr) ,7,5,6,4,3,2,1,0);
53}
trunk/src/mame/machine/deco222.h
r19861r19862
11
22#include "emu.h"
3#include "cpu/hd6309/hd6309.h"
4#include "cpu/m6809/m6809.h"
53#include "cpu/m6502/m6502.h"
64
75class deco_222_device : public m6502_device {
r19861r19862
2220
2321};
2422
25static const device_type DECO_222 = &device_creator<deco_222_device>;
No newline at end of file
23static const device_type DECO_222 = &device_creator<deco_222_device>;
24
25
26
27class deco_c10707_device : public m6502_device {
28public:
29   deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
30
31protected:
32   class mi_decrypt : public mi_default_normal {
33   public:
34      bool had_written;
35
36      virtual ~mi_decrypt() {}
37      virtual UINT8 read_decrypted(UINT16 adr);
38   };
39
40   virtual void device_start();
41   virtual void device_reset();
42
43};
44
45static const device_type DECO_C10707 = &device_creator<deco_c10707_device>;
46
trunk/src/mame/mame.mak
r19861r19862
629629   $(DRIVERS)/dec0.o $(MACHINE)/dec0.o $(VIDEO)/dec0.o \
630630   $(DRIVERS)/dec8.o $(VIDEO)/dec8.o \
631631   $(MACHINE)/deco222.o \
632   $(MACHINE)/decocpu7.o \
632633   $(DRIVERS)/deco_ld.o \
633634   $(DRIVERS)/deco_mlc.o $(VIDEO)/deco_mlc.o \
634635   $(DRIVERS)/deco156.o $(MACHINE)/deco156.o \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team