Previous 15994 Revisions Next

r13307 Saturday 19th November, 2011 at 13:52:04 UTC by Miodrag Milanović
Removed file not existing in MAME (no whatsnew)
[src/mame/drivers]stvinit.c
[src/mess]mess.mak

src/mame/drivers/stvinit.c
r13306r13307
1/* ST-V Inits and SpeedUp Hacks */
2/* stvinit.c */
3
4/*
5to be honest i think some of these cause more problems than they're worth ...
6*/
7
8#include "emu.h"
9#include "cpu/sh2/sh2.h"
10#include "machine/stvprot.h"
11#include "includes/stv.h"
12
13#define FIRST_SPEEDUP_SLOT   (2)         // in case we remove/alter the BIOS speedups later
14
15
16
17/*
18EEPROM write 0000 to address 2d
19EEPROM write 0000 to address 2e
20EEPROM write 0000 to address 2f
21EEPROM write 0000 to address 30
22EEPROM write ffff to address 31
23EEPROM write ffff to address 32
24EEPROM write ffff to address 33
25EEPROM write ffff to address 34
26EEPROM write ffff to address 35
27EEPROM write ffff to address 36
28EEPROM write ffff to address 37
29EEPROM write ffff to address 38
30EEPROM write ffff to address 39
31EEPROM write ffff to address 3a
32EEPROM write ffff to address 3b
33EEPROM write ffff to address 3c
34EEPROM write ffff to address 3d
35EEPROM write ffff to address 3e
36EEPROM write ffff to address 3f
37*/
38#if 0
39static const UINT8 stv_default_eeprom[128] = {
40    0x53,0x45,0xff,0xff,0xff,0xff,0x3b,0xe2,
41    0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x00,
42    0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x08,
43    0x08,0xfd,0x10,0x04,0x23,0x2a,0x00,0x00,
44    0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
45    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
46    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
47    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
48    0xff,0xff,0x3b,0xe2,0xff,0xff,0x00,0x00,
49    0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00,
50    0x00,0x00,0x00,0x08,0x08,0xfd,0x10,0x04,
51    0x23,0x2a,0x00,0x00,0x00,0x00,0x00,0x00,
52    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
53    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
54    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
55    0xff,0xff,0xff,0xff
56};
57#endif
58
59/*
60
6106013AE8: MOV.L   @($D4,PC),R5
6206013AEA: MOV.L   @($D8,PC),R0
6306013AEC: MOV.W   @R5,R5
6406013AEE: MOV.L   @R0,R0
6506013AF0: AND     R10,R5
6606013AF2: TST     R0,R0
6706013AF4: BTS     $06013B00
6806013AF6: EXTS.W  R5,R5
6906013B00: EXTS.W  R5,R5
7006013B02: TST     R5,R5
7106013B04: BF      $06013B0A
7206013B06: TST     R4,R4
7306013B08: BT      $06013AE8
74
75   (loops for 375868 instructions)
76
77*/
78
79void install_stvbios_speedups(running_machine &machine)
80{
81   // flushes 0 & 1 on both CPUs are for the BIOS speedups
82   sh2drc_add_pcflush(machine.device("maincpu"), 0x60154b2);
83   sh2drc_add_pcflush(machine.device("maincpu"), 0x6013aee);
84
85   sh2drc_add_pcflush(machine.device("slave"), 0x60154b2);
86   sh2drc_add_pcflush(machine.device("slave"), 0x6013aee);
87}
88
89DRIVER_INIT(shienryu)
90{
91   // master
92   sh2drc_add_pcflush(machine.device("maincpu"), 0x60041c6);
93   // slave
94   sh2drc_add_pcflush(machine.device("slave"), 0x600440e);
95
96   DRIVER_INIT_CALL(stv);
97}
98
99DRIVER_INIT(prikura)
100{
101/*
102 06018640: MOV.B   @R14,R0  // 60b9228
103 06018642: TST     R0,R0
104 06018644: BF      $06018640
105
106    (loops for 263473 instructions)
107*/
108   saturn_state *state = machine.driver_data<saturn_state>();
109
110   // master
111   sh2drc_add_pcflush(machine.device("maincpu"), 0x6018640);
112   // slave
113   sh2drc_add_pcflush(machine.device("slave"), 0x6018c6e);
114
115   DRIVER_INIT_CALL(stv);
116
117   state->m_minit_boost = state->m_sinit_boost = 0;
118   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
119}
120
121DRIVER_INIT(hanagumi)
122{
123/*
124    06013E1E: NOP
125    0601015E: MOV.L   @($6C,PC),R3
126    06010160: MOV.L   @R3,R0  (6094188)
127    06010162: TST     R0,R0
128    06010164: BT      $0601015A
129    0601015A: JSR     R14
130    0601015C: NOP
131    06013E20: MOV.L   @($34,PC),R3
132    06013E22: MOV.B   @($00,R3),R0
133    06013E24: TST     R0,R0
134    06013E26: BT      $06013E1C
135    06013E1C: RTS
136    06013E1E: NOP
137
138   (loops for 288688 instructions)
139*/
140   sh2drc_add_pcflush(machine.device("maincpu"), 0x6010160);
141
142   DRIVER_INIT_CALL(stv);
143}
144
145
146
147
148/* these idle loops might change if the interrupts change / are fixed because i don't really think these are vblank waits... */
149
150/* puyosun
151
152CPU0: Aids Screen
153
15406021CF0: MOV.B   @($13,GBR),R0 (60ffc13)
15506021CF2: CMP/PZ  R0
15606021CF4: BT      $06021CF0
157   (loops for xxx instructions)
158
159   this is still very slow .. but i don't think it can be sped up further
160
161
162*/
163
164DRIVER_INIT(puyosun)
165{
166   saturn_state *state = machine.driver_data<saturn_state>();
167
168   sh2drc_add_pcflush(machine.device("maincpu"), 0x6021cf0);
169
170   sh2drc_add_pcflush(machine.device("slave"), 0x60236fe);
171
172   DRIVER_INIT_CALL(stv);
173
174   state->m_minit_boost = state->m_sinit_boost = 0;
175   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
176}
177
178/* mausuke
179
180CPU0 Data East Logo:
181060461A0: MOV.B   @($13,GBR),R0  (60ffc13)
182060461A2: CMP/PZ  R0
183060461A4: BT      $060461A0
184   (loops for 232602 instructions)
185
186*/
187
188DRIVER_INIT(mausuke)
189{
190   saturn_state *state = machine.driver_data<saturn_state>();
191
192   sh2drc_add_pcflush(machine.device("maincpu"), 0x60461A0);
193
194   DRIVER_INIT_CALL(stv);
195
196   state->m_minit_boost = state->m_sinit_boost = 0;
197   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
198}
199
200DRIVER_INIT(cottonbm)
201{
202   saturn_state *state = machine.driver_data<saturn_state>();
203
204//  sh2drc_add_pcflush(machine.device("maincpu"), 0x6030ee2);
205//  sh2drc_add_pcflush(machine.device("slave"), 0x6032b52);
206
207   DRIVER_INIT_CALL(stv);
208
209   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(10);
210}
211
212DRIVER_INIT(cotton2)
213{
214   saturn_state *state = machine.driver_data<saturn_state>();
215
216   sh2drc_add_pcflush(machine.device("maincpu"), 0x6031c7a);
217   sh2drc_add_pcflush(machine.device("slave"), 0x60338ea);
218
219   DRIVER_INIT_CALL(stv);
220
221   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
222}
223
224DRIVER_INIT(dnmtdeka)
225{
226   // install all 3 speedups on both master and slave
227   sh2drc_add_pcflush(machine.device("maincpu"), 0x6027c90);
228   sh2drc_add_pcflush(machine.device("maincpu"), 0xd04);
229   sh2drc_add_pcflush(machine.device("maincpu"), 0x60051f2);
230
231   sh2drc_add_pcflush(machine.device("slave"), 0x6027c90);
232   sh2drc_add_pcflush(machine.device("slave"), 0xd04);
233   sh2drc_add_pcflush(machine.device("slave"), 0x60051f2);
234
235   DRIVER_INIT_CALL(stv);
236}
237
238DRIVER_INIT(diehard)
239{
240   // install all 3 speedups on both master and slave
241   sh2drc_add_pcflush(machine.device("maincpu"), 0x6027c98);
242   sh2drc_add_pcflush(machine.device("maincpu"), 0xd04);
243   sh2drc_add_pcflush(machine.device("maincpu"), 0x60051f2);
244
245   sh2drc_add_pcflush(machine.device("slave"), 0x6027c98);
246   sh2drc_add_pcflush(machine.device("slave"), 0xd04);
247   sh2drc_add_pcflush(machine.device("slave"), 0x60051f2);
248
249   DRIVER_INIT_CALL(stv);
250}
251
252DRIVER_INIT(fhboxers)
253{
254//  saturn_state *state = machine.driver_data<saturn_state>();
255
256   sh2drc_add_pcflush(machine.device("maincpu"), 0x60041c2);
257   sh2drc_add_pcflush(machine.device("maincpu"), 0x600bb0a);
258   sh2drc_add_pcflush(machine.device("maincpu"), 0x600b31e);
259
260   DRIVER_INIT_CALL(stv);
261
262//  state->m_instadma_hack = 1;
263}
264
265DRIVER_INIT( groovef )
266{
267   saturn_state *state = machine.driver_data<saturn_state>();
268
269   sh2drc_add_pcflush(machine.device("maincpu"), 0x6005e7c);
270   sh2drc_add_pcflush(machine.device("maincpu"), 0x6005e86);
271   sh2drc_add_pcflush(machine.device("maincpu"), 0x60a4970);
272
273   sh2drc_add_pcflush(machine.device("slave"), 0x60060c2);
274
275   DRIVER_INIT_CALL(stv);
276
277   state->m_minit_boost = state->m_sinit_boost = 0;
278   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
279}
280
281DRIVER_INIT( danchih )
282{
283   saturn_state *state = machine.driver_data<saturn_state>();
284
285   sh2drc_add_pcflush(machine.device("maincpu"), 0x6028b28);
286   sh2drc_add_pcflush(machine.device("maincpu"), 0x6028c8e);
287   sh2drc_add_pcflush(machine.device("slave"), 0x602ae26);
288
289   DRIVER_INIT_CALL(stv);
290
291   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(5);
292}
293
294/*
295060011AE: AND     #$0F,R0
296060011B0: MOV     #$5E,R1
297060011B2: ADD     R5,R1
298060011B4: MOV.B   R0,@R1
299060011B6: MOV     R5,R0
300060011B8: ADD     #$70,R0
301
302060011BA: MOV.B   @(R0,R4),R0 <- reads 0x02020000,cause of the crash
303060011BC: RTS
304060011BE: NOP
305060131AA: CMP/EQ  #$01,R0
306060131AC: BT      $0601321C
307060131AE: CMP/EQ  #$02,R0
308060131B0: BT      $0601324A
309
310TODO: understand where it gets 0x02020000,it must be 0x0000000
311
312wpset 60cf888,4,r
313
314*/
315
316static READ32_HANDLER( astrass_hack_r )
317{
318   saturn_state *state = space->machine().driver_data<saturn_state>();
319
320   /*PC reads at 0x60011ba if -debug is active?*/
321   if(cpu_get_pc(&space->device())==0x60011b8 || cpu_get_pc(&space->device()) == 0x60011ba) return 0x00000000;
322
323   return state->m_workram_h[0x000770/4];
324}
325
326DRIVER_INIT( astrass )
327{
328   sh2drc_add_pcflush(machine.device("maincpu"), 0x60011b8);
329   sh2drc_add_pcflush(machine.device("maincpu"), 0x605b9da);
330
331   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x06000770, 0x06000773, FUNC(astrass_hack_r) );
332
333   install_astrass_protection(machine);
334
335   DRIVER_INIT_CALL(stv);
336}
337
338DRIVER_INIT(thunt)
339{
340   saturn_state *state = machine.driver_data<saturn_state>();
341
342   sh2drc_add_pcflush(machine.device("maincpu"), 0x602A024);
343   sh2drc_add_pcflush(machine.device("maincpu"), 0x6013EEA);
344   sh2drc_add_pcflush(machine.device("slave"), 0x602AAF8);
345
346   DRIVER_INIT_CALL(stv);
347
348   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(1);
349}
350
351DRIVER_INIT(sandor)
352{
353   saturn_state *state = machine.driver_data<saturn_state>();
354
355   sh2drc_add_pcflush(machine.device("maincpu"), 0x602a0f8);
356   sh2drc_add_pcflush(machine.device("maincpu"), 0x6013fbe);
357   sh2drc_add_pcflush(machine.device("slave"), 0x602abcc);
358
359   DRIVER_INIT_CALL(stv);
360   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(1);
361}
362
363DRIVER_INIT(grdforce)
364{
365   saturn_state *state = machine.driver_data<saturn_state>();
366
367   sh2drc_add_pcflush(machine.device("maincpu"), 0x6041e32);
368   sh2drc_add_pcflush(machine.device("slave"), 0x6043aa2);
369
370   DRIVER_INIT_CALL(stv);
371
372   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
373}
374
375DRIVER_INIT(batmanfr)
376{
377   saturn_state *state = machine.driver_data<saturn_state>();
378
379   sh2drc_add_pcflush(machine.device("maincpu"), 0x60121c0);
380   sh2drc_add_pcflush(machine.device("slave"), 0x60125bc);
381
382   DRIVER_INIT_CALL(stv);
383
384   state->m_minit_boost = state->m_sinit_boost = 0;
385   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
386}
387
388DRIVER_INIT(colmns97)
389{
390   saturn_state *state = machine.driver_data<saturn_state>();
391
392   sh2drc_add_pcflush(machine.device("slave"), 0x60298a2);
393
394   DRIVER_INIT_CALL(stv);
395
396   state->m_minit_boost = state->m_sinit_boost = 0;
397}
398
399DRIVER_INIT(winterht)
400{
401   saturn_state *state = machine.driver_data<saturn_state>();
402
403   sh2drc_add_pcflush(machine.device("maincpu"), 0x6098aea);
404   sh2drc_add_pcflush(machine.device("slave"), 0x609ae4e);
405
406   DRIVER_INIT_CALL(stv);
407
408   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(2);
409}
410
411DRIVER_INIT(seabass)
412{
413   saturn_state *state = machine.driver_data<saturn_state>();
414
415   sh2drc_add_pcflush(machine.device("maincpu"), 0x602cbfa);
416   sh2drc_add_pcflush(machine.device("slave"), 0x60321ee);
417
418   DRIVER_INIT_CALL(stv);
419
420   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(5);
421}
422
423DRIVER_INIT(vfremix)
424{
425   saturn_state *state = machine.driver_data<saturn_state>();
426
427   sh2drc_add_pcflush(machine.device("maincpu"), 0x602c30c);
428   sh2drc_add_pcflush(machine.device("slave"), 0x604c332);
429
430   DRIVER_INIT_CALL(stv);
431
432   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(20);
433}
434
435DRIVER_INIT(sss)
436{
437   saturn_state *state = machine.driver_data<saturn_state>();
438
439   sh2drc_add_pcflush(machine.device("maincpu"), 0x6026398);
440   sh2drc_add_pcflush(machine.device("slave"), 0x6028cd6);
441
442   install_sss_protection(machine);
443
444   DRIVER_INIT_CALL(stv);
445
446   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
447}
448
449DRIVER_INIT(othellos)
450{
451   saturn_state *state = machine.driver_data<saturn_state>();
452
453   sh2drc_add_pcflush(machine.device("maincpu"), 0x602bcbe);
454   sh2drc_add_pcflush(machine.device("slave"), 0x602d92e);
455
456   DRIVER_INIT_CALL(stv);
457
458   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
459}
460
461DRIVER_INIT(sasissu)
462{
463   saturn_state *state = machine.driver_data<saturn_state>();
464
465   sh2drc_add_pcflush(machine.device("slave"), 0x60710be);
466
467   DRIVER_INIT_CALL(stv);
468
469   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(2);
470}
471
472DRIVER_INIT(gaxeduel)
473{
474   sh2drc_add_pcflush(machine.device("maincpu"), 0x6012ee4);
475
476   DRIVER_INIT_CALL(stv);
477}
478
479DRIVER_INIT(suikoenb)
480{
481   sh2drc_add_pcflush(machine.device("maincpu"), 0x6013f7a);
482
483   DRIVER_INIT_CALL(stv);
484}
485
486
487DRIVER_INIT(sokyugrt)
488{
489   saturn_state *state = machine.driver_data<saturn_state>();
490
491   DRIVER_INIT_CALL(stv);
492
493   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
494}
495
496DRIVER_INIT(znpwfv)
497{
498   saturn_state *state = machine.driver_data<saturn_state>();
499
500   sh2drc_add_pcflush(machine.device("maincpu"), 0x6012ec2);
501   sh2drc_add_pcflush(machine.device("slave"), 0x60175a6);
502
503   DRIVER_INIT_CALL(stv);
504   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_nsec(500);
505}
506
507DRIVER_INIT(twcup98)
508{
509   saturn_state *state = machine.driver_data<saturn_state>();
510
511   sh2drc_add_pcflush(machine.device("maincpu"), 0x605edde);
512   sh2drc_add_pcflush(machine.device("slave"), 0x6062bca);
513
514   DRIVER_INIT_CALL(stv);
515   install_twcup98_protection(machine);
516
517   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(5);
518}
519
520DRIVER_INIT(smleague)
521{
522   saturn_state *state = machine.driver_data<saturn_state>();
523
524   sh2drc_add_pcflush(machine.device("maincpu"), 0x6063bf4);
525   sh2drc_add_pcflush(machine.device("slave"), 0x6062bca);
526
527   DRIVER_INIT_CALL(stv);
528
529   /* tight sync to avoid dead locks */
530   state->m_minit_boost = state->m_sinit_boost = 0;
531   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(5000);
532}
533
534DRIVER_INIT(finlarch)
535{
536   saturn_state *state = machine.driver_data<saturn_state>();
537
538   sh2drc_add_pcflush(machine.device("maincpu"), 0x6064d60);
539
540   DRIVER_INIT_CALL(stv);
541
542   /* tight sync to avoid dead locks */
543   state->m_minit_boost = state->m_sinit_boost = 0;
544   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(5000);
545}
546
547DRIVER_INIT(maruchan)
548{
549   saturn_state *state = machine.driver_data<saturn_state>();
550
551   sh2drc_add_pcflush(machine.device("maincpu"), 0x601ba46);
552   sh2drc_add_pcflush(machine.device("slave"), 0x601ba46);
553
554   DRIVER_INIT_CALL(stv);
555
556   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(50);
557}
558
559DRIVER_INIT(pblbeach)
560{
561   //saturn_state *state = machine.driver_data<saturn_state>();
562
563   //sh2drc_add_pcflush(machine.device("maincpu"), 0x605eb78);
564
565   DRIVER_INIT_CALL(stv);
566
567//  state->m_instadma_hack = 1;
568
569}
570
571DRIVER_INIT(shanhigw)
572{
573   sh2drc_add_pcflush(machine.device("maincpu"), 0x6020c5c);
574
575   DRIVER_INIT_CALL(stv);
576}
577
578DRIVER_INIT(elandore)
579{
580   saturn_state *state = machine.driver_data<saturn_state>();
581
582   sh2drc_add_pcflush(machine.device("maincpu"), 0x604eac0);
583   sh2drc_add_pcflush(machine.device("slave"), 0x605340a);
584
585   install_elandore_protection(machine);
586
587   DRIVER_INIT_CALL(stv);
588   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(0);
589}
590
591DRIVER_INIT(rsgun)
592{
593   saturn_state *state = machine.driver_data<saturn_state>();
594
595   sh2drc_add_pcflush(machine.device("maincpu"), 0x6034d04);
596   sh2drc_add_pcflush(machine.device("slave"), 0x6036152);
597
598   install_rsgun_protection(machine);
599
600   DRIVER_INIT_CALL(stv);
601
602   state->m_minit_boost_timeslice = state->m_sinit_boost_timeslice = attotime::from_usec(20);
603}
604
605DRIVER_INIT(ffreveng)
606{
607   install_ffreveng_protection(machine);
608   DRIVER_INIT_CALL(stv);
609}
610
611DRIVER_INIT(decathlt)
612{
613   install_decathlt_protection(machine);
614   DRIVER_INIT_CALL(stv);
615}
616
617DRIVER_INIT(nameclv3)
618{
619   sh2drc_add_pcflush(machine.device("maincpu"), 0x601eb4c);
620   sh2drc_add_pcflush(machine.device("slave"), 0x602b80e);
621
622   DRIVER_INIT_CALL(stv);
623}
src/mess/mess.mak
r13306r13307
471471   $(MAME_DRIVERS)/saturn.o   \
472472   $(MAME_MACHINE)/stvcd.o      \
473473   $(MAME_MACHINE)/scudsp.o   \
474   $(MAME_DRIVERS)/stvinit.o   \
475474   $(MAME_MACHINE)/stvprot.o   \
476   $(MAME_MACHINE)/smpc.o          \
475   $(MAME_MACHINE)/smpc.o      \
477476   $(MAME_VIDEO)/stvvdp1.o      \
478477   $(MAME_VIDEO)/stvvdp2.o      \
479478   $(MAME_DRIVERS)/cps1.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team