Previous 199869 Revisions Next

r34583 Friday 23rd January, 2015 at 18:54:59 UTC by Couriersud
Merge branch 'master' of https://github.com/mamedev/mame.git
[src/mame]mame.lst
[src/mame/drivers]ddenlovr.c dkong.c dynax.c model3.c st_mp200.c stv.c
[src/mame/includes]dynax.h model3.h stv.h
[src/mame/machine]315-5881_crypt.c 315-5881_crypt.h 315-5881_helper.c stvprot.c
[src/mame/video]taitoair.c

trunk/src/mame/drivers/ddenlovr.c
r243094r243095
110110#include "cpu/m68000/m68000.h"
111111#include "cpu/z80/z80.h"
112112#include "sound/ay8910.h"
113#include "sound/okim6295.h"
114#include "sound/2413intf.h"
115113#include "machine/msm6242.h"
116114#include "machine/nvram.h"
117115#include "includes/dynax.h"
r243094r243095
153151{
154152public:
155153   ddenlovr_state(const machine_config &mconfig, device_type type, const char *tag)
156      : dynax_state(mconfig, type, tag)
157      { }
154      : dynax_state(mconfig, type, tag),
155      m_dsw_sel16(*this, "dsw_sel16"),
156      m_protection1(*this, "protection1"),
157      m_protection2(*this, "protection2")   { }
158     
158159
160   optional_shared_ptr<UINT16> m_dsw_sel16;
161   optional_shared_ptr<UINT16> m_protection1;
162   optional_shared_ptr<UINT16> m_protection2;
163
164
165   UINT8 *  m_ddenlovr_pixmap[8];
166
167   /* blitter (TODO: merge with the dynax.h, where possible) */
168   int m_extra_layers;
169   int m_ddenlovr_dest_layer;
170   int m_ddenlovr_blit_flip;
171   int m_ddenlovr_blit_x;
172   int m_ddenlovr_blit_y;
173   int m_ddenlovr_blit_address;
174   int m_ddenlovr_blit_pen;
175   int m_ddenlovr_blit_pen_mode;
176   int m_ddenlovr_blitter_irq_flag;
177   int m_ddenlovr_blitter_irq_enable;
178   int m_ddenlovr_rect_width;
179   int m_ddenlovr_rect_height;
180   int m_ddenlovr_clip_width;
181   int m_ddenlovr_clip_height;
182   int m_ddenlovr_line_length;
183   int m_ddenlovr_clip_ctrl;
184   int m_ddenlovr_clip_x;
185   int m_ddenlovr_clip_y;
186   int m_ddenlovr_scroll[8*2];
187   int m_ddenlovr_priority;
188   int m_ddenlovr_priority2;
189   int m_ddenlovr_bgcolor;
190   int m_ddenlovr_bgcolor2;
191   int m_ddenlovr_layer_enable;
192   int m_ddenlovr_layer_enable2;
193   int m_ddenlovr_palette_base[8];
194   int m_ddenlovr_palette_mask[8];
195   int m_ddenlovr_transparency_pen[8];
196   int m_ddenlovr_transparency_mask[8];
197   int m_ddenlovr_blit_latch;
198   int m_ddenlovr_blit_pen_mask;   // not implemented
199   int m_ddenlovr_blit_rom_bits;           // usually 8, 16 in hanakanz
200   const int *m_ddenlovr_blit_commands;
201   int m_ddenlovr_blit_regs[2];
202
203   /* ddenlovr misc (TODO: merge with dynax.h, where possible) */
204   UINT8 m_palram[0x200];
205   int m_okibank;
206   UINT8 m_rongrong_blitter_busy_select;
207   UINT8 m_prot_val;
208   UINT16 m_prot_16;
209   UINT16 m_quiz365_protection[2];
210
211   UINT16 m_mmpanic_leds;  /* A led for each of the 9 buttons */
212   UINT8 m_funkyfig_lockout;
213   UINT8 m_romdata[2];
214   int m_palette_index;
215   UINT8 m_hginga_rombank;
216   UINT8 m_mjflove_irq_cause;
217   UINT8 m_daimyojn_palette_sel;
218
159219   DECLARE_MACHINE_START(ddenlovr);
160220   DECLARE_MACHINE_RESET(ddenlovr);
161221   DECLARE_VIDEO_START(ddenlovr);
r243094r243095
350410   DECLARE_VIDEO_START(htengoku);
351411   DECLARE_WRITE8_MEMBER(htengoku_dsw_w);
352412   DECLARE_READ8_MEMBER(htengoku_dsw_r);
413   DECLARE_WRITE8_MEMBER( quizchq_oki_bank_w );
414   DECLARE_WRITE16_MEMBER( ddenlovr_oki_bank_w );
415   DECLARE_WRITE16_MEMBER( quiz365_oki_bank1_w );
416   DECLARE_WRITE16_MEMBER( quiz365_oki_bank2_w );
417   DECLARE_WRITE8_MEMBER( ddenlovr_select_w );
418   DECLARE_READ8_MEMBER( quiz365_input_r );
419   DECLARE_WRITE16_MEMBER( nettoqc_oki_bank_w );
420   DECLARE_WRITE8_MEMBER( hanakanz_oki_bank_w );
421   DECLARE_WRITE8_MEMBER( mjchuuka_oki_bank_w );
422   DECLARE_READ8_MEMBER( hginga_dsw_r );
423   DECLARE_WRITE8_MEMBER( mjflove_okibank_w );
424   DECLARE_WRITE8_MEMBER( jongtei_okibank_w );
425   DECLARE_READ8_MEMBER( seljan2_dsw_r );
426   DECLARE_WRITE8_MEMBER( daimyojn_okibank_w );
353427
354428   void ddenlovr_flipscreen_w( UINT8 data );
355429   void ddenlovr_blit_flip_w( UINT8 data );
r243094r243095
368442   void mmpanic_update_leds();
369443   void mjchuuka_get_romdata();
370444   UINT8 hgokou_player_r( int player );
371   DECLARE_WRITE8_MEMBER( quizchq_oki_bank_w );
372   DECLARE_WRITE16_MEMBER( ddenlovr_oki_bank_w );
373   DECLARE_WRITE16_MEMBER( quiz365_oki_bank1_w );
374   DECLARE_WRITE16_MEMBER( quiz365_oki_bank2_w );
375   DECLARE_WRITE8_MEMBER( ddenlovr_select_w );
376   DECLARE_READ8_MEMBER( quiz365_input_r );
377   DECLARE_WRITE16_MEMBER( nettoqc_oki_bank_w );
378   DECLARE_WRITE8_MEMBER( hanakanz_oki_bank_w );
379   DECLARE_WRITE8_MEMBER( mjchuuka_oki_bank_w );
380   DECLARE_READ8_MEMBER( hginga_dsw_r );
381   DECLARE_WRITE8_MEMBER( mjflove_okibank_w );
382   DECLARE_WRITE8_MEMBER( jongtei_okibank_w );
383   DECLARE_READ8_MEMBER( seljan2_dsw_r );
384   DECLARE_WRITE8_MEMBER( daimyojn_okibank_w );
385445};
386446
387447VIDEO_START_MEMBER(ddenlovr_state,ddenlovr)
r243094r243095
19161976   AM_RANGE(0x300286, 0x300287) AM_READ(ddenlovr_gfxrom_r)                             // Video Chip
19171977
19181978   AM_RANGE(0x3002c0, 0x3002c1) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)// Sound
1919   AM_RANGE(0x300300, 0x300303) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
1979   AM_RANGE(0x300300, 0x300303) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
19201980   AM_RANGE(0x300340, 0x30035f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
19211981   AM_RANGE(0x300380, 0x300383) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
19221982   AM_RANGE(0x300384, 0x300385) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r243094r243095
19682028   AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r)                                       // ? must be 78 on startup (not necessary in ddlover)
19692029   AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w)
19702030   AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r)                             // Video Chip
1971   AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
2031   AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
19722032   AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
19732033   AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
19742034   AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1")
r243094r243095
20352095   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w)                         // Coin Counters
20362096   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w)                         //
20372097
2038   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
2098   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
20392099   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
20402100   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
20412101   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r243094r243095
20732133   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w)                         // Coin Counters
20742134   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w)                         //
20752135
2076   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
2136   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
20772137   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
20782138   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
20792139   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r243094r243095
21472207   AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r)                                           // ? must be 78 on startup (not necessary in ddlover)
21482208   AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w)
21492209   AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r)                                 // Video Chip
2150   AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
2210   AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
21512211   AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
21522212   AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
21532213   AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1")
r243094r243095
22102270   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w)                         // Coin Counters
22112271   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w)                         //
22122272
2213   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
2273   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
22142274   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
22152275   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
22162276   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r243094r243095
22662326   AM_RANGE(0x22, 0x23) AM_READ(rongrong_input2_r)
22672327
22682328   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write)
2269   AM_RANGE(0x60, 0x61) AM_DEVWRITE("ymsnd", ym2413_device, write)
2329   AM_RANGE(0x60, 0x61) AM_DEVWRITE("ym2413", ym2413_device, write)
22702330
22712331   AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w)
22722332   AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w)
r243094r243095
23032363
23042364   AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
23052365   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write)
2306   AM_RANGE(0x60, 0x61) AM_DEVWRITE("ymsnd", ym2413_device, write)
2366   AM_RANGE(0x60, 0x61) AM_DEVWRITE("ym2413", ym2413_device, write)
23072367
23082368   AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w)
23092369   AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w)
r243094r243095
24572517   AM_RANGE(0x02, 0x02) AM_READNOP     // read just before port 00
24582518   AM_RANGE(0x04, 0x04) AM_NOP                 // read only once at the start
24592519   AM_RANGE(0x06, 0x06) AM_WRITENOP    // almost always 1, sometimes 0
2460   AM_RANGE(0x08, 0x09) AM_DEVWRITE("ymsnd", ym2413_device, write)
2520   AM_RANGE(0x08, 0x09) AM_DEVWRITE("ym2413", ym2413_device, write)
24612521   AM_RANGE(0x0c, 0x0c) AM_DEVWRITE("aysnd", ay8910_device, data_w)
24622522   AM_RANGE(0x0e, 0x0e) AM_DEVWRITE("aysnd", ay8910_device, address_w)
24632523ADDRESS_MAP_END
r243094r243095
27402800   AM_RANGE(0x93, 0x93) AM_WRITE(hanakanz_coincounter_w)
27412801   AM_RANGE(0x94, 0x94) AM_WRITE(hanakanz_keyb_w)
27422802   AM_RANGE(0x96, 0x96) AM_READ(hanakanz_rand_r)
2743   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write)
2803   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym2413", ym2413_device, write)
27442804   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("oki", okim6295_device, read, write)
27452805   AM_RANGE(0xe0, 0xef) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
27462806ADDRESS_MAP_END
r243094r243095
27562816   AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w)
27572817   AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w)
27582818   AM_RANGE(0x83, 0x84) AM_READ(hanakanz_gfxrom_r)
2759   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write)
2819   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym2413", ym2413_device, write)
27602820   AM_RANGE(0xb0, 0xb0) AM_READ_PORT("SYSTEM")
27612821   AM_RANGE(0xb1, 0xb2) AM_READ(hanakanz_keyb_r)
27622822   AM_RANGE(0xb3, 0xb3) AM_WRITE(hanakanz_coincounter_w)
r243094r243095
27782838   AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w)
27792839   AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w)
27802840   AM_RANGE(0x83, 0x84) AM_READ(hanakanz_gfxrom_r)
2781   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write)
2841   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym2413", ym2413_device, write)
27822842   AM_RANGE(0xb0, 0xb0) AM_READ_PORT("SYSTEM")
27832843//  AM_RANGE(0xb1, 0xb2) AM_READ(hanakanz_keyb_r)
27842844   AM_RANGE(0xb1, 0xb1) AM_READ_PORT("KEYB0")
r243094r243095
28022862   AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w)
28032863   AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w)
28042864   AM_RANGE(0x83, 0x84) AM_READ(hanakanz_gfxrom_r)
2805   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write)
2865   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym2413", ym2413_device, write)
28062866   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
28072867//  AM_RANGE(0x91, 0x91) AM_READ(hanakanz_keyb_r)
28082868   AM_RANGE(0x91, 0x91) AM_READ_PORT("KEYB0")
r243094r243095
28412901   AM_RANGE(0x94, 0x94) AM_READ_PORT("SYSTEM")
28422902   AM_RANGE(0x95, 0x96) AM_READ(hanakanz_keyb_r)
28432903   AM_RANGE(0x97, 0x97) AM_WRITE(hanakanz_coincounter_w)
2844   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write)
2904   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym2413", ym2413_device, write)
28452905   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("oki", okim6295_device, read, write)
28462906   AM_RANGE(0xe0, 0xef) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
28472907ADDRESS_MAP_END
r243094r243095
29693029   AM_RANGE(0x63, 0x63) AM_MIRROR(0xff00) AM_READ_PORT("DSW4")
29703030   AM_RANGE(0x64, 0x64) AM_MIRROR(0xff00) AM_READ_PORT("DSW5")     // DSW 1-4 high bits
29713031   AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_DEVREADWRITE("oki", okim6295_device, read, write)
2972   AM_RANGE(0xa0, 0xa1) AM_MIRROR(0xff00) AM_DEVWRITE("ymsnd", ym2413_device, write)
3032   AM_RANGE(0xa0, 0xa1) AM_MIRROR(0xff00) AM_DEVWRITE("ym2413", ym2413_device, write)
29733033   AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
29743034   AM_RANGE(0xe0, 0xe1) AM_MIRROR(0xff00) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
29753035ADDRESS_MAP_END
r243094r243095
30783138   AM_RANGE(0x22, 0x22) AM_READ(mjmyster_coins_r)
30793139   AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r)
30803140   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write)
3081   AM_RANGE(0x42, 0x43) AM_DEVWRITE("ymsnd", ym2413_device, write)
3141   AM_RANGE(0x42, 0x43) AM_DEVWRITE("ym2413", ym2413_device, write)
30823142   AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r)
30833143   AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w)
30843144   AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r243094r243095
32433303   AM_RANGE(0x03, 0x03) AM_READ(rongrong_gfxrom_r)
32443304   AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(mjmyster_rambank_w)
32453305   AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w)
3246   AM_RANGE(0x22, 0x23) AM_DEVWRITE("ymsnd", ym2413_device, write)
3306   AM_RANGE(0x22, 0x23) AM_DEVWRITE("ym2413", ym2413_device, write)
32473307   AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r)
32483308   AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w)
32493309   AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r243094r243095
33663426   AM_RANGE(0x61, 0x61) AM_WRITE(hgokou_input_w)
33673427   AM_RANGE(0x62, 0x62) AM_READ(hgokou_input_r)
33683428   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki", okim6295_device, read, write)
3369   AM_RANGE(0x82, 0x83) AM_DEVWRITE("ymsnd", ym2413_device, write)
3429   AM_RANGE(0x82, 0x83) AM_DEVWRITE("ym2413", ym2413_device, write)
33703430   AM_RANGE(0x84, 0x84) AM_DEVREAD("aysnd", ay8910_device, data_r)
33713431   AM_RANGE(0x86, 0x86) AM_DEVWRITE("aysnd", ay8910_device, data_w)
33723432   AM_RANGE(0x88, 0x88) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r243094r243095
34093469   AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(mjmyster_rambank_w)        // ? ack on RTC int
34103470   AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w)
34113471   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("oki", okim6295_device, read, write)
3412   AM_RANGE(0x22, 0x23) AM_DEVWRITE("ymsnd", ym2413_device, write)
3472   AM_RANGE(0x22, 0x23) AM_DEVWRITE("ym2413", ym2413_device, write)
34133473   AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r)
34143474   AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w)
34153475   AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r243094r243095
35003560   AM_RANGE(0x1c, 0x1c) AM_READ(hparadis_dsw_r)
35013561   AM_RANGE(0x1e, 0x1e) AM_WRITE(hparadis_select_w)
35023562   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write)
3503   AM_RANGE(0x60, 0x61) AM_DEVWRITE("ymsnd", ym2413_device, write)
3563   AM_RANGE(0x60, 0x61) AM_DEVWRITE("ym2413", ym2413_device, write)
35043564   AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w)
35053565   AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w)
35063566   AM_RANGE(0x88, 0x8b) AM_WRITE(ddenlovr_transparency_pen_w)
r243094r243095
35463606   AM_RANGE(0x22, 0x22) AM_READ(mjmywrld_coins_r)
35473607   AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r)
35483608   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write)
3549   AM_RANGE(0x42, 0x43) AM_DEVWRITE("ymsnd", ym2413_device, write)
3609   AM_RANGE(0x42, 0x43) AM_DEVWRITE("ym2413", ym2413_device, write)
35503610   AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r)
35513611   AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w)
35523612   AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r243094r243095
36463706   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w)                         // Coin Counters
36473707   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w)                         //
36483708
3649   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
3709   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
36503710   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write, 0x00ff)
36513711   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
36523712   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r243094r243095
37373797   AM_RANGE(0x0100, 0x0100) AM_READ_PORT("DSW1")
37383798   AM_RANGE(0x0181, 0x0181) AM_WRITENOP                        // ? int. enable
37393799   AM_RANGE(0x0184, 0x0184) AM_WRITE(mjflove_coincounter_w)
3740   AM_RANGE(0x0200, 0x0201) AM_DEVWRITE("ymsnd", ym2413_device, write)
3800   AM_RANGE(0x0200, 0x0201) AM_DEVWRITE("ym2413", ym2413_device, write)
37413801   AM_RANGE(0x0280, 0x028f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
37423802   AM_RANGE(0x0300, 0x0301) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
37433803   AM_RANGE(0x0380, 0x0380) AM_DEVREADWRITE("oki", okim6295_device, read, write)
r243094r243095
37783838   AM_RANGE(0x60, 0x60) AM_WRITE(hanakanz_blitter_data_w)
37793839   AM_RANGE(0x61, 0x61) AM_WRITE(hanakanz_palette_w)
37803840   AM_RANGE(0x63, 0x64) AM_READ(hanakanz_gfxrom_r)
3781   AM_RANGE(0x80, 0x81) AM_DEVWRITE("ymsnd", ym2413_device, write)
3841   AM_RANGE(0x80, 0x81) AM_DEVWRITE("ym2413", ym2413_device, write)
37823842   AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("oki", okim6295_device, read, write)
37833843   AM_RANGE(0xc0, 0xcf) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
37843844ADDRESS_MAP_END
r243094r243095
38413901static ADDRESS_MAP_START( sryudens_portmap, AS_IO, 8, ddenlovr_state )
38423902   ADDRESS_MAP_GLOBAL_MASK(0xff)
38433903   AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("oki", okim6295_device, read, write)
3844   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ymsnd", ym2413_device, write)
3904   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ym2413", ym2413_device, write)
38453905   AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
38463906   AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(sryudens_rambank_w)    // ? ack on RTC int
38473907   AM_RANGE(0x1e, 0x1e) AM_WRITE(mjflove_rombank_w)
r243094r243095
39283988   AM_RANGE(0x70, 0x70) AM_WRITE(quizchq_oki_bank_w)
39293989   AM_RANGE(0x80, 0x80) AM_RAM
39303990   AM_RANGE(0x90, 0x90) AM_DEVREADWRITE("oki", okim6295_device, read, write)
3931   AM_RANGE(0x92, 0x93) AM_DEVWRITE("ymsnd", ym2413_device, write)
3991   AM_RANGE(0x92, 0x93) AM_DEVWRITE("ym2413", ym2413_device, write)
39323992   AM_RANGE(0x94, 0x95) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
39333993ADDRESS_MAP_END
39343994
r243094r243095
40004060   AM_RANGE(0x38, 0x38) AM_READNOP         // ? ack or watchdog
40014061   AM_RANGE(0x40, 0x41) AM_WRITE(mjflove_blitter_w)
40024062   AM_RANGE(0x43, 0x43) AM_READ(rongrong_gfxrom_r)
4003   AM_RANGE(0x50, 0x51) AM_DEVWRITE("ymsnd", ym2413_device, write)
4063   AM_RANGE(0x50, 0x51) AM_DEVWRITE("ym2413", ym2413_device, write)
40044064   AM_RANGE(0x54, 0x54) AM_DEVREADWRITE("oki", okim6295_device, read, write)
40054065   AM_RANGE(0x58, 0x58) AM_DEVWRITE("aysnd", ay8910_device, address_w)
40064066   AM_RANGE(0x5c, 0x5c) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)   // dsw
r243094r243095
41544214   AM_RANGE( 0x40, 0x40 ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    // AY8910
41554215   AM_RANGE( 0x42, 0x42 ) AM_DEVREAD("aysnd", ay8910_device, data_r)     //
41564216   AM_RANGE( 0x44, 0x44 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   //
4157   AM_RANGE( 0x46, 0x47 ) AM_DEVWRITE("ymsnd", ym2413_device, write)        //
4217   AM_RANGE( 0x46, 0x47 ) AM_DEVWRITE("ym2413", ym2413_device, write)        //
41584218   AM_RANGE( 0x80, 0x8f ) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
41594219   AM_RANGE( 0xa0, 0xa3 ) AM_WRITE(ddenlovr_palette_base_w)    // ddenlovr mixer chip
41604220   AM_RANGE( 0xa4, 0xa7 ) AM_WRITE(ddenlovr_palette_mask_w)
r243094r243095
42264286   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(ddenlovr_state, htengoku_dsw_w))
42274287   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
42284288
4229   MCFG_SOUND_ADD("ymsnd", YM2413, 3579545)
4289   MCFG_SOUND_ADD("ym2413", YM2413, 3579545)
42304290   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
42314291
42324292   /* devices */
r243094r243095
43414401   AM_RANGE(0x42, 0x44) AM_READ(hanakanz_gfxrom_r)
43424402   AM_RANGE(0x8a, 0x8b) AM_READ(daimyojn_year_hack_r)  // ?
43434403   AM_RANGE(0x80, 0x8f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
4344   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write)
4404   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym2413", ym2413_device, write)
43454405   AM_RANGE(0xa2, 0xa2) AM_DEVREADWRITE("oki", okim6295_device, read, write)
43464406   AM_RANGE(0xa8, 0xa8) AM_READ_PORT("SYSTEM")
43474407   AM_RANGE(0xaa, 0xaa) AM_READ(daimyojn_keyb1_r)
r243094r243095
93019361   save_item(NAME(m_mjflove_irq_cause));
93029362   save_item(NAME(m_daimyojn_palette_sel));
93039363   save_item(NAME(m_palram));
9304
9305   save_item(NAME(m_irq_count));
93069364}
93079365
93089366MACHINE_RESET_MEMBER(ddenlovr_state,ddenlovr)
r243094r243095
93239381   m_hginga_rombank = 0;
93249382   m_mjflove_irq_cause = 0;
93259383   m_daimyojn_palette_sel = 0;
9326   m_irq_count = 0;
93279384
93289385   m_quiz365_protection[0] = 0;
93299386   m_quiz365_protection[1] = 0;
r243094r243095
94359492   /* sound hardware */
94369493   MCFG_SPEAKER_STANDARD_MONO("mono")
94379494
9438   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8)
9495   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_28_63636MHz / 8)
94399496   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
94409497
94419498   MCFG_SOUND_ADD("aysnd", AY8910, XTAL_28_63636MHz / 16)  // or /8 ?
r243094r243095
95539610   /* sound hardware */
95549611   MCFG_SPEAKER_STANDARD_MONO("mono")
95559612
9556   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz/8) // 3.579545Mhz, verified
9613   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_28_63636MHz/8) // 3.579545Mhz, verified
95579614   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50)
95589615
95599616   MCFG_OKIM6295_ADD("oki", XTAL_28_63636MHz/28, OKIM6295_PIN7_HIGH) // clock frequency verified 1.022MHz, pin 7 verified high
r243094r243095
96379694   /* sound hardware */
96389695   MCFG_SPEAKER_STANDARD_MONO("mono")
96399696
9640   MCFG_SOUND_ADD("ymsnd", YM2413, 3579545)
9697   MCFG_SOUND_ADD("ym2413", YM2413, 3579545)
96419698   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
96429699
96439700   MCFG_SOUND_ADD("aysnd", AY8910, 3579545)
r243094r243095
97149771   /* sound hardware */
97159772   MCFG_SPEAKER_STANDARD_MONO("mono")
97169773
9717   MCFG_SOUND_ADD("ymsnd", YM2413, 3579545)
9774   MCFG_SOUND_ADD("ym2413", YM2413, 3579545)
97189775   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
97199776
97209777   MCFG_OKIM6295_ADD("oki", 1022720, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
r243094r243095
97609817   /* sound hardware */
97619818   MCFG_SPEAKER_STANDARD_MONO("mono")
97629819
9763   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_37516MHz / 8)
9820   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_28_37516MHz / 8)
97649821   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
97659822
97669823   MCFG_OKIM6295_ADD("oki", XTAL_28_37516MHz / 28, OKIM6295_PIN7_HIGH)
r243094r243095
1012910186   /* sound hardware */
1013010187   MCFG_SPEAKER_STANDARD_MONO("mono")
1013110188
10132   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8)
10189   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_28_63636MHz / 8)
1013310190   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
1013410191
1013510192   MCFG_OKIM6295_ADD("oki", XTAL_28_63636MHz / 28, OKIM6295_PIN7_HIGH)
r243094r243095
1017210229   /* sound hardware */
1017310230   MCFG_SPEAKER_STANDARD_MONO("mono")
1017410231
10175   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8)
10232   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_28_63636MHz / 8)
1017610233   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
1017710234
1017810235   MCFG_SOUND_ADD("aysnd", AY8910, XTAL_28_63636MHz / 8)
r243094r243095
1021910276   /* sound hardware */
1022010277   MCFG_SPEAKER_STANDARD_MONO("mono")
1022110278
10222   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8)
10279   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_28_63636MHz / 8)
1022310280   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
1022410281
1022510282   MCFG_SOUND_ADD("aysnd", AY8910, XTAL_28_63636MHz / 8)
r243094r243095
1028610343   /* sound hardware */
1028710344   MCFG_SPEAKER_STANDARD_MONO("mono")
1028810345
10289   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8)
10346   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_28_63636MHz / 8)
1029010347   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
1029110348
1029210349   MCFG_SOUND_ADD("aysnd", AY8910, XTAL_28_63636MHz / 8)
r243094r243095
1033610393   /* sound hardware */
1033710394   MCFG_SPEAKER_STANDARD_MONO("mono")
1033810395
10339   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8)
10396   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_28_63636MHz / 8)
1034010397   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
1034110398
1034210399   MCFG_OKIM6295_ADD("oki", XTAL_28_63636MHz / 28, OKIM6295_PIN7_HIGH)
trunk/src/mame/drivers/dkong.c
r243094r243095
302302    ------------------------------------------------
303303
304304
305Donkey Kong Notes
306=================
307
308    Nintendo Service Department Bulletin # TKG-02 12-11-81
309    GAME: Donkey Kong
310    SUBJECT: Speed-up Kit #1
311
312    TO prevent extremely long play times, we are making available
313    a speed-up kit. This kit prevents players from waiting on top
314    of ladders, on screen #1, while the barrels roll across
315    instead of coming donw on top of him. Whit this kit, barrels
316    will roll on top of the player on a ladder 70 to 80 percent of
317    the time.
318
319    Machines above serial #30,000 will have this kit installed at
320    the factory, and all TKG4 board sets will come with this kit.
321
322    To install this kit in a four-board set, follow these
323    instructions:
324
325    1) Remove P.C. Boards from game, leaving them
326    attached to P.C. Board bracket.
327
328    2) Using a pair of needle-nose pliers, separate the
329    sound P.C. Board fromt he CPU P.C. Board, exposing
330    the entire surface of the CPU Board.
331
332    3) Remove the EPROMS's at location 5F, 5A, 5H and 5K
333    from the CPU Board. (Note 5A should read 5G - MSH)
334
335    4) Install the speed-up kit EPROM's in the corres-
336    ponding locations.
337
338    5) Reconnect the sound P.C. Board to the CPU P.C.
339    Board and mount the P.C. Boards in the game.
340    --------------------------------------------------------------
341
342    That kit included the following 4 EPROM's
343
344    USA (c) 1981 Nintendo of America set
345    ------------------------------------
346
347    Filename Label Type Loc/PCB *Label *Loc/PCB CSum
348    --------- ---------- ------ ------- ---------- -------- ----
349    2532.5K TKG4-C-5At 2532 5A(CPU) TKG3-C-5K 5K(CPU) A0F0
350    2532.5H TKG4-C-5Bt 2532 5B(CPU) TKG3-C-5H 5H(CPU) B2BC
351    2532.5G TKG4-C-5Ct 2532 5C(CPU) TKG3-C-5G 5G(CPU) 73BA
352    2532.5F TKG4-C-5Et 2532 5E(CPU) TKG3-C-5F 5F(CPU) AA97
353
354    Not only did the eprom fix the ladder bug, but it also changed
355    the copyright screen to read "(C)1981 Nintendo of America".
356
357
305358    D2K Jumpman returns Notes
306359    =========================
307360
r243094r243095
313366    6800 and E800.
314367
315368
316Donkey Kong "Hard" Kit
317======================
369    Donkey Kong "Hard" Kit
370    ======================
318371
319A yet "unconfirmed original" rom replacement kit which is a replacement for
320TKG-03 and -04 boards and greatly increases the speed and amount of fireballs
321showing on all levels.  Such behavior can be seen easily on the Rivet Board,
322where most of the fireballs have appeared even before removing the first rivet.
372    A yet "unconfirmed original" rom replacement kit which is a replacement for
373    TKG-03 and -04 boards and greatly increases the speed and amount of fireballs
374    showing on all levels.  Such behavior can be seen easily on the Rivet Board,
375    where most of the fireballs have appeared even before removing the first rivet.
323376
324Hopefully confirmation and information will come along later which confirms
325this is a legitimate Nintendo Kit.
377    Hopefully confirmation and information will come along later which confirms
378    this is a legitimate Nintendo Kit.
326379
327380***************************************************************************/
328381
r243094r243095
18941947   ROM_LOAD( "trs01v1d.bin",    0x0300, 0x0100, BAD_DUMP CRC(1b828315) SHA1(00c9f8c5ae86b68d38c66f9071b5f1ef421c1005) ) /* character color codes on a per-column basis */
18951948ROM_END
18961949
1897ROM_START( dkong )
1950ROM_START( dkong ) /* Confirmed TKG-04 Upgrade as mentioned in Nintendo Service Department Bulletin # TKG-02 12-11-81 */
18981951   ROM_REGION( 0x10000, "maincpu", 0 )
18991952   ROM_LOAD( "c_5et_g.bin",  0x0000, 0x1000, CRC(ba70b88b) SHA1(d76ebecfea1af098d843ee7e578e480cd658ac1a) )
19001953   ROM_LOAD( "c_5ct_g.bin",  0x1000, 0x1000, CRC(5ec461ec) SHA1(acb11a8fbdbb3ab46068385fe465f681e3c824bd) )
r243094r243095
22542307   ROM_LOAD( "v-2n.bpr",  0x0200, 0x0100, CRC(dbf185bf) SHA1(2697a991a4afdf079dd0b7e732f71c7618f43b70) )   /* character color codes on a per-column basis */
22552308ROM_END
22562309
2257ROM_START( dkongjre )
2310ROM_START( dkongjre )  /* Confirmed E-Kit set mentioned in Nintendo Service Department Bulletin # DJR-03 (02-23-83) */
22582311   ROM_REGION( 0x10000, "maincpu", 0 )
22592312   ROM_LOAD( "djr1-c.5b",    0x0000, 0x1000, CRC(ffe9e1a5) SHA1(715dc79d85169b4c1faf43458592e69b434afefd) )
22602313   ROM_CONTINUE(             0x3000, 0x1000 )
r243094r243095
22912344   ROM_REGION( 0x10000, "maincpu", 0 )
22922345   ROM_LOAD( "dkjr1-c.5b-p", 0x0000, 0x1000, CRC(8d99b3e0) SHA1(311a9f353e62d9d07c678e45baa2efec575a8f3b) ) // does not match SUM16 of bulletin (see notes), definitely not from Nintendo
22932346   ROM_CONTINUE(             0x3000, 0x1000 )
2294   ROM_LOAD( "dkjr1-c.5c-p", 0x2000, 0x0800, CRC(b92d258c) SHA1(793483e249d08cbbbefe06d3ddc4c2eda5428ee8) ) // "
2347   ROM_LOAD( "dkjr1-c.5c-p", 0x2000, 0x0800, CRC(b92d258c) SHA1(793483e249d08cbbbefe06d3ddc4c2eda5428ee8) )
22952348   ROM_CONTINUE(             0x4800, 0x0800 )
22962349   ROM_CONTINUE(             0x1000, 0x0800 )
22972350   ROM_CONTINUE(             0x5800, 0x0800 )
trunk/src/mame/drivers/dynax.c
r243094r243095
7979#include "sound/ay8910.h"
8080#include "sound/2203intf.h"
8181#include "sound/3812intf.h"
82#include "sound/msm5205.h"
83#include "sound/2413intf.h"
8482#include "machine/nvram.h"
8583#include "rendlay.h"
8684
r243094r243095
534532   AM_RANGE( 0x74, 0x74 ) AM_WRITE(dynax_blitter_ack_w)        // Blitter IRQ Ack
535533   AM_RANGE( 0x76, 0x76 ) AM_WRITE(dynax_blit_palbank_w)       // Layers Palettes (High Bit)
536534   AM_RANGE( 0x77, 0x77 ) AM_WRITE(hanamai_layer_half_w)       // half of the interleaved layer to write to
537   AM_RANGE( 0x78, 0x79 ) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) // 2 x DSW
535   AM_RANGE( 0x78, 0x79 ) AM_DEVREADWRITE("ym2203", ym2203_device, read, write) // 2 x DSW
538536   AM_RANGE( 0x7a, 0x7b ) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)   // AY8910
539537//  AM_RANGE( 0x7c, 0x7c ) AM_WRITENOP   // CRT Controller
540538//  AM_RANGE( 0x7d, 0x7d ) AM_WRITENOP   //
r243094r243095
556554   AM_RANGE( 0x26, 0x26 ) AM_READ_PORT("DSW2")         // DSW3
557555   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
558556   AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
559   AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ymsnd", ym2413_device, write)        //
557   AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ym2413", ym2413_device, write)        //
560558   AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r)     // AY8910, DSW1
561559   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
562560   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
r243094r243095
640638
641639   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
642640   AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
643   AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ymsnd", ym2413_device, write)        //
641   AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ym2413", ym2413_device, write)        //
644642
645643   AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r)     // AY8910, DSW1
646644   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
r243094r243095
780778   AM_RANGE( 0x11, 0x17 ) AM_WRITE(dynax_blitter_rev2_w)       // Blitter
781779   AM_RANGE( 0x20, 0x20 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
782780   AM_RANGE( 0x22, 0x22 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
783   AM_RANGE( 0x24, 0x25 ) AM_DEVWRITE("ymsnd", ym2413_device, write)        //
781   AM_RANGE( 0x24, 0x25 ) AM_DEVWRITE("ym2413", ym2413_device, write)        //
784782   AM_RANGE( 0x28, 0x28 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
785783   AM_RANGE( 0x2a, 0x2a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
786784   AM_RANGE( 0x48, 0x48 ) AM_WRITE(dynax_extra_scrollx_w)  // screen scroll X
r243094r243095
819817   AM_RANGE( 0x26, 0x26 ) AM_READ_PORT("DSW1")         // DSW3
820818   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
821819   AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
822   AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ymsnd", ym2413_device, write)        //
820   AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ym2413", ym2413_device, write)        //
823821   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
824822   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
825823   AM_RANGE( 0x40, 0x40 ) AM_WRITE(dynax_blit_pen_w)       // Destination Pen
r243094r243095
847845static ADDRESS_MAP_START( sprtmtch_io_map, AS_IO, 8, dynax_state )
848846   ADDRESS_MAP_GLOBAL_MASK(0xff)
849847   AM_RANGE( 0x01, 0x07 ) AM_WRITE(dynax_blitter_rev2_w)       // Blitter
850   AM_RANGE( 0x10, 0x11 ) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)  // 2 x DSW
848   AM_RANGE( 0x10, 0x11 ) AM_DEVREADWRITE("ym2203", ym2203_device, read, write)  // 2 x DSW
851849//  AM_RANGE( 0x12, 0x12 ) AM_WRITENOP   // CRT Controller
852850//  AM_RANGE( 0x13, 0x13 ) AM_WRITENOP   // CRT Controller
853851   AM_RANGE( 0x20, 0x20 ) AM_READ_PORT("P1")               // P1
r243094r243095
893891   AM_RANGE( 0x63, 0x63 ) AM_READ(hanamai_keyboard_0_r)        // P1
894892   AM_RANGE( 0x64, 0x64 ) AM_READ_PORT("DSW0")         // DSW
895893   AM_RANGE( 0x67, 0x67 ) AM_READ_PORT("DSW1")         // DSW
896   AM_RANGE( 0x70, 0x71 ) AM_DEVWRITE("ymsnd", ym2413_device, write)        //
894   AM_RANGE( 0x70, 0x71 ) AM_DEVWRITE("ym2413", ym2413_device, write)        //
897895//  AM_RANGE( 0x80, 0x80 ) AM_WRITENOP   // IRQ ack?
898896ADDRESS_MAP_END
899897
r243094r243095
902900   ADDRESS_MAP_GLOBAL_MASK(0xff)
903901   AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
904902   AM_RANGE( 0x02, 0x02 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
905   AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ymsnd", ym2413_device, write)        //
903   AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ym2413", ym2413_device, write)        //
906904   AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
907905   AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
908906   AM_RANGE( 0x10, 0x10 ) AM_WRITE(hanamai_keyboard_w)     // keyboard row select
r243094r243095
10241022   AM_RANGE( 0x10, 0x10 ) AM_WRITE(jantouki_sound_vblank_ack_w)    // VBlank IRQ Ack
10251023   AM_RANGE( 0x21, 0x21 ) AM_DEVREAD("aysnd", ay8910_device, data_r)         // AY8910
10261024   AM_RANGE( 0x22, 0x23 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)   //
1027   AM_RANGE( 0x28, 0x29 ) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) //
1025   AM_RANGE( 0x28, 0x29 ) AM_DEVREADWRITE("ym2203", ym2203_device, read, write) //
10281026   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)      // MSM5205 reset
10291027   AM_RANGE( 0x40, 0x40 ) AM_WRITE(adpcm_data_w)               // MSM5205 data
10301028   AM_RANGE( 0x50, 0x50 ) AM_READ(jantouki_soundlatch_status_r)    // Soundlatch status
r243094r243095
10601058   ADDRESS_MAP_GLOBAL_MASK(0xff)
10611059   AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
10621060   AM_RANGE( 0x02, 0x02 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
1063   AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ymsnd", ym2413_device, write)        //
1061   AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ym2413", ym2413_device, write)        //
10641062   AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
10651063   AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
10661064   AM_RANGE( 0x11, 0x12 ) AM_WRITE(mjelctrn_blitter_ack_w) //?
r243094r243095
13391337   AM_RANGE( 0x10000, 0x10000 ) AM_DEVREAD("aysnd", ay8910_device, data_r)       // AY8910
13401338   AM_RANGE( 0x10008, 0x10008 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) //
13411339   AM_RANGE( 0x10010, 0x10010 ) AM_DEVWRITE("aysnd", ay8910_device, address_w)  //
1342   AM_RANGE( 0x10020, 0x10021 ) AM_DEVWRITE("ymsnd", ym2413_device, write)      //
1340   AM_RANGE( 0x10020, 0x10021 ) AM_DEVWRITE("ym2413", ym2413_device, write)      //
13431341   AM_RANGE( 0x10040, 0x10040 ) AM_WRITE(dynax_blit_pen_w)     // Destination Pen
13441342   AM_RANGE( 0x10044, 0x10044 ) AM_WRITE(tenkai_blit_dest_w)       // Destination Layer
13451343   AM_RANGE( 0x10048, 0x10048 ) AM_WRITE(tenkai_blit_palette23_w)  // Layers Palettes
r243094r243095
14811479         case 0x8050:    // CRT controller
14821480         case 0x8051:    return;
14831481
1484         case 0x8070:    downcast<ym2413_device *>(m_ymsnd)->register_port_w(space, 0, data);    return;
1485         case 0x8071:    downcast<ym2413_device *>(m_ymsnd)->data_port_w(space, 0, data);    return;
1482         case 0x8070:    m_ym2413->register_port_w(space, 0, data);    return;
1483         case 0x8071:    m_ym2413->data_port_w(space, 0, data);    return;
14861484
14871485         case 0x8060:    m_keyb = data;  return;
14881486
r243094r243095
39673965
39683966MACHINE_START_MEMBER(dynax_state,dynax)
39693967{
3970   m_ymsnd = machine().device("ymsnd");
3971
39723968   save_item(NAME(m_sound_irq));
39733969   save_item(NAME(m_vblank_irq));
39743970   save_item(NAME(m_blitter_irq));
r243094r243095
40934089   MCFG_SOUND_ADD("aysnd", AY8910, 22000000 / 8)
40944090   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
40954091
4096   MCFG_SOUND_ADD("ymsnd", YM2203, 22000000 / 8)
4092   MCFG_SOUND_ADD("ym2203", YM2203, 22000000 / 8)
40974093   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dynax_state, sprtmtch_sound_callback))
40984094   MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1"))
40994095   MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW0"))
r243094r243095
41474143   MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0"))
41484144   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
41494145
4150   MCFG_SOUND_ADD("ymsnd", YM2413, 3579545)
4146   MCFG_SOUND_ADD("ym2413", YM2413, 3579545)
41514147   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
41524148
41534149   MCFG_SOUND_ADD("msm", MSM5205, 384000)
r243094r243095
41944190   MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0"))
41954191   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
41964192
4197   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_3_579545MHz )
4193   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_3_579545MHz )
41984194   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
41994195
42004196   MCFG_SOUND_ADD("msm", MSM5205, XTAL_384kHz )
r243094r243095
42384234   /* sound hardware */
42394235   MCFG_SPEAKER_STANDARD_MONO("mono")
42404236
4241   MCFG_SOUND_ADD("ymsnd", YM2203, 22000000 / 8)
4237   MCFG_SOUND_ADD("ym2203", YM2203, 22000000 / 8)
42424238   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dynax_state, sprtmtch_sound_callback))
42434239   MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0"))
42444240   MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
r243094r243095
42834279   /* sound hardware */
42844280   MCFG_SPEAKER_STANDARD_MONO("mono")
42854281
4286   MCFG_SOUND_ADD("ymsnd", YM2413, 24000000/6)
4282   MCFG_SOUND_ADD("ym2413", YM2413, 24000000/6)
42874283   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
42884284MACHINE_CONFIG_END
42894285
r243094r243095
43824378
43834379   membank("bank1")->configure_entries(0, 0x10, &MAIN[0x8000],  0x8000);
43844380   membank("bank2")->configure_entries(0, 12,   &SOUND[0x8000], 0x8000);
4385
4386   m_top_scr = machine().device("top");
4387   m_bot_scr = machine().device("bottom");
4388
4381   
43894382   MACHINE_START_CALL_MEMBER(dynax);
43904383}
43914384
r243094r243095
44374430   MCFG_SOUND_ADD("aysnd", AY8910, 22000000 / 8)
44384431   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
44394432
4440   MCFG_SOUND_ADD("ymsnd", YM2203, 22000000 / 8)
4433   MCFG_SOUND_ADD("ym2203", YM2203, 22000000 / 8)
44414434   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dynax_state, jantouki_sound_callback))
44424435   MCFG_SOUND_ROUTE(0, "mono", 0.20)
44434436   MCFG_SOUND_ROUTE(1, "mono", 0.20)
r243094r243095
46164609   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(dynax_state, tenkai_dswsel_w))
46174610   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
46184611
4619   MCFG_SOUND_ADD("ymsnd", YM2413, 3579545)
4612   MCFG_SOUND_ADD("ym2413", YM2413, 3579545)
46204613   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
46214614
46224615   /* devices */
r243094r243095
46874680   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(dynax_state, tenkai_dswsel_w))
46884681   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
46894682
4690   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_24MHz / 8) // ?
4683   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_24MHz / 8) // ?
46914684   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
46924685MACHINE_CONFIG_END
46934686
trunk/src/mame/drivers/model3.c
r243094r243095
664664#include "machine/nvram.h"
665665#include "includes/model3.h"
666666
667//#define DECRYPT_ANALYSIS_HACKS
667668
669#ifdef DECRYPT_ANALYSIS_HACKS
670int readcount = 0;
671int segcount = 0;
672#endif
673
668674void model3_state::update_irq_state()
669675{
670676   if ((m_irq_enable & m_irq_state) || m_scsi_irq_state)
r243094r243095
16731679}
16741680
16751681
1676static const UINT16 vs299_prot_data[] =
1677{
1678   0xc800, 0x4a20, 0x5041, 0x4e41, 0x4920, 0x4154, 0x594c, 0x4220,
1679   0x4152, 0x4953, 0x204c, 0x5241, 0x4547, 0x544e, 0x4e49, 0x2041,
1680   0x4547, 0x4d52, 0x4e41, 0x2059, 0x4e45, 0x4c47, 0x4e41, 0x2044,
1681   0x454e, 0x4854, 0x5245, 0x414c, 0x444e, 0x2053, 0x5246, 0x4e41,
1682   0x4543, 0x4320, 0x4c4f, 0x4d4f, 0x4942, 0x2041, 0x4150, 0x4152,
1683   0x5547, 0x5941, 0x4220, 0x4c55, 0x4147, 0x4952, 0x2041, 0x5053,
1684   0x4941, 0x204e, 0x5243, 0x414f, 0x4954, 0x2041, 0x4542, 0x474c,
1685   0x5549, 0x204d, 0x494e, 0x4547, 0x4952, 0x2041, 0x4153, 0x4455,
1686   0x2049, 0x4f4b, 0x4552, 0x2041, 0x4544, 0x4d4e, 0x5241, 0x204b,
1687   0x4f52, 0x414d, 0x494e, 0x2041, 0x4353, 0x544f, 0x414c, 0x444e,
1688   0x5520, 0x4153, 0x5320, 0x554f, 0x4854, 0x4641, 0x4952, 0x4143,
1689   0x4d20, 0x5845, 0x4349, 0x204f, 0x5559, 0x4f47, 0x4c53, 0x5641,
1690   0x4149, 0x4620, 0x5f43, 0x4553, 0x4147
1691};
16921682
1693static const UINT16 swt_prot_data[] =
1694{
1695   0xffff,
1696   0x3d3d, 0x3d3d, 0x203d, 0x5453, 0x5241, 0x5720, 0x5241, 0x2053,
1697   0x3d3d, 0x3d3d, 0x0a3d, 0x6f43, 0x7970, 0x6952, 0x6867, 0x2074,
1698   0x4553, 0x4147, 0x4520, 0x746e, 0x7265, 0x7270, 0x7369, 0x7365,
1699   0x202c, 0x744c, 0x2e64, 0x410a, 0x756d, 0x6573, 0x656d, 0x746e,
1700   0x5220, 0x4426, 0x4420, 0x7065, 0x2e74, 0x2320, 0x3231, 0x4b0a,
1701   0x7461, 0x7573, 0x6179, 0x7573, 0x4120, 0x646e, 0x206f, 0x2026,
1702   0x614b, 0x6f79, 0x6f6b, 0x5920, 0x6d61, 0x6d61, 0x746f, 0x0a6f,
1703};
17041683
17051684static const UINT16 fvipers2_prot_data[] =
17061685{
r243094r243095
17371716   0x7470, 0x202e, 0x3123, 0x660a, 0x726f, 0x7420, 0x7365, 0x0a74,
17381717};
17391718
1740static const UINT16 oceanhun_prot_data[] =
1741{
1742   0x0000,    // dummy read
1743   0x3d3d, 0x203d, 0x434f, 0x4145, 0x204e, 0x5548, 0x544e, 0x5245,
1744   0x3d20, 0x3d3d, 0x430a, 0x706f, 0x5279, 0x6769, 0x7468, 0x5320,
1745   0x4745, 0x2041, 0x6e45, 0x6574, 0x7072, 0x6972, 0x6573, 0x2c73,
1746   0x4c20, 0x6474, 0x0a2e, 0x6d41, 0x7375, 0x6d65, 0x6e65, 0x2074,
1747   0x2652, 0x2044, 0x6544, 0x7470, 0x202e, 0x3123, 0x4b0a, 0x7a61,
1748   0x6e75, 0x7261, 0x2069, 0x7354, 0x6b75, 0x6d61, 0x746f, 0x206f,
1749   0x6553, 0x7463, 0x6f69, 0x206e, 0x614d, 0x616e, 0x6567, 0x0a72
1750};
1751/*
1752   dirtdvls: first 2 words read are discarded, then every other word
1753   is written to char RAM starting at f1013400 (in between words are
1754   discarded).
1755*/
17561719
1720
1721
17571722READ64_MEMBER(model3_state::model3_security_r)
17581723{
17591724   UINT64 retvalue = U64(0xffffffffffffffff);
r243094r243095
17631728      case 0x00 / 8:    retvalue = 0; break;       /* status */
17641729      case 0x1c/8:                    /* security board data read */
17651730      {
1766         if (core_stricmp(machine().system().name, "vs299") == 0 ||
1767            core_stricmp(machine().system().name, "vs2v991") == 0)
1731         #ifdef DECRYPT_ANALYSIS_HACKS
1732         readcount += 2;
1733         printf("model3_security_r offset %08x : %08x%08x (%08x%08x) count %08x\n", offset * 8, (UINT32)(retvalue >> 32), (UINT32)(retvalue & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff), readcount);
1734         #endif
1735         
1736         if (core_stricmp(machine().system().name, "fvipers2") == 0)
17681737         {
1769            retvalue = (UINT64)vs299_prot_data[m_prot_data_ptr++] << 48;
1770         }
1771         else if (core_stricmp(machine().system().name, "swtrilgy") == 0 ||
1772                  core_stricmp(machine().system().name, "swtrilgya") == 0)
1773         {
1774            UINT64 data = (UINT64)swt_prot_data[m_prot_data_ptr++] << 16;
1775            if (m_prot_data_ptr > 0x38)
1776            {
1777               m_prot_data_ptr = 0;
1778            }
1779            retvalue = data;
1780         }
1781         else if (core_stricmp(machine().system().name, "fvipers2") == 0)
1782         {
17831738            UINT64 data = (UINT64)fvipers2_prot_data[m_prot_data_ptr++] << 16;
17841739            if (m_prot_data_ptr >= 0x41)
17851740            {
r243094r243095
18071762            }
18081763            retvalue = data;
18091764         }
1810         else if (core_stricmp(machine().system().name, "oceanhun") == 0)
1811         {
1812            UINT64 data = (UINT64)oceanhun_prot_data[m_prot_data_ptr++] << 16;
1813            if (m_prot_data_ptr >= 58)
1814            {
1815               m_prot_data_ptr = 0;
1816            }
1817            retvalue = data;
1818         }
18191765         else
18201766         {
18211767            retvalue = 0;
r243094r243095
18231769         break;
18241770      }
18251771   }
1826   printf("model3_security_r offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(retvalue >> 32), (UINT32)(retvalue & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff));
18271772
18281773   return retvalue;
18291774}
18301775
1776
1777
1778WRITE64_MEMBER(model3_state::model3_security_w)
1779{
1780   if (offset == 0x10 / 8)
1781   {
1782      if (data != 0)
1783         printf("model3_security_w address isn't 0?\n");
1784
1785      first_read = 1;
1786
1787      printf("setting base %08x%08x\n",  (UINT32)(data >> 32), (UINT32)(data & 0xffffffff));
1788   }
1789   else if (offset == 0x18 / 8)
1790   {
1791      UINT16 subkey = data >> (32 + 16);
1792      subkey = ((subkey & 0xff00) >> 8) | ((subkey & 0x00ff) << 8); // endian swap the sub-key for this hardware
1793      printf("model3_5881prot_w setting subkey %04x\n", subkey);
1794
1795#ifdef DECRYPT_ANALYSIS_HACKS // dump out a copy of protection RAM
1796      FILE* fp2;
1797      char filename[256];
1798      sprintf(filename,"xxxencrypted_%s_part%d", machine().system().name, segcount);
1799      segcount++;
1800      readcount = 0;
1801      fp2 = fopen(filename, "w+b");
1802
1803      {
1804         for (int i = 0; i < 0x8000; i++)
1805         {
1806            UINT16 dat = m_maincpu->space().read_word((0xf0180000 + 4 * i));
1807            UINT8* dst2 = (UINT8*)&dat;
1808            fwrite(&dst2[1], 1, 1, fp2);
1809            fwrite(&dst2[0], 1, 1, fp2);
1810         }
1811
1812      }
1813      fclose(fp2);
1814#endif
1815
1816   }
1817   else
1818   {
1819      printf("model3_5881prot_w offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(data >> 32), (UINT32)(data & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff));
1820   }
1821}
1822
18311823READ64_MEMBER(model3_state::model3_5881prot_r)
18321824{
18331825   UINT64 retvalue = U64(0xffffffffffffffff);
r243094r243095
18891881   {
18901882      printf("model3_5881prot_w offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(data >> 32), (UINT32)(data & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff));
18911883   }
1892
1893
1894
18951884}
18961885
18971886WRITE64_MEMBER(model3_state::daytona2_rombank_w)
r243094r243095
55865575   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
55875576MACHINE_CONFIG_END
55885577
5589static MACHINE_CONFIG_START( model3_20, model3_state )
5578static MACHINE_CONFIG_START(model3_20, model3_state)
55905579   MCFG_CPU_ADD("maincpu", PPC603R, 166000000)
55915580   MCFG_PPC_BUS_FREQUENCY(66000000)    /* Multiplier 2.5, Bus = 66MHz, Core = 166MHz */
55925581   MCFG_CPU_PROGRAM_MAP(model3_mem)
r243094r243095
55955584   MCFG_CPU_ADD("audiocpu", M68000, 12000000)
55965585   MCFG_CPU_PROGRAM_MAP(model3_snd)
55975586
5598   MCFG_MACHINE_START_OVERRIDE(model3_state,model3_20)
5599   MCFG_MACHINE_RESET_OVERRIDE(model3_state,model3_20)
5587   MCFG_MACHINE_START_OVERRIDE(model3_state, model3_20)
5588   MCFG_MACHINE_RESET_OVERRIDE(model3_state, model3_20)
56005589
56015590   MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
56025591   MCFG_NVRAM_ADD_1FILL("backup")
r243094r243095
56235612   MCFG_SOUND_ROUTE(0, "rspeaker", 2.0)
56245613MACHINE_CONFIG_END
56255614
5626static MACHINE_CONFIG_START( model3_21, model3_state )
5615static MACHINE_CONFIG_DERIVED(model3_20_5881, model3_20)
5616   MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0)
5617   MCFG_SET_READ_CALLBACK(model3_state, crypt_read_callback)
5618MACHINE_CONFIG_END
5619
5620static MACHINE_CONFIG_START(model3_21, model3_state)
56275621   MCFG_CPU_ADD("maincpu", PPC603R, 166000000)
56285622   MCFG_PPC_BUS_FREQUENCY(66000000)    /* Multiplier 2.5, Bus = 66MHz, Core = 166MHz */
56295623   MCFG_CPU_PROGRAM_MAP(model3_mem)
r243094r243095
56325626   MCFG_CPU_ADD("audiocpu", M68000, 12000000)
56335627   MCFG_CPU_PROGRAM_MAP(model3_snd)
56345628
5635   MCFG_MACHINE_START_OVERRIDE(model3_state,model3_21)
5636   MCFG_MACHINE_RESET_OVERRIDE(model3_state,model3_21)
5629   MCFG_MACHINE_START_OVERRIDE(model3_state, model3_21)
5630   MCFG_MACHINE_RESET_OVERRIDE(model3_state, model3_21)
56375631
56385632   MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
56395633   MCFG_NVRAM_ADD_1FILL("backup")
r243094r243095
56605654   MCFG_SOUND_ROUTE(0, "rspeaker", 2.0)
56615655MACHINE_CONFIG_END
56625656
5657
56635658UINT16 model3_state::crypt_read_callback(UINT32 addr)
56645659{
56655660   UINT16 dat = 0;
r243094r243095
56705665
56715666//   dat = ((dat & 0xff00) >> 8) | ((dat & 0x00ff) << 8);
56725667//   printf("reading %04x\n", dat);
5668
56735669   return dat;
56745670}
56755671
r243094r243095
57245720   }
57255721   else
57265722   {
5727      m_maincpu->space(AS_PROGRAM).install_read_handler(0xf01a0000, 0xf01a003f, 0, 0x0e000000, read64_delegate(FUNC(model3_state::model3_security_r), this) );                   
5723      m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xf01a0000, 0xf01a003f, 0, 0x0e000000, read64_delegate(FUNC(model3_state::model3_security_r), this), write64_delegate(FUNC(model3_state::model3_security_w), this) );                   
57285724   }
57295725}
57305726
r243094r243095
58915887DRIVER_INIT_MEMBER(model3_state,vs298)
58925888{
58935889   DRIVER_INIT_CALL(model3_20);
5890   DRIVER_INIT_CALL(genprot);
58945891}
58955892
58965893
5897DRIVER_INIT_MEMBER(model3_state,vs2v991)
5898{
5899   DRIVER_INIT_CALL(model3_20);
5900}
59015894
5902DRIVER_INIT_MEMBER(model3_state,vs299b)
5903{
5904   DRIVER_INIT_CALL(model3_20);
5905}
59065895
5907DRIVER_INIT_MEMBER(model3_state,vs299a)
5908{
5909   DRIVER_INIT_CALL(model3_20);
5910}
5911
59125896DRIVER_INIT_MEMBER(model3_state,vs299)
59135897{
59145898   DRIVER_INIT_CALL(model3_20);
5899   DRIVER_INIT_CALL(genprot);
59155900}
59165901
59175902DRIVER_INIT_MEMBER(model3_state,harley)
r243094r243095
59695954{
59705955   //UINT32 *rom = (UINT32*)memregion("user1")->base();
59715956   DRIVER_INIT_CALL(model3_20);
5957   DRIVER_INIT_CALL(genprot);
59725958
59735959   //rom[(0xf6dd0^4)/4] = 0x60000000;
59745960}
r243094r243095
59785964   m_step20_with_old_real3d = true;
59795965
59805966   DRIVER_INIT_CALL(model3_20);
5967   DRIVER_INIT_CALL(genprot);
59815968}
59825969
59835970DRIVER_INIT_MEMBER(model3_state,dirtdvls)
r243094r243095
59855972   m_step20_with_old_real3d = true;
59865973
59875974   DRIVER_INIT_CALL(model3_20);
5975   DRIVER_INIT_CALL(genprot);
59885976}
59895977
59905978DRIVER_INIT_MEMBER(model3_state,daytona2)
r243094r243095
59995987   rom[(0x6063c4^4)/4] = 0x60000000;
60005988   rom[(0x616434^4)/4] = 0x60000000;
60015989   rom[(0x69f4e4^4)/4] = 0x60000000;
5990
5991   DRIVER_INIT_CALL(genprot);
60025992}
60035993
60045994DRIVER_INIT_MEMBER(model3_state,dayto2pe)
r243094r243095
60146004   rom[(0x618b28^4)/4] = 0x60000000;       // jump to encrypted code
60156005
60166006   rom[(0x64ca34^4)/4] = 0x60000000;       // dec
6007
6008   DRIVER_INIT_CALL(genprot);
60176009}
60186010
60196011DRIVER_INIT_MEMBER(model3_state,spikeout)
r243094r243095
60236015
60246016   rom[(0x6059cc^4)/4] = 0x60000000;
60256017   rom[(0x6059ec^4)/4] = 0x60000000;
6018   DRIVER_INIT_CALL(genprot);
60266019}
60276020
60286021DRIVER_INIT_MEMBER(model3_state,spikeofe)
r243094r243095
60326025
60336026   rom[(0x6059cc^4)/4] = 0x60000000;
60346027   rom[(0x6059ec^4)/4] = 0x60000000;
6028   DRIVER_INIT_CALL(genprot);
60356029}
60366030
60376031DRIVER_INIT_MEMBER(model3_state,eca)
60386032{
60396033   DRIVER_INIT_CALL(model3_20);
6034   DRIVER_INIT_CALL(genprot);
60406035}
60416036
60426037DRIVER_INIT_MEMBER(model3_state,skichamp)
r243094r243095
60586053   DRIVER_INIT_CALL(model3_20);
60596054
60606055   rom[(0x57995c^4)/4] = 0x60000000;   // decrementer
6056
6057   DRIVER_INIT_CALL(genprot);
60616058}
60626059
60636060DRIVER_INIT_MEMBER(model3_state,magtruck)
r243094r243095
60656062   m_step20_with_old_real3d = true;
60666063
60676064   DRIVER_INIT_CALL(model3_20);
6065   DRIVER_INIT_CALL(genprot);
60686066}
60696067
60706068DRIVER_INIT_MEMBER(model3_state,lamachin)
r243094r243095
60726070   m_step20_with_old_real3d = true;
60736071
60746072   DRIVER_INIT_CALL(model3_20);
6073   DRIVER_INIT_CALL(genprot);
60756074}
60766075
60776076
r243094r243095
60966095GAME( 1998, vs29815,    vs298, model3_15, model3, model3_state,    vs29815, ROT0, "Sega", "Virtua Striker 2 '98 (Step 1.5)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
60976096
60986097/* Model 3 Step 2.0 */
6099GAME( 1997, vs2,            0, model3_20, model3, model3_state,        vs2, ROT0, "Sega", "Virtua Striker 2 (Step 2.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6100GAME( 1997, harley,         0, model3_20, harley, model3_state,     harley, ROT0, "Sega", "Harley-Davidson and L.A. Riders (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6101GAME( 1997, harleya,   harley, model3_20, harley, model3_state,     harleya, ROT0, "Sega", "Harley-Davidson and L.A. Riders (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6102GAME( 1998, lamachin,       0, model3_20, model3, model3_state,   lamachin, ROT0, "Sega", "L.A. Machineguns", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6103GAME( 1998, oceanhun,       0, model3_20, model3, model3_state,   oceanhun, ROT0, "Sega", "The Ocean Hunter", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6104GAME( 1998, skichamp,       0, model3_20, skichamp, model3_state, skichamp, ROT0, "Sega", "Ski Champ", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6105GAME( 1998, srally2,        0, model3_20, scud, model3_state,      srally2, ROT0, "Sega", "Sega Rally 2", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6106GAME( 1998, srally2x,       0, model3_20, scud, model3_state,      srally2, ROT0, "Sega", "Sega Rally 2 DX", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6107GAME( 1998, von2,           0, model3_20, model3, model3_state,       von2, ROT0, "Sega", "Virtual On 2: Oratorio Tangram (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6108GAME( 1998, von254g,     von2, model3_20, model3, model3_state,       von2, ROT0, "Sega", "Virtual On 2: Oratorio Tangram (ver 5.4g)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6109GAME( 1998, fvipers2,       0, model3_20, model3, model3_state,  model3_20, ROT0, "Sega", "Fighting Vipers 2 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6110GAME( 1998, vs298,          0, model3_20, model3, model3_state,      vs298, ROT0, "Sega", "Virtua Striker 2 '98 (Step 2.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6111GAME( 1999, vs2v991,        0, model3_20, model3, model3_state,    vs2v991, ROT0, "Sega", "Virtua Striker 2 '99.1 (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6112GAME( 1999, vs299b,   vs2v991, model3_20, model3, model3_state,     vs299b, ROT0, "Sega", "Virtua Striker 2 '99 (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6113GAME( 1999, vs299a,   vs2v991, model3_20, model3, model3_state,     vs299a, ROT0, "Sega", "Virtua Striker 2 '99 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6114GAME( 1999, vs299,    vs2v991, model3_20, model3, model3_state,      vs299, ROT0, "Sega", "Virtua Striker 2 '99", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6098GAME( 1997, vs2,            0, model3_20,      model3, model3_state,        vs2, ROT0, "Sega", "Virtua Striker 2 (Step 2.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6099GAME( 1997, harley,         0, model3_20,      harley, model3_state,     harley, ROT0, "Sega", "Harley-Davidson and L.A. Riders (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6100GAME( 1997, harleya,   harley, model3_20,      harley, model3_state,     harleya, ROT0, "Sega", "Harley-Davidson and L.A. Riders (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6101GAME( 1998, lamachin,       0, model3_20_5881, model3, model3_state,   lamachin, ROT0, "Sega", "L.A. Machineguns", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6102GAME( 1998, oceanhun,       0, model3_20_5881, model3, model3_state,   oceanhun, ROT0, "Sega", "The Ocean Hunter", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6103GAME( 1998, skichamp,       0, model3_20,      skichamp, model3_state, skichamp, ROT0, "Sega", "Ski Champ", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6104GAME( 1998, srally2,        0, model3_20,      scud, model3_state,      srally2, ROT0, "Sega", "Sega Rally 2", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6105GAME( 1998, srally2x,       0, model3_20,      scud, model3_state,      srally2, ROT0, "Sega", "Sega Rally 2 DX", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6106GAME( 1998, von2,           0, model3_20_5881, model3, model3_state,       von2, ROT0, "Sega", "Virtual On 2: Oratorio Tangram (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6107GAME( 1998, von254g,     von2, model3_20_5881, model3, model3_state,       von2, ROT0, "Sega", "Virtual On 2: Oratorio Tangram (ver 5.4g)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6108GAME( 1998, fvipers2,       0, model3_20_5881, model3, model3_state,      vs299, ROT0, "Sega", "Fighting Vipers 2 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6109GAME( 1998, vs298,          0, model3_20_5881, model3, model3_state,      vs298, ROT0, "Sega", "Virtua Striker 2 '98 (Step 2.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6110GAME( 1999, vs2v991,        0, model3_20_5881, model3, model3_state,      vs299, ROT0, "Sega", "Virtua Striker 2 '99.1 (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6111GAME( 1999, vs299b,   vs2v991, model3_20_5881, model3, model3_state,      vs299, ROT0, "Sega", "Virtua Striker 2 '99 (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6112GAME( 1999, vs299a,   vs2v991, model3_20_5881, model3, model3_state,      vs299, ROT0, "Sega", "Virtua Striker 2 '99 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6113GAME( 1999, vs299,    vs2v991, model3_20_5881, model3, model3_state,      vs299, ROT0, "Sega", "Virtua Striker 2 '99", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
61156114
61166115/* Model 3 Step 2.1 */
6117GAME( 1998, daytona2,         0, model3_21,      daytona2, model3_state, daytona2, ROT0, "Sega", "Daytona USA 2 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6118GAME( 1998, dayto2pe,         0, model3_21,      daytona2, model3_state, dayto2pe, ROT0, "Sega", "Daytona USA 2 Power Edition", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6119GAME( 1998, dirtdvls,         0, model3_21,      scud, model3_state,     dirtdvls, ROT0, "Sega", "Dirt Devils (set 1) (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6120GAME( 1998, dirtdvlsa, dirtdvls, model3_21,      scud, model3_state,     dirtdvls, ROT0, "Sega", "Dirt Devils (set 2) (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6116GAME( 1998, daytona2,         0, model3_21_5881, daytona2, model3_state, daytona2, ROT0, "Sega", "Daytona USA 2 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6117GAME( 1998, dayto2pe,         0, model3_21_5881, daytona2, model3_state, dayto2pe, ROT0, "Sega", "Daytona USA 2 Power Edition", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6118GAME( 1998, dirtdvls,         0, model3_21_5881, scud,     model3_state, dirtdvls, ROT0, "Sega", "Dirt Devils (set 1) (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6119GAME( 1998, dirtdvlsa, dirtdvls, model3_21_5881, scud,     model3_state, dirtdvls, ROT0, "Sega", "Dirt Devils (set 2) (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
61216120GAME( 1998, swtrilgy,         0, model3_21_5881, swtrilgy, model3_state, swtrilgy, ROT0, "Sega / LucasArts", "Star Wars Trilogy (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
61226121GAME( 1998, swtrilgya, swtrilgy, model3_21_5881, swtrilgy, model3_state, swtrilga, ROT0, "Sega / LucasArts", "Star Wars Trilogy", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6123GAME( 1998, spikeout,         0, model3_21,      model3, model3_state,   spikeout, ROT0, "Sega", "Spikeout (Revision C)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6124GAME( 1998, spikeofe,         0, model3_21,      model3, model3_state,   spikeofe, ROT0, "Sega", "Spikeout Final Edition", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6125GAME( 1998, magtruck,         0, model3_21,      eca, model3_state,      magtruck, ROT0, "Sega", "Magical Truck Adventure", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6126GAME( 1999, eca,              0, model3_21,      eca, model3_state,           eca, ROT0, "Sega", "Emergency Call Ambulance", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6127GAME( 1999, ecax,           eca, model3_21,      eca, model3_state,           eca, ROT0, "Sega", "Emergency Call Ambulance (Export)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6128GAME( 1999, ecap,           eca, model3_21,      eca, model3_state,           eca, ROT0, "Sega", "Emergency Call Ambulance (US location test?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6122GAME( 1998, spikeout,         0, model3_21_5881, model3,   model3_state, spikeout, ROT0, "Sega", "Spikeout (Revision C)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6123GAME( 1998, spikeofe,         0, model3_21_5881, model3,   model3_state, spikeofe, ROT0, "Sega", "Spikeout Final Edition", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6124GAME( 1998, magtruck,         0, model3_21_5881, eca,      model3_state, magtruck, ROT0, "Sega", "Magical Truck Adventure", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6125GAME( 1999, eca,              0, model3_21_5881, eca,      model3_state, eca,      ROT0, "Sega", "Emergency Call Ambulance", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6126GAME( 1999, ecax,           eca, model3_21_5881, eca,      model3_state, eca,      ROT0, "Sega", "Emergency Call Ambulance (Export)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6127GAME( 1999, ecap,           eca, model3_21_5881, eca,      model3_state, eca,      ROT0, "Sega", "Emergency Call Ambulance (US location test?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
trunk/src/mame/drivers/st_mp200.c
r243094r243095
769769/*--------------------------------
770770/ Split Second #144
771771/-------------------------------*/
772ROM_START(splitsec)
772ROM_START(spltsecp)
773773   ROM_REGION(0x10000, "maincpu", 0)
774774   ROM_LOAD( "cpu_u1.716", 0x1000, 0x0800, CRC(c6ff9aa9) SHA1(39f80faca16c869ac14df7c5fc3dfa80b47dad95))
775775   ROM_LOAD( "cpu_u5.716", 0x1800, 0x0800, CRC(fda74efc) SHA1(31becc243ada23e2f4d17927985772c9fcf8a3c3))
r243094r243095
929929GAME(1980,  nineball,   0,          st_mp200,   mp200, st_mp200_state,   st_mp200,   ROT0, "Stern", "Nine Ball", GAME_IS_SKELETON_MECHANICAL)
930930GAME(1981,  lightnin,   0,          st_mp201,   mp200, st_mp200_state,   st_mp201,   ROT0, "Stern", "Lightning", GAME_IS_SKELETON_MECHANICAL)
931931GAME(1980,  stargzr,    0,          st_mp200,   mp200, st_mp200_state,   st_mp200,   ROT0, "Stern", "Stargazer", GAME_IS_SKELETON_MECHANICAL)
932GAME(1981,  splitsec,   0,          st_mp201,   mp200, st_mp200_state,   st_mp201,   ROT0, "Stern", "Split Second", GAME_IS_SKELETON_MECHANICAL)
932GAME(1981,  spltsecp,   0,          st_mp201,   mp200, st_mp200_state,   st_mp201,   ROT0, "Stern", "Split Second (Pinball)", GAME_IS_SKELETON_MECHANICAL)
933933GAME(1981,  catacomp,   0,          st_mp201,   mp200, st_mp200_state,   st_mp201,   ROT0, "Stern", "Catacomb (Pinball)", GAME_IS_SKELETON_MECHANICAL)
934934GAME(1982,  dragfist,   0,          st_mp200,   mp200, st_mp200_state,   st_mp200,   ROT0, "Stern", "Dragonfist", GAME_IS_SKELETON_MECHANICAL)
935935GAME(1984,  lazrlord,   0,          st_mp200,   mp200, st_mp200_state,   st_mp200,   ROT0, "Stern", "Lazer Lord", GAME_IS_SKELETON_MECHANICAL)
trunk/src/mame/drivers/stv.c
r243094r243095
672672   m_maincpu->sh2drc_add_pcflush(0x60011ba);
673673   m_maincpu->sh2drc_add_pcflush(0x605b9da);
674674
675   install_astrass_protection();
675   install_common_protection();
676676
677677   DRIVER_INIT_CALL(stv);
678678}
r243094r243095
766766   m_maincpu->sh2drc_add_pcflush(0x6026398);
767767   m_slave->sh2drc_add_pcflush(0x6028cd6);
768768
769   install_sss_protection();
769   install_common_protection();
770770
771771   DRIVER_INIT_CALL(stv);
772772
r243094r243095
829829   m_slave->sh2drc_add_pcflush(0x6062bca);
830830
831831   DRIVER_INIT_CALL(stv);
832   install_twcup98_protection();
832   install_common_protection();
833833
834834   m_minit_boost_timeslice = m_sinit_boost_timeslice = attotime::from_usec(5);
835835}
r243094r243095
886886   m_maincpu->sh2drc_add_pcflush(0x604eac0);
887887   m_slave->sh2drc_add_pcflush(0x605340a);
888888
889   install_elandore_protection();
889   install_common_protection();
890890
891891   DRIVER_INIT_CALL(stv);
892892   m_minit_boost_timeslice = m_sinit_boost_timeslice = attotime::from_usec(0);
r243094r243095
897897   m_maincpu->sh2drc_add_pcflush(0x6034d04);
898898   m_slave->sh2drc_add_pcflush(0x6036152);
899899
900   install_rsgun_protection();
900   install_common_protection();
901901
902902   DRIVER_INIT_CALL(stv);
903903
r243094r243095
906906
907907DRIVER_INIT_MEMBER(stv_state,ffreveng)
908908{
909   install_ffreveng_protection();
909   install_common_protection();
910910   DRIVER_INIT_CALL(stv);
911911}
912912
trunk/src/mame/includes/dynax.h
r243094r243095
44
55***************************************************************************/
66#include "machine/msm6242.h"
7#include "sound/2413intf.h"
78#include "sound/msm5205.h"
89#include "sound/okim6295.h"
910
r243094r243095
1213public:
1314   dynax_state(const machine_config &mconfig, device_type type, const char *tag)
1415      : driver_device(mconfig, type, tag),
15         m_dsw_sel16(*this, "dsw_sel16"),
16         m_protection1(*this, "protection1"),
17         m_protection2(*this, "protection2"),
1816         m_maincpu(*this, "maincpu"),
1917         m_soundcpu(*this, "soundcpu"),
18         m_ym2413(*this, "ym2413"),
2019         m_oki(*this, "oki"),
2120         m_msm(*this, "msm"),
2221         m_screen(*this, "screen"),
r243094r243095
2423         m_rtc(*this, "rtc")
2524      { }
2625
26   /* devices */
27   required_device<cpu_device> m_maincpu;
28   optional_device<cpu_device> m_soundcpu;
29   optional_device<ym2413_device> m_ym2413;
30   optional_device<okim6295_device> m_oki;
31   optional_device<msm5205_device> m_msm;
32   optional_device<screen_device> m_screen;
33   required_device<palette_device> m_palette;
34   optional_device<msm6242_device> m_rtc;
35
2736   // up to 8 layers, 2 images per layer (interleaved on screen)
2837   UINT8 *  m_pixmap[8][2];
29   UINT8 *  m_ddenlovr_pixmap[8];
3038
3139   /* irq */
3240   typedef void (dynax_state::*irq_func)();    // some games trigger IRQ at blitter end, some don't
r243094r243095
7684   const int *m_priority_table;
7785   int m_hanamai_priority;
7886
79   /* ddenlovr blitter (TODO: merge with the above, where possible) */
80   int m_extra_layers;
81   int m_ddenlovr_dest_layer;
82   int m_ddenlovr_blit_flip;
83   int m_ddenlovr_blit_x;
84   int m_ddenlovr_blit_y;
85   int m_ddenlovr_blit_address;
86   int m_ddenlovr_blit_pen;
87   int m_ddenlovr_blit_pen_mode;
88   int m_ddenlovr_blitter_irq_flag;
89   int m_ddenlovr_blitter_irq_enable;
90   int m_ddenlovr_rect_width;
91   int m_ddenlovr_rect_height;
92   int m_ddenlovr_clip_width;
93   int m_ddenlovr_clip_height;
94   int m_ddenlovr_line_length;
95   int m_ddenlovr_clip_ctrl;
96   int m_ddenlovr_clip_x;
97   int m_ddenlovr_clip_y;
98   int m_ddenlovr_scroll[8*2];
99   int m_ddenlovr_priority;
100   int m_ddenlovr_priority2;
101   int m_ddenlovr_bgcolor;
102   int m_ddenlovr_bgcolor2;
103   int m_ddenlovr_layer_enable;
104   int m_ddenlovr_layer_enable2;
105   int m_ddenlovr_palette_base[8];
106   int m_ddenlovr_palette_mask[8];
107   int m_ddenlovr_transparency_pen[8];
108   int m_ddenlovr_transparency_mask[8];
109   int m_ddenlovr_blit_latch;
110   int m_ddenlovr_blit_pen_mask;   // not implemented
111   int m_ddenlovr_blit_rom_bits;           // usually 8, 16 in hanakanz
112   const int *m_ddenlovr_blit_commands;
113   int m_ddenlovr_blit_regs[2];
114
11587   /* input */
11688   UINT8 m_input_sel;
11789   UINT8 m_dsw_sel;
r243094r243095
139111   UINT8 m_gekisha_rom_enable;
140112   UINT8 *m_romptr;
141113
142   /* ddenlovr misc (TODO: merge with the above, where possible) */
143   UINT8 m_palram[0x200];
144   int m_okibank;
145   UINT8 m_rongrong_blitter_busy_select;
146
147   optional_shared_ptr<UINT16> m_dsw_sel16;
148   optional_shared_ptr<UINT16> m_protection1;
149   optional_shared_ptr<UINT16> m_protection2;
150   UINT8 m_prot_val;
151   UINT16 m_prot_16;
152   UINT16 m_quiz365_protection[2];
153
154   UINT16 m_mmpanic_leds;  /* A led for each of the 9 buttons */
155   UINT8 m_funkyfig_lockout;
156   UINT8 m_romdata[2];
157   int m_palette_index;
158   UINT8 m_hginga_rombank;
159   UINT8 m_mjflove_irq_cause;
160   UINT8 m_daimyojn_palette_sel;
161
162   int m_irq_count;
163
164
165   /* devices */
166   required_device<cpu_device> m_maincpu;
167   optional_device<cpu_device> m_soundcpu;
168   device_t *m_ymsnd;
169   optional_device<okim6295_device> m_oki;
170   optional_device<msm5205_device> m_msm;
171   optional_device<screen_device> m_screen;
172   required_device<palette_device> m_palette;
173   optional_device<msm6242_device> m_rtc;
174   device_t *m_top_scr;
175   device_t *m_bot_scr;
176114   DECLARE_WRITE8_MEMBER(dynax_vblank_ack_w);
177115   DECLARE_WRITE8_MEMBER(dynax_blitter_ack_w);
178116   DECLARE_WRITE8_MEMBER(jantouki_vblank_ack_w);
r243094r243095
275213   DECLARE_WRITE8_MEMBER(jantouki_blitter2_rev2_w);
276214   DECLARE_WRITE8_MEMBER(hanamai_priority_w);
277215   DECLARE_WRITE8_MEMBER(tenkai_priority_w);
216   
278217   DECLARE_DRIVER_INIT(mjelct3);
279218   DECLARE_DRIVER_INIT(blktouch);
280219   DECLARE_DRIVER_INIT(mjelct3a);
281220   DECLARE_DRIVER_INIT(mjreach);
282221   DECLARE_DRIVER_INIT(maya);
222   
283223   UINT32 screen_update_hanamai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
284224   UINT32 screen_update_hnoridur(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
285225   UINT32 screen_update_sprtmtch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
286226   UINT32 screen_update_mjdialq2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
287227   UINT32 screen_update_jantouki_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
288228   UINT32 screen_update_jantouki_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
229   
289230   INTERRUPT_GEN_MEMBER(sprtmtch_vblank_interrupt);
290231   INTERRUPT_GEN_MEMBER(jantouki_vblank_interrupt);
291232   INTERRUPT_GEN_MEMBER(jantouki_sound_vblank_interrupt);
292233   INTERRUPT_GEN_MEMBER(yarunara_clock_interrupt);
293234   INTERRUPT_GEN_MEMBER(mjelctrn_vblank_interrupt);
235   
294236   TIMER_DEVICE_CALLBACK_MEMBER(neruton_irq_scanline);
295237   TIMER_DEVICE_CALLBACK_MEMBER(majxtal7_vblank_interrupt);
296238   TIMER_DEVICE_CALLBACK_MEMBER(tenkai_interrupt);
239   
297240   void tenkai_update_rombank();
298241   void gekisha_bank_postload();
242   
299243   DECLARE_WRITE_LINE_MEMBER(sprtmtch_sound_callback);
300244   DECLARE_WRITE_LINE_MEMBER(jantouki_sound_callback);
301245   DECLARE_WRITE_LINE_MEMBER(adpcm_int);
r243094r243095
324268   DECLARE_VIDEO_START(mcnpshnt);
325269   DECLARE_PALETTE_INIT(janyuki);
326270   DECLARE_VIDEO_START(neruton);
271   
327272   inline void blitter_plot_pixel( int layer, int mask, int x, int y, int pen, int wrap, int flags );
328273   int blitter_drawgfx( int layer, int mask, const char *gfx, int src, int pen, int x, int y, int wrap, int flags );
329274   void dynax_blitter_start( int flags );
trunk/src/mame/includes/model3.h
r243094r243095
231231   DECLARE_READ64_MEMBER(network_r);
232232   DECLARE_WRITE64_MEMBER(network_w);
233233   DECLARE_READ64_MEMBER(model3_security_r);
234   DECLARE_WRITE64_MEMBER(model3_security_w);
235
236
234237   DECLARE_WRITE64_MEMBER(daytona2_rombank_w);
235238   DECLARE_WRITE16_MEMBER(model3snd_ctrl);
236239   UINT32 pci_device_get_reg();
r243094r243095
243246   DECLARE_DRIVER_INIT(scudplus);
244247   DECLARE_DRIVER_INIT(model3_20);
245248   DECLARE_DRIVER_INIT(bass);
246   DECLARE_DRIVER_INIT(vs2v991);
247249   DECLARE_DRIVER_INIT(vs2);
248250   DECLARE_DRIVER_INIT(daytona2);
249251   DECLARE_DRIVER_INIT(eca);
r243094r243095
260262   DECLARE_DRIVER_INIT(getbass);
261263   DECLARE_DRIVER_INIT(scudplusa);
262264   DECLARE_DRIVER_INIT(dirtdvls);
263   DECLARE_DRIVER_INIT(vs299b);
264265   DECLARE_DRIVER_INIT(vf3);
265266   DECLARE_DRIVER_INIT(von2);
266   DECLARE_DRIVER_INIT(vs299a);
267267   DECLARE_DRIVER_INIT(lostwsga);
268268   DECLARE_DRIVER_INIT(oceanhun);
269269   DECLARE_DRIVER_INIT(dayto2pe);
trunk/src/mame/includes/stv.h
r243094r243095
701701      : saturn_state(mconfig, type, tag),
702702      m_adsp(*this, "adsp"),
703703      m_adsp_pram(*this, "adsp_pram"),
704      m_cryptdevice(*this, "315_5881"),
705      m_using_crypt_device(0)
704      m_cryptdevice(*this, "315_5881")
706705   {
707706   }
708707
r243094r243095
799798
800799   // protection specific variables and functions (see machine/stvprot.c)
801800   UINT32 m_abus_protenable;
802   UINT32 m_abus_prot_addr;
803801   UINT32 m_abus_protkey;
804802
805803   UINT32 m_a_bus[4];
806   UINT32 m_ctrl_index;
807   UINT32 m_internal_counter;
808   UINT8 m_char_offset; //helper to jump the decoding of the NULL chars.
809804
810   UINT32 (*m_prot_readback)(address_space&,int,UINT32);
811
812805   DECLARE_READ32_MEMBER( common_prot_r );
813806   DECLARE_WRITE32_MEMBER( common_prot_w );
814807
815808   void install_common_protection();
816
817   void install_twcup98_protection();
818   void install_sss_protection();
819   void install_astrass_protection();
820   void install_rsgun_protection();
821   void install_elandore_protection();
822   void install_ffreveng_protection();
823
824809   void stv_register_protection_savestates();
825810
826811   // Decathlete specific variables and functions (see machine/decathlt.c)
r243094r243095
840825
841826   optional_device<sega_315_5881_crypt_device> m_cryptdevice;
842827   UINT16 crypt_read_callback(UINT32 addr);
843   int m_using_crypt_device;
844828};
845829
846830
trunk/src/mame/machine/315-5881_crypt.c
r243094r243095
234234
235235      {
236236         {
237            2,2,2,3,1,1,0,1,0,1,2,2,3,3,0,2,0,3,2,3,3,0,2,1,0,3,1,0,0,2,3,2,
238            3,2,0,3,2,0,1,0,3,3,1,1,2,2,2,0,2,1,3,1,1,1,1,2,2,2,3,0,1,3,0,0,
237            2,2,2,3,1,1,0,1,3,3,1,1,2,2,2,0,0,3,2,3,3,0,2,1,2,2,3,0,1,3,0,0,
238            3,2,0,3,2,0,1,0,0,1,2,2,3,3,0,2,2,1,3,1,1,1,1,2,0,3,1,0,0,2,3,2,
239239         },
240         {1,2,5,6,7,-1},
240         {1,2,5,6,7,6},
241241         {2,7}
242242      },
243243
r243094r243095
341341
342342      {
343343         {
344            0,2,3,2,1,1,0,0,2,1,0,3,3,0,0,0,3,2,0,2,1,1,2,1,0,0,3,1,2,2,3,1,
345            3,1,3,0,0,0,1,3,1,0,0,3,2,2,3,1,1,3,0,0,2,1,3,3,1,3,1,2,3,1,2,1,
344            0,1,3,0,1,1,2,3,2,0,0,3,2,1,3,1,3,3,0,0,1,0,0,3,0,3,3,2,3,2,0,1,
345            3,2,3,2,2,1,3,1,1,1,0,3,3,2,2,1,1,2,0,2,0,1,1,0,1,0,1,1,2,0,3,0,
346346         },
347         {0,3,5,6,-1,-1},
347         {0,3,5,6,5,0},
348348         {1,2}
349349      },
350350
r243094r243095
387387
388388      {
389389         {
390            1,2,3,2,0,3,2,3,0,1,1,0,0,2,2,3,2,0,0,3,0,2,3,3,2,2,1,0,2,1,0,3,
391            1,0,2,0,1,1,0,1,0,0,1,0,3,0,3,3,2,2,0,2,1,1,1,0,3,0,1,3,2,3,2,1,
390            1,0,3,0,0,1,2,1,0,0,1,0,0,0,2,3,2,2,0,2,0,1,3,0,2,0,1,3,2,3,0,1,
391            1,2,2,2,1,3,0,3,0,1,1,0,3,2,3,3,2,0,0,3,1,2,1,3,3,2,1,0,2,1,2,3,
392392         },
393         {2,3,4,6,7,-1},
393         {2,3,4,6,7,2},
394394         {2,3}
395395      },
396396
r243094r243095
406406   {   // 3rd round
407407      {
408408         {
409            0,3,0,1,0,2,3,3,1,0,1,3,2,2,1,1,3,3,3,0,2,0,2,0,0,0,2,3,1,1,0,0,
410            3,3,0,3,3,0,0,2,1,1,1,0,2,2,2,0,3,0,3,1,2,2,0,3,0,0,3,2,0,3,2,1,
409            0,3,0,1,3,0,0,2,1,0,1,3,2,2,2,0,3,3,3,0,2,2,0,3,0,0,2,3,0,3,2,1,
410            3,3,0,3,0,2,3,3,1,1,1,0,2,2,1,1,3,0,3,1,2,0,2,0,0,0,3,2,1,1,0,0,
411411         },
412         {1,4,5,6,7,-1},
412         {1,4,5,6,7,5},
413413         {0,5}
414414      },
415415
r243094r243095
424424
425425      {
426426         {
427            2,2,3,2,0,3,2,3,1,1,2,0,2,3,1,3,0,0,0,3,2,0,1,0,1,3,2,3,3,3,1,0,
427            2,2,0,3,0,3,1,0,1,1,2,3,2,3,1,0,0,0,3,2,2,0,2,3,1,3,2,0,3,3,1,3,           
428428            // unused?
429429            255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
430430         },
431         {1,2,4,7,-1,-1},
431         {1,2,4,7,2,-1},
432432         {2,4}
433433      },
434434
r243094r243095
481481};
482482
483483const int sega_315_5881_crypt_device::fn1_game_key_scheduling[FN1GK][2] = {
484    {1,29},  {1,71},  {2,4},   {2,54},  {3,8},   {4,56},  {4,73},  {5,11},
485    {6,51},  {7,92},  {8,89},  {9,9},   {9,39},  {9,41},  {9,58},  {9,86},
486    {10,90}, {11,6},  {12,64}, {13,49}, {14,44}, {15,40}, {16,69}, {17,15},
487    {18,23}, {18,43}, {19,82}, {20,81}, {21,32}, {22,5},  {23,66}, {24,13},
488   {24,45}, {25,12}, {25,35}, {26,61}, {27,10}, {27,59}, {28,25}
484   {1,29},  {1,71},  {2,4},   {2,54},  {3,8},   {4,56},  {4,73},  {5,11},
485   {6,51},  {7,92},  {8,89},  {9,9},   {9,39},  {9,58},  {9,86},  {10,90},
486   {11,6},  {12,64}, {13,49}, {14,44}, {15,40}, {16,69}, {17,15}, {18,23},
487   {18,43}, {19,82}, {20,81}, {21,32}, {22,5},  {23,66}, {24,13}, {24,45},
488   {25,12}, {25,35}, {26,61}, {27,10}, {27,59}, {28,25}
489489};
490490
491491const int sega_315_5881_crypt_device::fn2_game_key_scheduling[FN2GK][2] = {
492    {0,0},   {1,3},   {2,11},  {3,20},  {4,22},  {5,23},  {6,29},  {7,38},
493    {8,39},  {9,55},  {9,86},  {9,87},  {9,90},  {10,50}, {10,53}, {11,57},
494    {12,59}, {13,61}, {13,64}, {14,63}, {15,67}, {16,72}, {17,83}, {18,88},
495    {19,94}, {20,35}, {21,17}, {22,6},  {22,11}, {23,85}, {24,16}, {25,25},
496   {26,92}, {27,47}, {28,28}
492   {0,0},   {1,3},   {2,11},  {3,20},  {4,22},  {5,23},  {6,29},  {7,38},
493   {8,39},  {9,55},  {9,86},  {9,87},  {9,90},  {10,50}, {11,57}, {12,59},
494   {13,61}, {14,63}, {15,67}, {16,72}, {17,83}, {18,88}, {19,94}, {20,35},
495   {21,17}, {22,6},  {23,85}, {24,16}, {25,25}, {26,92}, {27,47}, {28,28}
497496};
498497
499498const int sega_315_5881_crypt_device::fn1_sequence_key_scheduling[20][2] = {
r243094r243095
583582      }
584583   }
585584
586   // subkeys bits 10 & 41
587   fn2_subkeys[0] ^= (BIT(sequence_key, 2) << 10);
588   fn2_subkeys[1] ^= (BIT(sequence_key, 4) << 17);
589585   /**************************************************************/
590586
591587   // First Feistel Network
trunk/src/mame/machine/315-5881_crypt.h
r243094r243095
7474   static const sbox fn1_sboxes[4][4];
7575   static const sbox fn2_sboxes[4][4];
7676
77   static const int FN1GK = 39;
78   static const int FN2GK = 35;
77   static const int FN1GK = 38;
78   static const int FN2GK = 32;
7979   static const int fn1_game_key_scheduling[FN1GK][2];
8080   static const int fn2_game_key_scheduling[FN2GK][2];
8181   static const int fn1_sequence_key_scheduling[20][2];
trunk/src/mame/machine/315-5881_helper.c
r243094r243095
128128   { "dynamcopb",       0x0c2a4a93 }, //             1998     317-0236-COM   Model 2
129129   { "dyndeka2b",       0x0c2a4a93 }, //             1998     317-0236-COM   Model 2
130130   { "dynamcopc",       0x0c2a4a93 }, //             1998     317-0236-COM   Model 2
131   { "pltkids",         -1         }, //             1998     317-5044-COM   Model 2
132   { "pltkidsa",        -1         }, //             1998     317-5044-COM   Model 2
133131   { "zerogun",         -1         }, //             1997     317-5038-COM   Model 2  // lowest numbered chip?
134132   { "zerogunj",        -1         }, //             1997     317-5038-COM   Model 2 
135133   { "zeroguna",        -1         }, //             1997     317-5038-COM   Model 2 
136134   { "zerogunaj",       -1         }, //             1997     317-5038-COM   Model 2 
135   { "pltkids",         -1         }, //             1998     317-5044-COM   Model 2
136   { "pltkidsa",        -1         }, //             1998     317-5044-COM   Model 2
137137
138
138   { "magtruck",        0x09266e45 }, //             ????     ?              Model 3
139   { "von2",            0x092a0e97 }, //             ????     317-0234-COM   Model 3
140   { "von254g",         0x092a0e97 }, //             ????     317-0234-COM   Model 3
141   { "fvipers2",        -1         }, //             ????     317-0235-COM   Model 3
139142   { "vs298",           0x09234e96 }, //             ????     317-0237-COM   Model 3
143   { "dirtdvls",        0x09290f17 }, //             ????     317-0238-COM   Model 3
144   { "dirtdvlsa",       0x09290f17 }, //             ????     317-0238-COM   Model 3
145   { "daytona2",        0x09250e16 }, //             ????     317-0239-COM   Model 3
146   { "spikeout",        -1         }, //             ????     317-0240-COM   Model 3
147   { "spikeofe",        -1         }, //             ????     ?317-0240-COM? Model 3
140148   { "swtrilgy",        0x11272a01 }, //             ????     317-0241-COM   Model 3
141149   { "swtrilgya",       0x11272a01 }, //             ????     317-0241-COM   Model 3
150   { "oceanhun",        0x092b6a01 }, //             ????     317-0242-COM   Model 3
151   { "lamachin",        0x092a2bc5 }, //             ????     317-0244-COM   Model 3
142152   { "vs299",           0x09222ac8 }, //             ????     317-0245-COM   Model 3
143
144
153   { "vs2v991",         0x09222ac8 }, //             ????     317-0245-COM   Model 3
154   { "vs299b",          0x09222ac8 }, //             ????     317-0245-COM   Model 3
155   { "vs299a",          0x09222ac8 }, //             ????     317-0245-COM   Model 3
156   { "eca",             0x0923aa91 }, //             ????     317-0265-COM   Model 3
157   { "ecax",            0x0923aa91 }, //             ????     317-0265-COM   Model 3
158   { "ecap",            0x0923aa91 }, //             ????     317-0265-COM   Model 3
159   { "dayto2pe",        -1         }, //             ????     317-5045-COM   Model 3
160   
145161   { NULL, 0 }    // end of table
146162};
147163
trunk/src/mame/machine/stvprot.c
r243094r243095
1/* ST-V protection stuff */
1/* ST-V hookup for 315-5881 encryption/compression chip */
22
33/*
44
r243094r243095
1111 Steep Slope Sliders (gfx transfer of character portraits)
1212 Tecmo World Cup '98 (tecmo logo, player movement)
1313
14 I think this is an encryption device.  Decathlete is also protected, but uses a different device
15 see machine/decathlt.c for details of that one, unlike this that appears to perform decompression
16 operations.
17
18
19 Astra Superstars data were extracted from Saturn version of the game. It is not known if
20 protection device has data stored inside, or they are read from roms (using decryption/decompression)
21
2214*/
2315
24/****************************************************************************************
25
26Protection & cartridge handling
27
28*****************************************************************************************
29
30These are the known ST-V games that uses this area as a valid protection,I have written
31the data used by the games in the various circumstances for reference:
32-Astra Super Stars [astrass]
33 [0]        [1]        [2]        [3]
34 0x000y0000 0x00000000 0x06130027 0x01230000 test mode,char transfer (3)
35 0x???????? 0x???????? 0x???????? 0x???????? attract mode
36 0x000y0000 0x00000000 0x06130027 0x01230000 gameplay,char transfer (3)
37
38-Elan Doree : Legend of Dragon [elandore]
39 [0]        [1]        [2]        [3]
40 No protection                               test mode
41 No protection                               attract mode
42 0x000y0000 0x00000000 0x****00** 0xff7f0000 gameplay,VDP-1 write (textures on humans)
43 0x000y0000 0x00000000 0x****00** 0xffbf0000 gameplay,VDP-1 write (textures on humans)
44
45 0x000y0000 0x00000000 0x****00** 0xf9ff0000 gameplay,VDP-1 write (textures on dragons)
46 0x000y0000 0x00000000 0x****00** 0xfbff0000 gameplay,VDP-1 write (textures on dragons)
47 0x000y0000 0x00000000 0x****00** 0xfe7f0000 gameplay,VDP-1 write (textures on dragons)
48 0x000y0000 0x00000000 0x****00** 0xfd7f0000 gameplay,VDP-1 write (textures on dragons)
49 0x000y0000 0x00000000 0x****00** 0xfeff0000 gameplay,VDP-1 write (textures on dragons)
50 0x000y0000 0x00000000 0x****00** 0xf9bf0000 gameplay,VDP-1 write (textures on dragons)
51
52-Final Fight Revenge [ffreveng]
53 [0]        [1]        [2]        [3]
54 0x000y0000 0x00000000 0x4bcc0013 0x10da0000 test mode,boot vectors at $06080000
55 0x000y0000 0x00000000 0x0b780013 0x10d70000 attract mode,boot vectors at $06080000
56 0x???????? 0x???????? 0x???????? 0x???????? gameplay
57
58-Radiant Silvergun [rsgun]
59 [0]        [1]        [2]        [3]
60 No protection                               test mode
61 0x000y0000 0x00000000 0x08000010 0x77770000 attract mode,work ram-h $60ff1ec and so on (1)
62 0x???????? 0x???????? 0x???????? 0x???????? gameplay
63
64-Steep Slope Sliders [sss]
65 [0]        [1]        [2]        [3]
66 No protection                               test mode
67*0x000y0000 0x00000000 0x000000a6 0x2c5b0000 attract mode,VDP-1 write
68*0x000y0000 0x00000000 0x000000a6 0x2c5b0000 gameplay,VDP-1 write character 1 (2)
69*0x000y0000 0x00000000 0x0f9800a6 0x47f10000 gameplay,VDP-1 write character 2
70*0x000y0000 0x00000000 0x1d4800a6 0xfcda0000 gameplay,VDP-1 write character 3
71*0x000y0000 0x00000000 0x29e300a6 0xb5e60000 gameplay,VDP-1 write character 4
72*0x000y0000 0x00000000 0x38e900a6 0x392c0000 gameplay,VDP-1 write character 5
73*0x000y0000 0x00000000 0x462500a6 0x77c30000 gameplay,VDP-1 write character 6
74*0x000y0000 0x00000000 0x555c00a6 0x8a620000 gameplay,VDP-1 write character 7
75
76=========================================================================================
77y = setted as a 0,then after the ctrl data is moved is toggled to 1 then again toggled
78    to 0 after the reading,this bit is likely to be a "calculate protection values"
79    if 1,use normal ram if 0.
80* = working checks
81[3,low word]AFAIK this is the cartridge area and it's read-only.
82(1)That area is usually (but not always) used as system registers.
83(2)Same as P.O.S.T. check,it was really simple to look-up because of that.
84(3)Wrong offset,or it requires something else like a bitswap?
85=========================================================================================
86Protection works as a sort of data transfer,it could also be that it uses
87encryption on the data used...
88
89For now I'm writing this function with a command basis so I can work better with it.
90****************************************************************************************/
91
9216#include "emu.h"
9317#include "includes/stv.h"
9418
95//FILE *fp;
96//FILE *fp2;
9719
9820
99/************************
100*
101* Tecmo World Cup '98
102*
103************************/
10421
105/*
106 0x200214
107 0x20de94
108 wpset 0x200214,0x20de94-0x200214,r
109 dump twcup98.dmp,0x200214,0x20de94-0x200214,4,0,0
110 protection tests the data 0x201220 at
111 bp 0x6009a9e
112 with 0x60651f8
113 */
11422
115
116//MAIN : 12120000  DATA : 0ad20069 Tecmo logo
117//MAIN : 12120000  DATA : e332006b title screen
118// TODO: encrypted / compressed data.
119// Both points to a section that has a string ("TECMO" / "TITLE")
120
121
122/*************************
123*
124* Final Fight Revenge
125*
126*************************/
127
128/*
129ffreveng protection notes
130Global:
131R2 is the vector read (where to jump to)
132R3 is the vector pointer
133
134Directory listing for Final Fight Revenge (Saturn Version):
135
136In the ST-V version, most of these file names could be found at relative address 0x346a0 (0x22346a0)
137Also, there's a table at 0x260000 (0x2260000), this points to offsets to the ROM (and are sent to the protection device),
138and the size of it
139
140fad      size     file name   date
141000000aa 00003000  2000/2/8
142000000aa 00003000 ? 2000/2/8
143000000b0 00076080 0;1 2000/2/8
1440001799e 014b2000 ALY.RED;1 1999/11/9
14500002350 00001900 ALYHRAM.BIN;1 2000/2/8
1460000040e 00005204 ANDEND.BIN;1 1999/11/9
147000001a0 0000c700 ANDORE.BIN;1 2000/2/8
148000003c8 00016938 ANDORE.CRT;1 1999/11/9
149000001b9 000f3528 ANDOREM.BIN;1 2000/2/8
15000003525 012db000 ATN.RED;1 1999/11/9
151000024e6 00001900 ATNHRAM.BIN;1 2000/2/8
15200013291 0120d000 ATO.RED;1 1999/11/9
153000024a0 00001100 ATOHRAM.BIN;1 2000/2/8
15400000419 0000f000 BELGER.BIN;1 2000/2/8
155000005f0 00013bdc BELGER.CRT;1 1999/11/9
15600000437 000ce990 BELGERM.BIN;1 2000/2/8
15700002611 00000894 BURGR.BIN;1 2000/2/8
15800002605 00000638 CAFFE.BIN;1 2000/2/8
1590000273b 000022e0 CAPCOM.BIN;1 1999/11/9
16000001d9a 00012100 CAPHRAM.BIN;1 2000/2/8
16100000834 00004cec CDYEND.BIN;1 1999/11/9
1620000218a 00005900 CHSHRAM.BIN;1 2000/2/8
1630000061a 0000b900 CODY.BIN;1 2000/2/8
16400000809 00014e00 CODY.CRT;1 1999/11/9
16500002857 000ff412 CODYANIM.BIN;1 1999/11/9
16600002a56 00011dbc CODYAPAL.BIN;1 1999/11/9
16700000632 000d31cc CODYM.BIN;1 2000/2/8
16800002619 0000046c CURRY.BIN;1 2000/2/8
16900000b36 00005110 DAMEND.BIN;1 1999/11/9
1700000083e 0000b300 DAMND.BIN;1 2000/2/8
17100000aa6 000181ae DAMND.CRT;1 1999/11/9
17200000855 0010c674 DAMNDM.BIN;1 2000/2/8
17300000ad9 000063c0 DDAD.BIN;1 1999/11/9
17400000b2c 00004a30 DDBL.BIN;1 1999/11/9
17500000b25 000034b4 DDCD.BIN;1 1999/11/9
17600000ae6 00004c6c DDDM.BIN;1 1999/11/9
17700000b1c 00004660 DDED.BIN;1 1999/11/9
17800000b15 00003770 DDEL.BIN;1 1999/11/9
17900000b0e 00003268 DDGY.BIN;1 1999/11/9
18000000b06 00003c74 DDHG.BIN;1 1999/11/9
18100000b00 000029a8 DDPS.BIN;1 1999/11/9
18200000af9 000035e4 DDRL.BIN;1 1999/11/9
18300000af0 000044a8 DDSD.BIN;1 1999/11/9
1840000217a 00007d00 DEMHRAM.BIN;1 2000/2/8
1850000278e 00064396 DLOOP.CRT;1 1999/11/9
18600000b41 0000e200 EDDIE.BIN;1 2000/2/8
18700000d25 00019a44 EDDIE.CRT;1 1999/11/9
18800000b5e 000c7758 EDDIEM.BIN;1 2000/2/8
18900000d5a 00005204 EDIEND.BIN;1 1999/11/9
19000000d65 0000d700 ELGADO.BIN;1 2000/2/8
19100001010 00018b2e ELGADO.CRT;1 1999/11/9
19200000d80 0012ec64 ELGADOM.BIN;1 2000/2/8
19300001043 00005204 ELGEND.BIN;1 1999/11/9
19400001d79 0000e5ec ENDING.BIN;1 1999/11/9
19500002bc3 0002e8f4 ENDING.CRT;1 1999/11/9
1960000019e 0000005d FFEXABS.TXT;1 1999/11/9
1970000019f 00000060 FFEXBIB.TXT;1 1999/11/9
1980000019d 00000032 FFEXCPY.TXT;1 1999/11/9
19900002615 0000062c FRIES.BIN;1 2000/2/8
20000001ce1 0004b8b4 GAMEL.BIN;1 1999/11/9
201000003f6 000011fc GANDRE.BIN;1 1999/11/9
2020000040b 00001246 GBEL.BIN;1 1999/11/9
203000003f9 00000af3 GCODY.BIN;1 1999/11/9
204000003fb 00000cc4 GDAM.BIN;1 1999/11/9
205000003fd 00000f6a GEDDIE.BIN;1 1999/11/9
206000003ff 00000c85 GGADO.BIN;1 1999/11/9
20700000401 00000d4c GGUY.BIN;1 1999/11/9
20800000403 00000f16 GHAG.BIN;1 1999/11/9
20900000405 00000a63 GPOISON.BIN;1 1999/11/9
21000000407 00000a85 GROL.BIN;1 1999/11/9
21100005b71 01156000 GRV.RED;1 1999/11/9
2120000243b 00001600 GRVHRAM.BIN;1 2000/2/8
21300000409 00000dad GSODOM.BIN;1 1999/11/9
2140000104e 0000c300 GUY.BIN;1 2000/2/8
2150000123a 00014844 GUY.CRT;1 1999/11/9
21600001266 00005204 GUYEND.BIN;1 1999/11/9
21700001067 000d14aa GUYM.BIN;1 2000/2/8
21800001271 0000c600 HAGGAR.BIN;1 2000/2/8
21900001489 00017ad8 HAGGAR.CRT;1 1999/11/9
2200000128a 000e46fc HAGGARM.BIN;1 2000/2/8
221000014bb 00005204 HGREND.BIN;1 1999/11/9
22200002740 0001b468 HISCORE.BIN;1 1999/11/9
22300002777 00000a00 HISCP.BIN;1 1999/11/9
22400002779 000086c0 HISCTEX.BIN;1 1999/11/9
2250000278b 00001680 HSFACE_T.BIN;1 1999/11/9
22600002607 00000618 HTDOG.BIN;1 2000/2/8
22700015741 010e3800 JNK.RED;1 1999/11/9
228000023cd 00001900 JNKHRAM.BIN;1 2000/2/8
22900002d0b 0003dfc0 KANJI.FON;1 1999/11/9
23000001d98 00000d44 LOAD.BIN;1 1999/11/9
23100001dbf 001dd5a8 LOGO.CPK;1 1999/11/9
23200002d0a 00000400 LVLHRAM.BIN;1 2000/2/8
2330000260a 000005e8 MEAT.BIN;1 2000/2/8
23400007eb3 01253800 MLK.RED;1 1999/11/9
23500002196 00000d00 MLKHRAM.BIN;1 2000/2/8
2360000278a 00000400 NAMEP.BIN;1 1999/11/9
2370000a3f0 011b8000 NPK.RED;1 1999/11/9
238000022d0 00002700 NPKHRAM.BIN;1 2000/2/8
23900010dc0 0121d800 NUK.RED;1 1999/11/9
24000002555 00001100 NUKHRAM.BIN;1 2000/2/8
24100002c21 00036f94 OVER.CRT;1 1999/11/9
242000014c6 0000ab00 POISON.BIN;1 2000/2/8
243000017f1 00018880 POISON.CRT;1 1999/11/9
244000014dc 0017617c POISONM.BIN;1 2000/2/8
2450000c7f6 01166000 PRK.RED;1 1999/11/9
24600002268 00001100 PRKHRAM.BIN;1 2000/2/8
24700002a82 00003940 PSCBCHR.BIN;1 1999/11/9
24800002a8a 00002000 PSCBMAP.BIN;1 1999/11/9
24900002a92 00000ac0 PSCRTEX.BIN;1 1999/11/9
25000002a7b 000033c0 PSFCCHR.BIN;1 1999/11/9
25100001824 000049d4 PSNEND.BIN;1 1999/11/9
25200002a8e 00001e54 PSNMCHR.BIN;1 1999/11/9
25300002a94 000037c0 PSSBCHR.BIN;1 1999/11/9
25400002a9b 00002000 PSSBMAP.BIN;1 1999/11/9
25500002a9f 00000200 PSSBPAL.BIN;1 1999/11/9
25600002a7a 00000600 PS_PAL.BIN;1 1999/11/9
25700002c8f 0003d4c0 RESIDENT.CRT;1 1999/11/9
25800001c68 0003ae40 RESTEXT.BIN;1 1999/11/9
25900001cde 00001220 RESTEXTB.BIN;1 1999/11/9
26000001d97 00000200 RETIMEPA.BIN;1 1999/11/9
2610000261b 000004e8 REVNG.BIN;1 1999/11/9
26200001a5b 00005204 ROLEND.BIN;1 1999/11/9
2630000182e 0000e700 ROLENTO.BIN;1 2000/2/8
26400001a2d 00016bfc ROLENTO.CRT;1 1999/11/9
2650000184b 000d6bf0 ROLENTOM.BIN;1 2000/2/8
266000025c5 000062e4 SDDRVS.TSK;1 1999/11/9
26700002eb3 002ee000 SEGA_WRN.DA;1 1998/4/30
26800002b82 00020492 SELECT.CRT;1 1999/11/9
26900002aa0 00070e04 SODBTEX.BIN;1 1999/11/9
27000001c5d 00005154 SODEND.BIN;1 1999/11/9
27100001a66 0000b100 SODOM.BIN;1 2000/2/8
27200001c29 0001943a SODOM.CRT;1 1999/11/9
27300001a7d 000b9e2f SODOMM.BIN;1 2000/2/8
2740000260d 000004cc SUSHI.BIN;1 2000/2/8
2750000261c 0008f204 TITLE.BIN;1 1999/11/9
2760000eb58 010e9000 WHS.RED;1 1999/11/9
277000021ff 00001100 WHSHRAM.BIN;1 2000/2/8
278000003a0 00009b90 _ADCL00.BIN;1 1999/11/9
279000003b4 00009b90 _ADCL01.BIN;1 1999/11/9
280000023cb 00000c54 _ALYBMAP.BIN;1 1999/11/9
2810000239b 00017ec0 _ALYFCHR.BIN;1 1999/11/9
28200002399 00000c1a _ALYFMAP.BIN;1 1999/11/9
28300002354 00000600 _ALYPAL.BIN;1 1999/11/9
2840000235a 0001f400 _ALYRCHR.BIN;1 1999/11/9
28500002355 0000205c _ALYRMAP.BIN;1 1999/11/9
2860000252a 00015800 _ATNBCHR.BIN;1 1999/11/9
28700002526 00001882 _ATNBMAP.BIN;1 1999/11/9
28800002525 00000416 _ATNFMAP.BIN;1 1999/11/9
289000024ea 00000600 _ATNPAL.BIN;1 1999/11/9
290000024ef 0001af00 _ATNRCHR.BIN;1 1999/11/9
291000024eb 00001d10 _ATNRMAP.BIN;1 1999/11/9
292000024e3 000017fa _ATOBMAP.BIN;1 1999/11/9
293000024e2 00000040 _ATOFCHR.BIN;1 1999/11/9
294000024e1 00000006 _ATOFMAP.BIN;1 1999/11/9
295000024a3 00000600 _ATOPAL.BIN;1 1999/11/9
296000024a9 0001bbc0 _ATORCHR.BIN;1 1999/11/9
297000024a4 00002004 _ATORMAP.BIN;1 1999/11/9
29800000618 00000a20 _BGUNTX.BIN;1 1999/11/9
299000005d5 0000d688 _BLTXURE.BIN;1 1999/11/9
30000002613 00000a80 _BURGRTX.BIN;1 1999/11/9
30100002606 000006c0 _CAFFETX.BIN;1 1999/11/9
302000007d9 0000bdb0 _CDCL00.BIN;1 1999/11/9
303000007f1 0000bdb0 _CDCL01.BIN;1 1999/11/9
30400000ad7 000008a0 _CHSAWTX.BIN;1 1999/11/9
305000025e3 00003500 _CRAT2TX.BIN;1 1999/11/9
306000025ea 00002200 _CRAT3TX.BIN;1 1999/11/9
307000025d5 00003300 _CRATDTX.BIN;1 1999/11/9
308000025dc 00003300 _CRATNTX.BIN;1 1999/11/9
3090000261a 00000500 _CURRYTX.BIN;1 1999/11/9
31000000a6e 0000d918 _DMCL00.BIN;1 1999/11/9
31100000a8a 0000d918 _DMCL01.BIN;1 1999/11/9
312000025ef 00001b60 _DRUMTX.BIN;1 1999/11/9
31300000ced 0000da3c _EDCL00.BIN;1 1999/11/9
31400000d09 0000da3c _EDCL01.BIN;1 1999/11/9
31500000fde 0000c404 _ELCL00.BIN;1 1999/11/9
31600000ff7 0000c404 _ELCL01.BIN;1 1999/11/9
31700002616 000011a0 _FRIESTX.BIN;1 1999/11/9
31800001d96 00000660 _GFNTCHR.BIN;1 1999/11/9
31900001264 00000880 _GKATATX.BIN;1 1999/11/9
32000002488 0000bcc0 _GRVBCHR.BIN;1 1999/11/9
32100002486 00000d76 _GRVBMAP.BIN;1 1999/11/9
32200002483 000010fc _GRVFMAP.BIN;1 1999/11/9
3230000243e 00000600 _GRVPAL.BIN;1 1999/11/9
32400002444 0001f4c0 _GRVRCHR.BIN;1 1999/11/9
3250000243f 00002004 _GRVRMAP.BIN;1 1999/11/9
3260000120a 0000bf44 _GYCL00.BIN;1 1999/11/9
32700001222 0000bf44 _GYCL01.BIN;1 1999/11/9
32800001453 0000d614 _HGCL00.BIN;1 1999/11/9
3290000146e 0000d614 _HGCL01.BIN;1 1999/11/9
33000002608 00000880 _HTDOGTX.BIN;1 1999/11/9
331000025f3 00002b60 _ICEBTX.BIN;1 1999/11/9
33200001042 00000560 _JKNFTX.BIN;1 1999/11/9
33300002419 00010940 _JNKBCHR.BIN;1 1999/11/9
33400002417 00000982 _JNKBMAP.BIN;1 1999/11/9
33500002414 0000113a _JNKFMAP.BIN;1 1999/11/9
336000023d1 00000600 _JNKPAL.BIN;1 1999/11/9
337000023d6 0001ee80 _JNKRCHR.BIN;1 1999/11/9
338000023d2 00001bde _JNKRMAP.BIN;1 1999/11/9
339000025d4 000006c0 _KATA2TX.BIN;1 1999/11/9
34000001c5c 00000780 _KATANTX.BIN;1 1999/11/9
3410000260b 00000cc0 _MEATTX.BIN;1 1999/11/9
342000021dd 00010e80 _MLKBCHR.BIN;1 1999/11/9
343000021db 00000be6 _MLKBMAP.BIN;1 1999/11/9
344000021d9 00000f70 _MLKFMAP.BIN;1 1999/11/9
34500002198 00000600 _MLKPAL.BIN;1 1999/11/9
3460000219c 0001e440 _MLKRCHR.BIN;1 1999/11/9
34700002199 000013de _MLKRMAP.BIN;1 1999/11/9
3480000234d 00001416 _NPKBMAP.BIN;1 1999/11/9
3490000231d 00017dc0 _NPKFCHR.BIN;1 1999/11/9
3500000231a 00001406 _NPKFMAP.BIN;1 1999/11/9
351000022d5 00000600 _NPKPAL.BIN;1 1999/11/9
352000022db 0001f640 _NPKRCHR.BIN;1 1999/11/9
353000022d6 00002202 _NPKRMAP.BIN;1 1999/11/9
3540000259a 000153c0 _NUKBCHR.BIN;1 1999/11/9
35500002596 00001924 _NUKBMAP.BIN;1 1999/11/9
35600002594 00000f6e _NUKFMAP.BIN;1 1999/11/9
35700002558 00000600 _NUKPAL.BIN;1 1999/11/9
3580000255e 0001adc0 _NUKRCHR.BIN;1 1999/11/9
35900002559 00002004 _NUKRMAP.BIN;1 1999/11/9
360000025d3 000005a0 _NYOIBTX.BIN;1 1999/11/9
361000025f9 000039e0 _OILCTX.BIN;1 1999/11/9
362000014b9 00000b40 _PIPETX.BIN;1 1999/11/9
36300001823 00000600 _POISNTX.BIN;1 1999/11/9
364000022cc 000018fc _PRKBMAP.BIN;1 1999/11/9
365000022ac 0000fd00 _PRKFCHR.BIN;1 1999/11/9
366000022a8 00001d4a _PRKFMAP.BIN;1 1999/11/9
3670000226b 00000600 _PRKPAL.BIN;1 1999/11/9
36800002271 0001b0c0 _PRKRCHR.BIN;1 1999/11/9
3690000226c 00002202 _PRKRMAP.BIN;1 1999/11/9
370000017c9 00009874 _PSCL00.BIN;1 1999/11/9
371000017dd 00009874 _PSCL01.BIN;1 1999/11/9
37200000d59 00000180 _PSTKTX.BIN;1 1999/11/9
373000019f9 0000cb2c _RLCL00.BIN;1 1999/11/9
37400001a13 0000cb2c _RLCL01.BIN;1 1999/11/9
37500001bf1 0000dd0c _SDCL00.BIN;1 1999/11/9
37600001c0d 0000dd0c _SDCL01.BIN;1 1999/11/9
37700000833 00000660 _SKNFTX.BIN;1 1999/11/9
378000025d2 00000240 _SPIKETX.BIN;1 1999/11/9
3790000260e 000011e0 _SUSHITX.BIN;1 1999/11/9
38000002601 00001ba0 _TOMBTX.BIN;1 1999/11/9
3810000224b 0000e2c0 _WHSBCHR.BIN;1 1999/11/9
38200002249 00000a36 _WHSBMAP.BIN;1 1999/11/9
38300002245 00001bb8 _WHSFMAP.BIN;1 1999/11/9
38400002202 00000600 _WHSPAL.BIN;1 1999/11/9
38500002207 0001efc0 _WHSRCHR.BIN;1 1999/11/9
38600002203 00001cf4 _WHSRMAP.BIN;1 1999/11/9
387*/
388
389
390
391
392
393
394
395UINT32 rsgun_prot_read_callback( address_space &space, int protaddr, UINT32 key )
396{
397   int tempctrl = protaddr - 0x0201000; // technically it doesn't seem to care, but...
398
399   switch(key)
400   {
401      case 0x77770000:
402      {
403         UINT32 val =
404            ((tempctrl & 0xff)<<24) |
405            (((tempctrl+1) & 0xff)<<16) |
406            (((tempctrl+2) & 0xff)<<8) |
407            ((tempctrl+3) & 0xff);
408         if(tempctrl & 0x100)
409            val &= 0x0f0f0f0f;
410         else
411            val &= 0xf0f0f0f0;
412
413         return val;
414      }
415   }
416
417   return 0;
418}
419
420UINT32 twcup98_prot_read_callback( address_space &space, int protaddr, UINT32 key )
421{
422   UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
423   UINT32 res = 0;
424
425   UINT32 twcup_prot_data[8] =
426   {
427      0x23232323, 0x23232323, 0x4c4c4c4c, 0x4c156301
428   };
429
430   switch(key >> 16)
431   {
432      case 0x1212:
433         if(protaddr & 2)
434         {
435            res = (ROM[protaddr / 4] & 0xffff) << 16;
436            res |= (ROM[(protaddr+4) / 4] & 0xffff0000) >> 16;
437         }
438         else
439         {
440            res = ROM[protaddr / 4] & 0xffff0000;
441            res |= ROM[protaddr / 4] & 0xffff;
442         }
443
444         if(protaddr >= 0xD215A4+0x100c && protaddr < 0xD215A4+0x100c+8*4)
445            res = twcup_prot_data[(protaddr-(0xD215A4+0x100c))/4];
446
447         return res;
448   }
449
450   return 0;
451}
452
453UINT32 sss_prot_read_callback( address_space &space, int protaddr, UINT32 key )
454{
455   UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
456   int read_offset_hack = 0;
457   UINT32 res;
458
459   /*
460       MAIN : 2c5b0000  DATA : 000000a6 014c0000
461       MAIN : 47f10000  DATA : 0f9800a6 014c1f30
462       MAIN : fcda0000  DATA : 1d4800a6 014c3a90
463       MAIN : b5e60000  DATA : 29e300a6 014c53c6
464       MAIN : 392c0000  DATA : 38e900a6 014c71d2
465       MAIN : 77c30000  DATA : 462500a6 014c8c4a
466       MAIN : 8a620000  DATA : 555c00a6 014caab8
467   */
468
469   // I have a feeling rather than the offsets being scrambled they were lazy
470   // and left unencrypted copies in the ROM... but this still needs verification
471   switch(key>>16)
472   {
473      case 0x2c5b: read_offset_hack = 0x60054; break;
474      case 0x47f1: read_offset_hack = 0x56498; break;
475      case 0xfcda: read_offset_hack = 0x50b0c; break;
476      case 0xb5e6: read_offset_hack = 0x4af56; break;
477      case 0x392c: read_offset_hack = 0x45876; break;
478      case 0x77c3: read_offset_hack = 0x3fe02; break;
479      case 0x8a62: read_offset_hack = 0x3a784; break;
480   }
481
482   switch(key>>16)
483   {
484      default:
485         if(protaddr & 2)
486         {
487            res = (ROM[(protaddr-read_offset_hack) / 4] & 0xffff) << 16;
488            res |= (ROM[((protaddr-read_offset_hack)+4) / 4] & 0xffff0000) >> 16;
489         }
490         else
491         {
492            res = ROM[(protaddr-read_offset_hack) / 4] & 0xffff0000;
493            res |= ROM[(protaddr-read_offset_hack) / 4] & 0xffff;
494         }
495         return res;
496   }
497}
498
499
500
501UINT32 elandore_prot_read_callback( address_space &space, int protaddr, UINT32 key )
502{
503   UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
504   UINT32 res = 0;
505
506   switch(key >> 16)
507   {
508      default:
509         if(protaddr & 2)
510         {
511            res = (ROM[protaddr / 4] & 0xffff) << 16;
512            res |= (ROM[(protaddr+4) / 4] & 0xffff0000) >> 16;
513         }
514         else
515         {
516            res = ROM[protaddr / 4] & 0xffff0000;
517            res |= ROM[protaddr / 4] & 0xffff;
518         }
519         return res;
520   }
521
522   // never executed
523   //return 0;
524}
525
526UINT32 ffreveng_prot_read_callback( address_space &space, int protaddr, UINT32 key )
527{
528   //UINT32 res = 0;
529
530   switch(key >> 16)
531   {
532      case 0x10da://ffreveng, boot vectors at $6080000,test mode
533      case 0x10d7://ffreveng, boot vectors at $6080000,attract mode
534         #if 0
535         if(protaddr & 2)
536         {
537            res = (ROM[protaddr / 4] & 0xffff) << 16;
538            res |= (ROM[(protaddr+4) / 4] & 0xffff0000) >> 16;
539         }
540         else
541         {
542            res = ROM[protaddr / 4] & 0xffff0000;
543            res |= ROM[protaddr / 4] & 0xffff;
544         }
545         #endif
546         return 0;
547   }
548
549   return 0;
550}
551
552
55323/*************************************
55424*
55525* Common Handlers
55626*
55727*************************************/
55828
559// the naomi hookup of 315-5881 reads 16-bits at a time, here we seem to read 32?
560
56129READ32_MEMBER( stv_state::common_prot_r )
56230{
56331   UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
r243094r243095
56634   {
56735      if(offset == 3)
56836      {
569         #ifdef MAME_DEBUG
570         popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),m_abus_protkey);
571         #endif
572         if (!m_using_crypt_device) // decrypt using hacks
573         {
574            UINT32 realret = space.read_dword(0x2000000 + m_ctrl_index);
575            UINT32 retdata = m_prot_readback(space, m_ctrl_index, m_abus_protkey);
576            //fwrite(&realret, 1, 4, fp);
577            //fwrite(&retdata, 1, 4, fp2);
578
579            logerror("A-Bus control protection read at %06x with data = %08x Returning = %08x Would otherwise return = %08x\n", space.device().safe_pc(), m_abus_protkey, retdata, realret);
580            m_ctrl_index += 4;
581            return retdata;
582         }
583         else // decrypt using real decryption device
584         {
585            UINT8* base;
586            UINT16 res = m_cryptdevice->do_decrypt(base);
587            UINT16 res2 = m_cryptdevice->do_decrypt(base);
588            res = ((res & 0xff00) >> 8) | ((res & 0x00ff) << 8);
589            res2 = ((res2 & 0xff00) >> 8) | ((res2 & 0x00ff) << 8);
37         UINT8* base;
38         UINT16 res = m_cryptdevice->do_decrypt(base);
39         UINT16 res2 = m_cryptdevice->do_decrypt(base);
40         res = ((res & 0xff00) >> 8) | ((res & 0x00ff) << 8);
41         res2 = ((res2 & 0xff00) >> 8) | ((res2 & 0x00ff) << 8);
59042           
591            return res2 | (res << 16);
592         }
593         
43         return res2 | (res << 16);         
59444      }
59545      return m_a_bus[offset];
59646   }
r243094r243095
61161WRITE32_MEMBER ( stv_state::common_prot_w )
61262{
61363   COMBINE_DATA(&m_a_bus[offset]);
614   //printf("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
61564
61665   if (offset == 0)
61766   {
r243094r243095
61968   }
62069   else if(offset == 2)
62170   {
622      COMBINE_DATA(&m_abus_prot_addr);
71      if (mem_mask&0xffff0000) m_cryptdevice->set_addr_low(data >> 16);
72      if (mem_mask&0x0000ffff) m_cryptdevice->set_addr_high(data&0xffff);
62373
624      m_cryptdevice->set_addr_low(m_abus_prot_addr >> 16);
625      m_cryptdevice->set_addr_high(m_abus_prot_addr&0xffff);
626
62774   }
62875   else if(offset == 3)
62976   {
63077      COMBINE_DATA(&m_abus_protkey);
63178
63279      m_cryptdevice->set_subkey(m_abus_protkey>>16);
633
634
635      int a_bus_vector;
636      a_bus_vector = m_abus_prot_addr >> 16;
637      a_bus_vector|= (m_abus_prot_addr & 0xffff) << 16;
638      a_bus_vector<<= 1;
639      /*
640      if (fp)
641      {
642         fclose(fp);
643         fp = 0;
644      }
645      if (fp2)
646      {
647         fclose(fp2);
648         fp2 = 0;
649      }
650      char filename[256];
651      sprintf(filename,"encrypted_%s_key_%04x_address_%08x", machine().system().name, m_abus_protkey>>16, a_bus_vector);
652      fp=fopen(filename, "w+b");
653      sprintf(filename,"not-encrypted_%s_key_%04x_address_%08x", machine().system().name, m_abus_protkey>>16, a_bus_vector);
654      fp2=fopen(filename, "w+b");
655      */
656
657      //printf("MAIN : %08x  DATA : %08x %08x\n",m_abus_protkey,m_abus_prot_addr,a_bus_vector);
658
659      // if you look at the first transfer in ffreveng this is clearly a ROM address from a table |  MAIN : 10d70000  DATA : 0b780013 002616f0
660      // (opr21872.7, offset 0x616f0, which happens to be 0x2616f0 in the ROM region "game0")
661      // the values sent by the CPU are plucked from a table above where the data is, located at 0x60000
662      // Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
663      // 00060000   00 00 16 F0 00 00 2F A0  00 00 46 90 00 00 4D 04
664      // this is the first entry in the table, 0x16f0 is the address, 0x2fa0 is the length.
665      // the next entry is address 0x4690, length 0x4d04.  0x16f0 + 0x2fa0 == 0x4690 so that entry is located straight after the first one
666      // the game reads the number of bytes specified in the length via the protection device, writing them to RAM.  This suggests there
667      // is no compression going on, only some form of encryption.
668
669      m_ctrl_index = a_bus_vector;
67080   }
67181}
67282
r243094r243095
67585   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x4fffff0, 0x4ffffff, read32_delegate(FUNC(stv_state::common_prot_r), this), write32_delegate(FUNC(stv_state::common_prot_w), this));
67686
67787   INT64 key = get_315_5881_key(machine());
678
679   if (key != -1)
680   {
681      m_cryptdevice->set_key(key); // use real decryption
682      m_using_crypt_device = 1;
683   }
684   else
685      m_using_crypt_device = 0; // use protection sim
88   m_cryptdevice->set_key(key);
68689}
68790
688void stv_state::install_sss_protection()
689{
690   install_common_protection();
691   m_prot_readback = sss_prot_read_callback;
692}
693
694void stv_state::install_astrass_protection()
695{
696   install_common_protection();
697}
698
699void stv_state::install_ffreveng_protection()
700{
701   install_common_protection();
702   m_prot_readback = ffreveng_prot_read_callback;
703}
704
705void stv_state::install_elandore_protection()
706{
707   install_common_protection();
708   m_prot_readback = elandore_prot_read_callback;
709}
710
711void stv_state::install_rsgun_protection()
712{
713   install_common_protection();
714   m_prot_readback = rsgun_prot_read_callback;
715}
716
717void stv_state::install_twcup98_protection()
718{
719   install_common_protection();
720   m_prot_readback = twcup98_prot_read_callback;
721}
722
723
72491void stv_state::stv_register_protection_savestates()
72592{
72693   save_item(NAME(m_a_bus));
727   save_item(NAME(m_ctrl_index));
728   save_item(NAME(m_internal_counter));
729   save_item(NAME(m_char_offset));
73094}
trunk/src/mame/mame.lst
r243094r243095
3114231142orbitor1
3114331143quicksil
3114431144seawitch
31145splitsec
31145spltsecp
3114631146stargzr
3114731147viperp
3114831148gamatron
trunk/src/mame/video/taitoair.c
r243094r243095
229229         int xx1 = x1 >> TAITOAIR_FRAC_SHIFT;
230230         int xx2 = x2 >> TAITOAIR_FRAC_SHIFT;
231231         int grad_col;
232
232         int base_color;
233         
233234         if (xx1 <= cliprect.max_x || xx2 >= cliprect.min_x)
234235         {
235236            if (xx1 < cliprect.min_x)
236237               xx1 = cliprect.min_x;
237238            if (xx2 > cliprect.max_x)
238239               xx2 = cliprect.max_x;
240           
241            if(color & 0x40)
242            {
243               /* Non-terrain elements are colored with this. */
244               base_color = (color & 0x3f) + 0x340;
245               grad_col = 0;
246            }
247            else
248            {
249               /* Terrain elements, with a gradient applied. */
250               /* TODO: it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */
251               base_color = ((color & 0x3f) * 0x80) + 0x2040;
252               grad_col = (y1 >> 3) & 0x3f;
253            }
239254
240            /* TODO: it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */
241            grad_col = (y1 >> 3) & 0x3f;
242
243255            while (xx1 <= xx2)
244256            {
245               bitmap.pix16(y1, xx1) = color + grad_col;
257               bitmap.pix16(y1, xx1) = base_color + grad_col;
246258               xx1++;
247259            }
248260         }
r243094r243095
393405                  logerror("quad: unknown value %04x at %04x\n", m_line_ram[adr], adr);
394406                  break;
395407               }
396               m_q.col = ((m_line_ram[adr] & 0x007f) * 0x80) + 0x2040;
408               m_q.col = m_line_ram[adr] & 0x7f;//((m_line_ram[adr] & 0x007f) * 0x80) + 0x2040;
409
397410               adr--;
398411               pcount = 0;
399412               while (pcount < TAITOAIR_POLY_MAX_PT && adr >= 1 && !(m_line_ram[adr] & 0xc000))


Previous 199869 Revisions Next


© 1997-2024 The MAME Team