summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/combatsc.cpp
blob: 5f8c4b754b325b9cba17535e341754e88c1d6766 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino, Manuel Abadia
/***************************************************************************

"Combat School" (also known as "Boot Camp") - (Konami GX611)

TODO:
- Ugly text flickering in various places, namely the text when you finish level 1.
  This is due of completely busted sprite limit hook-up. (check k007121.cpp and MT #00185)
- understand how the trackball really works for clone sets.
- it seems that to get correct target colors in firing range III we have to
  use the WRONG lookup table (the one for tiles instead of the one for
  sprites).
- in combatscb, wrong sprite/char priority (see cpu head at beginning of arm
  wrestling, and heads in intermission after firing range III)
- improve sound hook up in bootleg.
- YM2203 pitch is wrong. Fixing it screws up the tempo.

  Update: 3MHz(24MHz/8) is the more appropriate clock speed for the 2203.
  It gives the correct pitch(ear subjective) compared to the official
  soundtrack albeit the music plays slow by about 10%.

  Execution timing of the Z80 is important because it maintains music tempo
  by polling the 2203's second timer. Even when working alone with no
  context-switch the chip shouldn't be running at 1.5MHz otherwise it won't
  keep the right pace. Similar Konami games from the same period(mainevt,
  battlnts, flkatck...etc.) all have a 3.579545MHz Z80 for sound.

  In spite of adjusting clock speed polling is deemed inaccurate when
  interleaving is taken into account. A high resolution timer around the
  poll loop is probably the best bet. The driver sets its timer manually
  because strange enough, interleaving doesn't occur immediately when
  cpuexec_boost_interleave() is called. Speculations are TIME_NOWs could have
  been used as the timer durations to force instant triggering.


Credits:

    Hardware Info:
        Jose Tejada Gomez
        Manuel Abadia
        Cesareo Gutierrez

    MAME Driver:
        Phil Stroffolino
        Manuel Abadia

Memory Maps (preliminary):

***************************
* Combat School (bootleg) *
***************************

MAIN CPU:
---------
00c0-00c3   Objects control
0500        bankswitch control
0600-06ff   palette
0800-1fff   RAM
2000-2fff   Video RAM (banked)
3000-3fff   Object RAM (banked)
4000-7fff   Banked Area + IO + Video Registers
8000-ffff   ROM

SOUND CPU:
----------
0000-8000   ROM
8000-87ef   RAM
87f0-87ff   ???
9000-9001   YM2203
9008        ???
9800        OKIM5205?
a000        soundlatch?
a800        OKIM5205?
fffc-ffff   ???


        Notes about the sound systsem of the bootleg:
        ---------------------------------------------
        The positions 0x87f0-0x87ff are very important, it
        does work similar to a semaphore (same as a lot of
        vblank bits). For example in the init code, it writes
        zero to 0x87fa, then it waits to it 'll be different
        to zero, but it isn't written by this cpu. (shareram?)
        I have tried put here a K007232 chip, but it didn't
        work.

        Sound chips: OKI M5205 & YM2203

        We are using the other sound hardware for now.

****************************
* Combat School (Original) *
****************************

0000-005f   Video Registers (banked)
0400-0407   input ports
0408        coin counters
0410        bankswitch control
0600-06ff   palette
0800-1fff   RAM
2000-2fff   Video RAM (banked)
3000-3fff   Object RAM (banked)
4000-7fff   Banked Area + IO + Video Registers
8000-ffff   ROM

SOUND CPU:
----------
0000-8000   ROM
8000-87ff   RAM
9000        uPD7759
b000        uPD7759
c000        uPD7759
d000        soundlatch read
e000-e001   YM2203


2008-08:
Dip location and recommended settings verified with the US manual

***************************************************************************/

#include "emu.h"
#include "includes/combatsc.h"

#include "cpu/m6809/hd6309.h"
#include "cpu/z80/z80.h"
#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "speaker.h"


/*************************************
 *
 *  Memory handlers
 *
 *************************************/

WRITE8_MEMBER(combatsc_state::combatsc_vreg_w)
{
	if (data != m_vreg)
	{
		m_textlayer->mark_all_dirty();
		if ((data & 0x0f) != (m_vreg & 0x0f))
			m_bg_tilemap[0]->mark_all_dirty();
		if ((data >> 4) != (m_vreg >> 4))
			m_bg_tilemap[1]->mark_all_dirty();
		m_vreg = data;
	}
}

READ8_MEMBER(combatsc_state::combatscb_io_r)
{
	static const char *const portnames[] = { "IN0", "IN1", "DSW1", "DSW2" };

	return ioport(portnames[offset])->read();
}

WRITE8_MEMBER(combatsc_state::combatscb_priority_w)
{
	if (data & 0x40)
	{
		m_video_circuit = 1;
		m_videoram = m_page[1];
		m_scrollram = m_scrollram1;
	}
	else
	{
		m_video_circuit = 0;
		m_videoram = m_page[0];
		m_scrollram = m_scrollram0;
	}

	m_priority = data & 0x20;
}

WRITE8_MEMBER(combatsc_state::combatsc_bankselect_w)
{
	m_priority = data & 0x20;

	if (data & 0x40)
	{
		m_video_circuit = 1;
		m_videoram = m_page[1];
		m_scrollram = m_scrollram1;
	}
	else
	{
		m_video_circuit = 0;
		m_videoram = m_page[0];
		m_scrollram = m_scrollram0;
	}

	if (data & 0x10)
		membank("bank1")->set_entry((data & 0x0e) >> 1);
	else
		membank("bank1")->set_entry(8 + (data & 1));
}

WRITE8_MEMBER(combatsc_state::combatscb_io_w)
{
	switch (offset)
	{
		case 0x400: combatscb_priority_w(space, 0, data); break;
		case 0x800: m_soundlatch->write(space, offset, data); break;
		case 0xc00: combatsc_vreg_w(space, 0, data); break;
		default: m_io_ram[offset] = data; break;
	}
}

WRITE8_MEMBER(combatsc_state::combatscb_bankselect_w)
{
	if (data & 0x40)
	{
		m_video_circuit = 1;
		m_videoram = m_page[1];
	}
	else
	{
		m_video_circuit = 0;
		m_videoram = m_page[0];
	}

	data = data & 0x1f;

	if (data != m_bank_select)
	{
		m_bank_select = data;

		if (data & 0x10)
			membank("bank1")->set_entry((data & 0x0e) >> 1);
		else
			membank("bank1")->set_entry(8 + (data & 1));

		if (data == 0x1f)
		{
			membank("bank1")->set_entry(8 + (data & 1));
			space.install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(combatsc_state::combatscb_io_w),this));
			space.install_read_handler(0x4400, 0x4403, read8_delegate(FUNC(combatsc_state::combatscb_io_r),this));/* IO RAM & Video Registers */
		}
		else
		{
			space.install_read_bank(0x4000, 0x7fff, "bank1");   /* banked ROM */
			space.unmap_write(0x4000, 0x7fff);  /* banked ROM */
		}
	}
}

/****************************************************************************/

WRITE8_MEMBER(combatsc_state::combatsc_coin_counter_w)
{
	/* b7-b3: unused? */
	/* b1: coin counter 2 */
	/* b0: coin counter 1 */

	machine().bookkeeping().coin_counter_w(0, data & 0x01);
	machine().bookkeeping().coin_counter_w(1, data & 0x02);
}

READ8_MEMBER(combatsc_state::trackball_r)
{
	if (offset == 0)
	{
		int i, dir[4];

		for (i = 0; i < 4; i++)
		{
			uint8_t curr;

			curr = m_track_ports[i].read_safe(0xff);

			dir[i] = curr - m_pos[i];
			m_sign[i] = dir[i] & 0x80;
			m_pos[i] = curr;
		}

		/* fix sign for orthogonal movements */
		if (dir[0] || dir[1])
		{
			if (!dir[0]) m_sign[0] = m_sign[1] ^ 0x80;
			if (!dir[1]) m_sign[1] = m_sign[0];
		}
		if (dir[2] || dir[3])
		{
			if (!dir[2]) m_sign[2] = m_sign[3] ^ 0x80;
			if (!dir[3]) m_sign[3] = m_sign[2];
		}
	}

	return m_sign[offset] | (m_pos[offset] & 0x7f);
}


/* the protection is a simple multiply */
WRITE8_MEMBER(combatsc_state::protection_w)
{
	m_prot[offset] = data;
}
READ8_MEMBER(combatsc_state::protection_r)
{
	return ((m_prot[0] * m_prot[1]) >> (offset * 8)) & 0xff;
}
WRITE8_MEMBER(combatsc_state::protection_clock_w)
{
	/* 0x3f is written here every time before accessing the other registers */
}


/****************************************************************************/

WRITE8_MEMBER(combatsc_state::combatsc_sh_irqtrigger_w)
{
	m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
}

READ8_MEMBER(combatsc_state::combatsc_busy_r)
{
	return m_upd7759->busy_r() ? 1 : 0;
}

WRITE8_MEMBER(combatsc_state::combatsc_play_w)
{
	m_upd7759->start_w(data & 2);
}

WRITE8_MEMBER(combatsc_state::combatsc_voice_reset_w)
{
	m_upd7759->reset_w(data & 1);
}

WRITE8_MEMBER(combatsc_state::combatsc_portA_w)
{
	/* unknown. always write 0 */
}

// causes scores to disappear during fire ranges, either sprite busy flag or screen frame number related
READ8_MEMBER(combatsc_state::unk_r)
{
	return 0; //m_screen->frame_number() & 1;
}

/*************************************
 *
 *  Address maps
 *
 *************************************/

void combatsc_state::combatsc_map(address_map &map)
{
	map(0x0000, 0x0007).w(this, FUNC(combatsc_state::combatsc_pf_control_w));
	map(0x001f, 0x001f).r(this, FUNC(combatsc_state::unk_r));
	map(0x0020, 0x005f).rw(this, FUNC(combatsc_state::combatsc_scrollram_r), FUNC(combatsc_state::combatsc_scrollram_w));
//  AM_RANGE(0x0060, 0x00ff) AM_WRITEONLY                 /* RAM */

	map(0x0200, 0x0201).rw(this, FUNC(combatsc_state::protection_r), FUNC(combatsc_state::protection_w));
	map(0x0206, 0x0206).w(this, FUNC(combatsc_state::protection_clock_w));

	map(0x0400, 0x0400).portr("IN0");
	map(0x0401, 0x0401).portr("DSW3");           /* DSW #3 */
	map(0x0402, 0x0402).portr("DSW1");           /* DSW #1 */
	map(0x0403, 0x0403).portr("DSW2");           /* DSW #2 */
	map(0x0404, 0x0407).r(this, FUNC(combatsc_state::trackball_r));           /* 1P & 2P controls / trackball */
	map(0x0408, 0x0408).w(this, FUNC(combatsc_state::combatsc_coin_counter_w));  /* coin counters */
	map(0x040c, 0x040c).w(this, FUNC(combatsc_state::combatsc_vreg_w));
	map(0x0410, 0x0410).nopr().w(this, FUNC(combatsc_state::combatsc_bankselect_w)); // read is clr a (discarded)
	map(0x0414, 0x0414).w(m_soundlatch, FUNC(generic_latch_8_device::write));
	map(0x0418, 0x0418).w(this, FUNC(combatsc_state::combatsc_sh_irqtrigger_w));
	map(0x041c, 0x041c).w("watchdog", FUNC(watchdog_timer_device::reset_w)); /* watchdog reset? */

	map(0x0600, 0x06ff).ram().w(m_palette, FUNC(palette_device::write_indirect)).share("palette");
	map(0x0800, 0x1fff).ram();                             /* RAM */
	map(0x2000, 0x3fff).rw(this, FUNC(combatsc_state::combatsc_video_r), FUNC(combatsc_state::combatsc_video_w));
	map(0x4000, 0x7fff).bankr("bank1");                        /* banked ROM area */
	map(0x8000, 0xffff).rom();                             /* ROM */
}

void combatsc_state::combatscb_map(address_map &map)
{
	map(0x0000, 0x04ff).ram();
	map(0x0500, 0x0500).w(this, FUNC(combatsc_state::combatscb_bankselect_w));
	map(0x0600, 0x06ff).ram().w(m_palette, FUNC(palette_device::write_indirect)).share("palette");
	map(0x0800, 0x1fff).ram();
	map(0x2000, 0x3fff).rw(this, FUNC(combatsc_state::combatsc_video_r), FUNC(combatsc_state::combatsc_video_w));
	map(0x4000, 0x7fff).bankr("bank1");                        /* banked ROM/RAM area */
	map(0x8000, 0xffff).rom();                             /* ROM */
}

void combatsc_state::combatsc_sound_map(address_map &map)
{
	map(0x0000, 0x7fff).rom();                                             /* ROM */
	map(0x8000, 0x87ff).ram();                                             /* RAM */

	map(0x9000, 0x9000).w(this, FUNC(combatsc_state::combatsc_play_w));                  /* upd7759 play voice */
	map(0xa000, 0xa000).w(m_upd7759, FUNC(upd7759_device::port_w));                  /* upd7759 voice select */
	map(0xb000, 0xb000).r(this, FUNC(combatsc_state::combatsc_busy_r));                   /* upd7759 busy? */
	map(0xc000, 0xc000).w(this, FUNC(combatsc_state::combatsc_voice_reset_w));           /* upd7759 reset? */

	map(0xd000, 0xd000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); /* soundlatch read? */
	map(0xe000, 0xe001).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write));   /* YM 2203 intercepted */
}

WRITE8_MEMBER(combatsc_state::combatscb_msm_w)
{
	membank("bl_abank")->set_entry(BIT(data, 7));

	m_msm->reset_w(BIT(data, 4));
	m_msm->data_w(data & 0x0f);
}

WRITE8_MEMBER(combatsc_state::combatscb_sound_irq_ack)
{
	m_audiocpu->set_input_line(0, CLEAR_LINE);
}

void combatsc_state::combatscb_sound_map(address_map &map)
{
	map(0x0000, 0x7fff).rom();                                     /* ROM */
	map(0x8000, 0x87ff).ram();                                     /* RAM */
	map(0x9000, 0x9001).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write));   /* YM 2203 */
	map(0x9008, 0x9009).r("ymsnd", FUNC(ym2203_device::read));               /* ??? */
	map(0x9800, 0x9800).w(this, FUNC(combatsc_state::combatscb_msm_w));
	map(0xa000, 0xa000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); /* soundlatch read? */
	map(0xa800, 0xa800).w(this, FUNC(combatsc_state::combatscb_sound_irq_ack));
	map(0xc000, 0xffff).bankr("bl_abank");
}

/*************************************
 *
 *  Input ports
 *
 *************************************/

static INPUT_PORTS_START( common_inputs )
	PORT_START("IN0")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START("DSW3")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW3:1")
	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On )  )
	PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW3:2" )   /* Not Used according to the manual */
	PORT_SERVICE_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW3:3" )
	PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW3:4" )   /* Not Used according to the manual */
INPUT_PORTS_END

static INPUT_PORTS_START( dips )
	PORT_START("DSW1")
	PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
	PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
	PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
	PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
	PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
	PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
	PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
	PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
	PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
	PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
	PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
	PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
	PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
	PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
	PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
	PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
	PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
	PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
	PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
	PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
	PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
	PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
	PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
	PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
	PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
	PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
	PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
	PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
	PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
	PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
	PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
	PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
	PORT_DIPSETTING(    0x00, DEF_STR( None ) )
	/* None = coin slot B disabled */

	PORT_START("DSW2")
	PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" )   /* Not Used according to the manual */
	PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" )   /* Not Used according to the manual */
	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:3")
	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
	PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
	PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" )   /* Not Used according to the manual */
	PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" )   /* Not Used according to the manual */
	PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7")
	PORT_DIPSETTING( 0x60, DEF_STR( Easy ) )
	PORT_DIPSETTING( 0x40, DEF_STR( Normal ) )
	PORT_DIPSETTING( 0x20, DEF_STR( Difficult ) )
	PORT_DIPSETTING( 0x00, DEF_STR( Very_Difficult ) )
	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
	PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
	PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END

static INPUT_PORTS_START( combatsc )
	PORT_INCLUDE( dips )

	PORT_INCLUDE( common_inputs )

	PORT_START("IN1")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
INPUT_PORTS_END

static INPUT_PORTS_START( combatsct )
	PORT_INCLUDE( dips )

	PORT_INCLUDE( common_inputs )

	/* trackball 1P */
	PORT_START("TRACK0_Y")
	PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(10) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)

	PORT_START("TRACK0_X")
	PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(10) PORT_KEYDELTA(10) PORT_PLAYER(1)

	/* trackball 2P (not implemented yet) */
	PORT_START("TRACK1_Y")
	PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(10) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)

	PORT_START("TRACK1_X")
	PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(10) PORT_KEYDELTA(10) PORT_PLAYER(2)
INPUT_PORTS_END

static INPUT_PORTS_START( combatscb )
	PORT_INCLUDE( dips )

	PORT_MODIFY("DSW2")
	PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW2:3" )
	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5")
	PORT_DIPSETTING(    0x10, DEF_STR( No ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )

	PORT_START("IN0")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )

	PORT_START("IN1")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
INPUT_PORTS_END



/*************************************
 *
 *  Graphics definitions
 *
 *************************************/

static const gfx_layout gfxlayout =
{
	8,8,
	0x4000,
	4,
	{ 0,1,2,3 },
	{ 0, 4, 8, 12, 16, 20, 24, 28},
	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
	32*8
};

static const gfx_layout tile_layout =
{
	8,8,
	0x2000, /* number of tiles */
	4,      /* bitplanes */
	{ 0*0x10000*8, 1*0x10000*8, 2*0x10000*8, 3*0x10000*8 }, /* plane offsets */
	{ 0,1,2,3,4,5,6,7 },
	{ 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 },
	8*8
};

static const gfx_layout sprite_layout =
{
	16,16,
	0x800,  /* number of sprites */
	4,      /* bitplanes */
	{ 3*0x10000*8, 2*0x10000*8, 1*0x10000*8, 0*0x10000*8 }, /* plane offsets */
	{
		0,1,2,3,4,5,6,7,
		16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7
	},
	{
		0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8,
		8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8
	},
	8*8*4
};

static GFXDECODE_START( gfx_combatsc )
	GFXDECODE_ENTRY( "gfx1", 0x00000, gfxlayout, 0, 8*16 )
	GFXDECODE_ENTRY( "gfx2", 0x00000, gfxlayout, 0, 8*16 )
GFXDECODE_END

static GFXDECODE_START( gfx_combatscb )
	GFXDECODE_ENTRY( "gfx1", 0x00000, tile_layout,   0, 8*16 )
	GFXDECODE_ENTRY( "gfx1", 0x40000, tile_layout,   0, 8*16 )
	GFXDECODE_ENTRY( "gfx2", 0x00000, sprite_layout, 0, 8*16 )
	GFXDECODE_ENTRY( "gfx2", 0x40000, sprite_layout, 0, 8*16 )
GFXDECODE_END


/*************************************
 *
 *  Machine driver
 *
 *************************************/

void combatsc_state::machine_start_combatsc()
{
	uint8_t *MEM = memregion("maincpu")->base() + 0x38000;

	m_io_ram  = MEM + 0x0000;
	m_page[0] = MEM + 0x4000;
	m_page[1] = MEM + 0x6000;

	m_interleave_timer = machine().scheduler().timer_alloc(timer_expired_delegate());

	membank("bank1")->configure_entries(0, 10, memregion("maincpu")->base() + 0x10000, 0x4000);

	save_item(NAME(m_priority));
	save_item(NAME(m_vreg));
	save_item(NAME(m_bank_select));
	save_item(NAME(m_video_circuit));
	save_item(NAME(m_boost));
	save_item(NAME(m_prot));
	save_item(NAME(m_pos));
	save_item(NAME(m_sign));
}

void combatsc_state::machine_start_combatscb()
{
	machine_start_combatsc();
	membank("bl_abank")->configure_entries(0, 2, memregion("audiocpu")->base() + 0x8000, 0x4000);
}

void combatsc_state::machine_reset()
{
	address_space &space = m_maincpu->space(AS_PROGRAM);
	int i;

	memset(m_io_ram,  0x00, 0x4000);
	memset(m_page[0], 0x00, 0x2000);
	memset(m_page[1], 0x00, 0x2000);

	m_vreg = -1;
	m_boost = 1;
	m_bank_select = -1;
	m_prot[0] = 0;
	m_prot[1] = 0;

	for (i = 0; i < 4; i++)
	{
		m_pos[i] = 0;
		m_sign[i] = 0;
	}

	combatsc_bankselect_w(space, 0, 0);
}

/* combat school (original) */
MACHINE_CONFIG_START(combatsc_state::combatsc)

	/* basic machine hardware */
	MCFG_DEVICE_ADD("maincpu", HD6309, 3000000*4)  /* 3 MHz? */
	MCFG_DEVICE_PROGRAM_MAP(combatsc_map)
	MCFG_DEVICE_VBLANK_INT_DRIVER("screen", combatsc_state,  irq0_line_hold)

	MCFG_DEVICE_ADD("audiocpu", Z80,3579545)   /* 3.579545 MHz */
	MCFG_DEVICE_PROGRAM_MAP(combatsc_sound_map)

	MCFG_QUANTUM_TIME(attotime::from_hz(1200))

	set_machine_start_cb(config, driver_callback_delegate(&machine_start_combatsc, this));

	MCFG_WATCHDOG_ADD("watchdog")

	/* video hardware */
	MCFG_SCREEN_ADD("screen", RASTER)
//  MCFG_SCREEN_REFRESH_RATE(60)
//  MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
//  MCFG_SCREEN_SIZE(32*8, 32*8)
//  MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
	MCFG_SCREEN_RAW_PARAMS(XTAL(24'000'000)/3, 528, 0, 256, 256, 16, 240) // not accurate, assuming same to other Konami games (59.17)
	MCFG_SCREEN_UPDATE_DRIVER(combatsc_state, screen_update_combatsc)
	MCFG_SCREEN_PALETTE("palette")

	MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_combatsc)
	MCFG_PALETTE_ADD("palette", 8*16*16)
	MCFG_PALETTE_INDIRECT_ENTRIES(128)
	MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
	MCFG_PALETTE_ENDIANNESS(ENDIANNESS_LITTLE)
	MCFG_PALETTE_INIT_OWNER(combatsc_state,combatsc)
	set_video_start_cb(config, driver_callback_delegate(&video_start_combatsc, this));

	MCFG_K007121_ADD("k007121_1")
	MCFG_K007121_PALETTE("palette")
	MCFG_K007121_ADD("k007121_2")
	MCFG_K007121_PALETTE("palette")

	/* sound hardware */
	SPEAKER(config, "mono").front_center();

	MCFG_GENERIC_LATCH_8_ADD("soundlatch")

	MCFG_DEVICE_ADD("ymsnd", YM2203, 3000000)
	MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, combatsc_state, combatsc_portA_w))
	MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)

	MCFG_DEVICE_ADD("upd", UPD7759)
	MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
MACHINE_CONFIG_END


/* combat school (bootleg on different hardware) */
MACHINE_CONFIG_START(combatsc_state::combatscb)

	/* basic machine hardware */
	MCFG_DEVICE_ADD("maincpu", HD6309, 3000000*4)  /* 3 MHz? */
	MCFG_DEVICE_PROGRAM_MAP(combatscb_map)
	MCFG_DEVICE_VBLANK_INT_DRIVER("screen", combatsc_state,  irq0_line_hold)

	MCFG_DEVICE_ADD("audiocpu", Z80,3579545)   /* 3.579545 MHz */
	MCFG_DEVICE_PROGRAM_MAP(combatscb_sound_map)

	MCFG_QUANTUM_TIME(attotime::from_hz(1200))

	set_machine_start_cb(config, driver_callback_delegate(&machine_start_combatscb, this));

	/* video hardware */
	MCFG_SCREEN_ADD("screen", RASTER)
	MCFG_SCREEN_REFRESH_RATE(60)
	MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
	MCFG_SCREEN_SIZE(32*8, 32*8)
	MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
	MCFG_SCREEN_UPDATE_DRIVER(combatsc_state, screen_update_combatscb)
	MCFG_SCREEN_PALETTE("palette")

	MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_combatscb)
	MCFG_PALETTE_ADD("palette", 8*16*16)
	MCFG_PALETTE_INDIRECT_ENTRIES(128)
	MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
	MCFG_PALETTE_ENDIANNESS(ENDIANNESS_LITTLE)
	MCFG_PALETTE_INIT_OWNER(combatsc_state,combatscb)
	set_video_start_cb(config, driver_callback_delegate(&video_start_combatscb, this));

	SPEAKER(config, "mono").front_center();

	MCFG_GENERIC_LATCH_8_ADD("soundlatch")
	MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))

	MCFG_DEVICE_ADD("ymsnd", YM2203, 3000000)
	MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)

	MCFG_DEVICE_ADD("msm", MSM5205, 384000)
	MCFG_MSM5205_PRESCALER_SELECTOR(S96_4B)
	MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
	MCFG_MSM5205_VCK_CALLBACK(ASSERTLINE("audiocpu", 0))
MACHINE_CONFIG_END



/*************************************
 *
 *  ROM definition(s)
 *
 *************************************/

