Previous 199869 Revisions Next

r32920 Friday 24th October, 2014 at 05:39:06 UTC by Robbbert
gts3a.c : WIP
[src/mame/drivers]gts3a.c

trunk/src/mame/drivers/gts3a.c
r241431r241432
33  PINBALL
44  Gottlieb System 3
55  Dot Matrix Display
6 
7  You need to pick "Pixel Aspect (4:1)" video option in the tab menu.
68
79Status:
810- Nothing works
r241431r241432
1719#include "machine/genpin.h"
1820#include "cpu/m6502/m65c02.h"
1921#include "machine/6522via.h"
22#include "video/mc6845.h"
2023
2124class gts3a_state : public driver_device
2225{
2326public:
2427   gts3a_state(const machine_config &mconfig, device_type type, const char *tag)
2528      : driver_device(mconfig, type, tag)
29      , m_palette(*this, "palette")
2630      , m_maincpu(*this, "maincpu")
31      , m_dmdcpu(*this, "dmdcpu")
2732      , m_u4(*this, "u4")
2833      , m_u5(*this, "u5")
2934      , m_switches(*this, "X")
r241431r241432
3439   DECLARE_READ8_MEMBER(u4a_r);
3540   DECLARE_READ8_MEMBER(u4b_r);
3641   DECLARE_WRITE8_MEMBER(u4b_w);
42   DECLARE_READ8_MEMBER(dmd_r);
43   DECLARE_WRITE8_MEMBER(dmd_w);
3744   DECLARE_WRITE_LINE_MEMBER(nmi_w);
3845   DECLARE_INPUT_CHANGED_MEMBER(test_inp);
46   MC6845_UPDATE_ROW(crtc_update_row);
47   DECLARE_PALETTE_INIT(gts3a);
48   required_device<palette_device> m_palette;
3949private:
4050   bool m_dispclk;
4151   bool m_lampclk;
r241431r241432
4353   UINT8 m_row; // for lamps and switches
4454   UINT8 m_segment[4];
4555   UINT8 m_u4b;
56   UINT8 m_dmd;
4657   virtual void machine_reset();
4758   required_device<m65c02_device> m_maincpu;
59   required_device<m65c02_device> m_dmdcpu;
4860   required_device<via6522_device> m_u4;
4961   required_device<via6522_device> m_u5;
5062   required_ioport_array<12> m_switches;
r241431r241432
5971   AM_RANGE(0x4000, 0xffff) AM_ROM
6072ADDRESS_MAP_END
6173
74static ADDRESS_MAP_START( gts3a_dmd_map, AS_PROGRAM, 8, gts3a_state )
75   AM_RANGE(0x0000, 0x1fff) AM_RAM
76   AM_RANGE(0x2000, 0x2000) AM_DEVREAD("crtc", mc6845_device, status_r)
77   AM_RANGE(0x2001, 0x2001) AM_DEVREAD("crtc", mc6845_device, register_r)
78   AM_RANGE(0x2800, 0x2800) AM_DEVWRITE("crtc", mc6845_device, address_w)
79   AM_RANGE(0x2801, 0x2801) AM_DEVWRITE("crtc", mc6845_device, register_w)
80   AM_RANGE(0x3000, 0x3000) AM_READ(dmd_r)
81   AM_RANGE(0x3800, 0x3800) AM_WRITE(dmd_w)
82   AM_RANGE(0x4000, 0x7fff) AM_READ_BANK("bank1")
83   AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("dmdcpu", 0x78000)
84ADDRESS_MAP_END
85
6286static INPUT_PORTS_START( gts3a )
6387   PORT_START("TTS")
6488   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE) PORT_NAME("Test") PORT_CHANGED_MEMBER(DEVICE_SELF, gts3a_state, test_inp, 1)
r241431r241432
254278
255279DRIVER_INIT_MEMBER( gts3a_state, gts3a )
256280{
281   UINT8 *dmd = memregion("dmdcpu")->base();
282
283   membank("bank1")->configure_entries(0, 32, &dmd[0x0000], 0x4000);
257284}
258285
286READ8_MEMBER( gts3a_state::dmd_r )
287{
288   return 0;
289}
290
291WRITE8_MEMBER( gts3a_state::dmd_w )
292{
293   m_dmd = data;
294   membank("bank1")->set_entry(data & 0x1f);
295}
296
297PALETTE_INIT_MEMBER( gts3a_state, gts3a )
298{
299   palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00));
300   palette.set_pen_color(1, rgb_t(0xf7, 0x00, 0x00));
301}
302
303MC6845_UPDATE_ROW( gts3a_state::crtc_update_row )
304{
305   const rgb_t *palette = m_palette->palette()->entry_list_raw();
306   UINT8 gfx=0;
307   UINT16 mem,x;
308   UINT32 *p = &bitmap.pix32(y);
309
310   for (x = 0; x < x_count; x++)
311   {
312      mem = (ma + x) & 0xfff;mem++;
313      gfx = 4;//m_p_chargen[(chr<<4) | ra] ^ inv;
314
315      /* Display a scanline of a character */
316      *p++ = palette[BIT(gfx, 7)];
317      *p++ = palette[BIT(gfx, 6)];
318      *p++ = palette[BIT(gfx, 5)];
319      *p++ = palette[BIT(gfx, 4)];
320      *p++ = palette[BIT(gfx, 3)];
321      *p++ = palette[BIT(gfx, 2)];
322      *p++ = palette[BIT(gfx, 1)];
323      *p++ = palette[BIT(gfx, 0)];
324   }
325}
326
259327static MACHINE_CONFIG_START( gts3a, gts3a_state )
260328   /* basic machine hardware */
261329   MCFG_CPU_ADD("maincpu", M65C02, XTAL_4MHz / 2)
262330   MCFG_CPU_PROGRAM_MAP(gts3a_map)
263331   MCFG_NVRAM_ADD_0FILL("nvram")
264332
333   MCFG_CPU_ADD("dmdcpu", M65C02, XTAL_3_579545MHz / 2)
334   MCFG_CPU_PROGRAM_MAP(gts3a_dmd_map)
335
265336   /* Video */
266   // to be done
337   MCFG_SCREEN_ADD("screen", LCD)
338   MCFG_SCREEN_REFRESH_RATE(60)
339   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
340   MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
341   MCFG_SCREEN_SIZE(128, 32)
342   MCFG_SCREEN_VISIBLE_AREA(0, 127, 0, 31)
343   MCFG_PALETTE_ADD( "palette", 2 )
344   MCFG_PALETTE_INIT_OWNER(gts3a_state, gts3a)
267345
346   MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_3_579545MHz / 2)
347   MCFG_MC6845_SHOW_BORDER_AREA(false)
348   MCFG_MC6845_CHAR_WIDTH(8)
349   MCFG_MC6845_UPDATE_ROW_CB(gts3a_state, crtc_update_row)
350
268351   /* Sound */
269352   MCFG_FRAGMENT_ADD( genpin_audio )
270353
r241431r241432
295378
296379   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
297380
298   ROM_REGION(0x80000, "user1", 0)
381   ROM_REGION(0x80000, "dmdcpu", 0)
299382   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(2b9533cd) SHA1(2b154550006e37a9dd1acb0cb832535415a7266b))
300383
301384   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
319402
320403   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
321404
322   ROM_REGION(0x80000, "user1", 0)
405   ROM_REGION(0x80000, "dmdcpu", 0)
323406   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, NO_DUMP)
324407
325408   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
347430
348431   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
349432
350   ROM_REGION(0x80000, "user1", 0)
433   ROM_REGION(0x80000, "dmdcpu", 0)
351434   ROM_LOAD("dsprom.bin", 0x00000, 0x40000, CRC(3cc7f470) SHA1(6adf8ac2ff93eb19c7b1dbbcf8fff6cd926dc563))
352435   ROM_RELOAD( 0x40000, 0x40000)
353436
r241431r241432
373456
374457   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
375458
376   ROM_REGION(0x80000, "user1", 0)
459   ROM_REGION(0x80000, "dmdcpu", 0)
377460   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(bbe96c5e) SHA1(4aaac8d88e739ccb22a7d87a820b14b6d40d3ff8))
378461
379462   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
397480
398481   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
399482
400   ROM_REGION(0x80000, "user1", 0)
483   ROM_REGION(0x80000, "dmdcpu", 0)
401484   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(d78d0fa3) SHA1(132c05e71cf5ad53184f044873fb3dd71f6da15f))
402485
403486   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
418501
419502   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
420503
421   ROM_REGION(0x80000, "user1", 0)
504   ROM_REGION(0x80000, "dmdcpu", 0)
422505   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(d78d0fa3) SHA1(132c05e71cf5ad53184f044873fb3dd71f6da15f))
423506
424507   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
441524
442525   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
443526
444   ROM_REGION(0x80000, "user1", 0)
527   ROM_REGION(0x80000, "dmdcpu", 0)
445528   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(fdc8baed) SHA1(d8ad96665cd9d8b2a6ce94653753c692384685ff))
446529
447530   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
466549
467550   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
468551
469   ROM_REGION(0x80000, "user1", 0)
552   ROM_REGION(0x80000, "dmdcpu", 0)
470553   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(1f70baae) SHA1(cf07bb057093b2bd18e6ee45009245ea62094e53))
471554
472555   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
487570
488571   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
489572
490   ROM_REGION(0x80000, "user1", 0)
573   ROM_REGION(0x80000, "dmdcpu", 0)
491574   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(1f70baae) SHA1(cf07bb057093b2bd18e6ee45009245ea62094e53))
492575
493576   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
511594
512595   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
513596
514   ROM_REGION(0x80000, "user1", 0)
597   ROM_REGION(0x80000, "dmdcpu", 0)
515598   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(9657ebd5) SHA1(b716daa71f8ec4332bf338f1f976425b6ec781ab))
516599
517600   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
535618
536619   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
537620
538   ROM_REGION(0x80000, "user1", 0)
621   ROM_REGION(0x80000, "dmdcpu", 0)
539622   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(d6cca842) SHA1(0498ab558d252e42dee9636e6736d159c7d06275))
540623
541624   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
556639
557640   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
558641
559   ROM_REGION(0x80000, "user1", 0)
642   ROM_REGION(0x80000, "dmdcpu", 0)
560643   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(d6cca842) SHA1(0498ab558d252e42dee9636e6736d159c7d06275))
561644
562645   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
580663
581664   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
582665
583   ROM_REGION(0x80000, "user1", 0)
666   ROM_REGION(0x80000, "dmdcpu", 0)
584667   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(17b89750) SHA1(927702f88013945cb9f2ea8389800b925182c347))
585668
586669   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
600683
601684   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
602685
603   ROM_REGION(0x80000, "user1", 0)
686   ROM_REGION(0x80000, "dmdcpu", 0)
604687   ROM_LOAD("dsprom1.bin", 0x00000, 0x80000, CRC(91c1b01a) SHA1(96eec2e9e52c8278c102f433a554327d420fe131))
605688
606689   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
620703
621704   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
622705
623   ROM_REGION(0x80000, "user1", 0)
706   ROM_REGION(0x80000, "dmdcpu", 0)
624707   ROM_LOAD("dsprom2.bin", 0x00000, 0x80000, CRC(d0205e03) SHA1(d8dea47f0fa0e46e2bd107a1f57121372fdef0d8))
625708
626709   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
640723
641724   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
642725
643   ROM_REGION(0x80000, "user1", 0)
726   ROM_REGION(0x80000, "dmdcpu", 0)
644727   ROM_LOAD("dsprom3.bin", 0x00000, 0x80000, CRC(db483524) SHA1(ea14e8b04c32fc403ce2ff060caed5562104a862))
645728
646729   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
660743
661744   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
662745
663   ROM_REGION(0x80000, "user1", 0)
746   ROM_REGION(0x80000, "dmdcpu", 0)
664747   ROM_LOAD("dsprom3.bin", 0x00000, 0x80000, CRC(db483524) SHA1(ea14e8b04c32fc403ce2ff060caed5562104a862))
665748
666749   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
683766
684767   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
685768
686   ROM_REGION(0x80000, "user1", 0)
769   ROM_REGION(0x80000, "dmdcpu", 0)
687770   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(e565e5e9) SHA1(c37abf28918feb38bbad6ebb610023d52ba96957))
688771
689772   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
705788
706789   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
707790
708   ROM_REGION(0x80000, "user1", 0)
791   ROM_REGION(0x80000, "dmdcpu", 0)
709792   ROM_LOAD("dsprom2.bin", 0x00000, 0x80000, CRC(80eb7513) SHA1(d13d44545c7b177e27b596bac6eba173b34a017b))
710793
711794   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
727810
728811   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
729812
730   ROM_REGION(0x80000, "user1", 0)
813   ROM_REGION(0x80000, "dmdcpu", 0)
731814   ROM_LOAD("dsprom2.bin", 0x00000, 0x80000, CRC(80eb7513) SHA1(d13d44545c7b177e27b596bac6eba173b34a017b))
732815
733816   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
752835
753836   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
754837
755   ROM_REGION(0x80000, "user1", 0)
838   ROM_REGION(0x80000, "dmdcpu", 0)
756839   ROM_LOAD("dsprom.bin", 0x00000, 0x40000, CRC(5c901899) SHA1(d106561b2e382afdb16e938072c9c8f1d1ccdae6))
757840   ROM_RELOAD( 0x40000, 0x40000)
758841
r241431r241432
771854
772855   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
773856
774   ROM_REGION(0x80000, "user1", 0)
857   ROM_REGION(0x80000, "dmdcpu", 0)
775858   ROM_LOAD("dsprom.bin", 0x00000, 0x40000, CRC(5c901899) SHA1(d106561b2e382afdb16e938072c9c8f1d1ccdae6))
776859   ROM_RELOAD( 0x40000, 0x40000)
777860
r241431r241432
794877
795878   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
796879
797   ROM_REGION(0x80000, "user1", 0)
880   ROM_REGION(0x80000, "dmdcpu", 0)
798881   ROM_LOAD("dsprom2.bin", 0x00000, 0x40000, CRC(181e8234) SHA1(9b22681f61cae401269a88c3cfd783d683390877))
799882   ROM_RELOAD( 0x40000, 0x40000)
800883
r241431r241432
817900
818901   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
819902
820   ROM_REGION(0x80000, "user1", 0)
903   ROM_REGION(0x80000, "dmdcpu", 0)
821904   ROM_LOAD("dsprom2.bin", 0x00000, 0x40000, CRC(181e8234) SHA1(9b22681f61cae401269a88c3cfd783d683390877))
822905   ROM_RELOAD( 0x40000, 0x40000)
823906
r241431r241432
840923
841924   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
842925
843   ROM_REGION(0x80000, "user1", 0)
926   ROM_REGION(0x80000, "dmdcpu", 0)
844927   ROM_LOAD("dsprom2.bin", 0x00000, 0x40000, CRC(181e8234) SHA1(9b22681f61cae401269a88c3cfd783d683390877))
845928   ROM_RELOAD( 0x40000, 0x40000)
846929
r241431r241432
863946
864947   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
865948
866   ROM_REGION(0x80000, "user1", 0)
949   ROM_REGION(0x80000, "dmdcpu", 0)
867950   ROM_LOAD("dsprom2.bin", 0x00000, 0x40000, CRC(181e8234) SHA1(9b22681f61cae401269a88c3cfd783d683390877))
868951   ROM_RELOAD( 0x40000, 0x40000)
869952
r241431r241432
889972
890973   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
891974
892   ROM_REGION(0x80000, "user1", 0)
975   ROM_REGION(0x80000, "dmdcpu", 0)
893976   ROM_LOAD("dsprom.bin", 0x00000, 0x40000, CRC(dda6c8be) SHA1(b64f73b81afe973674f9543a704b498e31d26c12))
894977   ROM_RELOAD( 0x40000, 0x40000)
895978
r241431r241432
915998
916999   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
9171000
918   ROM_REGION(0x80000, "user1", 0)
1001   ROM_REGION(0x80000, "dmdcpu", 0)
9191002   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(340b8a49) SHA1(3ac76faf920b00b77c77023c42595307840ed3a7))
9201003
9211004   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
9371020
9381021   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
9391022
940   ROM_REGION(0x80000, "user1", 0)
1023   ROM_REGION(0x80000, "dmdcpu", 0)
9411024   ROM_LOAD("dsprom1.bin", 0x00000, 0x80000, CRC(24f10ad2) SHA1(15f44f69d39ca9782410a75070edf348f64dba62))
9421025
9431026   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
9591042
9601043   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
9611044
962   ROM_REGION(0x80000, "user1", 0)
1045   ROM_REGION(0x80000, "dmdcpu", 0)
9631046   ROM_LOAD("dsprom1.bin", 0x00000, 0x80000, CRC(24f10ad2) SHA1(15f44f69d39ca9782410a75070edf348f64dba62))
9641047
9651048   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
9841067
9851068   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
9861069
987   ROM_REGION(0x80000, "user1", 0)
1070   ROM_REGION(0x80000, "dmdcpu", 0)
9881071   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(79164099) SHA1(fa048fb7aa91cadd6c0758c570a4c74337bd7cd5))
9891072
9901073   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
10041087
10051088   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
10061089
1007   ROM_REGION(0x80000, "user1", 0)
1090   ROM_REGION(0x80000, "dmdcpu", 0)
10081091   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(79164099) SHA1(fa048fb7aa91cadd6c0758c570a4c74337bd7cd5))
10091092
10101093   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
10271110
10281111   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
10291112
1030   ROM_REGION(0x80000, "user1", 0)
1113   ROM_REGION(0x80000, "dmdcpu", 0)
10311114   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(cbdec3ab) SHA1(2d70d436783830bf074a7a0590d5c48432136595))
10321115
10331116   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
10521135
10531136   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
10541137
1055   ROM_REGION(0x80000, "user1", 0)
1138   ROM_REGION(0x80000, "dmdcpu", 0)
10561139   ROM_LOAD("dsprom.bin", 0x00000, 0x80000, CRC(71ba5263) SHA1(e86c2cc89d31534fb2d9d24fab2fcdb0af7cc73d))
10571140
10581141   ROM_REGION(0x10000, "cpu4", 0)
r241431r241432
10741157
10751158   ROM_REGION(0x10000, "cpu2", ROMREGION_ERASEFF)
10761159
1077   ROM_REGION(0x80000, "user1", 0)
1160   ROM_REGION(0x80000, "dmdcpu", 0)
10781161   ROM_LOAD("dsprom2.bin", 0x00000, 0x80000, CRC(4c8ea71d) SHA1(ce751b84e2033e4de2f2c57490867ecafd423aaa))
10791162
10801163   ROM_REGION(0x10000, "cpu4", 0)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team