ROM_START( combatsc )
	ROM_REGION( 0x40000, "maincpu", 0 ) /* 6309 code */
	ROM_LOAD( "611g01.rom", 0x30000, 0x08000, CRC(857ffffe) SHA1(de7566d58314df4b7fdc07eb31a3f9bdd12d1a73) )
	ROM_CONTINUE(           0x08000, 0x08000 )
	ROM_LOAD( "611g02.rom", 0x10000, 0x20000, CRC(9ba05327) SHA1(ea03845fb49d18ac4fca97cfffce81db66b9967b) )
	/* extra 0x8000 for banked RAM */

	ROM_REGION( 0x10000 , "audiocpu", 0 ) /* sound CPU */
	ROM_LOAD( "611g03.rom", 0x00000, 0x08000, CRC(2a544db5) SHA1(94a97c3c54bf13ccc665aa5057ac6b1d700fae2d) )

	ROM_REGION( 0x80000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "611g07.rom",    0x00000, 0x40000, CRC(73b38720) SHA1(e109eb78aea464127d813284ca040e8d719599e3) )
	ROM_LOAD16_BYTE( "611g08.rom",    0x00001, 0x40000, CRC(46e7d28c) SHA1(1ece7fac954204ac35d00f3d573964fcf82dcf77) )

	ROM_REGION( 0x80000, "gfx2", 0 )
	ROM_LOAD16_BYTE( "611g11.rom",    0x00000, 0x40000, CRC(69687538) SHA1(4349a1c052a759acdf7259f8bf8c5c9489b788f2) )
	ROM_LOAD16_BYTE( "611g12.rom",    0x00001, 0x40000, CRC(9c6bf898) SHA1(eafc227b4e7df0c652ec7d78784c039c35965fdc) )

	ROM_REGION( 0x0400, "proms", 0 )
	ROM_LOAD( "611g06.h14",  0x0000, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g05.h15",  0x0100, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */
	ROM_LOAD( "611g10.h6",   0x0200, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g09.h7",   0x0300, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */

	ROM_REGION( 0x20000, "upd", 0 ) /* uPD7759 data */
	ROM_LOAD( "611g04.rom",  0x00000, 0x20000, CRC(2987e158) SHA1(87c5129161d3be29a339083349807e60b625c3f7) )

	ROM_REGION( 0x0600, "plds", 0 )
	ROM_LOAD( "ampal16l8.e7", 0x0000, 0x0104, CRC(300a9936) SHA1(a4a87e93f41392fc7d7d8601d7187d87b9f9ab01) )
	ROM_LOAD( "pal16r6.16d",  0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */
	ROM_LOAD( "pal20l8.8h",   0x0400, 0x0144, NO_DUMP ) /* PAL is read protected */
ROM_END

ROM_START( combatsct )
	ROM_REGION( 0x40000, "maincpu", 0 ) /* 6309 code */
	ROM_LOAD( "g01.rom",     0x30000, 0x08000, CRC(489c132f) SHA1(c717195f89add4be4a21ecc1ddd58361b0ab4a74) )
	ROM_CONTINUE(            0x08000, 0x08000 )
	ROM_LOAD( "611g02.rom",  0x10000, 0x20000, CRC(9ba05327) SHA1(ea03845fb49d18ac4fca97cfffce81db66b9967b) )
	/* extra 0x8000 for banked RAM */

	ROM_REGION( 0x10000 , "audiocpu", 0 ) /* sound CPU */
	ROM_LOAD( "611g03.rom", 0x00000, 0x08000, CRC(2a544db5) SHA1(94a97c3c54bf13ccc665aa5057ac6b1d700fae2d) )

	ROM_REGION( 0x80000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "611g07.rom",    0x00000, 0x40000, CRC(73b38720) SHA1(e109eb78aea464127d813284ca040e8d719599e3) )
	ROM_LOAD16_BYTE( "611g08.rom",    0x00001, 0x40000, CRC(46e7d28c) SHA1(1ece7fac954204ac35d00f3d573964fcf82dcf77) )

	ROM_REGION( 0x80000, "gfx2", 0 )
	ROM_LOAD16_BYTE( "611g11.rom",    0x00000, 0x40000, CRC(69687538) SHA1(4349a1c052a759acdf7259f8bf8c5c9489b788f2) )
	ROM_LOAD16_BYTE( "611g12.rom",    0x00001, 0x40000, CRC(9c6bf898) SHA1(eafc227b4e7df0c652ec7d78784c039c35965fdc) )

	ROM_REGION( 0x0400, "proms", 0 )
	ROM_LOAD( "611g06.h14",  0x0000, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g05.h15",  0x0100, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */
	ROM_LOAD( "611g10.h6",   0x0200, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g09.h7",   0x0300, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */

	ROM_REGION( 0x20000, "upd", 0 ) /* uPD7759 data */
	ROM_LOAD( "611g04.rom",  0x00000, 0x20000, CRC(2987e158) SHA1(87c5129161d3be29a339083349807e60b625c3f7) )
ROM_END

ROM_START( combatscj )
	ROM_REGION( 0x40000, "maincpu", 0 ) /* 6309 code */
	ROM_LOAD( "611p01.a14",  0x30000, 0x08000, CRC(d748268e) SHA1(91588b6a0d3af47065204b980a56544a9f29b6d9) )
	ROM_CONTINUE(            0x08000, 0x08000 )
	ROM_LOAD( "611g02.rom",  0x10000, 0x20000, CRC(9ba05327) SHA1(ea03845fb49d18ac4fca97cfffce81db66b9967b) )
	/* extra 0x8000 for banked RAM */

	ROM_REGION( 0x10000 , "audiocpu", 0 ) /* sound CPU */
	ROM_LOAD( "611g03.rom", 0x00000, 0x08000, CRC(2a544db5) SHA1(94a97c3c54bf13ccc665aa5057ac6b1d700fae2d) )

	ROM_REGION( 0x80000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "611g07.rom",    0x00000, 0x40000, CRC(73b38720) SHA1(e109eb78aea464127d813284ca040e8d719599e3) )
	ROM_LOAD16_BYTE( "611g08.rom",    0x00001, 0x40000, CRC(46e7d28c) SHA1(1ece7fac954204ac35d00f3d573964fcf82dcf77) )

	ROM_REGION( 0x80000, "gfx2", 0 )
	ROM_LOAD16_BYTE( "611g11.rom",    0x00000, 0x40000, CRC(69687538) SHA1(4349a1c052a759acdf7259f8bf8c5c9489b788f2) )
	ROM_LOAD16_BYTE( "611g12.rom",    0x00001, 0x40000, CRC(9c6bf898) SHA1(eafc227b4e7df0c652ec7d78784c039c35965fdc) )

	ROM_REGION( 0x0400, "proms", 0 )
	ROM_LOAD( "611g06.h14",  0x0000, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g05.h15",  0x0100, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */
	ROM_LOAD( "611g10.h6",   0x0200, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g09.h7",   0x0300, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */

	ROM_REGION( 0x20000, "upd", 0 ) /* uPD7759 data */
	ROM_LOAD( "611g04.rom",  0x00000, 0x20000, CRC(2987e158) SHA1(87c5129161d3be29a339083349807e60b625c3f7) )
ROM_END

ROM_START( bootcamp )
	ROM_REGION( 0x40000, "maincpu", 0 ) /* 6309 code */
	ROM_LOAD( "xxx-v01.12a", 0x30000, 0x08000, CRC(c10dca64) SHA1(f34de26e998b1501e430d46e96cdc58ebc68481e) )
	ROM_CONTINUE(            0x08000, 0x08000 )
	ROM_LOAD( "611g02.rom",  0x10000, 0x20000, CRC(9ba05327) SHA1(ea03845fb49d18ac4fca97cfffce81db66b9967b) )
	/* extra 0x8000 for banked RAM */

	ROM_REGION( 0x10000 , "audiocpu", 0 ) /* sound CPU */
	ROM_LOAD( "611g03.rom", 0x00000, 0x08000, CRC(2a544db5) SHA1(94a97c3c54bf13ccc665aa5057ac6b1d700fae2d) )

	ROM_REGION( 0x80000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "611g07.rom",    0x00000, 0x40000, CRC(73b38720) SHA1(e109eb78aea464127d813284ca040e8d719599e3) )
	ROM_LOAD16_BYTE( "611g08.rom",    0x00001, 0x40000, CRC(46e7d28c) SHA1(1ece7fac954204ac35d00f3d573964fcf82dcf77) )

	ROM_REGION( 0x80000, "gfx2", 0 )
	ROM_LOAD16_BYTE( "611g11.rom",    0x00000, 0x40000, CRC(69687538) SHA1(4349a1c052a759acdf7259f8bf8c5c9489b788f2) )
	ROM_LOAD16_BYTE( "611g12.rom",    0x00001, 0x40000, CRC(9c6bf898) SHA1(eafc227b4e7df0c652ec7d78784c039c35965fdc) )

	ROM_REGION( 0x0400, "proms", 0 )
	ROM_LOAD( "611g06.h14",  0x0000, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g05.h15",  0x0100, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */
	ROM_LOAD( "611g10.h6",   0x0200, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g09.h7",   0x0300, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */

	ROM_REGION( 0x20000, "upd", 0 ) /* uPD7759 data */
	ROM_LOAD( "611g04.rom",  0x00000, 0x20000, CRC(2987e158) SHA1(87c5129161d3be29a339083349807e60b625c3f7) )
ROM_END

ROM_START( bootcampa )
	ROM_REGION( 0x40000, "maincpu", 0 ) /* 6309 code */
	ROM_LOAD( "611x01.a-14", 0x30000, 0x08000, CRC(98ffc6ed) SHA1(ab02532333272683d889f209d3fc01235871d909) )
	ROM_CONTINUE(            0x08000, 0x08000 )
	ROM_LOAD( "611g02.rom",  0x10000, 0x20000, CRC(9ba05327) SHA1(ea03845fb49d18ac4fca97cfffce81db66b9967b) )
	/* extra 0x8000 for banked RAM */

	ROM_REGION( 0x10000 , "audiocpu", 0 ) /* sound CPU */
	ROM_LOAD( "611g03.rom", 0x00000, 0x08000, CRC(2a544db5) SHA1(94a97c3c54bf13ccc665aa5057ac6b1d700fae2d) )

	ROM_REGION( 0x80000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "611g07.rom",    0x00000, 0x40000, CRC(73b38720) SHA1(e109eb78aea464127d813284ca040e8d719599e3) )
	ROM_LOAD16_BYTE( "611g08.rom",    0x00001, 0x40000, CRC(46e7d28c) SHA1(1ece7fac954204ac35d00f3d573964fcf82dcf77) )

	ROM_REGION( 0x80000, "gfx2", 0 )
	ROM_LOAD16_BYTE( "611g11.rom",    0x00000, 0x40000, CRC(69687538) SHA1(4349a1c052a759acdf7259f8bf8c5c9489b788f2) )
	ROM_LOAD16_BYTE( "611g12.rom",    0x00001, 0x40000, CRC(9c6bf898) SHA1(eafc227b4e7df0c652ec7d78784c039c35965fdc) )

	ROM_REGION( 0x0400, "proms", 0 )
	ROM_LOAD( "611g06.h14",  0x0000, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g05.h15",  0x0100, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */
	ROM_LOAD( "611g10.h6",   0x0200, 0x0100, CRC(f916129a) SHA1(d5e4a8a3baab8fcdac86ef5182858cede1abf040) ) /* sprites lookup table */
	ROM_LOAD( "611g09.h7",   0x0300, 0x0100, CRC(207a7b07) SHA1(f4e638e7f182e5228a062b243406d0ceaaa5bfdc) ) /* chars lookup table */

	ROM_REGION( 0x20000, "upd", 0 ) /* uPD7759 data */
	ROM_LOAD( "611g04.rom",  0x00000, 0x20000, CRC(2987e158) SHA1(87c5129161d3be29a339083349807e60b625c3f7) )
ROM_END

ROM_START( combatscb )
	ROM_REGION( 0x40000, "maincpu", 0 ) /* 6809 code */
	ROM_LOAD( "combat.002",  0x30000, 0x08000, CRC(0996755d) SHA1(bb6bbbf7ab3b5fab5e1c6cebc7b3f0d720493c3b) )
	ROM_CONTINUE(            0x08000, 0x08000 )
	ROM_LOAD( "combat.003",  0x10000, 0x10000, CRC(229c93b2) SHA1(ac3fd3df1bb5f6a461d0d1423c50568348ef69df) )
	ROM_LOAD( "combat.004",  0x20000, 0x10000, CRC(a069cb84) SHA1(f49f70afb17df46b16f5801ef42edb0706730723) )
	/* extra 0x8000 for banked RAM */

	ROM_REGION( 0x10000 , "audiocpu", 0 ) /* sound CPU */
	ROM_LOAD( "combat.001",  0x00000, 0x10000, CRC(61456b3b) SHA1(320db628283dd1bec465e95020d1a1158e6d6ae4) )

	ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT )
	ROM_LOAD( "combat.006",  0x00000, 0x10000, CRC(8dc29a1f) SHA1(564dd7c6acff34db93b8e300dda563f5f38ba159) ) /* tiles, bank 0 */
	ROM_LOAD( "combat.008",  0x10000, 0x10000, CRC(61599f46) SHA1(cfd79a88bb496773daf207552c67f595ee696bc4) )
	ROM_LOAD( "combat.010",  0x20000, 0x10000, CRC(d5cda7cd) SHA1(140db6270c3f358aa27013db3bb819a48ceb5142) )
	ROM_LOAD( "combat.012",  0x30000, 0x10000, CRC(ca0a9f57) SHA1(d6b3daf7c34345bb2f64068d480bd51d7bb36e4d) )
	ROM_LOAD( "combat.005",  0x40000, 0x10000, CRC(0803a223) SHA1(67d4162385dd56d5396e181070bfa6760521eb45) ) /* tiles, bank 1 */
	ROM_LOAD( "combat.007",  0x50000, 0x10000, CRC(23caad0c) SHA1(0544cde479c6d4192da5bb4b6f0e2e75d09663c3) )
	ROM_LOAD( "combat.009",  0x60000, 0x10000, CRC(5ac80383) SHA1(1e89c371a92afc000d593daebda4156952a15244) )
	ROM_LOAD( "combat.011",  0x70000, 0x10000, CRC(cda83114) SHA1(12d2a9f694287edb3bb0ee7a8ba0e0724dad8e1f) )

	ROM_REGION( 0x80000, "gfx2", ROMREGION_INVERT )
	ROM_LOAD( "combat.013",  0x00000, 0x10000, CRC(4bed2293) SHA1(3369de47d4ba041d9f17a18dcca2af7ac9f8bc0c) ) /* sprites, bank 0 */
	ROM_LOAD( "combat.015",  0x10000, 0x10000, CRC(26c41f31) SHA1(f8eb7d0729a21a0dd92ce99c9cda0cde9526b861) )
	ROM_LOAD( "combat.017",  0x20000, 0x10000, CRC(6071e6da) SHA1(ba5f8e83b07faaffc564d3568630e17efdb5a09f) )
	ROM_LOAD( "combat.019",  0x30000, 0x10000, CRC(3b1cf1b8) SHA1(ff4de37c051bcb374c44d1b99006ff6ff5e1f927) )
	ROM_LOAD( "combat.014",  0x40000, 0x10000, CRC(82ea9555) SHA1(59bf7836938ce9e3242d1cca754de8dbe85bbfb7) ) /* sprites, bank 1 */
	ROM_LOAD( "combat.016",  0x50000, 0x10000, CRC(2e39bb70) SHA1(a6c4acd93cc803e987de6e18fbdc5ce4634b14a8) )
	ROM_LOAD( "combat.018",  0x60000, 0x10000, CRC(575db729) SHA1(6b1676da4f24fc90c77262789b6cc116184ab912) )
	ROM_LOAD( "combat.020",  0x70000, 0x10000, CRC(8d748a1a) SHA1(4386e14e19b91e053033dde2a13019bc6d8e1d5a) )

	ROM_REGION( 0x0200, "proms", 0 )
	ROM_LOAD( "prom.d10",    0x0000, 0x0100, CRC(265f4c97) SHA1(76f1b75a593d3d77ef6173a1948f842d5b27d418) ) /* sprites lookup table */
	ROM_LOAD( "prom.c11",    0x0100, 0x0100, CRC(a7a5c0b4) SHA1(48bfc3af40b869599a988ebb3ed758141bcfd4fc) ) /* priority? */
ROM_END


/*************************************
 *
 *  Driver initialization
 *
 *************************************/

void combatsc_state::init_combatsc()
{
	/* joystick instead of trackball */
	m_maincpu->space(AS_PROGRAM).install_read_port(0x0404, 0x0404, "IN1");
}


/*************************************
 *
 *  Game driver(s)
 *
 *************************************/

GAME( 1988, combatsc,  0,        combatsc,  combatsc,  combatsc_state, init_combatsc, ROT0, "Konami",  "Combat School (joystick)",        0 )
GAME( 1987, combatsct, combatsc, combatsc,  combatsct, combatsc_state, empty_init,    ROT0, "Konami",  "Combat School (trackball)",       MACHINE_NOT_WORKING )
GAME( 1987, combatscj, combatsc, combatsc,  combatsct, combatsc_state, empty_init,    ROT0, "Konami",  "Combat School (Japan trackball)", MACHINE_NOT_WORKING )
GAME( 1987, bootcamp,  combatsc, combatsc,  combatsct, combatsc_state, empty_init,    ROT0, "Konami",  "Boot Camp (set 1)",               MACHINE_NOT_WORKING )
GAME( 1987, bootcampa, combatsc, combatsc,  combatsct, combatsc_state, empty_init,    ROT0, "Konami",  "Boot Camp (set 2)",               MACHINE_NOT_WORKING )
GAME( 1988, combatscb, combatsc, combatscb, combatscb, combatsc_state, empty_init,    ROT0, "bootleg", "Combat School (bootleg)",         MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND )
x'> return m_rom[offset+0xc00];
}
@@ -228,7 +228,7 @@ WRITE8_MEMBER(a2bus_timemasterho_device::pia_out_b)
{
if (m_dsw1->read() & 1)
{
- m_msm5832->write_w((data >> 6) & 1 ? ASSERT_LINE : CLEAR_LINE);
+ m_msm5832->write_w((data >> 6) & 1 ? ASSERT_LINE : CLEAR_LINE);
}
}
@@ -277,4 +277,3 @@ WRITE_LINE_MEMBER(a2bus_timemasterho_device::pia_irqb_w)
m_irqb = state;
update_irqs();
}
-
diff --git a/src/emu/bus/a7800/a78_carts.h b/src/emu/bus/a7800/a78_carts.h
index 1d31e22acdb..73739dddcf8 100644
--- a/src/emu/bus/a7800/a78_carts.h
+++ b/src/emu/bus/a7800/a78_carts.h
@@ -20,10 +20,10 @@ static SLOT_INTERFACE_START(a7800_cart)
SLOT_INTERFACE_INTERNAL("a78_abs", A78_ROM_ABSOLUTE)
SLOT_INTERFACE_INTERNAL("a78_act", A78_ROM_ACTIVISION)
SLOT_INTERFACE_INTERNAL("a78_hsc", A78_HISCORE)
- SLOT_INTERFACE_INTERNAL("a78_xboard", A78_XBOARD) // the actual XBoarD expansion (as passthru)
- SLOT_INTERFACE_INTERNAL("a78_xm", A78_XM) // the actual XM expansion (as passthru)
- SLOT_INTERFACE_INTERNAL("a78_megacart", A78_ROM_MEGACART)
- SLOT_INTERFACE_INTERNAL("a78_versa", A78_ROM_VERSABOARD)
+ SLOT_INTERFACE_INTERNAL("a78_xboard", A78_XBOARD) // the actual XBoarD expansion (as passthru)
+ SLOT_INTERFACE_INTERNAL("a78_xm", A78_XM) // the actual XM expansion (as passthru)
+ SLOT_INTERFACE_INTERNAL("a78_megacart", A78_ROM_MEGACART)
+ SLOT_INTERFACE_INTERNAL("a78_versa", A78_ROM_VERSABOARD)
// cart variants with a POKEY at 0x0450 (typically a VersaBoard variant, or an homebrew pcb)
SLOT_INTERFACE_INTERNAL("a78_p450_t0", A78_ROM_P450)
SLOT_INTERFACE_INTERNAL("a78_p450_t1", A78_ROM_P450_POKEY)
diff --git a/src/emu/bus/a7800/a78_slot.c b/src/emu/bus/a7800/a78_slot.c
index 9deac1afdd4..d1d6130ba26 100644
--- a/src/emu/bus/a7800/a78_slot.c
+++ b/src/emu/bus/a7800/a78_slot.c
@@ -21,7 +21,7 @@
- read_40xx/write_40xx for accesses in the $4000 to $ffff range
even if not all carts use all of them (in particular no cart type
seems to use access to the ranges $0500 to $0fff and $2800 to $2fff)
-
+
***********************************************************************************************************/
@@ -70,15 +70,15 @@ void device_a78_cart_interface::rom_alloc(UINT32 size, const char *tag)
tempstring.cat(A78SLOT_ROM_REGION_TAG);
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
m_rom_size = size;
-
+
// setup other helpers
if ((size / 0x4000) & 1) // compensate for SuperGame carts with 9 x 16K banks (to my knowledge no other cart has m_bank_mask != power of 2)
m_bank_mask = (size / 0x4000) - 2;
else
m_bank_mask = (size / 0x4000) - 1;
-
+
// the rom is mapped to the top of the memory area
- // so we store the starting point of data to simplify
+ // so we store the starting point of data to simplify
// the access handling
m_base_rom = 0x10000 - size;
}
@@ -272,7 +272,7 @@ int a78_cart_slot_device::validate_header(int head, bool log)
}
head &= 0xff00;
}
-
+
if ((head & 0xff00) > 0x300)
{
if (log)
@@ -282,7 +282,7 @@ int a78_cart_slot_device::validate_header(int head, bool log)
}
head &= 0x00ff;
}
-
+
return head;
}
@@ -329,7 +329,7 @@ static int a78_get_pcb_id(const char *slot)
if (!core_stricmp(slot_list[i].slot_option, slot))
return slot_list[i].pcb_id;
}
-
+
return 0;
}
@@ -340,7 +340,7 @@ static const char *a78_get_slot(int type)
if (slot_list[i].pcb_id == type)
return slot_list[i].slot_option;
}
-
+
return "a78_rom";
}
@@ -349,17 +349,17 @@ bool a78_cart_slot_device::call_load()
if (m_cart)
{
UINT32 len;
-
+
if (software_entry() != NULL)
{
const char *pcb_name;
bool has_ram = get_software_region("ram") ? TRUE : FALSE;
bool has_nvram = get_software_region("nvram") ? TRUE : FALSE;
len = get_software_region_length("rom");
-
+
m_cart->rom_alloc(len, tag());
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
-
+
if ((pcb_name = get_feature("slot")) != NULL)
m_type = a78_get_pcb_id(pcb_name);
else
@@ -377,19 +377,19 @@ bool a78_cart_slot_device::call_load()
{
// Load and check the header
int mapper;
- char head[128];
+ char head[128];
fread(head, 128);
-
+
if (verify_header((char *)head) == IMAGE_VERIFY_FAIL)
return IMAGE_INIT_FAIL;
-
+
len = (head[49] << 24) | (head[50] << 16) | (head[51] << 8) | head[52];
if (len + 128 > length())
{
logerror("Invalid length in the header. The game might be corrupted.\n");
len = length() - 128;
}
-
+
// let's try to auto-fix some common errors in the header
mapper = validate_header((head[53] << 8) | head[54], TRUE);
@@ -415,7 +415,7 @@ bool a78_cart_slot_device::call_load()
m_type = A78_VERSABOARD;
break;
}
-
+
// check if cart has a POKEY at $0450 (typically a VersaBoard variant)!
if (mapper & 0x40)
{
@@ -425,7 +425,7 @@ bool a78_cart_slot_device::call_load()
m_type += A78_POKEY0450;
}
}
-
+
// check special bits, which override the previous
if ((mapper & 0xff00) == 0x0100)
m_type = A78_ACTIVISION;
@@ -452,10 +452,10 @@ bool a78_cart_slot_device::call_load()
}
internal_header_logging((UINT8 *)head, length());
-
+
m_cart->rom_alloc(len, tag());
fread(m_cart->get_rom_base(), len);
-
+
if (m_type == A78_TYPE6)
m_cart->ram_alloc(0x4000);
if (m_type == A78_MEGACART || (m_type >= A78_VERSABOARD && m_type <= A78_VERSA_POK450))
@@ -468,7 +468,7 @@ bool a78_cart_slot_device::call_load()
battery_load(m_cart->get_nvram_base(), 0x800, 0xff);
}
}
-
+
//printf("Type: %s\n", a78_get_slot(m_type));
}
return IMAGE_INIT_PASS;
@@ -476,7 +476,7 @@ bool a78_cart_slot_device::call_load()
void a78_partialhash(hash_collection &dest, const unsigned char *data,
- unsigned long length, const char *functions)
+ unsigned long length, const char *functions)
{
if (length <= 128)
return;
@@ -537,13 +537,13 @@ void a78_cart_slot_device::get_default_card_software(astring &result)
const char *slot_string = "a78_rom";
dynamic_buffer head(128);
int type = A78_TYPE0, mapper;
-
+
// Load and check the header
- core_fread(m_file, head, 128);
+ core_fread(m_file, head, 128);
// let's try to auto-fix some common errors in the header
mapper = validate_header((head[53] << 8) | head[54], FALSE);
-
+
switch (mapper & 0x2e)
{
case 0x0000:
@@ -566,7 +566,7 @@ void a78_cart_slot_device::get_default_card_software(astring &result)
type = A78_VERSABOARD;
break;
}
-
+
// check if cart has a POKEY at $0450 (typically a VersaBoard variant)!
if (mapper & 0x40)
{
@@ -576,18 +576,18 @@ void a78_cart_slot_device::get_default_card_software(astring &result)
type += A78_POKEY0450;
}
}
-
+
// check special bits, which override the previous
if ((mapper & 0xff00) == 0x0100)
type = A78_ACTIVISION;
else if ((mapper & 0xff00) == 0x0200)
type = A78_ABSOLUTE;
-
+
logerror("Cart type: %x\n", type);
slot_string = a78_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
@@ -663,9 +663,9 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
/*-------------------------------------------------
A78 header logging
-
+
A78 HEADER FORMAT
-
+
Bytes | Content | Length
========================================
0 | Header version | 1 byte
@@ -679,7 +679,7 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
53..54 | Cart type [*] | 2 bytes
-------|-------------------|------------
55 | Controller 1 type | 1 byte
- | |
+ | |
| 0 = None |
| 1 = Joystick |
| 2 = Light Gun |
@@ -690,23 +690,23 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
-------|-------------------|------------
57 | TV System | 1 byte
| |
- | 0 = NTSC/1 = PAL |
+ | 0 = NTSC/1 = PAL |
-------|-------------------|------------
58 | Save data | 1 byte
| | (only v2)
| 0 = None / Unk |
| 1 = High Score |
| 2 = Savekey |
- -------|-------------------|-----------
+ -------|-------------------|-----------
63 | Expansion module | 1 byte
| |
| 0 = No expansion |
| module |
| 1 = Expansion |
| required |
- -------|-------------------|-----------
-
-
+ -------|-------------------|-----------
+
+
[*] Cart type:
bit 0-7 - Hardware "flags"
@@ -716,13 +716,13 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
bit 3 [0x08] - bank 0 of 144K ROM at $4000
bit 4 [0x10] - bank 6 at $4000
bit 5 [0x20] - banked RAM at $4000
-
+
bit 8-15 - Special values
0 = Normal cart
1 = Absolute (F18 Hornet)
2 = Activision (Double Dragon & Rampage)
3 = POKEY at $0450
-
+
-------------------------------------------------*/
void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
@@ -788,7 +788,7 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
ctrl1.cpy("Unknown controller");
break;
}
-
+
switch (head_ctrl2)
{
case 0x00:
@@ -804,10 +804,10 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
ctrl2.cpy("Unknown controller");
break;
}
-
+
logerror( "ROM DETAILS\n" );
logerror( "===========\n\n" );
- logerror( "\tTotal length (with header): 0x%x (%dK + 128b header)\n\n", len, len/0x400);
+ logerror( "\tTotal length (with header): 0x%x (%dK + 128b header)\n\n", len, len/0x400);
logerror( "HEADER DETAILS\n" );
logerror( "==============\n\n" );
logerror( "\tTitle: %.32s\n", head_title);
@@ -829,5 +829,5 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
logerror( "\n");
logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.cstr());
logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.cstr());
- logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
+ logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
}
diff --git a/src/emu/bus/a7800/a78_slot.h b/src/emu/bus/a7800/a78_slot.h
index b9c7e935d40..528c8932c04 100644
--- a/src/emu/bus/a7800/a78_slot.h
+++ b/src/emu/bus/a7800/a78_slot.h
@@ -12,19 +12,19 @@
/* PCB */
enum
{
- A78_TYPE0 = 0, // standard 8K/16K/32K games, no bankswitch
- A78_TYPE1, // as TYPE0 + POKEY chip on the PCB
- A78_TYPE2, // Atari SuperGame pcb (8x16K banks with bankswitch)
- A78_TYPE3, // as TYPE1 + POKEY chip on the PCB
- A78_TYPE6, // as TYPE1 + RAM IC on the PCB
- A78_TYPEA, // Alien Brigade, Crossbow (9x16K banks with diff bankswitch)
- A78_ABSOLUTE, // F18 Hornet
- A78_ACTIVISION, // Double Dragon, Rampage
- A78_HSC, // Atari HighScore cart
- A78_XB_BOARD, // A7800 Expansion Board (it shall more or less apply to the Expansion Module too, but this is not officially released yet)
- A78_XM_BOARD, // A7800 XM Expansion Module (theoretical specs only, since this is not officially released yet)
- A78_MEGACART, // Homebrew by CPUWIZ, consists of SuperGame bank up to 512K + 32K RAM banked
- A78_VERSABOARD = 0x10, // Homebrew by CPUWIZ, consists of SuperGame bank up to 256K + 32K RAM banked
+ A78_TYPE0 = 0, // standard 8K/16K/32K games, no bankswitch
+ A78_TYPE1, // as TYPE0 + POKEY chip on the PCB
+ A78_TYPE2, // Atari SuperGame pcb (8x16K banks with bankswitch)
+ A78_TYPE3, // as TYPE1 + POKEY chip on the PCB
+ A78_TYPE6, // as TYPE1 + RAM IC on the PCB
+ A78_TYPEA, // Alien Brigade, Crossbow (9x16K banks with diff bankswitch)
+ A78_ABSOLUTE, // F18 Hornet
+ A78_ACTIVISION, // Double Dragon, Rampage
+ A78_HSC, // Atari HighScore cart
+ A78_XB_BOARD, // A7800 Expansion Board (it shall more or less apply to the Expansion Module too, but this is not officially released yet)
+ A78_XM_BOARD, // A7800 XM Expansion Module (theoretical specs only, since this is not officially released yet)
+ A78_MEGACART, // Homebrew by CPUWIZ, consists of SuperGame bank up to 512K + 32K RAM banked
+ A78_VERSABOARD = 0x10, // Homebrew by CPUWIZ, consists of SuperGame bank up to 256K + 32K RAM banked
// VersaBoard variants configured as Type 1/3/A or VersaBoard + POKEY at $0450
A78_TYPE0_POK450 = 0x20,
A78_TYPE1_POK450 = 0x21,
@@ -68,7 +68,7 @@ protected:
UINT8 *m_rom;
UINT32 m_rom_size;
dynamic_buffer m_ram;
- dynamic_buffer m_nvram; // HiScore cart can save scores!
+ dynamic_buffer m_nvram; // HiScore cart can save scores!
// helpers
UINT32 m_base_rom;
int m_bank_mask;
@@ -101,7 +101,7 @@ public:
int get_cart_type() { return m_type; };
int identify_cart_type(UINT8 *ROM, UINT32 len);
bool has_cart() { return m_cart != NULL; }
-
+
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
@@ -125,7 +125,7 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_10xx);
virtual DECLARE_WRITE8_MEMBER(write_30xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
private:
device_a78_cart_interface* m_cart;
int m_type;
diff --git a/src/emu/bus/a7800/cpuwiz.c b/src/emu/bus/a7800/cpuwiz.c
index c5d6ef74532..f25580a1c08 100644
--- a/src/emu/bus/a7800/cpuwiz.c
+++ b/src/emu/bus/a7800/cpuwiz.c
@@ -3,26 +3,26 @@
/***********************************************************************************************************
A7800 CPUWIZ's homebrew boards (MegaCart+ and VersaBoard)
-
+
Here we emulate the base configurations of these two boards:
MegaCart+ = up to 512K (31 banks at $8000, 1 at $C000) of ROM and 2 x 16K RAM @ $4000
VersaBoard = up to 256K of ROM and 2 x 16K RAM
-
- Plus, for the moment, a VersaBoard with POKEY mapped at 0x0450 and support for 144K ROM,
- since a few demo homebrew programs seems to use this to combine compatibility with
+
+ Plus, for the moment, a VersaBoard with POKEY mapped at 0x0450 and support for 144K ROM,
+ since a few demo homebrew programs seems to use this to combine compatibility with
XBoarD & XM expansions
Note that the VersaBoard can be configured to work with different banking hardware
e.g. with SG 9bank games or with SG + RAM (so to allow reproduction of games which
- could have worked on old carts without sacrifying original carts), but games running
+ could have worked on old carts without sacrifying original carts), but games running
on those "standard" variants can be emulated with the standard code from rom.c ;-)
-
-
+
+
TO DO:
- investigate whether the POKEY detection routines in homebrew do fail due to emulation
issues or not
-
+
***********************************************************************************************************/
@@ -86,7 +86,7 @@ READ8_MEMBER(a78_versaboard_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_versaboard_device::write_40xx)
@@ -130,5 +130,3 @@ machine_config_constructor a78_rom_p450_vb_device::device_mconfig_additions() co
{
return MACHINE_CONFIG_NAME( a78_pokeyvb );
}
-
-
diff --git a/src/emu/bus/a7800/cpuwiz.h b/src/emu/bus/a7800/cpuwiz.h
index ab019433b70..193ba336b96 100644
--- a/src/emu/bus/a7800/cpuwiz.h
+++ b/src/emu/bus/a7800/cpuwiz.h
@@ -15,15 +15,15 @@ public:
// construction/destruction
a78_versaboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_versaboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
int m_ram_bank;
};
@@ -36,7 +36,7 @@ class a78_megacart_device : public a78_versaboard_device
public:
// construction/destruction
a78_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_WRITE8_MEMBER(write_40xx);
};
@@ -51,14 +51,14 @@ class a78_rom_p450_vb_device : public a78_versaboard_device
public:
// construction/destruction
a78_rom_p450_vb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
diff --git a/src/emu/bus/a7800/hiscore.c b/src/emu/bus/a7800/hiscore.c
index 2e941af9fbd..c51d1c26b74 100644
--- a/src/emu/bus/a7800/hiscore.c
+++ b/src/emu/bus/a7800/hiscore.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
A7800 HighScore passthrough cart emulation
-
+
***********************************************************************************************************/
@@ -75,4 +75,3 @@ WRITE8_MEMBER(a78_hiscore_device::write_40xx)
{
m_hscslot->write_40xx(space, offset, data);
}
-
diff --git a/src/emu/bus/a7800/hiscore.h b/src/emu/bus/a7800/hiscore.h
index d848becfea7..d1750c77486 100644
--- a/src/emu/bus/a7800/hiscore.h
+++ b/src/emu/bus/a7800/hiscore.h
@@ -14,10 +14,10 @@ class a78_hiscore_device : public a78_rom_device
public:
// construction/destruction
a78_hiscore_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
diff --git a/src/emu/bus/a7800/rom.c b/src/emu/bus/a7800/rom.c
index 508c9cc895b..d2bfc5d78a4 100644
--- a/src/emu/bus/a7800/rom.c
+++ b/src/emu/bus/a7800/rom.c
@@ -10,7 +10,7 @@
- 9 banks or not
etc...
But we might merge many of these if they become too many
-
+
TODO:
- Are POKEY regs readable somewhere in SG 144K + POKEY homebrew? How do they detect
the POKEY otherwise?!?
@@ -232,11 +232,11 @@ READ8_MEMBER(a78_rom_device::read_40xx)
/*-------------------------------------------------
Carts with no bankswitch + POKEY chip
- The Pokey chips is accessed by writing at
+ The Pokey chips is accessed by writing at
0x4000-0x7fff.
-
+
GAMES: Ballblazer, Beef Drop (homebrew)
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_pokey_device::read_40xx)
@@ -274,19 +274,19 @@ machine_config_constructor a78_rom_pokey_device::device_mconfig_additions() cons
some test is run)
Note that the code is written so that also
homebrew games with larger ROMs work!
-
+
GAMES: Crack'd, Fatal Run, Ikari Warriors...
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg_device::read_40xx)
{
if (offset < 0x4000)
- return m_rom[(offset & 0x3fff) + ((m_bank_mask - 1) * 0x4000)]; // second to last bank (is this always ok?!?)
+ return m_rom[(offset & 0x3fff) + ((m_bank_mask - 1) * 0x4000)]; // second to last bank (is this always ok?!?)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg_device::write_40xx)
@@ -300,9 +300,9 @@ WRITE8_MEMBER(a78_rom_sg_device::write_40xx)
Carts with SuperGame bankswitch + POKEY chip
As above + Pokey chip access
-
+
GAMES: Commando
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg_pokey_device::read_40xx)
@@ -312,7 +312,7 @@ READ8_MEMBER(a78_rom_sg_pokey_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg_pokey_device::write_40xx)
@@ -332,12 +332,12 @@ machine_config_constructor a78_rom_sg_pokey_device::device_mconfig_additions() c
/*-------------------------------------------------
Carts with SuperGame bankswitch + 16K RAM
- FIXME: Some games contained only 8K of RAM, but
+ FIXME: Some games contained only 8K of RAM, but
for the moment we treat all as 16K of RAM even if
from softlist we shall differentiate between them.
-
+
GAMES: Impossible Mission, Jinks and some protos
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg_ram_device::read_40xx)
@@ -347,7 +347,7 @@ READ8_MEMBER(a78_rom_sg_ram_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg_ram_device::write_40xx)
@@ -364,11 +364,11 @@ WRITE8_MEMBER(a78_rom_sg_ram_device::write_40xx)
Carts with SuperGame bankswitch 9banks:
9 x 16K banks mappable in 0x8000-0xbfff
bank 7 is always mapped in 0xc000-0xffff
-
- GAMES: Alien Brigade & Crossbow + some homebrew
- like Donkey Kong XM demo, Bentley Bear's Crystal
+
+ GAMES: Alien Brigade & Crossbow + some homebrew
+ like Donkey Kong XM demo, Bentley Bear's Crystal
Quest
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg9_device::read_40xx)
@@ -378,7 +378,7 @@ READ8_MEMBER(a78_rom_sg9_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + ((m_bank_mask + 1) * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + ((m_bank_mask + 1) * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg9_device::write_40xx)
@@ -388,14 +388,14 @@ WRITE8_MEMBER(a78_rom_sg9_device::write_40xx)
}
/*-------------------------------------------------
-
+
Carts with Absolute bankswitch:
64K games. Lower 32K are 2 banks of 16K to be mapped
in 0x4000-0x7fff, depending on the value written
at 0x8000. Higher 32K are fixed in 0x8000-0xffff
-
+
GAMES: F-18 Hornet
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_abs_device::read_40xx)
@@ -431,9 +431,9 @@ WRITE8_MEMBER(a78_rom_abs_device::write_40xx)
0x6000-0x7fff first 8kb of bank 6
0x8000-0x9fff second 8kb of bank 7
0xe000-0xffff first 8kb of bank 7
-
+
GAMES: Double Dragon, Rampage.
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_act_device::read_40xx)
@@ -495,4 +495,3 @@ machine_config_constructor a78_rom_p450_sg9_device::device_mconfig_additions() c
{
return MACHINE_CONFIG_NAME( a78_pokey450 );
}
-
diff --git a/src/emu/bus/a7800/rom.h b/src/emu/bus/a7800/rom.h
index 425513d02d7..16f31360a74 100644
--- a/src/emu/bus/a7800/rom.h
+++ b/src/emu/bus/a7800/rom.h
@@ -34,14 +34,14 @@ public:
// construction/destruction
a78_rom_pokey_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
required_device<pokey_device> m_pokey;
};
@@ -55,11 +55,11 @@ public:
// construction/destruction
a78_rom_sg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
@@ -76,14 +76,14 @@ class a78_rom_sg_pokey_device : public a78_rom_sg_device
public:
// construction/destruction
a78_rom_sg_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
required_device<pokey_device> m_pokey;
};
@@ -97,7 +97,7 @@ public:
// construction/destruction
a78_rom_sg_ram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
@@ -112,7 +112,7 @@ public:
// construction/destruction
a78_rom_sg9_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
@@ -126,15 +126,15 @@ class a78_rom_abs_device : public a78_rom_device
public:
// construction/destruction
a78_rom_abs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
int m_bank;
};
@@ -147,15 +147,15 @@ class a78_rom_act_device : public a78_rom_device
public:
// construction/destruction
a78_rom_act_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
int m_bank;
};
@@ -170,13 +170,13 @@ class a78_rom_p450_device : public a78_rom_device
public:
// construction/destruction
a78_rom_p450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
@@ -189,13 +189,13 @@ class a78_rom_p450_pokey_device : public a78_rom_pokey_device
public:
// construction/destruction
a78_rom_p450_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
@@ -208,13 +208,13 @@ class a78_rom_p450_sg_ram_device : public a78_rom_sg_ram_device
public:
// construction/destruction
a78_rom_p450_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
@@ -227,13 +227,13 @@ class a78_rom_p450_sg9_device : public a78_rom_sg9_device
public:
// construction/destruction
a78_rom_p450_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
diff --git a/src/emu/bus/a7800/xboard.c b/src/emu/bus/a7800/xboard.c
index 66c89d3d05c..4a7d3742f1b 100644
--- a/src/emu/bus/a7800/xboard.c
+++ b/src/emu/bus/a7800/xboard.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
A7800 XBoarD & XM expansions emulation
-
+
The XBoarD should be socketed in the A7800 pcb in place of the Maria chip.
It adds to the system additional 128K of RAM and an onboard pokey.
The XM seems to work the same as XBoarD, but it also features HighScore savings
@@ -12,31 +12,31 @@
Currently, we emulate both of these as a passthru cart, even if not 100% accurate for the XBoarD
-
+
Memory map:
POKEY1 $0450 $045F 16 bytes
POKEY2* $0460 $046F 16 bytes
XCTRL $0470 $047F 1 byte
RAM $4000 $7FFF 16384 bytes
-
+
XCTRL Bit Description
-
+
+-------------------------------+
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+-------------------------------+
| | | | | | | |
| | | | | | | +-- Bank select bit 0 \
| | | | | | +------ Bank select bit 1 | Totally 128 KByte in 16 KByte banks
- | | | | | +---------- Bank select bit 2 /
+ | | | | | +---------- Bank select bit 2 /
| | | | +-------------- Enable memory bit (1 = Memory enabled, 0 after power on)
| | | +------------------ Enable POKEY bit** (1 = POKEY enabled, 0 after power on)
| | |
NA NA NA = Not Available or Not Used
-
+
* = Can be mounted piggy back on the first POKEY. Description how to do this will come when i have tried it out.
** This bit controls both POKEY chip select signals.
-
+
TODO:
- verify what happens when 2 POKEYs are present
@@ -142,9 +142,9 @@ machine_config_constructor a78_xm_device::device_mconfig_additions() const
-------------------------------------------------*/
/*-------------------------------------------------
-
+
XBoarD: passthru + 128K RAM + POKEY
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_xboard_device::read_40xx)
@@ -168,7 +168,7 @@ READ8_MEMBER(a78_xboard_device::read_04xx)
if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60)
return m_pokey->read(space, offset & 0x0f);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
+ return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
else
return 0xff;
}
@@ -178,7 +178,7 @@ WRITE8_MEMBER(a78_xboard_device::write_04xx)
if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60)
m_pokey->write(space, offset & 0x0f, data);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
+ m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
else if (offset >= 0x70 && offset < 0x80)
{
m_reg = data;
@@ -188,9 +188,9 @@ WRITE8_MEMBER(a78_xboard_device::write_04xx)
/*-------------------------------------------------
-
+
XM: Same as above but also featuring High Score savings
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_xm_device::read_10xx)
@@ -215,7 +215,7 @@ READ8_MEMBER(a78_xm_device::read_04xx)
else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61)
return m_ym->read(space, offset & 1);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
+ return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
else
return 0xff;
}
@@ -227,7 +227,7 @@ WRITE8_MEMBER(a78_xm_device::write_04xx)
else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61)
m_ym->write(space, offset & 1, data);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
+ m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
else if (offset >= 0x70 && offset < 0x80)
{
//printf("regs 0x%X\n", data);
diff --git a/src/emu/bus/a7800/xboard.h b/src/emu/bus/a7800/xboard.h
index 2eb63462b47..0e5e7f26cf0 100644
--- a/src/emu/bus/a7800/xboard.h
+++ b/src/emu/bus/a7800/xboard.h
@@ -17,12 +17,12 @@ public:
// construction/destruction
a78_xboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_xboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
@@ -43,19 +43,19 @@ class a78_xm_device : public a78_xboard_device
public:
// construction/destruction
a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
virtual DECLARE_READ8_MEMBER(read_10xx);
virtual DECLARE_WRITE8_MEMBER(write_10xx);
virtual DECLARE_READ8_MEMBER(read_30xx);
-
+
protected:
required_device<ym2151_device> m_ym;
int m_ym_enabled;
diff --git a/src/emu/bus/a800/a800_carts.h b/src/emu/bus/a800/a800_carts.h
index 8a67ef656a0..eb28c9c3b2c 100644
--- a/src/emu/bus/a800/a800_carts.h
+++ b/src/emu/bus/a800/a800_carts.h
@@ -14,7 +14,7 @@ static SLOT_INTERFACE_START(a800_left)
SLOT_INTERFACE_INTERNAL("a800_8k", A800_ROM)
SLOT_INTERFACE_INTERNAL("a800_8k_right", A800_ROM)
SLOT_INTERFACE_INTERNAL("a800_16k", A800_ROM)
- SLOT_INTERFACE_INTERNAL("a800_phoenix", A800_ROM) // not really emulated at this stage
+ SLOT_INTERFACE_INTERNAL("a800_phoenix", A800_ROM) // not really emulated at this stage
SLOT_INTERFACE_INTERNAL("a800_bbsb", A800_ROM_BBSB)
SLOT_INTERFACE_INTERNAL("a800_oss8k", A800_ROM_OSS8K)
SLOT_INTERFACE_INTERNAL("a800_oss034m", A800_ROM_OSS34)
@@ -23,13 +23,13 @@ static SLOT_INTERFACE_START(a800_left)
SLOT_INTERFACE_INTERNAL("a800_williams", A800_ROM_WILLIAMS)
SLOT_INTERFACE_INTERNAL("a800_diamond", A800_ROM_EXPRESS)
SLOT_INTERFACE_INTERNAL("a800_express", A800_ROM_EXPRESS)
- SLOT_INTERFACE_INTERNAL("a800_sparta", A800_ROM_SPARTADOS) // this is a passthru cart with unemulated (atm) subslot
+ SLOT_INTERFACE_INTERNAL("a800_sparta", A800_ROM_SPARTADOS) // this is a passthru cart with unemulated (atm) subslot
SLOT_INTERFACE_INTERNAL("a800_blizzard", A800_ROM)
SLOT_INTERFACE_INTERNAL("a800_turbo64", A800_ROM_TURBO)
SLOT_INTERFACE_INTERNAL("a800_turbo128", A800_ROM_TURBO)
SLOT_INTERFACE_INTERNAL("a800_tlink2", A800_ROM_TELELINK2)
SLOT_INTERFACE_INTERNAL("a800_sitsa", A800_ROM_MICROCALC)
- SLOT_INTERFACE_INTERNAL("a800_corina", A800_ROM) // NOT SUPPORTED YET!
+ SLOT_INTERFACE_INTERNAL("a800_corina", A800_ROM) // NOT SUPPORTED YET!
SLOT_INTERFACE_INTERNAL("xegs", XEGS_ROM)
SLOT_INTERFACE_END
diff --git a/src/emu/bus/a800/a800_slot.c b/src/emu/bus/a800/a800_slot.c
index 0a86342247f..e6d06c936e6 100644
--- a/src/emu/bus/a800/a800_slot.c
+++ b/src/emu/bus/a800/a800_slot.c
@@ -6,12 +6,12 @@
Atari 8 bit cart emulation
(through slot devices)
- Emulation of the cartslot(s) for Atari 8bit series of home computers
-
+ Emulation of the cartslot(s) for Atari 8bit series of home computers
+
Accessors to ROM are typically given in the area 0xa000-0xbfff, but some
carts (and the right slot in A800) maps ROM to 0x8000-0x9fff too
Bankswitch typically happens by accessing addresses in 0xd500-0xd5ff
-
+
Accordingly, this device offers the following handlers
- read_80xx/write_80xx
- read_d5xx/write_d5xx
@@ -67,9 +67,9 @@ void device_a800_cart_interface::rom_alloc(UINT32 size, const char *tag)
tempstring.cat(A800SLOT_ROM_REGION_TAG);
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
m_rom_size = size;
-
+
// setup other helpers
- m_bank_mask = (size / 0x2000) - 1; // code for XEGS carts makes use of this to simplify banking
+ m_bank_mask = (size / 0x2000) - 1; // code for XEGS carts makes use of this to simplify banking
}
}
@@ -243,15 +243,15 @@ bool a800_cart_slot_device::call_load()
if (m_cart)
{
UINT32 len;
-
+
if (software_entry() != NULL)
{
const char *pcb_name;
len = get_software_region_length("rom");
-
+
m_cart->rom_alloc(len, tag());
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
-
+
if ((pcb_name = get_feature("slot")) != NULL)
m_type = a800_get_pcb_id(pcb_name);
else
@@ -267,9 +267,9 @@ bool a800_cart_slot_device::call_load()
UINT8 header[16];
fread(header, 0x10);
m_type = identify_cart_type(header);
- len -= 0x10; // in identify_cart_type the first 0x10 bytes are read, so we need to adjust here
+ len -= 0x10; // in identify_cart_type the first 0x10 bytes are read, so we need to adjust here
}
- else // otherwise try to guess based on size
+ else // otherwise try to guess based on size
{
if (len == 0x8000)
m_type = A5200_32K;
@@ -323,7 +323,7 @@ int a800_cart_slot_device::identify_cart_type(UINT8 *header)
// check CART format
if (strncmp((const char *)header, "CART", 4))
fatalerror("Invalid header detected!\n");
-
+
switch ((header[4] << 24) + (header[5] << 16) + (header[6] << 8) + (header[7] << 0))
{
case 1:
@@ -400,7 +400,7 @@ int a800_cart_slot_device::identify_cart_type(UINT8 *header)
osd_printf_info("Cart type \"%d\" is currently unsupported.\n", (header[4] << 24) + (header[5] << 16) + (header[6] << 8) + (header[7] << 0));
break;
}
-
+
return type;
}
@@ -420,10 +420,10 @@ void a800_cart_slot_device::get_default_card_software(astring &result)
// check whether there is an header, to identify the cart type
if ((len % 0x1000) == 0x10)
{
- core_fread(m_file, head, 0x10);
+ core_fread(m_file, head, 0x10);
type = identify_cart_type(head);
}
- else // otherwise try to guess based on size
+ else // otherwise try to guess based on size
{
if (len == 0x4000)
type = A800_16K;
@@ -435,9 +435,9 @@ void a800_cart_slot_device::get_default_card_software(astring &result)
osd_printf_info("This game is not designed for A800. You might want to run it in A5200.\n");
slot_string = a800_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
@@ -453,11 +453,11 @@ void a5200_cart_slot_device::get_default_card_software(astring &result)
dynamic_buffer head(0x10);
UINT32 len = core_fsize(m_file);
int type = A5200_8K;
-
+
// check whether there is an header, to identify the cart type
if ((len % 0x1000) == 0x10)
{
- core_fread(m_file, head, 0x10);
+ core_fread(m_file, head, 0x10);
type = identify_cart_type(head);
astring info;
@@ -466,11 +466,11 @@ void a5200_cart_slot_device::get_default_card_software(astring &result)
}
if (type < A5200_4K)
osd_printf_info("This game is not designed for A5200. You might want to run it in A800 or A800XL.\n");
-
+
slot_string = a800_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
@@ -486,11 +486,11 @@ void xegs_cart_slot_device::get_default_card_software(astring &result)
dynamic_buffer head(0x10);
UINT32 len = core_fsize(m_file);
int type = A800_8K;
-
+
// check whether there is an header, to identify the cart type
if ((len % 0x1000) == 0x10)
{
- core_fread(m_file, head, 0x10);
+ core_fread(m_file, head, 0x10);
type = identify_cart_type(head);
}
if (type != A800_XEGS)
@@ -501,11 +501,11 @@ void xegs_cart_slot_device::get_default_card_software(astring &result)
else
osd_printf_info("You might want to run it in A800 or A800XL.\n");
}
-
+
slot_string = a800_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
@@ -549,4 +549,3 @@ WRITE8_MEMBER(a800_cart_slot_device::write_d5xx)
if (m_cart)
m_cart->write_d5xx(space, offset, data, mem_mask);
}
-
diff --git a/src/emu/bus/a800/a800_slot.h b/src/emu/bus/a800/a800_slot.h
index 536ed38da3e..b9e4f491d73 100644
--- a/src/emu/bus/a800/a800_slot.h
+++ b/src/emu/bus/a800/a800_slot.h
@@ -20,11 +20,11 @@ enum
A800_OSSM091,
A800_OSS8K,
A800_PHOENIX,
- A800_XEGS,
- A800_BBSB,
+ A800_XEGS,
+ A800_BBSB,
A800_DIAMOND,
A800_WILLIAMS,
- A800_EXPRESS,
+ A800_EXPRESS,
A800_SPARTADOS,
A800_BLIZZARD,
A800_TURBO64,
@@ -71,7 +71,7 @@ protected:
UINT8 *m_rom;
UINT32 m_rom_size;
dynamic_buffer m_ram;
- dynamic_buffer m_nvram; // HiScore cart can save scores!
+ dynamic_buffer m_nvram; // HiScore cart can save scores!
// helpers
int m_bank_mask;
};
@@ -101,7 +101,7 @@ public:
int get_cart_type() { return m_type; };
int identify_cart_type(UINT8 *header);
bool has_cart() { return m_cart != NULL; }
-
+
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
@@ -120,7 +120,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_d5xx);
virtual DECLARE_WRITE8_MEMBER(write_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
private:
device_a800_cart_interface* m_cart;
int m_type;
@@ -138,9 +138,9 @@ public:
// construction/destruction
a5200_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~a5200_cart_slot_device();
-
+
virtual const char *file_extensions() const { return "bin,rom,car,a52"; }
-
+
// slot interface overrides
virtual void get_default_card_software(astring &result);
};
@@ -155,7 +155,7 @@ public:
virtual ~xegs_cart_slot_device();
virtual const char *file_extensions() const { return "bin,rom,car"; }
-
+
// slot interface overrides
virtual void get_default_card_software(astring &result);
};
diff --git a/src/emu/bus/a800/oss.c b/src/emu/bus/a800/oss.c
index 1cf4d176d68..3df4f2b0ed4 100644
--- a/src/emu/bus/a800/oss.c
+++ b/src/emu/bus/a800/oss.c
@@ -95,11 +95,11 @@ void a800_rom_oss91_device::device_reset()
-------------------------------------------------*/
/*-------------------------------------------------
-
+
OSS 8K
-
+
This is used by The Writer's Tool only.
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss8k_device::read_80xx)
@@ -128,12 +128,12 @@ WRITE8_MEMBER(a800_rom_oss8k_device::write_d5xx)
/*-------------------------------------------------
-
+
OSS 034M
-
+
This apparently comes from a dump with the wrong bank order...
investigate whether we should remove it!
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss34_device::read_80xx)
@@ -156,7 +156,7 @@ WRITE8_MEMBER(a800_rom_oss34_device::write_d5xx)
break;
case 2:
case 6:
- m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
+ m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
break;
case 3:
case 7:
@@ -173,11 +173,11 @@ WRITE8_MEMBER(a800_rom_oss34_device::write_d5xx)
/*-------------------------------------------------
-
+
OSS 043M
-
+
Same as above but with correct bank order
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss43_device::read_80xx)
@@ -200,7 +200,7 @@ WRITE8_MEMBER(a800_rom_oss43_device::write_d5xx)
break;
case 2:
case 6:
- m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
+ m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
break;
case 3:
case 7:
@@ -217,12 +217,12 @@ WRITE8_MEMBER(a800_rom_oss43_device::write_d5xx)
/*-------------------------------------------------
-
+
OSS M091
-
- Simplified banking system which only uses two
+
+ Simplified banking system which only uses two
address lines (A0 & A3)
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss91_device::read_80xx)
@@ -250,4 +250,3 @@ WRITE8_MEMBER(a800_rom_oss91_device::write_d5xx)
break;
}
}
-
diff --git a/src/emu/bus/a800/oss.h b/src/emu/bus/a800/oss.h
index 5aef80526df..ad772689277 100644
--- a/src/emu/bus/a800/oss.h
+++ b/src/emu/bus/a800/oss.h
@@ -13,14 +13,14 @@ class a800_rom_oss8k_device : public a800_rom_device
public:
// construction/destruction
a800_rom_oss8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -53,14 +53,14 @@ class a800_rom_oss43_device : public a800_rom_device
public:
// construction/destruction
a800_rom_oss43_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -73,14 +73,14 @@ class a800_rom_oss91_device : public a800_rom_device
public:
// construction/destruction
a800_rom_oss91_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
diff --git a/src/emu/bus/a800/rom.c b/src/emu/bus/a800/rom.c
index b527c3b228d..ed11faa7d7b 100644
--- a/src/emu/bus/a800/rom.c
+++ b/src/emu/bus/a800/rom.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
A800/A5200/XEGS ROM cart emulation
-
+
Basic carts work the same (in addition of being mostly compatible) for all these systems
and thus we deal with them in a single file
@@ -196,7 +196,7 @@ void a5200_rom_bbsb_device::device_reset()
/*-------------------------------------------------
Carts with no bankswitch (8K, 16K)
-
+
The cart accessors are mapped in the correct
range at driver start
@@ -210,14 +210,14 @@ READ8_MEMBER(a800_rom_device::read_80xx)
/*-------------------------------------------------
-
+
Bounty Bob Strikes Back! cart (40K)
-
+
Area 0xa000-0xbfff always point to last 8K bank
- Areas 0x8000-0x8fff and 0x9000-0x9fff are
+ Areas 0x8000-0x8fff and 0x9000-0x9fff are
separate banks of 4K mapped either in the first
16K chunk or in the second 16K chunk
- Bankswitch is controlled by data written in
+ Bankswitch is controlled by data written in
0x8000-0x8fff and 0x9000-0x9fff respectively
-------------------------------------------------*/
@@ -240,12 +240,12 @@ WRITE8_MEMBER(a800_rom_bbsb_device::write_80xx)
}
/*-------------------------------------------------
-
+
XEGS carts (32K, 64K or 128K)
-
- Bankswitch is controlled by data written in
+
+ Bankswitch is controlled by data written in
0xd500-0xd5ff
-
+
-------------------------------------------------*/
READ8_MEMBER(xegs_rom_device::read_80xx)
@@ -253,8 +253,8 @@ READ8_MEMBER(xegs_rom_device::read_80xx)
if (offset < 0x2000)
return m_rom[(offset & 0x1fff) + (m_bank * 0x2000)];
else
- return m_rom[(offset & 0x1fff) + (m_bank_mask * 0x2000)]; // always last 8K bank
-
+ return m_rom[(offset & 0x1fff) + (m_bank_mask * 0x2000)]; // always last 8K bank
+
}
WRITE8_MEMBER(xegs_rom_device::write_d5xx)
@@ -264,16 +264,16 @@ WRITE8_MEMBER(xegs_rom_device::write_d5xx)
/*-------------------------------------------------
-
+
Williams 64K
-
+
The rom is accessed in 8K chunks at 0xa000-0xbfff
Bankswitch is controlled by writing to 7 diff
- offsets (their location varies with the cart type):
- offs 0 points to bank 0, offs 1 points to bank 1,
- and so on... the rom can be disabled by writing to
+ offsets (their location varies with the cart type):
+ offs 0 points to bank 0, offs 1 points to bank 1,
+ and so on... the rom can be disabled by writing to
the offsets 0x8-0xf of the same range as the bankswitch
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_williams_device::read_80xx)
@@ -287,16 +287,16 @@ WRITE8_MEMBER(a800_rom_williams_device::write_d5xx)
}
/*-------------------------------------------------
-
+
Express 64K / Diamond 64K carts
-
+
The rom is accessed in 8K chunks at 0xa000-0xbfff
- Bankswitch is the same as above, but writes trigger
- banks in reverse order: offs 7 points to bank 0, offs 6
+ Bankswitch is the same as above, but writes trigger
+ banks in reverse order: offs 7 points to bank 0, offs 6
points to bank 1, and so on... the rom can be disabled
by writing to the offsets 0x8-0xf of the same range
as the bankswitch
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_express_device::read_80xx)
@@ -311,10 +311,10 @@ WRITE8_MEMBER(a800_rom_express_device::write_d5xx)
/*-------------------------------------------------
-
+
Turbosoft 64K / 128K
-
-
+
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_turbo_device::read_80xx)
@@ -329,10 +329,10 @@ WRITE8_MEMBER(a800_rom_turbo_device::write_d5xx)
/*-------------------------------------------------
-
+
Telelink II
-
-
+
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_telelink2_device::read_80xx)
@@ -347,7 +347,7 @@ READ8_MEMBER(a800_rom_telelink2_device::read_80xx)
WRITE8_MEMBER(a800_rom_telelink2_device::write_80xx)
{
- m_nvram[offset & 0xff] = data | 0xf0; // low 4bits only
+ m_nvram[offset & 0xff] = data | 0xf0; // low 4bits only
}
READ8_MEMBER(a800_rom_telelink2_device::read_d5xx)
@@ -364,10 +364,10 @@ WRITE8_MEMBER(a800_rom_telelink2_device::write_d5xx)
/*-------------------------------------------------
-
+
SITSA Microcalc
-
-
+
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_microcalc_device::read_80xx)
@@ -386,21 +386,21 @@ WRITE8_MEMBER(a800_rom_microcalc_device::write_d5xx)
/*-------------------------------------------------
-
+
Carts with no bankswitch (4K, 8K, 16K, 32K)
-
+
Same as base carts above
-
+
-------------------------------------------------*/
/*-------------------------------------------------
-
+
Carts with 2x8K (16K) with A13 line not connected
-
+
Range 0x4000-0x7fff contains two copies of the low
8K, range 0x8000-0xbfff contains two copies of the
high 8K
-
+
-------------------------------------------------*/
READ8_MEMBER(a5200_rom_2chips_device::read_80xx)
@@ -413,18 +413,18 @@ READ8_MEMBER(a5200_rom_2chips_device::read_80xx)
/*-------------------------------------------------
-
+
Bounty Bob Strikes Back! cart (40K)
-
+
Similar to the A800 version, but:
Area 0x8000-0xbfff always point to last 8K bank
(repeated twice)
- Areas 0x4000-0x4fff and 0x5000-0x5fff are
+ Areas 0x4000-0x4fff and 0x5000-0x5fff are
separate banks of 4K mapped either in the first
16K chunk or in the second 16K chunk
- Bankswitch is controlled by data written in
+ Bankswitch is controlled by data written in
0x4000-0x4fff and 0x5000-0x5fff respectively
-
+
-------------------------------------------------*/
READ8_MEMBER(a5200_rom_bbsb_device::read_80xx)
@@ -445,4 +445,3 @@ WRITE8_MEMBER(a5200_rom_bbsb_device::write_80xx)
if (addr >= 0xff6 && addr <= 0xff9)
m_banks[BIT(offset, 12)] = (addr - 0xff6);
}
-
diff --git a/src/emu/bus/a800/rom.h b/src/emu/bus/a800/rom.h
index 55bb728a94f..4c4ea9b30c2 100644
--- a/src/emu/bus/a800/rom.h
+++ b/src/emu/bus/a800/rom.h
@@ -31,14 +31,14 @@ class a800_rom_bbsb_device : public a800_rom_device
public:
// construction/destruction
a800_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_80xx);
-
+
protected:
int m_banks[2];
};
@@ -51,14 +51,14 @@ class a800_rom_williams_device : public a800_rom_device
public:
// construction/destruction
a800_rom_williams_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -71,14 +71,14 @@ class a800_rom_express_device : public a800_rom_device
public:
// construction/destruction
a800_rom_express_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -91,11 +91,11 @@ class a800_rom_blizzard_device : public a800_rom_device
public:
// construction/destruction
a800_rom_blizzard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
};
@@ -107,14 +107,14 @@ class a800_rom_turbo_device : public a800_rom_device
public:
// construction/destruction
a800_rom_turbo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -127,7 +127,7 @@ class a800_rom_telelink2_device : public a800_rom_device
public:
// construction/destruction
a800_rom_telelink2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_80xx);
virtual DECLARE_READ8_MEMBER(read_d5xx);
@@ -142,14 +142,14 @@ class a800_rom_microcalc_device : public a800_rom_device
public:
// construction/destruction
a800_rom_microcalc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -162,14 +162,14 @@ class xegs_rom_device : public a800_rom_device
public:
// construction/destruction
xegs_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank;
};
@@ -182,7 +182,7 @@ class a5200_rom_2chips_device : public a800_rom_device
public:
// construction/destruction
a5200_rom_2chips_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
};
@@ -194,14 +194,14 @@ class a5200_rom_bbsb_device : public a800_rom_device
public:
// construction/destruction
a5200_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_80xx);
-
+
protected:
int m_banks[2];
};
diff --git a/src/emu/bus/a800/sparta.c b/src/emu/bus/a800/sparta.c
index 316dacb9fe9..a742be866c3 100644
--- a/src/emu/bus/a800/sparta.c
+++ b/src/emu/bus/a800/sparta.c
@@ -43,14 +43,14 @@ void a800_rom_spartados_device::device_reset()
-------------------------------------------------*/
/*-------------------------------------------------
-
+
SpartaDOS 64K carts
-
- Similar to Express / Diamond carts, because
- bankswitch is controlled by writing to 7 diff
- offsets in reverse order, but writes to offsets
+
+ Similar to Express / Diamond carts, because
+ bankswitch is controlled by writing to 7 diff
+ offsets in reverse order, but writes to offsets
0x8-0xf also enable/disable subslot
-
+
-------------------------------------------------*/
READ8_MEMBER(a800_rom_spartados_device::read_80xx)
@@ -58,7 +58,7 @@ READ8_MEMBER(a800_rom_spartados_device::read_80xx)
if (!m_subslot_enabled)
return m_rom[(offset & 0x1fff) + (m_bank * 0x2000)];
else
- return 0xff; // subslot, currently not implemented
+ return 0xff; // subslot, currently not implemented
}
WRITE8_MEMBER(a800_rom_spartados_device::write_d5xx)
@@ -69,4 +69,3 @@ WRITE8_MEMBER(a800_rom_spartados_device::write_d5xx)
m_bank = (offset ^ 0x07) & 0x0f;
}
-
diff --git a/src/emu/bus/a800/sparta.h b/src/emu/bus/a800/sparta.h
index ef6033e7716..983c5ba9200 100644
--- a/src/emu/bus/a800/sparta.h
+++ b/src/emu/bus/a800/sparta.h
@@ -13,14 +13,14 @@ class a800_rom_spartados_device : public a800_rom_device
public:
// construction/destruction
a800_rom_spartados_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual DECLARE_READ8_MEMBER(read_80xx);
virtual DECLARE_WRITE8_MEMBER(write_d5xx);
-
+
protected:
int m_bank, m_subslot_enabled;
};
diff --git a/src/emu/bus/apf/rom.h b/src/emu/bus/apf/rom.h
index c1a674803cd..0db205afda5 100644
--- a/src/emu/bus/apf/rom.h
+++ b/src/emu/bus/apf/rom.h
@@ -43,7 +43,7 @@ class apf_spacedst_device : public apf_rom_device
public:
// construction/destruction
apf_spacedst_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
diff --git a/src/emu/bus/apf/slot.c b/src/emu/bus/apf/slot.c
index 504bd699389..6a92271fc7c 100644
--- a/src/emu/bus/apf/slot.c
+++ b/src/emu/bus/apf/slot.c
@@ -169,9 +169,9 @@ bool apf_cart_slot_device::call_load()
seterror(IMAGE_ERROR_UNSPECIFIED, "Image extends beyond the expected size for an APF cart");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), size);
else
@@ -294,5 +294,3 @@ WRITE8_MEMBER(apf_cart_slot_device::write_ram)
if (m_cart)
m_cart->write_ram(space, offset, data);
}
-
-
diff --git a/src/emu/bus/apf/slot.h b/src/emu/bus/apf/slot.h
index d0c5903bc21..e40894b2cbe 100644
--- a/src/emu/bus/apf/slot.h
+++ b/src/emu/bus/apf/slot.h
@@ -39,7 +39,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
protected:
// internal state
@@ -71,7 +71,7 @@ public:
int get_type() { return m_type; }
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -112,6 +112,5 @@ extern const device_type APF_CART_SLOT;
#define MCFG_APF_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, APF_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/arcadia/slot.c b/src/emu/bus/arcadia/slot.c
index 96eba58bfcc..13ed093e412 100644
--- a/src/emu/bus/arcadia/slot.c
+++ b/src/emu/bus/arcadia/slot.c
@@ -155,7 +155,7 @@ bool arcadia_cart_slot_device::call_load()
UINT32 len = (software_entry() == NULL) ? length() : get_software_region_length("rom");
m_cart->rom_alloc(len, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), len);
else
@@ -260,4 +260,3 @@ READ8_MEMBER(arcadia_cart_slot_device::extra_rom)
else
return 0xff;
}
-
diff --git a/src/emu/bus/arcadia/slot.h b/src/emu/bus/arcadia/slot.h
index 71cd5e0dc96..ce9f6363dbd 100644
--- a/src/emu/bus/arcadia/slot.h
+++ b/src/emu/bus/arcadia/slot.h
@@ -99,6 +99,5 @@ extern const device_type EA2001_CART_SLOT;
#define MCFG_ARCADIA_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, EA2001_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/c64/dela_ep256.c b/src/emu/bus/c64/dela_ep256.c
index 9a9e6748c11..aa360b6c7b3 100644
--- a/src/emu/bus/c64/dela_ep256.c
+++ b/src/emu/bus/c64/dela_ep256.c
@@ -73,7 +73,7 @@ c64_dela_ep256_cartridge_device::c64_dela_ep256_cartridge_device(const machine_c
char str[6];
sprintf(str, "rom%i", i + 1);
m_eproms[i] = subdevice<generic_slot_device>(str);
- }
+ }
}
diff --git a/src/emu/bus/c64/rex_ep256.h b/src/emu/bus/c64/rex_ep256.h
index e69c8c2fba2..8e791966ac9 100644
--- a/src/emu/bus/c64/rex_ep256.h
+++ b/src/emu/bus/c64/rex_ep256.h
@@ -49,7 +49,7 @@ protected:
private:
generic_slot_device *m_eproms[8];
-
+
UINT8 m_bank, m_socket;
int m_reset;
};
diff --git a/src/emu/bus/centronics/digiblst.h b/src/emu/bus/centronics/digiblst.h
index 8ff24c8c434..3e66942961b 100644
--- a/src/emu/bus/centronics/digiblst.h
+++ b/src/emu/bus/centronics/digiblst.h
@@ -1,11 +1,11 @@
/*
* digiblst.h
*
- * Digiblaster - a DIY printer port DAC for the Amstrad CPC
- * Printed in the German magazine CPC Amstrad International issue 8-9/1991
- * Uses Strobe (inverted on the CPC) for the 8th bit (CPCs only have 7-bit printer ports)
+ * Digiblaster - a DIY printer port DAC for the Amstrad CPC
+ * Printed in the German magazine CPC Amstrad International issue 8-9/1991
+ * Uses Strobe (inverted on the CPC) for the 8th bit (CPCs only have 7-bit printer ports)
*
- * Code borrows from the Covox Speech Thing device.
+ * Code borrows from the Covox Speech Thing device.
*
* Created on: 23/08/2014
*/
diff --git a/src/emu/bus/chanf/rom.c b/src/emu/bus/chanf/rom.c
index 01d681bf59b..d2b946269b7 100644
--- a/src/emu/bus/chanf/rom.c
+++ b/src/emu/bus/chanf/rom.c
@@ -164,7 +164,7 @@ UINT8 chanf_rom_device::common_read_2102(UINT32 offset)
m_data0 = m_ram[m_addr] & 1;
return (m_latch[0] & 0x7f) | (m_data0 << 7);
}
-
+
return m_latch[0];
}
else
@@ -176,10 +176,10 @@ void chanf_rom_device::common_write_2102(UINT32 offset, UINT8 data)
if (offset == 0)
{
m_latch[0] = data;
-
+
m_read_write = BIT(data, 0);
- m_addr_latch = (m_addr_latch & 0x3f3) | (BIT(data, 2) << 2) | (BIT(data, 1) << 3); // bits 2,3 come from this write!
+ m_addr_latch = (m_addr_latch & 0x3f3) | (BIT(data, 2) << 2) | (BIT(data, 1) << 3); // bits 2,3 come from this write!
m_addr = m_addr_latch;
m_data0 = BIT(data, 3);
@@ -199,7 +199,7 @@ void chanf_rom_device::common_write_2102(UINT32 offset, UINT8 data)
// These are shared among Schach & Multigame cart types (not directly used by base chanf_rom_device)
UINT8 chanf_rom_device::common_read_3853(UINT32 offset)
-{
+{
if (offset < m_ram.count())
return m_ram[offset];
else
@@ -207,7 +207,7 @@ UINT8 chanf_rom_device::common_read_3853(UINT32 offset)
}
void chanf_rom_device::common_write_3853(UINT32 offset, UINT8 data)
-{
+{
if (offset < m_ram.count())
m_ram[offset] = data;
}
@@ -240,4 +240,3 @@ WRITE8_MEMBER(chanf_multi_final_device::write_bank)
m_base_bank = data & 0x1f;
m_half_bank = BIT(data, 5);
}
-
diff --git a/src/emu/bus/chanf/rom.h b/src/emu/bus/chanf/rom.h
index 272f0301012..e2afa9da580 100644
--- a/src/emu/bus/chanf/rom.h
+++ b/src/emu/bus/chanf/rom.h
@@ -24,14 +24,14 @@ public:
UINT8 common_read_3853(UINT32 offset);
void common_write_2102(UINT32 offset, UINT8 data);
void common_write_3853(UINT32 offset, UINT8 data);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
-
+
protected:
// used for RAM chip in Hangman & Maze
- UINT8 m_latch[2]; // PORT A & PORT B
+ UINT8 m_latch[2]; // PORT A & PORT B
UINT16 m_addr_latch, m_addr;
int m_read_write, m_data0;
};
@@ -43,11 +43,11 @@ class chanf_maze_device : public chanf_rom_device
public:
// construction/destruction
chanf_maze_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_2102(offset); }
virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_2102(offset, data); }
@@ -61,11 +61,11 @@ class chanf_hangman_device : public chanf_rom_device
public:
// construction/destruction
chanf_hangman_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_2102(offset); }
virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_2102(offset, data); }
@@ -79,7 +79,7 @@ class chanf_chess_device : public chanf_rom_device
public:
// construction/destruction
chanf_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_3853(offset); }
virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_3853(offset, data); }
@@ -93,11 +93,11 @@ class chanf_multi_old_device : public chanf_rom_device
public:
// construction/destruction
chanf_multi_old_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_3853(offset); }
@@ -116,17 +116,17 @@ class chanf_multi_final_device : public chanf_rom_device
public:
// construction/destruction
chanf_multi_final_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_3853(offset); }
virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_3853(offset, data); }
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
private:
int m_base_bank, m_half_bank;
};
diff --git a/src/emu/bus/chanf/slot.c b/src/emu/bus/chanf/slot.c
index 32f2e470b0d..e42a69629b9 100644
--- a/src/emu/bus/chanf/slot.c
+++ b/src/emu/bus/chanf/slot.c
@@ -178,9 +178,9 @@ bool channelf_cart_slot_device::call_load()
// we default to "chess" slot because some homebrew programs have been written to run
// on PCBs with RAM at $2000-$2800 as Saba Schach!
if (len == 0x40000)
- m_type = CF_MULTI; // TODO1: differentiate multicart final and earlier from fullpath
+ m_type = CF_MULTI; // TODO1: differentiate multicart final and earlier from fullpath
else
- m_type = CF_CHESS; // TODO2: is there any way to detect Maze and Hangman from fullpath?
+ m_type = CF_CHESS; // TODO2: is there any way to detect Maze and Hangman from fullpath?
m_cart->ram_alloc(0x800);
}
@@ -226,17 +226,17 @@ void channelf_cart_slot_device::get_default_card_software(astring &result)
const char *slot_string = "chess";
UINT32 len = core_fsize(m_file);
int type;
-
+
if (len == 0x40000)
type = CF_MULTI;
else
- type = CF_CHESS; // is there any way to detect the other carts from fullpath?
-
+ type = CF_CHESS; // is there any way to detect the other carts from fullpath?
+
slot_string = chanf_get_slot(type);
-
+
//printf("type: %s\n", slot_string);
clear();
-
+
result.cpy(slot_string);
return;
}
diff --git a/src/emu/bus/chanf/slot.h b/src/emu/bus/chanf/slot.h
index 24752c05df5..161eef039f8 100644
--- a/src/emu/bus/chanf/slot.h
+++ b/src/emu/bus/chanf/slot.h
@@ -42,7 +42,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
protected:
// internal state
@@ -74,7 +74,7 @@ public:
int get_type() { return m_type; }
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -115,6 +115,5 @@ extern const device_type CHANF_CART_SLOT;
#define MCFG_CHANNELF_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, CHANF_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/cpc/amdrum.h b/src/emu/bus/cpc/amdrum.h
index 0abcdefb558..5439855943c 100644
--- a/src/emu/bus/cpc/amdrum.h
+++ b/src/emu/bus/cpc/amdrum.h
@@ -18,7 +18,7 @@
#include "sound/dac.h"
class cpc_amdrum_device : public device_t,
- public device_cpc_expansion_card_interface
+ public device_cpc_expansion_card_interface
{
public:
// construction/destruction
diff --git a/src/emu/bus/cpc/symbfac2.c b/src/emu/bus/cpc/symbfac2.c
index 87df7e214d2..ccbc700f38d 100644
--- a/src/emu/bus/cpc/symbfac2.c
+++ b/src/emu/bus/cpc/symbfac2.c
@@ -47,11 +47,11 @@ static INPUT_PORTS_START(cpc_symbiface2)
PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("PS/2 Mouse forward button") PORT_CODE(MOUSECODE_BUTTON5) PORT_CHANGED_MEMBER(DEVICE_SELF,cpc_symbiface2_device,mouse_change_x,NULL)
// TODO: mouse scroll wheel support
-// PORT_START("sf2_mouse_scroll")
-// PORT_BIT(0x1f , 0, IPT_TRACKBALL_Y)
-// PORT_SENSITIVITY(100)
-// PORT_KEYDELTA(10)
-// PORT_PLAYER(1)
+// PORT_START("sf2_mouse_scroll")
+// PORT_BIT(0x1f , 0, IPT_TRACKBALL_Y)
+// PORT_SENSITIVITY(100)
+// PORT_KEYDELTA(10)
+// PORT_PLAYER(1)
INPUT_PORTS_END
@@ -189,26 +189,26 @@ WRITE8_MEMBER(cpc_symbiface2_device::rtc_w)
// PS/2 Mouse connector
// #FD10 (read only) read mouse status
/*
- Status byte
- Bit 76543210
- Use mmDDDDDD
-
- m: Mode
- D: Use-Data
-
- If read and...
-
- m = 00 -> no more data available, you can stop reading the status for a while
- m = 01 -> D = X offset (signed); you will receive positive values, if the user
- is moving the mouse to the right
- m = 10 -> D = Y offset (signed); you will receive positive values, if the user
- is moving the mouse upwards
- m = 11 -> D[bit5] = 0 -> D[bit0] = left button
- D[bit1] = right button
- D[bit2] = middle button
- D[bit3] = forward button
- D[bit4] = backward button
- D[bit5] = 1 -> D[bit0-4] = scroll wheel offset (signed)
+ Status byte
+ Bit 76543210
+ Use mmDDDDDD
+
+ m: Mode
+ D: Use-Data
+
+ If read and...
+
+ m = 00 -> no more data available, you can stop reading the status for a while
+ m = 01 -> D = X offset (signed); you will receive positive values, if the user
+ is moving the mouse to the right
+ m = 10 -> D = Y offset (signed); you will receive positive values, if the user
+ is moving the mouse upwards
+ m = 11 -> D[bit5] = 0 -> D[bit0] = left button
+ D[bit1] = right button
+ D[bit2] = middle button
+ D[bit3] = forward button
+ D[bit4] = backward button
+ D[bit5] = 1 -> D[bit0-4] = scroll wheel offset (signed)
*/
READ8_MEMBER(cpc_symbiface2_device::mouse_r)
{
diff --git a/src/emu/bus/cpc/symbfac2.h b/src/emu/bus/cpc/symbfac2.h
index 58a97ae12ad..bcc8f0eedba 100644
--- a/src/emu/bus/cpc/symbfac2.h
+++ b/src/emu/bus/cpc/symbfac2.h
@@ -14,7 +14,7 @@
#include "cpcexp.h"
class cpc_symbiface2_device : public device_t,
- public device_cpc_expansion_card_interface
+ public device_cpc_expansion_card_interface
{
public:
// construction/destruction
diff --git a/src/emu/bus/crvision/rom.c b/src/emu/bus/crvision/rom.c
index 61eebfb92ac..f67a27a054e 100644
--- a/src/emu/bus/crvision/rom.c
+++ b/src/emu/bus/crvision/rom.c
@@ -88,7 +88,7 @@ READ8_MEMBER(crvision_rom6k_device::read_rom80)
offset &= 0x1fff;
if (offset < 0x1000)
return m_rom[0x1000 + (offset & 0x7ff)];
-
+
return m_rom[offset & 0xfff];
}
diff --git a/src/emu/bus/crvision/rom.h b/src/emu/bus/crvision/rom.h
index 118a398b7a6..eb44fee4ef9 100644
--- a/src/emu/bus/crvision/rom.h
+++ b/src/emu/bus/crvision/rom.h
@@ -43,7 +43,7 @@ class crvision_rom8k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom80);
};
@@ -55,7 +55,7 @@ class crvision_rom10k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom10k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom40);
virtual DECLARE_READ8_MEMBER(read_rom80);
@@ -68,7 +68,7 @@ class crvision_rom12k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom12k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom40);
virtual DECLARE_READ8_MEMBER(read_rom80);
@@ -81,7 +81,7 @@ class crvision_rom16k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom80);
};
@@ -93,7 +93,7 @@ class crvision_rom18k_device : public crvision_rom_device
public:
// construction/destruction
crvision_rom18k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom40);
virtual DECLARE_READ8_MEMBER(read_rom80);
diff --git a/src/emu/bus/crvision/slot.c b/src/emu/bus/crvision/slot.c
index b72bebd00a1..195dd476588 100644
--- a/src/emu/bus/crvision/slot.c
+++ b/src/emu/bus/crvision/slot.c
@@ -163,9 +163,9 @@ bool crvision_cart_slot_device::call_load()
seterror(IMAGE_ERROR_UNSPECIFIED, "Image extends beyond the expected size for an APF cart");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), size);
else
@@ -295,4 +295,3 @@ READ8_MEMBER(crvision_cart_slot_device::read_rom80)
else
return 0xff;
}
-
diff --git a/src/emu/bus/crvision/slot.h b/src/emu/bus/crvision/slot.h
index db59daed13c..4219c153d1f 100644
--- a/src/emu/bus/crvision/slot.h
+++ b/src/emu/bus/crvision/slot.h
@@ -104,6 +104,5 @@ extern const device_type CRVISION_CART_SLOT;
#define MCFG_CRVISION_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, CRVISION_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/gameboy/gb_slot.h b/src/emu/bus/gameboy/gb_slot.h
index b4c16bbce74..ea6036a1481 100644
--- a/src/emu/bus/gameboy/gb_slot.h
+++ b/src/emu/bus/gameboy/gb_slot.h
@@ -71,8 +71,8 @@ public:
void set_has_battery(bool val) { has_battery = val; }
bool get_has_battery() { return has_battery; }
- void save_ram() { device().save_item(NAME(m_ram)); }
-
+ void save_ram() { device().save_item(NAME(m_ram)); }
+
// internal state
UINT8 *m_rom;
UINT32 m_rom_size;
@@ -122,8 +122,8 @@ public:
void setup_ram(UINT8 banks);
void internal_header_logging(UINT8 *ROM, UINT32 len);
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
-
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
diff --git a/src/emu/bus/gameboy/mbc.h b/src/emu/bus/gameboy/mbc.h
index 504f2327397..f480dc875fd 100644
--- a/src/emu/bus/gameboy/mbc.h
+++ b/src/emu/bus/gameboy/mbc.h
@@ -183,11 +183,11 @@ class gb_rom_188in1_device : public gb_rom_mbc1_device
public:
// construction/destruction
gb_rom_188in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start() { shared_start(); save_item(NAME(m_game_base)); };
virtual void device_reset() { shared_reset(); m_game_base = 0; };
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
diff --git a/src/emu/bus/gba/gba_slot.h b/src/emu/bus/gba/gba_slot.h
index 339666db18b..79ac615d25e 100644
--- a/src/emu/bus/gba/gba_slot.h
+++ b/src/emu/bus/gba/gba_slot.h
@@ -42,7 +42,7 @@ public:
UINT32 get_nvram_size() { return m_nvram.bytes(); }
void set_rom_size(UINT32 val) { m_rom_size = val; }
- void save_nvram() { device().save_item(NAME(m_nvram)); }
+ void save_nvram() { device().save_item(NAME(m_nvram)); }
// internal state
UINT32 *m_rom; // this points to the cart rom region
@@ -77,7 +77,7 @@ public:
void setup_ram(UINT8 banks);
void internal_header_logging(UINT8 *ROM, UINT32 len);
- void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); }
+ void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -175,7 +175,7 @@ static const gba_chip_fix_conflict_item gba_chip_fix_conflict_list[] =
{ "BR4J", GBA_CHIP_FLASH }, // 1586 - Rockman EXE 4.5 - Real Operation (JPN)
{ "BG8J", GBA_CHIP_EEPROM_64K }, // 1853 - Ganbare! Dodge Fighters (JPN)
{ "AROP", GBA_CHIP_EEPROM_4K }, // 1862 - Rocky (EUR)
-// "A2YE" - 1906 - Top Gun - Combat Zones (USA) - multiple NVRAM chips detected, but none present (protection against emu?)
+// "A2YE" - 1906 - Top Gun - Combat Zones (USA) - multiple NVRAM chips detected, but none present (protection against emu?)
{ "BKMJ", GBA_CHIP_EEPROM_4K }, // 2039 - Kim Possible (JPN)
{ "BKEJ", GBA_CHIP_EEPROM_64K }, // 2047 - Konjiki no Gashbell - The Card Battle for GBA (JPN)
{ "BKMP", GBA_CHIP_EEPROM_4K }, // 2297 - Kim Possible 2 - Drakken's Demise (EUR)
diff --git a/src/emu/bus/generic/carts.c b/src/emu/bus/generic/carts.c
index 244f9a28b70..91f53077054 100644
--- a/src/emu/bus/generic/carts.c
+++ b/src/emu/bus/generic/carts.c
@@ -1,9 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:etabeta
/**********************************************************************
-
+
Generic ROM / RAM socket slots
-
+
**********************************************************************/
diff --git a/src/emu/bus/generic/ram.c b/src/emu/bus/generic/ram.c
index 2750cd5de7e..4632c614cbc 100644
--- a/src/emu/bus/generic/ram.c
+++ b/src/emu/bus/generic/ram.c
@@ -1,21 +1,21 @@
// license:BSD-3-Clause
// copyright-holders:etabeta
/***********************************************************************************************************
-
-
+
+
Generic RAM socket emulation
-
+
This offers generic access to RAM
-
+
generic_ram_plain : returns 0xff when the system reads beyond the end of the RAM
- generic_ram_linear : maps linearly the RAM in the accessed area (i.e., read/write offset is masked with
+ generic_ram_linear : maps linearly the RAM in the accessed area (i.e., read/write offset is masked with
(RAM size - 1) )
-
+
TODO:
- support variable RAM size
- possibly support linear mapping when non-power of 2 RAMs are mapped
- add support for 16bit & 32bit RAM access
-
+
***********************************************************************************************************/
@@ -121,4 +121,3 @@ WRITE8_MEMBER(generic_ram_linear_device::write_ram)
{
m_ram[offset % m_ram.bytes()] = data;
}
-
diff --git a/src/emu/bus/generic/ram.h b/src/emu/bus/generic/ram.h
index be777167a6a..7d5637286f3 100644
--- a/src/emu/bus/generic/ram.h
+++ b/src/emu/bus/generic/ram.h
@@ -14,14 +14,14 @@ class generic_ram_plain_device : public device_t,
public:
// construction/destruction
generic_ram_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source);
-
+
// device-level overrides
virtual void device_start();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
-
+
private:
UINT32 m_size;
};
@@ -35,14 +35,14 @@ class generic_ram_linear_device : public device_t,
public:
// construction/destruction
generic_ram_linear_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source);
-
+
// device-level overrides
virtual void device_start();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
-
+
private:
UINT32 m_size;
};
diff --git a/src/emu/bus/generic/rom.c b/src/emu/bus/generic/rom.c
index 352acc4c141..fd2107eb798 100644
--- a/src/emu/bus/generic/rom.c
+++ b/src/emu/bus/generic/rom.c
@@ -4,18 +4,18 @@
Generic ROM emulation (for carts and ROM sockets)
-
+
This offers generic access to a ROM
-
+
generic_rom_plain : returns 0xff when the system reads beyond the end of the ROM
generic_rom_linear : maps linearly the ROM in the accessed area (i.e., read offset is masked with (ROM size - 1) )
generic_romram_plain : allows support for carts always containing ROM + RAM (e.g. X07)
-
+
TODO:
- possibly support linear mapping when non-power of 2 ROMs are mapped
-
+
***********************************************************************************************************/
@@ -120,4 +120,3 @@ WRITE8_MEMBER(generic_romram_plain_device::write_ram)
if (offset < m_ram.bytes())
m_ram[offset] = data;
}
-
diff --git a/src/emu/bus/generic/rom.h b/src/emu/bus/generic/rom.h
index c41fc427018..1a9b0bd1883 100644
--- a/src/emu/bus/generic/rom.h
+++ b/src/emu/bus/generic/rom.h
@@ -14,7 +14,7 @@ class generic_rom_device : public device_t,
public:
// construction/destruction
generic_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
+
// device-level overrides
virtual void device_start() {}
};
@@ -28,7 +28,7 @@ public:
// construction/destruction
generic_rom_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
generic_rom_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ16_MEMBER(read16_rom);
@@ -43,7 +43,7 @@ class generic_romram_plain_device : public generic_rom_plain_device
public:
// construction/destruction
generic_romram_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
@@ -57,7 +57,7 @@ class generic_rom_linear_device : public generic_rom_device
public:
// construction/destruction
generic_rom_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ16_MEMBER(read16_rom);
diff --git a/src/emu/bus/generic/slot.c b/src/emu/bus/generic/slot.c
index 119478fe38e..40f959e404e 100644
--- a/src/emu/bus/generic/slot.c
+++ b/src/emu/bus/generic/slot.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
Generic ROM / RAM Socket and Cartslot device
-
+
This device offers basic RAM / ROM allocation and access
The available handlers are suited for any situation where a system opens a
@@ -12,12 +12,12 @@
This device is not suited whenever the system exposes additional lines to
the socket/slot: e.g. whenever input/output lines are present, whenever
there are lines controlling bankswitch / paging, and whenever different
- cart configurations have to be supported (like some PCBs containing ROM
+ cart configurations have to be supported (like some PCBs containing ROM
only, and other containing both ROM and RAM)
In the latter situations, per-system slot devices have to be created (see
e.g. APF cart slot device for an example of a simple device with multiple
pcbs supported)
-
+
***********************************************************************************************************/
@@ -136,15 +136,15 @@ void generic_slot_device::device_config_complete()
bool generic_slot_device::call_load()
{
if (m_cart)
- {
+ {
if (!m_device_image_load.isnull())
return m_device_image_load(*this);
else
{
UINT32 len = common_get_size("rom");
-
+
rom_alloc(len, m_width, m_endianness);
- common_load_rom(get_rom_base(), len, "rom");
+ common_load_rom(get_rom_base(), len, "rom");
return IMAGE_INIT_PASS;
}
@@ -189,13 +189,13 @@ void generic_slot_device::get_default_card_software(astring &result)
/**************************************************
- Implementation
-
+ Implementation
+
**************************************************/
/*-------------------------------------------------
- common_get_size - it gets image file size both
+ common_get_size - it gets image file size both
for fullpath and for softlist
-------------------------------------------------*/
@@ -208,7 +208,7 @@ UINT32 generic_slot_device::common_get_size(const char *region)
}
/*-------------------------------------------------
- common_load_rom - it loads from image file both
+ common_load_rom - it loads from image file both
for fullpath and for softlist
-------------------------------------------------*/
@@ -283,4 +283,3 @@ WRITE8_MEMBER(generic_slot_device::write_ram)
if (m_cart)
m_cart->write_ram(space, offset, data);
}
-
diff --git a/src/emu/bus/generic/slot.h b/src/emu/bus/generic/slot.h
index 9d90d3a2253..a93d7d8904e 100644
--- a/src/emu/bus/generic/slot.h
+++ b/src/emu/bus/generic/slot.h
@@ -93,14 +93,14 @@ public:
static void static_set_device_load(device_t &device, device_image_load_delegate callback) { downcast<generic_slot_device &>(device).m_device_image_load = callback; }
static void static_set_device_unload(device_t &device, device_image_func_delegate callback) { downcast<generic_slot_device &>(device).m_device_image_unload = callback; }
-
+
void set_interface(const char * interface) { m_interface = interface; }
void set_default_card(const char * def) { m_default_card = def; }
void set_extensions(const char * exts) { m_extensions = exts; }
void set_must_be_loaded(bool mandatory) { m_must_be_loaded = mandatory; }
void set_width(int width) { m_width = width; }
void set_endian(endianness_t end) { m_endianness = end; }
-
+
// device-level overrides
virtual void device_start();
virtual void device_config_complete();
@@ -168,11 +168,9 @@ extern const device_type GENERIC_SOCKET;
#define MCFG_GENERIC_CARTSLOT_ADD(_tag, _slot_intf, _dev_intf) \
MCFG_DEVICE_ADD(_tag, GENERIC_SOCKET, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, NULL, false) \
- MCFG_GENERIC_INTERFACE(_dev_intf) \
-
+ MCFG_GENERIC_INTERFACE(_dev_intf)
#define MCFG_GENERIC_SOCKET_ADD(_tag, _slot_intf, _dev_intf) \
MCFG_DEVICE_ADD(_tag, GENERIC_SOCKET, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, NULL, false) \
- MCFG_GENERIC_INTERFACE(_dev_intf) \
-
+ MCFG_GENERIC_INTERFACE(_dev_intf)
#endif
diff --git a/src/emu/bus/intv/ecs.c b/src/emu/bus/intv/ecs.c
index 6b42f004bab..4400b5e8839 100644
--- a/src/emu/bus/intv/ecs.c
+++ b/src/emu/bus/intv/ecs.c
@@ -4,10 +4,10 @@
Mattel Intellivision Entertainment Computer System expansion emulation
TODO:
- - Make paged rom emulation more accurate (according to
+ - Make paged rom emulation more accurate (according to
http://spatula-city.org/~im14u2c/intv/tech/ecs.html
- writes to $xa5y should be available for every x and every y, i.e. we shall
- have writes to every 4K chunk of the memory map, and there shall be 16 pages
+ writes to $xa5y should be available for every x and every y, i.e. we shall
+ have writes to every 4K chunk of the memory map, and there shall be 16 pages
for each)
Current emulation is instead tailored around the minimal usage necessary to
make the main expansion and World Series Major League Baseball happy
@@ -67,12 +67,12 @@ void intv_ecs_device::device_start()
}
void intv_ecs_device::device_reset()
-{
+{
memset(m_bank_base, 0, sizeof(m_bank_base));
}
void intv_ecs_device::late_subslot_setup()
-{
+{
switch (m_subslot->get_type())
{
case INTV_RAM:
@@ -107,13 +107,13 @@ UINT8 intv_ecs_device::intv_control_r(int hand)
0xFF, 0x3F, 0x9F, 0x5F, 0xD7, 0xB7, 0x77, 0xDB,
0xBB, 0x7B, 0xDD, 0xBD, 0x7D, 0xDE, 0xBE, 0x7E
};
-
+
static const UINT8 disc_table[] =
{
0xF3, 0xE3, 0xE7, 0xF7, 0xF6, 0xE6, 0xEE, 0xFE,
0xFC, 0xEC, 0xED, 0xFD, 0xF9, 0xE9, 0xEB, 0xFB
};
-
+
static const UINT8 discyx_table[5][5] =
{
{ 0xE3, 0xF3, 0xFB, 0xEB, 0xE9 },
@@ -122,10 +122,10 @@ UINT8 intv_ecs_device::intv_control_r(int hand)
{ 0xF6, 0xE6, 0xFE, 0xEC, 0xED },
{ 0xE6, 0xEE, 0xFE, 0xFC, 0xEC }
};
-
+
int x, y;
UINT8 val = 0xff;
-
+
/* keypad */
x = m_keypad[hand]->read();
for (y = 0; y < 16; y++)
@@ -135,12 +135,12 @@ UINT8 intv_ecs_device::intv_control_r(int hand)
val &= keypad_table[y];
}
}
-
+
switch ((m_options->read() >> hand) & 4)
{
case 0: /* disc == digital */
default:
-
+
x = m_disc[hand]->read();
for (y = 0; y < 16; y++)
{
@@ -150,14 +150,14 @@ UINT8 intv_ecs_device::intv_control_r(int hand)
}
}
break;
-
+
case 1: /* disc == _fake_ analog */
-
+
x = m_discx[hand]->read();
y = m_discy[hand]->read();
val &= discyx_table[y / 32][x / 32];
}
-
+
return val;
}
@@ -252,7 +252,7 @@ static INPUT_PORTS_START( intv_ecs_kbd )
Bit 4 D E 2 3 W S Z X
Bit 5 A CTL (right) 1 Q (up) (down) (space)
Bit 6 SHIFT NC NC NC NC NC NC NC
-
+
Shifted keys that differ from pc:
Key : 1 2 5 6 7 (left) (right) (up) (down)
Shift + key: = " + - / % ' ^ ?
@@ -530,32 +530,32 @@ ioport_constructor intv_ecs_device::device_input_ports() const
Paged ROM handling
-------------------------------------------------*/
-READ16_MEMBER(intv_ecs_device::read_rom20)
-{
+READ16_MEMBER(intv_ecs_device::read_rom20)
+{
if (m_bank_base[2])
- return INTV_ROM16_READ(offset + 0x2000);
+ return INTV_ROM16_READ(offset + 0x2000);
else
return 0xffff;
}
-READ16_MEMBER(intv_ecs_device::read_rom70)
-{
+READ16_MEMBER(intv_ecs_device::read_rom70)
+{
if (m_bank_base[7])
return 0xffff;
else
- return INTV_ROM16_READ(offset + 0x7000);
+ return INTV_ROM16_READ(offset + 0x7000);
}
-READ16_MEMBER(intv_ecs_device::read_rome0)
-{
+READ16_MEMBER(intv_ecs_device::read_rome0)
+{
if (m_bank_base[14])
- return INTV_ROM16_READ(offset + 0xe000);
- else // if WSMLB is loaded, it shall go here, otherwise 0xffff
+ return INTV_ROM16_READ(offset + 0xe000);
+ else // if WSMLB is loaded, it shall go here, otherwise 0xffff
return m_subslot->read_rome0(space, offset, mem_mask);
}
-READ16_MEMBER(intv_ecs_device::read_romf0)
-{
+READ16_MEMBER(intv_ecs_device::read_romf0)
+{
// only WSMLB should come here with bank_base = 1
if (m_bank_base[15])
return m_subslot->read_romf0(space, offset + 0x1000, mem_mask);
@@ -585,4 +585,3 @@ WRITE16_MEMBER(intv_ecs_device::write_ay)
if (ACCESSING_BITS_0_7)
return m_snd->write(space, offset, data, mem_mask);
}
-
diff --git a/src/emu/bus/intv/ecs.h b/src/emu/bus/intv/ecs.h
index 6db3609c7ce..52ca99b76e5 100644
--- a/src/emu/bus/intv/ecs.h
+++ b/src/emu/bus/intv/ecs.h
@@ -14,14 +14,14 @@ class intv_ecs_device : public intv_rom_device
public:
// construction/destruction
intv_ecs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
virtual const rom_entry *device_rom_region() const;
-
+
// reading and writing
// actual ECS accesses
@@ -32,14 +32,14 @@ public:
virtual DECLARE_READ16_MEMBER(read_romf0);
// RAM
virtual DECLARE_READ16_MEMBER(read_ram) { return (int)m_ram[offset & (m_ram.count() - 1)]; }
- virtual DECLARE_WRITE16_MEMBER(write_ram) { m_ram[offset & (m_ram.count() - 1)] = data & 0xff; }
+ virtual DECLARE_WRITE16_MEMBER(write_ram) { m_ram[offset & (m_ram.count() - 1)] = data & 0xff; }
// AY8914
virtual DECLARE_READ16_MEMBER(read_ay);
virtual DECLARE_WRITE16_MEMBER(write_ay);
DECLARE_READ8_MEMBER(ay_porta_r);
DECLARE_READ8_MEMBER(ay_portb_r);
DECLARE_WRITE8_MEMBER(ay_porta_w);
-
+
// passthru accesses
virtual DECLARE_READ16_MEMBER(read_rom04) { return m_subslot->read_rom04(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom40) { return m_subslot->read_rom40(space, offset, mem_mask); }
@@ -47,27 +47,27 @@ public:
virtual DECLARE_READ16_MEMBER(read_rom50) { return m_subslot->read_rom50(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom60) { return m_subslot->read_rom60(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom80)
- {
+ {
if (m_ram88_enabled && offset >= 0x800)
- return m_subslot->read_ram(space, offset & 0x7ff, mem_mask);
+ return m_subslot->read_ram(space, offset & 0x7ff, mem_mask);
else
- return m_subslot->read_rom80(space, offset, mem_mask);
+ return m_subslot->read_rom80(space, offset, mem_mask);
}
virtual DECLARE_READ16_MEMBER(read_rom90) { return m_subslot->read_rom90(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_roma0) { return m_subslot->read_roma0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romb0) { return m_subslot->read_romb0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romc0) { return m_subslot->read_romc0(space, offset, mem_mask); }
- virtual DECLARE_READ16_MEMBER(read_romd0)
- {
+ virtual DECLARE_READ16_MEMBER(read_romd0)
+ {
if (m_ramd0_enabled && offset < 0x800)
- return m_subslot->read_ram(space, offset, mem_mask);
+ return m_subslot->read_ram(space, offset, mem_mask);
else
- return m_subslot->read_romd0(space, offset, mem_mask);
+ return m_subslot->read_romd0(space, offset, mem_mask);
}
// paged ROM banking
- virtual DECLARE_WRITE16_MEMBER(write_rom20)
- {
+ virtual DECLARE_WRITE16_MEMBER(write_rom20)
+ {
if (offset == 0xfff)
{
if (data == 0x2a50)
@@ -76,8 +76,8 @@ public:
m_bank_base[2] = 1;
}
}
- virtual DECLARE_WRITE16_MEMBER(write_rom70)
- {
+ virtual DECLARE_WRITE16_MEMBER(write_rom70)
+ {
if (offset == 0xfff)
{
if (data == 0x7a50)
@@ -86,8 +86,8 @@ public:
m_bank_base[7] = 1;
}
}
- virtual DECLARE_WRITE16_MEMBER(write_rome0)
- {
+ virtual DECLARE_WRITE16_MEMBER(write_rome0)
+ {
if (offset == 0xfff)
{
if (data == 0xea50)
@@ -96,8 +96,8 @@ public:
m_bank_base[14] = 1;
}
}
- virtual DECLARE_WRITE16_MEMBER(write_romf0)
- {
+ virtual DECLARE_WRITE16_MEMBER(write_romf0)
+ {
if (offset == 0xfff)
{
if (data == 0xfa50)
@@ -112,11 +112,11 @@ public:
// IntelliVoice passthru
virtual DECLARE_READ16_MEMBER(read_speech) { if (m_voice_enabled) return m_subslot->read_speech(space, offset, mem_mask); else return 0xffff; }
virtual DECLARE_WRITE16_MEMBER(write_speech) { if (m_voice_enabled) m_subslot->write_speech(space, offset, data, mem_mask); }
-
+
virtual void late_subslot_setup();
UINT8 intv_control_r(int hand);
-
+
private:
required_device<ay8914_device> m_snd;
diff --git a/src/emu/bus/intv/rom.c b/src/emu/bus/intv/rom.c
index 6bc190f4a83..6ff9cbd58d7 100644
--- a/src/emu/bus/intv/rom.c
+++ b/src/emu/bus/intv/rom.c
@@ -47,4 +47,3 @@ intv_wsmlb_device::intv_wsmlb_device(const machine_config &mconfig, const char *
: intv_rom_device(mconfig, INTV_ROM_WSMLB, "Intellivision World Series Baseball Cart", tag, owner, clock, "intv_wsmlb", __FILE__)
{
}
-
diff --git a/src/emu/bus/intv/rom.h b/src/emu/bus/intv/rom.h
index 2eb13cc5c76..cb6947b833c 100644
--- a/src/emu/bus/intv/rom.h
+++ b/src/emu/bus/intv/rom.h
@@ -13,7 +13,7 @@ public:
// construction/destruction
intv_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
intv_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ16_MEMBER(read_rom04) { return INTV_ROM16_READ(offset + 0x0400); }
virtual DECLARE_READ16_MEMBER(read_rom20) { return INTV_ROM16_READ(offset + 0x2000); }
@@ -30,7 +30,7 @@ public:
virtual DECLARE_READ16_MEMBER(read_romd0) { return INTV_ROM16_READ(offset + 0xd000); }
virtual DECLARE_READ16_MEMBER(read_rome0) { return INTV_ROM16_READ(offset + 0xe000); }
virtual DECLARE_READ16_MEMBER(read_romf0) { return INTV_ROM16_READ(offset + 0xf000); }
-
+
// device-level overrides
virtual void device_start() {}
virtual void device_reset() {}
@@ -43,7 +43,7 @@ class intv_ram_device : public intv_rom_device
public:
// construction/destruction
intv_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ16_MEMBER(read_ram) { return (int)m_ram[offset & (m_ram.count() - 1)]; }
virtual DECLARE_WRITE16_MEMBER(write_ram) { m_ram[offset & (m_ram.count() - 1)] = data & 0xff; }
@@ -56,7 +56,7 @@ class intv_gfact_device : public intv_rom_device
public:
// construction/destruction
intv_gfact_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ16_MEMBER(read_ram) { return (int)m_ram[offset & (m_ram.count() - 1)]; }
virtual DECLARE_WRITE16_MEMBER(write_ram) { m_ram[offset & (m_ram.count() - 1)] = data & 0xff; }
diff --git a/src/emu/bus/intv/slot.c b/src/emu/bus/intv/slot.c
index 0b60e504593..4b633fdb997 100644
--- a/src/emu/bus/intv/slot.c
+++ b/src/emu/bus/intv/slot.c
@@ -3,18 +3,18 @@
Mattel Intellivision cart emulation
(through slot devices)
-
+
This is a strange beast, because INTV carts had potentially access to
a *LOT* of memory ranges!
Quoting Joe Zbiciak's documentation for his emu (jzIntv):
-
-
+
+
The Intellivision leaves many addresses available to cartridges. However,
several address ranges come with caveats, such as interactions with other
- devices in the system, or incompatibilities with various peripherals.
-
+ devices in the system, or incompatibilities with various peripherals.
+
Below is a summary.
-
+
ADDRESSES NOTES
-------------- --------------------------------------------------------------
$0400 - $04FF RAM/ROM ok on all but Intellivision 2.
@@ -26,7 +26,7 @@
$4800 ROM ok. RAM ok only if boot ROM at $7000.
$4801 - $4FFF RAM/ROM ok.
$5000 - $5014 ROM ok. RAM ok only if boot ROM at $7000 or $4800.
- $5015 - $6FFF RAM/ROM ok.
+ $5015 - $6FFF RAM/ROM ok.
$7000 ROM ok if no ECS. RAM at $7000 confuses EXEC boot sequence.
$7001 - $77FF RAM/ROM ok if no ECS.
$7800 - $7FFF ROM ok if no ECS. Do not map RAM here due to GRAM alias.
@@ -38,8 +38,8 @@
$E000 - $EFFF RAM/ROM ok if no ECS.
$F000 - $F7FF RAM/ROM ok.
$F800 - $FFFF ROM ok. Do not map RAM here due to GRAM alias.
-
-
+
+
We handle this, by always creating a 0x10000 wide ROM region to load the
cart image and exposing the following (long list of) read handlers:
read_rom04
@@ -58,7 +58,7 @@
read_rome0
read_romf0
Each pcb types will then use the correct ones for its wiring setup.
-
+
The BIN+CFG format introduced by INTVPC emulator includes metadata about where to
load ROM into memory in the CFG file, but we don't support it (because we don't parse
the CFG at all) and we rely instead on the intv.hsi metadata for fullpath loading of
@@ -69,7 +69,7 @@
TODO:
- Convert also the keyboard component to be a passthru slot device
- Merge some of the ROM accessor above, once it is clear which ones can be merged
-
+
***********************************************************************************************************/
@@ -239,16 +239,16 @@ int intv_cart_slot_device::load_fullpath()
UINT8 num_segments;
UINT8 start_seg;
UINT8 end_seg;
-
+
UINT32 current_address;
UINT32 end_address;
-
+
UINT8 high_byte;
UINT8 low_byte;
-
+
UINT8 *ROM;
const char *file_type = filetype();
-
+
/* if it is in .rom format, we enter here */
if (!core_stricmp (file_type, "rom"))
{
@@ -256,9 +256,9 @@ int intv_cart_slot_device::load_fullpath()
fread(&temp, 1);
if (temp != 0xa8)
return IMAGE_INIT_FAIL;
-
+
fread(&num_segments, 1);
-
+
fread(&temp, 1);
if (temp != (num_segments ^ 0xff))
return IMAGE_INIT_FAIL;
@@ -270,10 +270,10 @@ int intv_cart_slot_device::load_fullpath()
{
fread(&start_seg, 1);
current_address = start_seg * 0x100;
-
+
fread(&end_seg, 1);
end_address = end_seg * 0x100 + 0xff;
-
+
while (current_address <= end_address)
{
fread(&low_byte, 1);
@@ -282,12 +282,12 @@ int intv_cart_slot_device::load_fullpath()
ROM[current_address << 1] = high_byte;
current_address++;
}
-
+
// Here we should calculate and compare the CRC16...
fread(&temp, 1);
fread(&temp, 1);
}
-
+
// Access tables and fine address restriction tables are not supported ATM
for (int i = 0; i < (16 + 32 + 2); i++)
{
@@ -300,7 +300,7 @@ int intv_cart_slot_device::load_fullpath()
{
// This code is a blatant hack, due to impossibility to load a separate .cfg file in MESS.
// It shall be eventually replaced by the .xml loading
-
+
// extrainfo format
// 1. mapper number (to deal with bankswitch). no bankswitch is mapper 0 (most games).
// 2.->5. current images have at most 4 chunks of data. we store here block size and location to load
@@ -314,7 +314,7 @@ int intv_cart_slot_device::load_fullpath()
m_cart->rom_alloc(0x20000, tag());
ROM = (UINT8 *)m_cart->get_rom_base();
-
+
if (!hashfile_extrainfo(*this, extrainfo))
{
// If no extrainfo, we assume a single 0x2000 chunk at 0x5000
@@ -329,12 +329,12 @@ int intv_cart_slot_device::load_fullpath()
else
{
sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
- &rom[3], &ram, &extra);
+ &rom[3], &ram, &extra);
//printf("extrainfo: %d %d %d %d %d %d %d \n", mapper, rom[0], rom[1], rom[2], rom[3], ram, extra);
-
+
if (mapper)
logerror("Bankswitch not yet implemented!\n");
-
+
if (ram)
{
start = ((ram & 0xf0) >> 4) * 0x1000;
@@ -355,25 +355,25 @@ int intv_cart_slot_device::load_fullpath()
}
if (extra & INTELLIVOICE_MASK)
{
- printf("WARNING: This game requires emulation of the IntelliVoice module.\n");
+ printf("WARNING: This game requires emulation of the IntelliVoice module.\n");
}
-
+
if (extra & ECS_MASK)
{
printf("WARNING: This game requires emulation of the ECS module.\n");
}
-
+
for (int j = 0; j < 4; j++)
{
start = ((rom[j] & 0xf0) >> 4) * 0x1000;
size = (rom[j] & 0x0f) * 0x800;
- // some cart has to be loaded to 0x4800, but none of the available ones goes to 0x4000.
+ // some cart has to be loaded to 0x4800, but none of the available ones goes to 0x4000.
// Hence, we use 0x04 << 4 in extrainfo (to reduce the stored values) and fix the value here.
if (start == 0x4000) start += 0x800;
-
+
// logerror("step %d: %d %d \n", j, start / 0x1000, size / 0x1000);
-
+
for (int i = 0; i < size; i++)
{
fread(&low_byte, 1);
@@ -383,7 +383,7 @@ int intv_cart_slot_device::load_fullpath()
}
}
}
-
+
return IMAGE_INIT_PASS;
}
}
@@ -408,7 +408,7 @@ bool intv_cart_slot_device::call_load()
// so if we are loading one of these, we allocate additional 0x2000 bytes for the paged bank
if (m_type == INTV_WSMLB)
extra_bank = true;
-
+
UINT32 size = 0;
UINT16 address = 0;
UINT8 *ROM, *region;
@@ -423,7 +423,7 @@ bool intv_cart_slot_device::call_load()
if (size)
{
region = get_software_region(region_name[i]);
-
+
for (int j = 0; j < size / 2; j++)
{
ROM[((address + j) << 1) + 1] = region[2 * j];
@@ -467,7 +467,7 @@ void intv_cart_slot_device::get_default_card_software(astring &result)
UINT32 len = core_fsize(m_file);
dynamic_buffer rom(len);
int type = INTV_STD;
-
+
core_fread(m_file, rom, len);
if (rom[0] == 0xa8 && (rom[1] == (rom[2] ^ 0xff)))
@@ -480,12 +480,12 @@ void intv_cart_slot_device::get_default_card_software(astring &result)
int start;
int mapper, rom[5], ram, extra;
astring extrainfo;
-
+
if (hashfile_extrainfo(*this, extrainfo))
{
sscanf(extrainfo.cstr() ,"%d %d %d %d %d %d %d", &mapper, &rom[0], &rom[1], &rom[2],
- &rom[3], &ram, &extra);
-
+ &rom[3], &ram, &extra);
+
if (ram)
{
start = ((ram & 0xf0) >> 4) * 0x1000;
@@ -495,7 +495,7 @@ void intv_cart_slot_device::get_default_card_software(astring &result)
type = INTV_GFACT;
}
}
-
+
}
slot_string = intv_get_slot(type);
@@ -567,6 +567,5 @@ SLOT_INTERFACE_START(intv_cart)
SLOT_INTERFACE_INTERNAL("intv_wsmlb", INTV_ROM_WSMLB)
SLOT_INTERFACE_INTERNAL("intv_voice", INTV_ROM_VOICE)
SLOT_INTERFACE_INTERNAL("intv_ecs", INTV_ROM_ECS)
-// SLOT_INTERFACE_INTERNAL("intv_keycomp", INTV_ROM_KEYCOMP)
+// SLOT_INTERFACE_INTERNAL("intv_keycomp", INTV_ROM_KEYCOMP)
SLOT_INTERFACE_END
-
diff --git a/src/emu/bus/intv/slot.h b/src/emu/bus/intv/slot.h
index e14243f190f..03b3792349b 100644
--- a/src/emu/bus/intv/slot.h
+++ b/src/emu/bus/intv/slot.h
@@ -11,7 +11,7 @@ enum
{
INTV_STD = 0,
INTV_RAM,
- INTV_GFACT, // has RAM too but at diff offset
+ INTV_GFACT, // has RAM too but at diff offset
INTV_WSMLB,
INTV_VOICE,
INTV_ECS,
@@ -51,7 +51,7 @@ public:
virtual DECLARE_READ16_MEMBER(read_ram) { return 0xffff; }
virtual DECLARE_WRITE16_MEMBER(write_ram) {}
-
+
// Used by IntelliVoice & ECS
virtual DECLARE_READ16_MEMBER(read_ay) { return 0xffff; }
virtual DECLARE_WRITE16_MEMBER(write_ay) {}
@@ -71,7 +71,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
virtual void late_subslot_setup() {}
protected:
@@ -105,7 +105,7 @@ public:
int get_type() { return m_type; }
int load_fullpath();
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -136,7 +136,7 @@ public:
virtual DECLARE_READ16_MEMBER(read_romd0) { if (m_cart) return m_cart->read_romd0(space, offset, mem_mask); else return 0xffff; }
virtual DECLARE_READ16_MEMBER(read_rome0) { if (m_cart) return m_cart->read_rome0(space, offset, mem_mask); else return 0xffff; }
virtual DECLARE_READ16_MEMBER(read_romf0) { if (m_cart) return m_cart->read_romf0(space, offset, mem_mask); else return 0xffff; }
-
+
virtual DECLARE_READ16_MEMBER(read_ay);
virtual DECLARE_WRITE16_MEMBER(write_ay);
virtual DECLARE_READ16_MEMBER(read_speech);
@@ -176,8 +176,7 @@ extern const device_type INTV_CART_SLOT;
#define MCFG_INTV_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, INTV_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
SLOT_INTERFACE_EXTERN(intv_cart);
diff --git a/src/emu/bus/intv/voice.h b/src/emu/bus/intv/voice.h
index 9ba16aef358..96e92bbf44c 100644
--- a/src/emu/bus/intv/voice.h
+++ b/src/emu/bus/intv/voice.h
@@ -13,7 +13,7 @@ class intv_voice_device : public intv_rom_device
public:
// construction/destruction
intv_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
@@ -23,7 +23,7 @@ public:
// actual IntelliVoice access
virtual DECLARE_READ16_MEMBER(read_speech);
virtual DECLARE_WRITE16_MEMBER(write_speech);
-
+
// passthru access
virtual DECLARE_READ16_MEMBER(read_rom04) { return m_subslot->read_rom04(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom20) { return m_subslot->read_rom20(space, offset, mem_mask); }
@@ -33,34 +33,34 @@ public:
virtual DECLARE_READ16_MEMBER(read_rom60) { return m_subslot->read_rom60(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom70) { return m_subslot->read_rom70(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_rom80)
- {
+ {
if (m_ram88_enabled && offset >= 0x800)
- return m_subslot->read_ram(space, offset & 0x7ff, mem_mask);
+ return m_subslot->read_ram(space, offset & 0x7ff, mem_mask);
else
- return m_subslot->read_rom80(space, offset, mem_mask);
+ return m_subslot->read_rom80(space, offset, mem_mask);
}
virtual DECLARE_READ16_MEMBER(read_rom90) { return m_subslot->read_rom90(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_roma0) { return m_subslot->read_roma0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romb0) { return m_subslot->read_romb0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romc0) { return m_subslot->read_romc0(space, offset, mem_mask); }
- virtual DECLARE_READ16_MEMBER(read_romd0)
- {
+ virtual DECLARE_READ16_MEMBER(read_romd0)
+ {
if (m_ramd0_enabled && offset < 0x800)
- return m_subslot->read_ram(space, offset, mem_mask);
+ return m_subslot->read_ram(space, offset, mem_mask);
else
- return m_subslot->read_romd0(space, offset, mem_mask);
+ return m_subslot->read_romd0(space, offset, mem_mask);
}
virtual DECLARE_READ16_MEMBER(read_rome0) { return m_subslot->read_rome0(space, offset, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_romf0) { return m_subslot->read_romf0(space, offset, mem_mask); }
-
+
// RAM passthru write
virtual DECLARE_WRITE16_MEMBER(write_88) { if (m_ram88_enabled) m_subslot->write_ram(space, offset, data, mem_mask); }
virtual DECLARE_WRITE16_MEMBER(write_d0) { if (m_ramd0_enabled) m_subslot->write_ram(space, offset, data, mem_mask); }
virtual DECLARE_READ16_MEMBER(read_ram) { return m_subslot->read_ram(space, offset, mem_mask); }
virtual DECLARE_WRITE16_MEMBER(write_ram) { m_subslot->write_ram(space, offset, data, mem_mask); }
-
+
virtual void late_subslot_setup();
-
+
private:
required_device<sp0256_device> m_speech;
required_device<intv_cart_slot_device> m_subslot;
diff --git a/src/emu/bus/isa/sb16.c b/src/emu/bus/isa/sb16.c
index 9c4e39d92b9..cff27627c2c 100644
--- a/src/emu/bus/isa/sb16.c
+++ b/src/emu/bus/isa/sb16.c
@@ -370,12 +370,12 @@ ROM_END
static ADDRESS_MAP_START(sb16_io, AS_IO, 8, sb16_lle_device)
AM_RANGE(0x0000, 0x0000) AM_MIRROR(0xff00) AM_READWRITE(dsp_data_r, dsp_data_w)
-// AM_RANGE(0x0001, 0x0001) // MIDI related?
-// AM_RANGE(0x0002, 0x0002)
+// AM_RANGE(0x0001, 0x0001) // MIDI related?
+// AM_RANGE(0x0002, 0x0002)
AM_RANGE(0x0004, 0x0004) AM_MIRROR(0xff00) AM_READWRITE(mode_r, mode_w)
AM_RANGE(0x0005, 0x0005) AM_MIRROR(0xff00) AM_READWRITE(dac_ctrl_r, dac_ctrl_w)
AM_RANGE(0x0006, 0x0006) AM_MIRROR(0xff00) AM_READ(dma_stat_r)
-// AM_RANGE(0x0007, 0x0007) // unknown
+// AM_RANGE(0x0007, 0x0007) // unknown
AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff00) AM_READWRITE(ctrl8_r, ctrl8_w)
AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xff00) AM_WRITE(rate_w)
AM_RANGE(0x000A, 0x000A) AM_MIRROR(0xff00) AM_READ(dma8_cnt_lo_r)
@@ -393,9 +393,9 @@ static ADDRESS_MAP_START(sb16_io, AS_IO, 8, sb16_lle_device)
AM_RANGE(0x001B, 0x001B) AM_MIRROR(0xff00) AM_READ(adc_data_r)
AM_RANGE(0x001D, 0x001D) AM_MIRROR(0xff00) AM_WRITE(dma8_w)
AM_RANGE(0x001F, 0x001F) AM_MIRROR(0xff00) AM_READ(dma8_r)
-// AM_RANGE(0x0080, 0x0080) // ASP comms
-// AM_RANGE(0x0081, 0x0081)
-// AM_RANGE(0x0082, 0x0082)
+// AM_RANGE(0x0080, 0x0080) // ASP comms
+// AM_RANGE(0x0081, 0x0081)
+// AM_RANGE(0x0082, 0x0082)
AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READWRITE(p1_r, p1_w)
AM_RANGE(MCS51_PORT_P2, MCS51_PORT_P2) AM_READWRITE(p2_r, p2_w)
ADDRESS_MAP_END
diff --git a/src/emu/bus/isa/svga_trident.c b/src/emu/bus/isa/svga_trident.c
index f5885769e2a..feea3722dde 100644
--- a/src/emu/bus/isa/svga_trident.c
+++ b/src/emu/bus/isa/svga_trident.c
@@ -87,10 +87,10 @@ void isa8_svga_tgui9680_device::device_start()
m_isa->install_memory(0xa0000, 0xbffff, 0, 0, read8_delegate(FUNC(trident_vga_device::mem_r),m_vga), write8_delegate(FUNC(trident_vga_device::mem_w),m_vga));
// uncomment to test Windows 3.1 TGUI9440AGi driver
-// m_isa->install_memory(0x4400000, 0x45fffff, 0, 0, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga));
+// m_isa->install_memory(0x4400000, 0x45fffff, 0, 0, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga));
// win95 drivers
-// m_isa->install_memory(0x4000000, 0x41fffff, 0, 0, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga));
+// m_isa->install_memory(0x4000000, 0x41fffff, 0, 0, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga));
// acceleration ports
m_isa->install_device(0x2120, 0x21ff, 0, 0, read8_delegate(FUNC(trident_vga_device::accel_r),m_vga), write8_delegate(FUNC(trident_vga_device::accel_w),m_vga));
diff --git a/src/emu/bus/isa/trident.c b/src/emu/bus/isa/trident.c
index 2ed9c76bbbd..a4afa62d9f8 100644
--- a/src/emu/bus/isa/trident.c
+++ b/src/emu/bus/isa/trident.c
@@ -45,21 +45,21 @@ UINT8 trident_vga_device::READPIXEL8(INT16 x, INT16 y)
UINT16 trident_vga_device::READPIXEL15(INT16 x, INT16 y)
{
return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*2) % vga.svga_intf.vram_size] |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8));
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8));
}
UINT16 trident_vga_device::READPIXEL16(INT16 x, INT16 y)
{
return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*2) % vga.svga_intf.vram_size] |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8));
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8));
}
UINT32 trident_vga_device::READPIXEL32(INT16 x, INT16 y)
{
return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*4) % vga.svga_intf.vram_size] |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+1) % vga.svga_intf.vram_size] << 8) |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+2) % vga.svga_intf.vram_size] << 16) |
- (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+3) % vga.svga_intf.vram_size] << 24));
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+1) % vga.svga_intf.vram_size] << 8) |
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+2) % vga.svga_intf.vram_size] << 16) |
+ (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+3) % vga.svga_intf.vram_size] << 24));
}
void trident_vga_device::WRITEPIXEL8(INT16 x, INT16 y, UINT8 data)
@@ -249,9 +249,9 @@ UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bi
for(x=0;x<cursor_size;x++)
{
UINT32 bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size]
- | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)
- | ((vga.memory[(src+1) % vga.svga_intf.vram_size]) << 16)
- | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 24));
+ | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)
+ | ((vga.memory[(src+1) % vga.svga_intf.vram_size]) << 16)
+ | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 24));
UINT32 bita = (vga.memory[(src+7) % vga.svga_intf.vram_size]
| ((vga.memory[(src+6) % vga.svga_intf.vram_size]) << 8)
| ((vga.memory[(src+5) % vga.svga_intf.vram_size]) << 16)
@@ -1131,60 +1131,60 @@ UINT8 trident_vga_device::old_mmio_r(address_space& space, UINT32 offset)
/*
Graphics Engine for 9440/9660/9680
-#define GER_STATUS 0x2120
-#define GE_BUSY 0x80
-#define GER_OPERMODE 0x2122 Byte for 9440, Word for 96xx
-#define DST_ENABLE 0x200 // Destination Transparency
-#define GER_COMMAND 0x2124
-#define GE_NOP 0x00 // No Operation
-#define GE_BLT 0x01 // BitBLT ROP3 only
-#define GE_BLT_ROP4 0x02 // BitBLT ROP4 (96xx only)
-#define GE_SCANLINE 0x03 // Scan Line
-#define GE_BRESLINE 0x04 // Bresenham Line
-#define GE_SHVECTOR 0x05 // Short Vector
-#define GE_FASTLINE 0x06 // Fast Line (96xx only)
-#define GE_TRAPEZ 0x07 // Trapezoidal fill (96xx only)
-#define GE_ELLIPSE 0x08 // Ellipse (96xx only) (RES)
-#define GE_ELLIP_FILL 0x09 // Ellipse Fill (96xx only) (RES)
-#define GER_FMIX 0x2127
-#define GER_DRAWFLAG 0x2128 // long
-#define FASTMODE 1<<28
-#define STENCIL 0x8000
-#define SOLIDFILL 0x4000
-#define TRANS_ENABLE 0x1000
-#define TRANS_REVERSE 0x2000
-#define YMAJ 0x0400
-#define XNEG 0x0200
-#define YNEG 0x0100
-#define SRCMONO 0x0040
-#define PATMONO 0x0020
-#define SCR2SCR 0x0004
-#define PAT2SCR 0x0002
-#define GER_FCOLOUR 0x212C // Word for 9440, long for 96xx
-#define GER_BCOLOUR 0x2130 // Word for 9440, long for 96xx
-#define GER_PATLOC 0x2134 // Word
-#define GER_DEST_XY 0x2138
-#define GER_DEST_X 0x2138 // Word
-#define GER_DEST_Y 0x213A // Word
-#define GER_SRC_XY 0x213C
-#define GER_SRC_X 0x213C // Word
-#define GER_SRC_Y 0x213E // Word
-#define GER_DIM_XY 0x2140
-#define GER_DIM_X 0x2140 // Word
-#define GER_DIM_Y 0x2142 // Word
-#define GER_STYLE 0x2144 // Long
-#define GER_CKEY 0x2168 // Long
-#define GER_FPATCOL 0x2178
-#define GER_BPATCOL 0x217C
-#define GER_PATTERN 0x2180 // from 0x2180 to 0x21FF
+#define GER_STATUS 0x2120
+#define GE_BUSY 0x80
+#define GER_OPERMODE 0x2122 Byte for 9440, Word for 96xx
+#define DST_ENABLE 0x200 // Destination Transparency
+#define GER_COMMAND 0x2124
+#define GE_NOP 0x00 // No Operation
+#define GE_BLT 0x01 // BitBLT ROP3 only
+#define GE_BLT_ROP4 0x02 // BitBLT ROP4 (96xx only)
+#define GE_SCANLINE 0x03 // Scan Line
+#define GE_BRESLINE 0x04 // Bresenham Line
+#define GE_SHVECTOR 0x05 // Short Vector
+#define GE_FASTLINE 0x06 // Fast Line (96xx only)
+#define GE_TRAPEZ 0x07 // Trapezoidal fill (96xx only)
+#define GE_ELLIPSE 0x08 // Ellipse (96xx only) (RES)
+#define GE_ELLIP_FILL 0x09 // Ellipse Fill (96xx only) (RES)
+#define GER_FMIX 0x2127
+#define GER_DRAWFLAG 0x2128 // long
+#define FASTMODE 1<<28
+#define STENCIL 0x8000
+#define SOLIDFILL 0x4000
+#define TRANS_ENABLE 0x1000
+#define TRANS_REVERSE 0x2000
+#define YMAJ 0x0400
+#define XNEG 0x0200
+#define YNEG 0x0100
+#define SRCMONO 0x0040
+#define PATMONO 0x0020
+#define SCR2SCR 0x0004
+#define PAT2SCR 0x0002
+#define GER_FCOLOUR 0x212C // Word for 9440, long for 96xx
+#define GER_BCOLOUR 0x2130 // Word for 9440, long for 96xx
+#define GER_PATLOC 0x2134 // Word
+#define GER_DEST_XY 0x2138
+#define GER_DEST_X 0x2138 // Word
+#define GER_DEST_Y 0x213A // Word
+#define GER_SRC_XY 0x213C
+#define GER_SRC_X 0x213C // Word
+#define GER_SRC_Y 0x213E // Word
+#define GER_DIM_XY 0x2140
+#define GER_DIM_X 0x2140 // Word
+#define GER_DIM_Y 0x2142 // Word
+#define GER_STYLE 0x2144 // Long
+#define GER_CKEY 0x2168 // Long
+#define GER_FPATCOL 0x2178
+#define GER_BPATCOL 0x217C
+#define GER_PATTERN 0x2180 // from 0x2180 to 0x21FF
Additional - Graphics Engine for 96xx
-#define GER_SRCCLIP_XY 0x2148
-#define GER_SRCCLIP_X 0x2148 // Word
-#define GER_SRCCLIP_Y 0x214A // Word
-#define GER_DSTCLIP_XY 0x214C
-#define GER_DSTCLIP_X 0x214C // Word
-#define GER_DSTCLIP_Y 0x214E // Word
+#define GER_SRCCLIP_XY 0x2148
+#define GER_SRCCLIP_X 0x2148 // Word
+#define GER_SRCCLIP_Y 0x214A // Word
+#define GER_DSTCLIP_XY 0x214C
+#define GER_DSTCLIP_X 0x214C // Word
+#define GER_DSTCLIP_Y 0x214E // Word
*/
READ8_MEMBER(trident_vga_device::accel_r)
diff --git a/src/emu/bus/megadrive/ggenie.c b/src/emu/bus/megadrive/ggenie.c
index 1f1dc8ceab1..62ebfbb55aa 100644
--- a/src/emu/bus/megadrive/ggenie.c
+++ b/src/emu/bus/megadrive/ggenie.c
@@ -5,17 +5,17 @@
based on Charles MacDonald's docs: http://cgfm2.emuviews.com/txt/genie.txt
-
+
There is an interesting difference between Rev.0 and Rev.A
- After the codes has been entered, the former just performs
- a last write to the MODE register (m_gg_regs[0]) which both
- sets the enable bits for the 6 available cheats (in the low
- 8 bits) and locks the GG so that later reads goes to the
+ After the codes has been entered, the former just performs
+ a last write to the MODE register (m_gg_regs[0]) which both
+ sets the enable bits for the 6 available cheats (in the low
+ 8 bits) and locks the GG so that later reads goes to the
piggyback cart. The latter revision, instead, performs the
- same operations in two subsequent 8bit writes, accessing
+ same operations in two subsequent 8bit writes, accessing
separately the low and high bits of the register.
-
+
***********************************************************************************************************/
#include "emu.h"
@@ -86,7 +86,7 @@ READ16_MEMBER(md_rom_ggenie_device::read)
return m_gg_data[5];
else
return m_exp->m_cart->read(space, offset);
- }
+ }
else
return 0xffff;
}
@@ -114,7 +114,7 @@ WRITE16_MEMBER(md_rom_ggenie_device::write)
else
{
m_gg_bypass = 0;
-
+
// bit9 set = read goes to ASIC registers
if (data & 0x200)
m_reg_enable = 1;
@@ -122,7 +122,7 @@ WRITE16_MEMBER(md_rom_ggenie_device::write)
else
m_reg_enable = 0;
}
-
+
// LOCK bit
if (data & 0x100)
{
@@ -133,7 +133,7 @@ WRITE16_MEMBER(md_rom_ggenie_device::write)
m_gg_addr[3] = ((m_gg_regs[11] & 0x3f) << 16) | m_gg_regs[12];
m_gg_addr[4] = ((m_gg_regs[14] & 0x3f) << 16) | m_gg_regs[15];
m_gg_addr[5] = ((m_gg_regs[17] & 0x3f) << 16) | m_gg_regs[18];
-
+
// data
m_gg_data[0] = m_gg_regs[4];
m_gg_data[1] = m_gg_regs[7];
@@ -144,9 +144,9 @@ WRITE16_MEMBER(md_rom_ggenie_device::write)
//printf("mode %X\n", data);
//for (int i = 0; i < 6; i++)
- // printf("addr %d = 0x%X - data 0x%X\n", i, m_gg_addr[i], m_gg_data[i]);
+ // printf("addr %d = 0x%X - data 0x%X\n", i, m_gg_addr[i], m_gg_data[i]);
}
- }
+ }
else if (offset == 1)
{
// RESET
diff --git a/src/emu/bus/msx_cart/disk.c b/src/emu/bus/msx_cart/disk.c
index a49285fc28e..93def4a5adf 100644
--- a/src/emu/bus/msx_cart/disk.c
+++ b/src/emu/bus/msx_cart/disk.c
@@ -164,7 +164,7 @@ msx_cart_fsfd1::msx_cart_fsfd1(const machine_config &mconfig, const char *tag, d
msx_cart_fscf351::msx_cart_fscf351(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : msx_cart_disk_type2(mconfig, MSX_CART_FSCF351, "MSX Cartridge - FS-CF351", tag, owner, clock, "msx_cart_fscf351")
+ : msx_cart_disk_type2(mconfig, MSX_CART_FSCF351, "MSX Cartridge - FS-CF351", tag, owner, clock, "msx_cart_fscf351")
{
}
@@ -624,4 +624,3 @@ WRITE8_MEMBER(msx_cart_fsfd1a::write_cart)
break;
}
}
-
diff --git a/src/emu/bus/msx_slot/disk.c b/src/emu/bus/msx_slot/disk.c
index 04f398ef6ef..998ab6e9899 100644
--- a/src/emu/bus/msx_slot/disk.c
+++ b/src/emu/bus/msx_slot/disk.c
@@ -677,7 +677,7 @@ void msx_slot_disk6_device::post_load()
void msx_slot_disk6_device::select_drive()
{
- if (m_drive_select1)
+ if (m_drive_select1)
{
m_floppy = m_floppy1 ? m_floppy1->get_device() : NULL;
if (!m_floppy)
@@ -809,4 +809,3 @@ WRITE8_MEMBER(msx_slot_disk6_device::write)
break;
}
}
-
diff --git a/src/emu/bus/nes/disksys.c b/src/emu/bus/nes/disksys.c
index 23eee5c4573..ae95074102c 100644
--- a/src/emu/bus/nes/disksys.c
+++ b/src/emu/bus/nes/disksys.c
@@ -11,7 +11,7 @@
Famicom Disk System.
Based on info from NESDev wiki ( http://wiki.nesdev.com/w/index.php/Family_Computer_Disk_System )
-
+
TODO:
- convert floppy drive + fds format to modern code!
- add sound bits
@@ -124,14 +124,14 @@ void nes_disksys_device::device_start()
irq_timer = timer_alloc(TIMER_IRQ);
irq_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1));
-
+
save_item(NAME(m_fds_motor_on));
save_item(NAME(m_fds_door_closed));
save_item(NAME(m_fds_current_side));
save_item(NAME(m_fds_head_position));
save_item(NAME(m_fds_status0));
save_item(NAME(m_read_mode));
- save_item(NAME(m_drive_ready));
+ save_item(NAME(m_drive_ready));
save_item(NAME(m_irq_enable));
save_item(NAME(m_irq_transfer));
save_item(NAME(m_irq_count));
@@ -173,8 +173,8 @@ void nes_disksys_device::pcb_reset()
RAM is in 0x6000-0xdfff (32K)
ROM is in 0xe000-0xffff (8K)
-
- registers + disk drive are accessed in
+
+ registers + disk drive are accessed in
0x4020-0x403f (read_ex/write_ex below)
-------------------------------------------------*/
@@ -210,7 +210,7 @@ READ8_MEMBER(nes_disksys_device::read_m)
}
void nes_disksys_device::hblank_irq(int scanline, int vblank, int blanked)
-{
+{
if (m_irq_transfer)
m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
}
@@ -218,7 +218,7 @@ void nes_disksys_device::hblank_irq(int scanline, int vblank, int blanked)
WRITE8_MEMBER(nes_disksys_device::write_ex)
{
LOG_MMC(("Famicom Disk System write_ex, offset: %04x, data: %02x\n", offset, data));
-
+
if (offset >= 0x20 && offset < 0x60)
{
// wavetable
@@ -255,34 +255,34 @@ WRITE8_MEMBER(nes_disksys_device::write_ex)
// bit4 - CRC control (set during CRC calculation of transfer)
// bit5 - Always set to '1'
// bit6 - Read/Write Start (Set to 1 when the drive becomes ready for read/write)
- // bit7 - Interrupt Transfer (0: Transfer without using IRQ; 1: Enable IRQ when
+ // bit7 - Interrupt Transfer (0: Transfer without using IRQ; 1: Enable IRQ when
// the drive becomes ready)
m_fds_motor_on = BIT(data, 0);
-
+
if (BIT(data, 1))
m_fds_head_position = 0;
-
+
if (!(data & 0x40) && m_drive_ready && m_fds_head_position > 2)
m_fds_head_position -= 2; // ??? is this some sort of compensation??
-
+
m_read_mode = BIT(data, 2);
- set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
m_drive_ready = data & 0x40;
m_irq_transfer = BIT(data, 7);
break;
case 0x06:
// external connector
break;
- case 0x60: // $4080 - Volume envelope - read through $4090
- case 0x62: // $4082 - Frequency low
- case 0x63: // $4083 - Frequency high
- case 0x64: // $4084 - Mod envelope - read through $4092
- case 0x65: // $4085 - Mod counter
- case 0x66: // $4086 - Mod frequency low
- case 0x67: // $4087 - Mod frequency high
- case 0x68: // $4088 - Mod table write
- case 0x69: // $4089 - Wave write / master volume
- case 0x6a: // $408a - Envelope speed
+ case 0x60: // $4080 - Volume envelope - read through $4090
+ case 0x62: // $4082 - Frequency low
+ case 0x63: // $4083 - Frequency high
+ case 0x64: // $4084 - Mod envelope - read through $4092
+ case 0x65: // $4085 - Mod counter
+ case 0x66: // $4086 - Mod frequency low
+ case 0x67: // $4087 - Mod frequency high
+ case 0x68: // $4088 - Mod table write
+ case 0x69: // $4089 - Wave write / master volume
+ case 0x6a: // $408a - Envelope speed
break;
}
}
@@ -299,11 +299,11 @@ READ8_MEMBER(nes_disksys_device::read_ex)
switch (offset)
{
- case 0x10:
+ case 0x10:
// $4030 - disk status 0
// bit0 - Timer Interrupt (1: an IRQ occurred)
- // bit1 - Byte transfer flag (Set to 1 every time 8 bits have been transfered between
- // the RAM adaptor & disk drive through $4024/$4031; Reset to 0 when $4024,
+ // bit1 - Byte transfer flag (Set to 1 every time 8 bits have been transfered between
+ // the RAM adaptor & disk drive through $4024/$4031; Reset to 0 when $4024,
// $4031, or $4030 has been serviced)
// bit4 - CRC control (0: CRC passed; 1: CRC error)
// bit6 - End of Head (1 when disk head is on the most inner track)
@@ -312,7 +312,7 @@ READ8_MEMBER(nes_disksys_device::read_ex)
// clear the disk IRQ detect flag
m_fds_status0 &= ~0x01;
break;
- case 0x11:
+ case 0x11:
// $4031 - data latch
// don't read data if disk is unloaded
if (!m_fds_data)
@@ -330,8 +330,8 @@ READ8_MEMBER(nes_disksys_device::read_ex)
else
ret = 0;
break;
- case 0x12:
- // $4032 - disk status 1:
+ case 0x12:
+ // $4032 - disk status 1:
// bit0 - Disk flag (0: Disk inserted; 1: Disk not inserted)
// bit1 - Ready flag (0: Disk ready; 1: Disk not ready)
// bit2 - Protect flag (0: Not write protected; 1: Write protected or disk ejected)
@@ -351,17 +351,17 @@ READ8_MEMBER(nes_disksys_device::read_ex)
else
ret = (m_fds_current_side == 0) ? 1 : 0; // 0 if a disk is inserted
break;
- case 0x13:
+ case 0x13:
// $4033 - external connector (bits 0-6) + battery status (bit 7)
ret = 0x80;
break;
- case 0x70: // $4090 - Volume gain - write through $4080
- case 0x72: // $4092 - Mod gain - read through $4084
+ case 0x70: // $4090 - Volume gain - write through $4080
+ case 0x72: // $4092 - Mod gain - read through $4084
default:
ret = 0x00;
break;
}
-
+
return ret;
}
@@ -372,7 +372,7 @@ READ8_MEMBER(nes_disksys_device::read_ex)
void nes_disksys_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
if (id == TIMER_IRQ)
- {
+ {
if (m_irq_enable && m_irq_count)
{
m_irq_count--;
@@ -381,7 +381,7 @@ void nes_disksys_device::device_timer(emu_timer &timer, device_timer_id id, int
m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
m_irq_enable = 0;
m_fds_status0 |= 0x01;
- m_irq_count_latch = 0; // used in Kaettekita Mario Bros
+ m_irq_count_latch = 0; // used in Kaettekita Mario Bros
}
}
}
@@ -399,7 +399,7 @@ void nes_disksys_device::disk_flip_side()
if (m_fds_current_side == 0)
popmessage("No disk inserted.");
else
- popmessage("Disk set to side %d", m_fds_current_side);
+ popmessage("Disk set to side %d", m_fds_current_side);
}
@@ -410,15 +410,15 @@ void nes_disksys_device::load_disk(device_image_interface &image)
{
int header = 0;
m_fds_sides = 0;
-
+
if (image.length() % 65500)
header = 0x10;
-
+
m_fds_sides = (image.length() - header) / 65500;
-
+
if (!m_fds_data)
m_fds_data = auto_alloc_array(machine(), UINT8, m_fds_sides * 65500);
-
+
// if there is an header, skip it
image.fseek(header, SEEK_SET);
image.fread(m_fds_data, 65500 * m_fds_sides);
@@ -430,4 +430,3 @@ void nes_disksys_device::unload_disk(device_image_interface &image)
/* TODO: should write out changes here as well */
m_fds_sides = 0;
}
-
diff --git a/src/emu/bus/nes/nes_slot.c b/src/emu/bus/nes/nes_slot.c
index bcd22d74381..89107fb1664 100644
--- a/src/emu/bus/nes/nes_slot.c
+++ b/src/emu/bus/nes/nes_slot.c
@@ -161,9 +161,9 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
printf("Warning! The loaded PRG has size not a multiple of 8KB (0x%X)\n", (UINT32)size);
m_prg_chunks--;
}
-
+
m_prg_mask = ((m_prg_chunks << 1) - 1);
-
+
// printf("first mask %x!\n", m_prg_mask);
if ((m_prg_chunks << 1) & m_prg_mask)
{
@@ -172,7 +172,7 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
// only half a dozen of NES carts have PRG which is not a power of 2
// so we use this bank_map only as an exception
// printf("uneven rom!\n");
-
+
// 1. redefine mask as (next power of 2)-1
for (; temp; )
{
@@ -182,15 +182,15 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
m_prg_mask = (1 << mask_bits) - 1;
// printf("new mask %x!\n", m_prg_mask);
mapsize = (1 << mask_bits)/2;
-
+
// 2. create a bank_map for banks in the range mask/2 -> mask
m_prg_bank_map.resize(mapsize);
-
+
// 3. fill the bank_map accounting for mirrors
int j;
for (j = mapsize; j < (m_prg_chunks << 1); j++)
m_prg_bank_map[j - mapsize] = j;
-
+
while (j % mapsize)
{
int k = 0, repeat_banks;
@@ -201,7 +201,7 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
m_prg_bank_map[(j - mapsize) + l] = m_prg_bank_map[(j - mapsize) + l - repeat_banks];
j += repeat_banks;
}
-
+
// check bank map!
// for (int i = 0; i < mapsize; i++)
// {
@@ -674,7 +674,7 @@ void device_nes_cart_interface::pcb_start(running_machine &machine, UINT8 *ciram
// main NES CPU here, even if it does not belong to this device.
m_maincpu = machine.device<cpu_device>("maincpu");
- if (cart_mounted) // disksys expansion can arrive here without the memory banks!
+ if (cart_mounted) // disksys expansion can arrive here without the memory banks!
{
// Setup PRG
m_prg_bank_mem[0] = machine.root_device().membank("prg0");
@@ -691,11 +691,11 @@ void device_nes_cart_interface::pcb_start(running_machine &machine, UINT8 *ciram
}
}
}
-
+
// Setup CHR (VRAM can be present also without PRG rom)
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
chr8(0, m_chr_source);
-
+
// Setup NT
m_ciram = ciram_ptr;
diff --git a/src/emu/bus/nes/nes_slot.h b/src/emu/bus/nes/nes_slot.h
index 02e017b0923..9c73d95d17d 100644
--- a/src/emu/bus/nes/nes_slot.h
+++ b/src/emu/bus/nes/nes_slot.h
@@ -376,10 +376,10 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_m);
virtual DECLARE_WRITE8_MEMBER(write_h);
virtual DECLARE_WRITE8_MEMBER(write_ex);
-
+
// hack until disk system is made modern!
virtual void disk_flip_side() { if (m_cart) m_cart->disk_flip_side(); }
-
+
int get_pcb_id() { return m_pcb_id; };
void pcb_start(UINT8 *ciram_ptr);
diff --git a/src/emu/bus/odyssey2/chess.h b/src/emu/bus/odyssey2/chess.h
index 8b71f56ed93..66015c033cb 100644
--- a/src/emu/bus/odyssey2/chess.h
+++ b/src/emu/bus/odyssey2/chess.h
@@ -12,10 +12,9 @@
class o2_chess_device : public o2_rom_device
{
-
virtual machine_config_constructor device_mconfig_additions() const;
-// virtual const rom_entry *device_rom_region() const;
-
+// virtual const rom_entry *device_rom_region() const;
+
public:
// construction/destruction
o2_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
diff --git a/src/emu/bus/odyssey2/rom.c b/src/emu/bus/odyssey2/rom.c
index da0f02f6941..d741dcdd802 100644
--- a/src/emu/bus/odyssey2/rom.c
+++ b/src/emu/bus/odyssey2/rom.c
@@ -50,12 +50,12 @@ o2_rom16_device::o2_rom16_device(const machine_config &mconfig, const char *tag,
//-------------------------------------------------
void o2_rom_device::device_start()
-{
+{
save_item(NAME(m_bank_base));
}
void o2_rom_device::device_reset()
-{
+{
m_bank_base = 0;
}
@@ -94,4 +94,3 @@ READ8_MEMBER(o2_rom16_device::read_rom0c)
{
return m_rom[offset + 0xc00 + (m_bank_base & 0x03) * 0x1000];
}
-
diff --git a/src/emu/bus/odyssey2/rom.h b/src/emu/bus/odyssey2/rom.h
index 52b08a0e5e4..7a4af0a32b5 100644
--- a/src/emu/bus/odyssey2/rom.h
+++ b/src/emu/bus/odyssey2/rom.h
@@ -15,17 +15,17 @@ public:
// construction/destruction
o2_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
o2_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom04);
virtual DECLARE_READ8_MEMBER(read_rom0c);
-
+
virtual void write_bank(int bank);
-
+
protected:
int m_bank_base;
};
@@ -37,7 +37,7 @@ class o2_rom12_device : public o2_rom_device
public:
// construction/destruction
o2_rom12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom04);
virtual DECLARE_READ8_MEMBER(read_rom0c);
@@ -50,7 +50,7 @@ class o2_rom16_device : public o2_rom_device
public:
// construction/destruction
o2_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom04);
virtual DECLARE_READ8_MEMBER(read_rom0c);
diff --git a/src/emu/bus/odyssey2/slot.c b/src/emu/bus/odyssey2/slot.c
index 12bde81adc1..c8dc8e053f5 100644
--- a/src/emu/bus/odyssey2/slot.c
+++ b/src/emu/bus/odyssey2/slot.c
@@ -166,7 +166,7 @@ bool o2_cart_slot_device::call_load()
{
UINT32 size = (software_entry() == NULL) ? length() : get_software_region_length("rom");
m_cart->rom_alloc(size, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), size);
else
@@ -223,7 +223,7 @@ void o2_cart_slot_device::get_default_card_software(astring &result)
type = O2_ROM12;
if (size == 16384)
type = O2_ROM16;
-
+
slot_string = o2_get_slot(type);
//printf("type: %s\n", slot_string);
@@ -278,4 +278,3 @@ SLOT_INTERFACE_START(o2_cart)
SLOT_INTERFACE_INTERNAL("o2_chess", O2_ROM_CHESS)
SLOT_INTERFACE_INTERNAL("o2_voice", O2_ROM_VOICE)
SLOT_INTERFACE_END
-
diff --git a/src/emu/bus/odyssey2/slot.h b/src/emu/bus/odyssey2/slot.h
index 4de4d26b9b0..fad028fc10a 100644
--- a/src/emu/bus/odyssey2/slot.h
+++ b/src/emu/bus/odyssey2/slot.h
@@ -92,7 +92,7 @@ public:
virtual DECLARE_WRITE8_MEMBER(io_write);
virtual DECLARE_READ8_MEMBER(t0_read) { if (m_cart) return m_cart->t0_read(space, offset); else return 0; }
- virtual void write_bank(int bank) { if (m_cart) m_cart->write_bank(bank); }
+ virtual void write_bank(int bank) { if (m_cart) m_cart->write_bank(bank); }
protected:
@@ -114,8 +114,7 @@ extern const device_type O2_CART_SLOT;
#define MCFG_O2_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, O2_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
SLOT_INTERFACE_EXTERN(o2_cart);
diff --git a/src/emu/bus/odyssey2/voice.c b/src/emu/bus/odyssey2/voice.c
index d229ab21934..c3f5fce565e 100644
--- a/src/emu/bus/odyssey2/voice.c
+++ b/src/emu/bus/odyssey2/voice.c
@@ -33,7 +33,7 @@ o2_voice_device::o2_voice_device(const machine_config &mconfig, const char *tag,
void o2_voice_device::device_start()
-{
+{
save_item(NAME(m_lrq_state));
}
diff --git a/src/emu/bus/odyssey2/voice.h b/src/emu/bus/odyssey2/voice.h
index 85339aa699f..83b8c532e1f 100644
--- a/src/emu/bus/odyssey2/voice.h
+++ b/src/emu/bus/odyssey2/voice.h
@@ -27,7 +27,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_rom04) { if (m_subslot->exists()) return m_subslot->read_rom04(space, offset); else return 0xff; }
virtual DECLARE_READ8_MEMBER(read_rom0c) { if (m_subslot->exists()) return m_subslot->read_rom0c(space, offset); else return 0xff; }
- virtual void write_bank(int bank) { if (m_subslot->exists()) m_subslot->write_bank(bank); }
+ virtual void write_bank(int bank) { if (m_subslot->exists()) m_subslot->write_bank(bank); }
DECLARE_WRITE_LINE_MEMBER(lrq_callback);
DECLARE_WRITE8_MEMBER(io_write);
diff --git a/src/emu/bus/pet/cb2snd.c b/src/emu/bus/pet/cb2snd.c
index b9e916b0e49..0ff4659a24c 100644
--- a/src/emu/bus/pet/cb2snd.c
+++ b/src/emu/bus/pet/cb2snd.c
@@ -65,4 +65,3 @@ DECLARE_WRITE_LINE_MEMBER( pet_userport_cb2_sound_device::input_m )
{
m_dac->write_unsigned8(state ? 0xff : 0x00);
}
-
diff --git a/src/emu/bus/rs232/xvd701.c b/src/emu/bus/rs232/xvd701.c
index 4484bb2ba36..a7a1ba40eab 100644
--- a/src/emu/bus/rs232/xvd701.c
+++ b/src/emu/bus/rs232/xvd701.c
@@ -93,7 +93,7 @@ void jvc_xvd701_device::send_response()
{
if (m_response_index < sizeof(m_response) && is_transmit_register_empty())
{
-// printf("sending %02x\n", m_response[m_response_index]);
+// printf("sending %02x\n", m_response[m_response_index]);
transmit_register_setup(m_response[m_response_index++]);
}
}
@@ -115,7 +115,7 @@ void jvc_xvd701_device::rcv_complete()
// printf("xvd701");
//for (int i = 0; i < sizeof(m_command); i++)
- // printf(" %02x", m_command[i]);
+ // printf(" %02x", m_command[i]);
//printf("\n");
diff --git a/src/emu/bus/saturn/sat_slot.c b/src/emu/bus/saturn/sat_slot.c
index 1868c23de15..ebd9c6e8890 100644
--- a/src/emu/bus/saturn/sat_slot.c
+++ b/src/emu/bus/saturn/sat_slot.c
@@ -156,15 +156,15 @@ bool sat_cart_slot_device::call_load()
// from fullpath, only ROM carts
UINT32 len = (software_entry() != NULL) ? get_software_region_length("rom") : length();
UINT32 *ROM;
-
+
m_cart->rom_alloc(len, tag());
ROM = m_cart->get_rom_base();
-
+
if (software_entry() != NULL)
memcpy(ROM, get_software_region("rom"), len);
else
fread(ROM, len);
-
+
// fix endianness....
for (int i = 0; i < len/4; i ++)
ROM[i] = BITSWAP32(ROM[i],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8,23,22,21,20,19,18,17,16,31,30,29,28,27,26,25,24);
diff --git a/src/emu/bus/scv/rom.h b/src/emu/bus/scv/rom.h
index e765df921c9..6d8ccff4d49 100644
--- a/src/emu/bus/scv/rom.h
+++ b/src/emu/bus/scv/rom.h
@@ -79,11 +79,11 @@ class scv_rom64_device : public scv_rom8_device
public:
// construction/destruction
scv_rom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -100,15 +100,15 @@ class scv_rom128_device : public scv_rom8_device
public:
// construction/destruction
scv_rom128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
private:
UINT8 m_bank_base;
};
@@ -121,16 +121,16 @@ class scv_rom128ram4_device : public scv_rom8_device
public:
// construction/destruction
scv_rom128ram4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
private:
UINT8 m_bank_base, m_ram_enabled;
};
diff --git a/src/emu/bus/scv/slot.c b/src/emu/bus/scv/slot.c
index ffffe98fcc2..dcd3639c1ed 100644
--- a/src/emu/bus/scv/slot.c
+++ b/src/emu/bus/scv/slot.c
@@ -175,11 +175,11 @@ bool scv_cart_slot_device::call_load()
seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(len, tag());
if (has_ram)
m_cart->ram_alloc(get_software_region_length("ram"));
-
+
ROM = m_cart->get_rom_base();
if (software_entry() == NULL)
@@ -317,4 +317,3 @@ WRITE8_MEMBER(scv_cart_slot_device::write_bank)
if (m_cart)
m_cart->write_bank(space, offset, data);
}
-
diff --git a/src/emu/bus/scv/slot.h b/src/emu/bus/scv/slot.h
index 3be1c8734b3..7db8b6eee9e 100644
--- a/src/emu/bus/scv/slot.h
+++ b/src/emu/bus/scv/slot.h
@@ -42,7 +42,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
protected:
// internal state
@@ -75,7 +75,7 @@ public:
int get_type() { return m_type; }
int get_cart_type(UINT8 *ROM, UINT32 len);
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -115,6 +115,5 @@ extern const device_type SCV_CART_SLOT;
#define MCFG_SCV_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, SCV_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/sega8/ccatch.c b/src/emu/bus/sega8/ccatch.c
index 3e917fa8d09..0f1b464660d 100644
--- a/src/emu/bus/sega8/ccatch.c
+++ b/src/emu/bus/sega8/ccatch.c
@@ -1,10 +1,10 @@
/***********************************************************************************************************
SG-1000 Card Catcher emulation
-
+
Sega Card Catcher is a passthrough adapter for
SG-1000 to load games in MyCard format into the
- main cartslot
+ main cartslot
***********************************************************************************************************/
diff --git a/src/emu/bus/sega8/mgear.h b/src/emu/bus/sega8/mgear.h
index 27672464ced..d4e800c19e8 100644
--- a/src/emu/bus/sega8/mgear.h
+++ b/src/emu/bus/sega8/mgear.h
@@ -12,11 +12,11 @@ class sega8_mgear_device : public sega8_rom_device
public:
// construction/destruction
sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart) { return m_subslot->read_cart(space, offset); }
virtual DECLARE_WRITE8_MEMBER(write_cart) { m_subslot->write_cart(space, offset, data); }
diff --git a/src/emu/bus/sega8/rom.c b/src/emu/bus/sega8/rom.c
index 9b222867ba3..436b710545c 100644
--- a/src/emu/bus/sega8/rom.c
+++ b/src/emu/bus/sega8/rom.c
@@ -752,7 +752,7 @@ READ8_MEMBER(sega8_4pak_device::read_cart)
{
int bank = offset / 0x4000;
- return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
+ return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
}
diff --git a/src/emu/bus/sega8/sega8_slot.c b/src/emu/bus/sega8/sega8_slot.c
index 2933929081c..5a64c283f66 100644
--- a/src/emu/bus/sega8/sega8_slot.c
+++ b/src/emu/bus/sega8/sega8_slot.c
@@ -873,4 +873,3 @@ SLOT_INTERFACE_START(gg_cart)
SLOT_INTERFACE_INTERNAL("codemasters", SEGA8_ROM_CODEMASTERS)
SLOT_INTERFACE_INTERNAL("mgear", SEGA8_ROM_MGEAR)
SLOT_INTERFACE_END
-
diff --git a/src/emu/bus/sega8/sega8_slot.h b/src/emu/bus/sega8/sega8_slot.h
index d70ae51a805..8a1caf8df9f 100644
--- a/src/emu/bus/sega8/sega8_slot.h
+++ b/src/emu/bus/sega8/sega8_slot.h
@@ -121,7 +121,7 @@ public:
int verify_cart(UINT8 *magic, int size);
void set_lphaser_xoffset(UINT8 *rom, int size);
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
void set_mandatory(bool val) { m_must_be_loaded = val; }
void set_intf(const char * interface) { m_interface = interface; }
diff --git a/src/emu/bus/sms_ctrl/graphic.c b/src/emu/bus/sms_ctrl/graphic.c
index 6b0024d91af..20a1f68dcda 100644
--- a/src/emu/bus/sms_ctrl/graphic.c
+++ b/src/emu/bus/sms_ctrl/graphic.c
@@ -9,18 +9,18 @@ I/O 3f write | this method
0x20 | 0x7f
0x00 | 0x3f
0x30 | 0xff
-
+
Typical sequence:
- 3f write 0x20
- read dc
- 3f write 0x00
-- read dc
+- read dc
- 3f write 0x20
- read dc
- 3f write 0x30
Suspect from kind of counter that is reset by a 0x30 write to I/O port 0x3f.
Once reset reads from i/O port dc expect to see 0xE0.
-And then any write with differing bits goes through several internal I/O ports
+And then any write with differing bits goes through several internal I/O ports
with the first port being the one with the buttons
In the reset/start state the lower four/five bits are 0.
@@ -45,11 +45,11 @@ const device_type SMS_GRAPHIC = &device_creator<sms_graphic_device>;
static INPUT_PORTS_START( sms_graphic )
- PORT_START("BUTTONS")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // MENU
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // DO
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) // PEN
- PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_START("BUTTONS")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // MENU
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // DO
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) // PEN
+ PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("X")
PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15)
@@ -110,8 +110,8 @@ UINT8 sms_graphic_device::peripheral_r()
{
case 0: // Initial state / "I am a board"
// If any regular button is pressed raise/lower TL ?
-// if ((m_buttons->read() & 0x07) != 0x07)
-// return 0xf0;
+// if ((m_buttons->read() & 0x07) != 0x07)
+// return 0xf0;
return 0xd0;
case 1: // Read buttons (active low)
@@ -155,4 +155,3 @@ void sms_graphic_device::peripheral_w(UINT8 data)
m_previous_write = data;
}
-
diff --git a/src/emu/bus/snes/snes_slot.h b/src/emu/bus/snes/snes_slot.h
index 808c2105f82..7d440437eaa 100644
--- a/src/emu/bus/snes/snes_slot.h
+++ b/src/emu/bus/snes/snes_slot.h
@@ -125,8 +125,8 @@ public:
UINT32 get_rtc_ram_size() { return m_rtc_ram.count(); };
void rom_map_setup(UINT32 size);
- void save_nvram() { device().save_item(NAME(m_nvram)); }
- void save_rtc_ram() { device().save_item(NAME(m_rtc_ram)); }
+ void save_nvram() { device().save_item(NAME(m_nvram)); }
+ void save_rtc_ram() { device().save_item(NAME(m_rtc_ram)); }
// internal state
UINT8 *m_rom;
@@ -166,7 +166,7 @@ public:
void setup_nvram();
void internal_header_logging(UINT8 *ROM, UINT32 len);
- void save_ram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram();
+ void save_ram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram();
if (m_cart && m_cart->get_rtc_ram_size()) m_cart->save_rtc_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
diff --git a/src/emu/bus/vboy/rom.h b/src/emu/bus/vboy/rom.h
index 6d474256d33..0101c303790 100644
--- a/src/emu/bus/vboy/rom.h
+++ b/src/emu/bus/vboy/rom.h
@@ -15,10 +15,10 @@ public:
// construction/destruction
vboy_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
vboy_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start() {}
-
+
// reading and writing
virtual DECLARE_READ32_MEMBER(read_cart);
};
diff --git a/src/emu/bus/vboy/slot.c b/src/emu/bus/vboy/slot.c
index a20d8ef5933..bcc3961e842 100644
--- a/src/emu/bus/vboy/slot.c
+++ b/src/emu/bus/vboy/slot.c
@@ -151,7 +151,7 @@ static const char *vboy_get_slot(int type)
if (slot_list[i].pcb_id == type)
return slot_list[i].slot_option;
}
-
+
return "vb_rom";
}
#endif
@@ -179,7 +179,7 @@ bool vboy_cart_slot_device::call_load()
m_cart->rom_alloc(0x200000, tag());
if (has_eeprom)
m_cart->eeprom_alloc(get_software_region_length("eeprom"));
-
+
ROM = (UINT8 *)m_cart->get_rom_base();
if (software_entry() == NULL)
@@ -190,7 +190,7 @@ bool vboy_cart_slot_device::call_load()
if (len < 0x080000) { memcpy(ROM + 0x040000, ROM, 0x040000); }
if (len < 0x100000) { memcpy(ROM + 0x080000, ROM, 0x080000); }
if (len < 0x200000) { memcpy(ROM + 0x100000, ROM, 0x100000); }
-
+
if (software_entry() == NULL)
m_type = vboy_get_pcb_id("vb_rom");
else
diff --git a/src/emu/bus/vboy/slot.h b/src/emu/bus/vboy/slot.h
index 910d61ab2ea..afa33c600d4 100644
--- a/src/emu/bus/vboy/slot.h
+++ b/src/emu/bus/vboy/slot.h
@@ -37,7 +37,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_eeprom_size() { return m_eeprom.count(); }
- void save_eeprom() { device().save_item(NAME(m_eeprom)); }
+ void save_eeprom() { device().save_item(NAME(m_eeprom)); }
protected:
// internal state
@@ -71,7 +71,7 @@ public:
int get_type() { return m_type; }
int get_cart_type(UINT8 *ROM, UINT32 len);
- void save_eeprom() { if (m_cart && m_cart->get_eeprom_size()) m_cart->save_eeprom(); }
+ void save_eeprom() { if (m_cart && m_cart->get_eeprom_size()) m_cart->save_eeprom(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -111,6 +111,5 @@ extern const device_type VBOY_CART_SLOT;
#define MCFG_VBOY_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, VBOY_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/vc4000/rom.c b/src/emu/bus/vc4000/rom.c
index f8b41852921..200d5d4127f 100644
--- a/src/emu/bus/vc4000/rom.c
+++ b/src/emu/bus/vc4000/rom.c
@@ -10,173 +10,173 @@
/* Game List and Emulation Status
-
+
When you load a game it will normally appear to be unresponsive. Most carts contain a number of variants
of each game (e.g. Difficulty, Player1 vs Player2 or Player1 vs Computer, etc).
-
+
Press F2 (if needed) to select which game variant you would like to play. The variant number will increment
on-screen. When you've made your choice, press F1 to start. The main keys are unlabelled, because an overlay
is provided with each cart. See below for a guide. You need to read the instructions that come with each game.
-
+
In some games, the joystick is used like 4 buttons, and other games like a paddle. The two modes are
incompatible when using a keyboard. Therefore (in the emulation) a config dipswitch is used. The preferred
setting is listed below.
-
+
(AC = Auto-centre, NAC = no auto-centre, 90 = turn controller 90 degrees).
-
+
The list is rather incomplete, information will be added as it becomes available.
-
+
The game names and numbers were obtained from the Amigan Software site.
-
+
Cart Num Name
----------------------------------------------
1. Grand Prix / Car Races / Autosport / Motor Racing / Road Race
Config: Paddle, NAC
Status: Working
Controls: Left-Right: Steer; Up: Accelerate
-
+
2. Black Jack
Status: Not working (some digits missing; indicator missing; dealer's cards missing)
Controls: set bet with S and D; A to deal; 1 to hit, 2 to stay; Q accept insurance, E to decline; double-up (unknown key)
Indicator: E make a bet then deal; I choose insurance; - you lost; + you won; X hit or stay
-
+
3. Olympics / Paddle Games / Bat & Ball / Pro Sport 60 / Sportsworld
Config: Paddle, NAC
Status: Working
-
+
4. Tank Battle / Combat
Config: Button, 90
Status: Working
Controls: Left-Right: Steer; Up: Accelerate; Fire: Shoot
-
+
5. Maths 1
Status: Working
Controls: Z difficulty; X = addition or subtraction; C ask question; A=1;S=2;D=3;Q=4;W=5;E=6;1=7;2=8;3=9;0=0; C enter
-
+
6. Maths 2
Status: Not working
Controls: Same as above.
-
+
7. Air Sea Attack / Air Sea Battle
Config: Button, 90
Status: Working
Controls: Left-Right: Move; Fire: Shoot
-
+
8. Treasure Hunt / Capture the Flag / Concentration / Memory Match
Config: Buttons
Status: Working
-
+
9. Labyrinth / Maze / Intelligence 1
Config: Buttons
Status: Working
-
+
10. Winter Sports
Notes: Background colours should be Cyan and White instead of Red and Black
-
+
11. Hippodrome / Horse Race
-
+
12. Hunting / Shooting Gallery
-
+
13. Chess 1
Status: Can't see what you're typing, wrong colours
-
+
14. Moto-cros
-
+
15. Four in a row / Intelligence 2
Config: Buttons
Status: Working
Notes: Seems the unused squares should be black. The screen jumps about while the computer is "thinking".
-
+
16. Code Breaker / Master Mind / Intelligence 3 / Challenge
-
+
17. Circus
STatus: severe gfx issues
-
+
18. Boxing / Prize Fight
-
+
19. Outer Space / Spacewar / Space Attack / Outer Space Combat
-
+
20. Melody Simon / Musical Memory / Follow the Leader / Musical Games / Electronic Music / Face the Music
-
+
21. Capture / Othello / Reversi / Attack / Intelligence 4
Config: Buttons
Status: Working
Notes: Seems the unused squares should be black
-
+
22. Chess 2
Status: Can't see what you're typing, wrong colours
-
+
23. Pinball / Flipper / Arcade
Status: gfx issues
-
+
24. Soccer
-
+
25. Bowling / NinePins
Config: Paddle, rotated 90 degrees, up/down autocentre, left-right does not
Status: Working
-
+
26. Draughts
-
+
27. Golf
Status: gfx issues
-
+
28. Cockpit
Status: gfx issues
-
+
29. Metropolis / Hangman
Status: gfx issues
-
+
30. Solitaire
-
+
31. Casino
Status: gfx issues, items missing and unplayable
Controls: 1 or 3=START; q=GO; E=STOP; D=$; Z=^; X=tens; C=units
-
+
32. Invaders / Alien Invasion / Earth Invasion
Status: Works
Config: Buttons
-
+
33. Super Invaders
Status: Stars are missing, colours are wrong
Config: Buttons (90)
-
+
36. BackGammon
Status: Not all counters are visible, Dice & game number not visible.
Controls: Fire=Exec; 1=D+; 3=D-; Q,W,E=4,5,6; A,S,D=1,2,3; Z=CL; X=STOP; C=SET
-
+
37. Monster Man / Spider's Web
Status: Works
Config: Buttons
-
+
38. Hyperspace
Status: Works
Config: Buttons (90)
Controls: 3 - status button; Q,W,E,A,S,D,Z,X,C selects which galaxy to visit
-
-
+
+
40. Super Space
Status: Works, some small gfx issues near the bottom
Config: Buttons
-
-
-
+
+
+
Acetronic: (dumps are compatible)
------------
-
+
* Shooting Gallery
Status: works but screen flickers
Config: Buttons
-
+
* Planet Defender
Status: Works
Config: Paddle (NAC)
-
+
* Laser Attack
Status: Works
Config: Buttons
-
-
-
+
+
+
Public Domain: (written for emulators, may not work on real hardware)
---------------
* Picture (no controls) - works
diff --git a/src/emu/bus/vc4000/rom.h b/src/emu/bus/vc4000/rom.h
index ac64abee2de..53ef34a4805 100644
--- a/src/emu/bus/vc4000/rom.h
+++ b/src/emu/bus/vc4000/rom.h
@@ -31,7 +31,7 @@ class vc4000_ram1k_device : public vc4000_rom_device
public:
// construction/destruction
vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
@@ -44,7 +44,7 @@ class vc4000_chess2_device : public vc4000_rom_device
public:
// construction/destruction
vc4000_chess2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(extra_rom);
virtual DECLARE_READ8_MEMBER(read_ram);
diff --git a/src/emu/bus/vc4000/slot.c b/src/emu/bus/vc4000/slot.c
index b9524565f77..43fbfa992e2 100644
--- a/src/emu/bus/vc4000/slot.c
+++ b/src/emu/bus/vc4000/slot.c
@@ -169,9 +169,9 @@ bool vc4000_cart_slot_device::call_load()
seterror(IMAGE_ERROR_UNSPECIFIED, "Image extends beyond the expected size for a VC4000 cart");
return IMAGE_INIT_FAIL;
}
-
+
m_cart->rom_alloc(size, tag());
-
+
if (software_entry() == NULL)
fread(m_cart->get_rom_base(), size);
else
@@ -236,7 +236,7 @@ void vc4000_cart_slot_device::get_default_card_software(astring &result)
type = VC4000_CHESS2;
else if (size > 0x0800) // some 4k roms have 1k of mirrored ram
type = VC4000_RAM1K;
-
+
slot_string = vc4000_get_slot(type);
//printf("type: %s\n", slot_string);
@@ -294,5 +294,3 @@ WRITE8_MEMBER(vc4000_cart_slot_device::write_ram)
if (m_cart)
m_cart->write_ram(space, offset, data);
}
-
-
diff --git a/src/emu/bus/vc4000/slot.h b/src/emu/bus/vc4000/slot.h
index 5f992d342aa..c4226d1c9b9 100644
--- a/src/emu/bus/vc4000/slot.h
+++ b/src/emu/bus/vc4000/slot.h
@@ -39,7 +39,7 @@ public:
UINT32 get_rom_size() { return m_rom_size; }
UINT32 get_ram_size() { return m_ram.count(); }
- void save_ram() { device().save_item(NAME(m_ram)); }
+ void save_ram() { device().save_item(NAME(m_ram)); }
protected:
// internal state
@@ -71,7 +71,7 @@ public:
int get_type() { return m_type; }
- void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
+ void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
@@ -112,6 +112,5 @@ extern const device_type VC4000_CART_SLOT;
#define MCFG_VC4000_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, VC4000_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
-
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#endif
diff --git a/src/emu/bus/vcs/compumat.c b/src/emu/bus/vcs/compumat.c
index fe67e120c41..57de9257711 100644
--- a/src/emu/bus/vcs/compumat.c
+++ b/src/emu/bus/vcs/compumat.c
@@ -1,10 +1,10 @@
/***************************************************************************
- Atari 2600 cart Spectravideo Compumate (Cart + keyboard!)
+ Atari 2600 cart Spectravideo Compumate (Cart + keyboard!)
This is tricky to implement and it is only a skeleton ATM.
The device needs to interface with both the TIA and the RIOT.
-
+
***************************************************************************/
diff --git a/src/emu/bus/vcs/compumat.h b/src/emu/bus/vcs/compumat.h
index d2d81fc83f0..b18988181ac 100644
--- a/src/emu/bus/vcs/compumat.h
+++ b/src/emu/bus/vcs/compumat.h
@@ -19,10 +19,10 @@ public:
virtual void device_start();
virtual ioport_constructor device_input_ports() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
-
+
private:
};
diff --git a/src/emu/bus/vcs/dpc.c b/src/emu/bus/vcs/dpc.c
index 85d8689067d..7387c6dbb34 100644
--- a/src/emu/bus/vcs/dpc.c
+++ b/src/emu/bus/vcs/dpc.c
@@ -37,7 +37,7 @@ void dpc_device::device_reset()
m_df[data_fetcher].music_mode = 0;
}
m_oscillator->adjust(attotime::from_hz(18400), 0, attotime::from_hz(18400));
-
+
}
void dpc_device::check_flag(UINT8 data_fetcher)
@@ -60,7 +60,7 @@ void dpc_device::decrement_counter(UINT8 data_fetcher)
if (data_fetcher > 4 && m_df[data_fetcher].music_mode)
m_df[data_fetcher].low = m_df[data_fetcher].top;
}
-
+
check_flag(data_fetcher);
}
@@ -149,7 +149,7 @@ READ8_MEMBER(dpc_device::read)
data = m_df[data_fetcher].flag ? 0xff : 0x00;
break;
}
-
+
if (data_fetcher < 5 || !m_df[data_fetcher].osc_clk)
{
decrement_counter(data_fetcher);
@@ -161,7 +161,7 @@ READ8_MEMBER(dpc_device::read)
WRITE8_MEMBER(dpc_device::write)
{
UINT8 data_fetcher = offset & 0x07;
-
+
switch (offset & 0x38)
{
case 0x00: // Top count
@@ -235,7 +235,7 @@ void a26_rom_dpc_device::device_reset()
m_base_bank = 0;
}
-void a26_rom_dpc_device::setup_addon_ptr(UINT8 *ptr)
+void a26_rom_dpc_device::setup_addon_ptr(UINT8 *ptr)
{
m_dpc->set_display_data(ptr);
}
@@ -279,4 +279,3 @@ DIRECT_UPDATE_MEMBER(a26_rom_dpc_device::cart_opbase)
}
return address;
}
-
diff --git a/src/emu/bus/vcs/dpc.h b/src/emu/bus/vcs/dpc.h
index 8cf12d893eb..a54e67e5778 100644
--- a/src/emu/bus/vcs/dpc.h
+++ b/src/emu/bus/vcs/dpc.h
@@ -19,7 +19,7 @@ struct df_t {
UINT8 osc_clk; /* Only used by data fetchers 5,6, and 7 */
};
-// m_dpc.oscillator = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2600_state::modeDPC_timer_callback),this));
+// m_dpc.oscillator = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2600_state::modeDPC_timer_callback),this));
class dpc_device : public device_t
{
@@ -74,16 +74,16 @@ public:
virtual void device_reset();
required_device<dpc_device> m_dpc;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
virtual DECLARE_DIRECT_UPDATE_MEMBER(cart_opbase);
virtual void setup_addon_ptr(UINT8 *ptr);
-
+
protected:
-// int m_reset_bank;
+// int m_reset_bank;
};
diff --git a/src/emu/bus/vcs/rom.c b/src/emu/bus/vcs/rom.c
index a585734c6f4..f9cc271b316 100755
--- a/src/emu/bus/vcs/rom.c
+++ b/src/emu/bus/vcs/rom.c
@@ -62,13 +62,13 @@ a26_rom_4k_device::a26_rom_4k_device(const machine_config &mconfig, const char *
a26_rom_f6_device::a26_rom_f6_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: a26_rom_2k_device(mconfig, type, name, tag, owner, clock, shortname, source),
- m_base_bank(-1) // set to -1 to help the Xin1 multicart...
+ m_base_bank(-1) // set to -1 to help the Xin1 multicart...
{
}
a26_rom_f6_device::a26_rom_f6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: a26_rom_2k_device(mconfig, A26_ROM_F6, "Atari VCS 2600 ROM Carts w/F6 bankswitch", tag, owner, clock, "vcs_f6", __FILE__),
- m_base_bank(-1) // set to -1 to help the Xin1 multicart...
+ m_base_bank(-1) // set to -1 to help the Xin1 multicart...
{
}
@@ -337,7 +337,7 @@ READ8_MEMBER(a26_rom_2k_device::read_rom)
/*-------------------------------------------------
"F4 Bankswitch" Carts:
- read/write access to 0x1ff4-0x1ffb determines the
+ read/write access to 0x1ff4-0x1ffb determines the
4K ROM bank to be read
GAMES: Fatal Run
@@ -350,7 +350,7 @@ READ8_MEMBER(a26_rom_f4_device::read_rom)
{
return m_ram[offset & (m_ram.count() - 1)];
}
-
+
// update banks
if (!space.debugger_access())
{
@@ -368,7 +368,7 @@ READ8_MEMBER(a26_rom_f4_device::read_rom)
break;
}
}
-
+
return m_rom[offset + (m_base_bank * 0x1000)];
}
@@ -380,7 +380,7 @@ WRITE8_MEMBER(a26_rom_f4_device::write_bank)
m_ram[offset & (m_ram.count() - 1)] = data;
return;
}
-
+
switch (offset)
{
case 0x0ff4:
@@ -401,10 +401,10 @@ WRITE8_MEMBER(a26_rom_f4_device::write_bank)
/*-------------------------------------------------
"F6 Bankswitch" Carts:
- read/write access to 0x1ff6-0x1ff9 determines the
+ read/write access to 0x1ff6-0x1ff9 determines the
4K ROM bank to be read
- GAMES: Atari 16K games, like Crossbow, Crystal
+ GAMES: Atari 16K games, like Crossbow, Crystal
Castles and the 2-in-1 carts
-------------------------------------------------*/
@@ -469,7 +469,7 @@ DIRECT_UPDATE_MEMBER(a26_rom_f6_device::cart_opbase)
/*-------------------------------------------------
"F8 Bankswitch" Carts:
- read/write access to 0x1ff8-0x1ff9 determines the
+ read/write access to 0x1ff8-0x1ff9 determines the
4K ROM bank to be read
GAMES: Atari 8K games, like Asteroids, Battlezone
@@ -484,7 +484,7 @@ READ8_MEMBER(a26_rom_f8_device::read_rom)
{
return m_ram[offset & (m_ram.count() - 1)];
}
-
+
// update banks
if (!space.debugger_access())
{
@@ -496,7 +496,7 @@ READ8_MEMBER(a26_rom_f8_device::read_rom)
break;
}
}
-
+
return m_rom[offset + (m_base_bank * 0x1000)];
}
@@ -508,7 +508,7 @@ WRITE8_MEMBER(a26_rom_f8_device::write_bank)
m_ram[offset & (m_ram.count() - 1)] = data;
return;
}
-
+
switch (offset)
{
case 0x0ff8:
@@ -523,12 +523,12 @@ WRITE8_MEMBER(a26_rom_f8_device::write_bank)
/*-------------------------------------------------
"FA Bankswitch" Carts:
- read/write access to 0x1ff8-0x1ffa determines the
+ read/write access to 0x1ff8-0x1ffa determines the
4K ROM bank to be read
- These games contained the CBS RAM+ chip (256bytes
+ These games contained the CBS RAM+ chip (256bytes
of RAM)
-
- GAMES: CBS RAM Plus games like Omega Race and Tunnel
+
+ GAMES: CBS RAM Plus games like Omega Race and Tunnel
Runner
-------------------------------------------------*/
@@ -540,7 +540,7 @@ READ8_MEMBER(a26_rom_fa_device::read_rom)
{
return m_ram[offset & (m_ram.count() - 1)];
}
-
+
// update banks
if (!space.debugger_access())
{
@@ -553,7 +553,7 @@ READ8_MEMBER(a26_rom_fa_device::read_rom)
break;
}
}
-
+
return m_rom[offset + (m_base_bank * 0x1000)];
}
@@ -563,8 +563,8 @@ WRITE8_MEMBER(a26_rom_fa_device::write_bank)
if (m_ram && offset < 0x100)
{
m_ram[offset & (m_ram.count() - 1)] = data;
- }
-
+ }
+
switch (offset)
{
case 0x0ff8:
@@ -580,22 +580,22 @@ WRITE8_MEMBER(a26_rom_fa_device::write_bank)
/*-------------------------------------------------
"FE Bankswitch" Carts:
- read/write access to 0x01fe-0x1ff determines the
+ read/write access to 0x01fe-0x1ff determines the
4K ROM bank to be read
-
+
GAMES: Activision 8K games like Decathlon
-------------------------------------------------*/
/*
-
+
There seems to be a kind of lag between the writing to address 0x1FE and the
Activision switcher springing into action. It waits for the next byte to arrive
on the data bus, which is the new PCH in the case of a JSR, and the PCH of the
stored PC on the stack in the case of an RTS.
-
+
depending on last byte & 0x20 -> 0x00 -> switch to bank #1
-> 0x20 -> switch to bank #0
-
+
*/
READ8_MEMBER(a26_rom_fe_device::read_rom)
@@ -607,9 +607,9 @@ READ8_MEMBER(a26_rom_fe_device::read_rom)
{
return m_ram[offset & (m_ram.count() - 1)];
}
-
+
data = m_rom[offset + (m_base_bank * 0x1000)];
-
+
if (!space.debugger_access())
{
if (m_trigger_on_next_access)
@@ -618,7 +618,7 @@ READ8_MEMBER(a26_rom_fe_device::read_rom)
m_trigger_on_next_access = 0;
}
}
-
+
return data;
}
@@ -634,7 +634,7 @@ WRITE8_MEMBER(a26_rom_fe_device::write_ram)
READ8_MEMBER(a26_rom_fe_device::read_bank)
{
UINT8 data = space.read_byte(0xfe + offset);
-
+
if (!space.debugger_access())
{
switch (offset & 1)
@@ -643,7 +643,7 @@ READ8_MEMBER(a26_rom_fe_device::read_bank)
// The next byte on the data bus determines which bank to switch to
m_trigger_on_next_access = 1;
break;
-
+
case 1:
if (m_trigger_on_next_access)
{
@@ -667,11 +667,11 @@ WRITE8_MEMBER(a26_rom_fe_device::write_bank)
}
/*-------------------------------------------------
- "3E Bankswitch" Carts:
- write access to 0x3e determines the 2K ROM bank to
- be read, write access to 0x3f determines the RAM bank
+ "3E Bankswitch" Carts:
+ write access to 0x3e determines the 2K ROM bank to
+ be read, write access to 0x3f determines the RAM bank
to be read
-
+
GAMES: Boulder Dash (Homebrew)
-------------------------------------------------*/
@@ -680,7 +680,7 @@ READ8_MEMBER(a26_rom_3e_device::read_rom)
{
if (m_ram && m_ram_enable && offset < 0x400)
return m_ram[offset + (m_ram_bank * 0x400)];
-
+
if (offset >= 0x800)
return m_rom[(offset & 0x7ff) + (m_num_bank - 1) * 0x800];
else
@@ -709,11 +709,11 @@ WRITE8_MEMBER(a26_rom_3e_device::write_ram)
/*-------------------------------------------------
- "3F Bankswitch" Carts:
- write access to 0x00-0x3f determines the 2K ROM bank
+ "3F Bankswitch" Carts:
+ write access to 0x00-0x3f determines the 2K ROM bank
to be read
- GAMES: Tigervision 8K games like Espial and Miner
+ GAMES: Tigervision 8K games like Espial and Miner
2049er. Extended version with bankswitch up to 512K
shall be supported as well (but we lack a test case)
@@ -733,8 +733,8 @@ WRITE8_MEMBER(a26_rom_3f_device::write_bank)
}
/*-------------------------------------------------
- "E0 Bankswitch" Carts:
- read/write access to 0x1fe0-0x1ff8 determines the
+ "E0 Bankswitch" Carts:
+ read/write access to 0x1fe0-0x1ff8 determines the
1K ROM bank to be read in each 1K chunk (0x1c00-0x1fff
always points to the last 1K of the ROM)
@@ -769,16 +769,16 @@ WRITE8_MEMBER(a26_rom_e0_device::write_bank)
1800-19ff is RAM
1a00-1fff is fixed to the last 0x600 of ROM
- The selectable bank can be ROM (if selected by
- 0x1fe0-0x1fe6 access) or a first 1K of RAM (if
+ The selectable bank can be ROM (if selected by
+ 0x1fe0-0x1fe6 access) or a first 1K of RAM (if
selected by 0x1fe7 access).
- The other 256byte RAM bank can be one of the
+ The other 256byte RAM bank can be one of the
four different chunks forming the other 1K of RAM
(the bank is selected by accessing 0x1fe8-0x1feb)
- GAMES: M Network 16K games like Burgertime and
+ GAMES: M Network 16K games like Burgertime and
Bump'n Jump
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_e7_device::read_rom)
@@ -833,12 +833,12 @@ WRITE8_MEMBER(a26_rom_e7_device::write_bank)
}
/*-------------------------------------------------
- "UA Bankswitch" Carts:
- read/write access to 0x200-0x27f determines the
+ "UA Bankswitch" Carts:
+ read/write access to 0x200-0x27f determines the
4K ROM bank to be read (0x220-0x23f for low 4K,
0x240-0x27f for high 4K)
- GAMES: UA Ltd. 8K games like Funky Flash and
+ GAMES: UA Ltd. 8K games like Funky Flash and
Pleaides
-------------------------------------------------*/
@@ -863,9 +863,9 @@ WRITE8_MEMBER(a26_rom_ua_device::write_bank)
/*-------------------------------------------------
- Commavid Carts:
+ Commavid Carts:
It allows for both ROM and RAM on the cartridge,
- without using bankswitching. There's 2K of ROM
+ without using bankswitching. There's 2K of ROM
and 1K of RAM.
GAMES: Magicard and Video Life by Commavid
@@ -894,8 +894,8 @@ WRITE8_MEMBER(a26_rom_cv_device::write_bank)
/*-------------------------------------------------
- Dynacom Megaboy Carts (aka "F0 Banswitch"):
- read/write access to 0x1ff0 determines the 4K ROM
+ Dynacom Megaboy Carts (aka "F0 Banswitch"):
+ read/write access to 0x1ff0 determines the 4K ROM
bank to be read (each access increases the bank index
up to 16, since the cart was 64K wide)
@@ -925,8 +925,8 @@ WRITE8_MEMBER(a26_rom_dc_device::write_bank)
/*-------------------------------------------------
- "FV Bankswitch" Carts:
- The first access to 0x1fd0 switch the bank, but
+ "FV Bankswitch" Carts:
+ The first access to 0x1fd0 switch the bank, but
only if pc() & 0x1f00 == 0x1f00!
GAMES: Challenge by HES
@@ -964,14 +964,14 @@ WRITE8_MEMBER(a26_rom_fv_device::write_bank)
/*-------------------------------------------------
- "JVP Bankswitch" Carts:
- read/write access to 0x0fa0-0x0fc0 determines the
+ "JVP Bankswitch" Carts:
+ read/write access to 0x0fa0-0x0fc0 determines the
4K ROM bank to be read (notice that this overlaps
the RIOT, currently handled in the main driver until
I can better investigate the behavior)
-
+
GAMES: No test case!?!
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_jvp_device::read_rom)
@@ -997,9 +997,9 @@ WRITE8_MEMBER(a26_rom_jvp_device::write_bank)
/*-------------------------------------------------
4 in 1 Carts (Reset based):
the 4K bank changes at each reset
-
+
GAMES: 4 in 1 carts
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_4in1_device::read_rom)
@@ -1012,9 +1012,9 @@ READ8_MEMBER(a26_rom_4in1_device::read_rom)
8 in 1 Carts (Reset based):
the 8K banks change at each reset, and internally
each game runs as a F8-bankswitched cart
-
+
GAMES: 8 in 1 cart
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_8in1_device::read_rom)
@@ -1029,7 +1029,7 @@ READ8_MEMBER(a26_rom_8in1_device::read_rom)
break;
}
}
-
+
return m_rom[offset + (m_base_bank * 0x1000) + (m_reset_bank * 0x2000)];
}
@@ -1037,13 +1037,12 @@ READ8_MEMBER(a26_rom_8in1_device::read_rom)
/*-------------------------------------------------
32 in 1 Carts (Reset based):
the 2K banks change at each reset
-
+
GAMES: 32 in 1 cart
-
+
-------------------------------------------------*/
READ8_MEMBER(a26_rom_32in1_device::read_rom)
{
return m_rom[(offset & 0x7ff) + (m_base_bank * 0x800)];
}
-
diff --git a/src/emu/bus/vcs/rom.h b/src/emu/bus/vcs/rom.h
index 33b00d0b5ea..a0434bd35c4 100755
--- a/src/emu/bus/vcs/rom.h
+++ b/src/emu/bus/vcs/rom.h
@@ -30,7 +30,7 @@ class a26_rom_4k_device : public a26_rom_2k_device
public:
// construction/destruction
a26_rom_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
// accesses just use the 2K ones, since it is just direct access to ROM/RAM
@@ -46,16 +46,16 @@ public:
// construction/destruction
a26_rom_f6_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a26_rom_f6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
virtual DECLARE_DIRECT_UPDATE_MEMBER(cart_opbase);
-
+
protected:
int m_base_bank;
};
@@ -68,10 +68,10 @@ class a26_rom_f4_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_f4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -86,7 +86,7 @@ public:
// construction/destruction
a26_rom_f8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a26_rom_f8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -100,7 +100,7 @@ class a26_rom_f8_sw_device : public a26_rom_f8_device
public:
// construction/destruction
a26_rom_f8_sw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
};
@@ -113,7 +113,7 @@ class a26_rom_fa_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_fa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -127,17 +127,17 @@ class a26_rom_fe_device : public a26_rom_2k_device
public:
// construction/destruction
a26_rom_fe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ8_MEMBER(read_bank);
virtual DECLARE_WRITE8_MEMBER(write_ram);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_base_bank;
int m_trigger_on_next_access;
@@ -151,16 +151,16 @@ class a26_rom_3e_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_3e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
virtual DECLARE_WRITE8_MEMBER(write_ram);
-
+
protected:
int m_num_bank;
int m_ram_bank;
@@ -175,14 +175,14 @@ class a26_rom_3f_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_3f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_num_bank;
};
@@ -195,15 +195,15 @@ class a26_rom_e0_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_e0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_base_banks[4];
};
@@ -216,15 +216,15 @@ class a26_rom_e7_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_e7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_ram_bank;
};
@@ -237,10 +237,10 @@ class a26_rom_ua_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_ua_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_READ8_MEMBER(read_bank);
@@ -255,7 +255,7 @@ class a26_rom_cv_device : public a26_rom_2k_device
public:
// construction/destruction
a26_rom_cv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -269,7 +269,7 @@ class a26_rom_dc_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -283,15 +283,15 @@ class a26_rom_fv_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_fv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
-
+
protected:
int m_locked;
};
@@ -304,7 +304,7 @@ class a26_rom_jvp_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_jvp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
virtual DECLARE_WRITE8_MEMBER(write_bank);
@@ -318,10 +318,10 @@ class a26_rom_4in1_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_4in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
};
@@ -334,11 +334,11 @@ class a26_rom_8in1_device : public a26_rom_f8_device
public:
// construction/destruction
a26_rom_8in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
@@ -354,10 +354,10 @@ class a26_rom_32in1_device : public a26_rom_f6_device
public:
// construction/destruction
a26_rom_32in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_rom);
};
diff --git a/src/emu/bus/vcs/scharger.c b/src/emu/bus/vcs/scharger.c
index efd685a5969..e536a474c18 100644
--- a/src/emu/bus/vcs/scharger.c
+++ b/src/emu/bus/vcs/scharger.c