Previous 199869 Revisions Next

r18327 Sunday 7th October, 2012 at 09:12:56 UTC by Curt Coder
srcclean (nw)
[hash]a2600.xml cbm2_cart.xml cbm2_flop.xml p500_flop.xml pc8801_flop.xml pc98.xml
[src/emu]clifront.c devdelegate.c devdelegate.h device.h driver.c driver.h
[src/emu/cpu/tms0980]tms0980.c
[src/emu/machine]53c810.c ds75160a.h ds75161a.c ds75161a.h mos6526.c rtc4543.c s3c2400.c s3c2410.c scsibus.c seibu_cop.c
[src/emu/sound]sn76496.c
[src/emu/video]pc_vga.c pc_vga.h tms9928a.c
[src/mame/drivers]8080bw.c blackt96.c calchase.c cd32.c cdi.c cps1.c deshoros.c firebeat.c gammagic.c ggconnie.c intrscti.c jack.c jpmsys5.c kontest.c magictg.c magtouch.c mediagx.c ninjakd2.c nsm.c pangofun.c pcat_dyn.c pcat_nit.c pipedrm.c pntnpuzl.c queen.c raiden2.c saturn.c savquest.c shangha3.c spectra.c su2000.c taitowlf.c techno.c vicdual.c vlc.c xtom3d.c
[src/mame/includes]archimds.h bfm_sc45.h bzone.h crbaloon.h deco32.h decocass.h dkong.h irobot.h kaneko16.h m79amb.h megadriv.h mw8080bw.h ninjakd2.h orbit.h stv.h vicdual.h
[src/mame/machine]archimds.c genpin.h megacd.c megacd.h pcecommn.h seicop.c
[src/mame/video]awpvid.c dkong.c jack.c ninjakd2.c
[src/mess/drivers]a2600.c ami1200.c amiga.c astrocde.c bml3.c c128.c c64.c cbm2.c d6800.c elwro800.c indiana.c jr100.c korgm1.c n64.c pc8801.c pv9234.c rainbow.c test_t400.c ti99_4p.c ti99_4x.c tm990189.c vic10.c x68k.c xerox820.c xor100.c
[src/mess/includes]atarist.h cbm2.h comquest.h concept.h dccons.h fmtowns.h kramermc.h vtech2.h x68k.h
[src/mess/machine]a2arcadebd.c amigakbd.h bebox.c cbm2_graphic.c kr2376.c msx.c pc.c rx01.c vtech2.c
[src/mess/video]isa_svga_cirrus.c isa_svga_cirrus.h isa_svga_s3.c isa_svga_s3.h isa_svga_tseng.c isa_svga_tseng.h isa_vga.c isa_vga.h isa_vga_ati.c isa_vga_ati.h nubus_vikbw.h

trunk/hash/pc98.xml
r18326r18327
1616<!--
1717PC-9821Xw System Restore startup disk
1818
19this is a System Restore startup disk for PC-9821Xw
20but not a Windows install source(need more disk?)
19this is a System Restore startup disk for PC-9821Xw
20but not a Windows install source(need more disk?)
2121
2222only have some part of Windows file and a Video driver(CLGD?).
2323-->
trunk/hash/cbm2_cart.xml
r18326r18327
66      <description>Calc Result</description>
77      <year>1983</year>
88      <publisher>Handic Software</publisher>
9     
9
1010      <part name="cart" interface="cbm2_cart">
1111         <dataarea name="bank3" size="0x2000">
1212            <rom name="calc_result-bx700.bin" size="0x2000" crc="4775ebb3" sha1="5c6928a9cd8a3ce6a1d11221292b832295d6543e" offset="0" />
r18326r18327
2424      <description>ProfiText</description>
2525      <year>198?</year>
2626      <publisher>&lt;unknown&gt;</publisher>
27     
27
2828      <part name="cart" interface="cbm2_cart">
2929         <dataarea name="bank1" size="0x2000">
3030            <rom name="profitext.bin" size="0x2000" crc="ac622a2b" sha1="a02fcd187b7493a08379bbaef3d4296a083d30c8" offset="0" />
r18326r18327
3636      <description>Demo 1</description>
3737      <year>198?</year>
3838      <publisher>&lt;unknown&gt;</publisher>
39     
39
4040      <part name="cart" interface="cbm2_cart">
4141         <dataarea name="bank1" size="0x2000">
4242            <rom name="cbm610-cart1-red-left.bin" size="0x2000" crc="be426f3d" sha1="da6f1099fd09165f8ee454e2e517cfc523deb8b7" offset="0" />
r18326r18327
5252      <description>Demo 2</description>
5353      <year>198?</year>
5454      <publisher>&lt;unknown&gt;</publisher>
55     
55
5656      <part name="cart" interface="cbm2_cart">
5757         <dataarea name="bank1" size="0x2000">
5858            <rom name="cbm610-cart2-white-left.bin" size="0x2000" crc="aeb6881c" sha1="4bdabbd7d6d642f916b5a91155396c98fce591a3" offset="0" />
r18326r18327
6868      <description>Moni610</description>
6969      <year>2008</year>
7070      <publisher>Ullrich von Bassewitz</publisher>
71     
71
7272      <part name="cart" interface="cbm2_cart">
7373         <dataarea name="bank1" size="0x2000">
7474            <rom name="moni.bin" size="0x2000" crc="43b08d1f" sha1="9c0c24907e85674348dd58e81e6da64e157e9d0f" offset="0" />
r18326r18327
8080      <description>VT52 Emulator</description>
8181      <year>1986</year>
8282      <publisher>&lt;unknown&gt;</publisher>
83     
83
8484      <part name="cart" interface="cbm2_cart">
8585         <dataarea name="bank2" size="0x2000">
8686            <rom name="vt52emu.bin" size="0x2000" crc="b3b6173a" sha1="dd4a412a1a6ce4272b02d731364dd6dc96a4570b" offset="0" />
r18326r18327
9292      <description>High Resolution Graphics</description>
9393      <year>198?</year>
9494      <publisher>Commodore</publisher>
95     
95
9696      <part name="cart" interface="cbm2_cart">
9797         <feature name="slot" value="graphic" />
9898
r18326r18327
106106      <description>Word Result</description>
107107      <year>198?</year>
108108      <publisher>Handic Software</publisher>
109     
109
110110      <part name="cart" interface="cbm2_cart">
111111         <dataarea name="bank1" size="0x1000">
112112            <!-- this is the Commodore 64 character generator ROM, used as a copy protection dongle -->
trunk/hash/cbm2_flop.xml
r18326r18327
11<?xml version="1.0"?>
22<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
33<softwarelist name="cbm2_flop" description="Commodore CBM-II diskettes">
4   
4
55   <software name="burnin">
66      <description>Factory Burn In Diagnostics for B Series</description>
77      <year>1983</year>
r18326r18327
1313         </dataarea>
1414      </part>
1515   </software>
16   
16
1717   <software name="termv2">
1818      <description>Terminal Version 2.0 for B Series</description>
1919      <year>1983</year>
trunk/hash/a2600.xml
r18326r18327
355355      </part>
356356   </software>
357357
358   <software name="decathln">
358   <software name="decathln">
359359      <description>The Activision Decathlon</description>
360360      <year>1983</year>
361361      <publisher>Activision</publisher>
r18326r18327
597597      </part>
598598   </software>
599599
600   <software name="abwerniee" cloneof="abwernie">
600   <software name="abwerniee" cloneof="abwernie">
601601   <!-- controller not emulated -->
602602      <description>Alpha Beam with Ernie (PAL)</description>
603603      <year>1983</year>
trunk/hash/pc8801_flop.xml
r18326r18327
5451654516   </software>
5451754517
5451854518
54519<!-- AKA PC-8001_Game_Pack_vol.3
54519<!-- AKA PC-8001_Game_Pack_vol.3
5452054520BUGFIRE
5452154521CHECK POINT
5452254522EUROPE(?)  (タイトル不明、ヨーロッパ戦線的なゲームです)
trunk/hash/p500_flop.xml
r18326r18327
11<?xml version="1.0"?>
22<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
33<softwarelist name="p500_flop" description="Commodore P500 diskettes">
4   
4
55   <software name="burnin">
66      <description>Factory Burn In Diagnostics for P500</description>
77      <year>1983</year>
trunk/src/emu/clifront.c
r18326r18327
12831283
12841284
12851285/*-------------------------------------------------
1286   verifysoftware - verify roms from the software
1286    verifysoftware - verify roms from the software
12871287    list of the specified driver(s)
12881288-------------------------------------------------*/
12891289void cli_frontend::verifysoftware(const char *gamename)
trunk/src/emu/video/tms9928a.c
r18326r18327
9797{
9898   m_50hz = is_50hz;
9999   m_reva = is_reva;
100//   static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap));
100//  static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap));
101101}
102102
103103
r18326r18327
108108{
109109   m_50hz = false;
110110   m_reva = true;
111//   static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap));
111//  static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap));
112112}
113113
114114
trunk/src/emu/video/pc_vga.c
r18326r18327
203203
204204   // Avoid an infinite loop when displaying.  0 is not possible anyway.
205205   vga.crtc.maximum_scan_line = 1;
206   
207206
208   // copy over interfaces
209   vga.read_dipswitch = read8_delegate(); //read_dipswitch;   
207
208   // copy over interfaces
209   vga.read_dipswitch = read8_delegate(); //read_dipswitch;
210210   vga.svga_intf.vram_size = 0x100000;
211211   vga.svga_intf.seq_regcount = 0x05;
212212   vga.svga_intf.crtc_regcount = 0x19;
213213
214   vga.memory   = auto_alloc_array_clear(machine(), UINT8, vga.svga_intf.vram_size);   
214   vga.memory   = auto_alloc_array_clear(machine(), UINT8, vga.svga_intf.vram_size);
215215}
216216
217217void svga_device::device_start()
r18326r18327
231231
232232   // Avoid an infinite loop when displaying.  0 is not possible anyway.
233233   vga.crtc.maximum_scan_line = 1;
234   
235234
236   // copy over interfaces
237   vga.read_dipswitch = read8_delegate(); //read_dipswitch;   
235
236   // copy over interfaces
237   vga.read_dipswitch = read8_delegate(); //read_dipswitch;
238238   vga.svga_intf.vram_size = 0x200000;
239239   vga.svga_intf.seq_regcount = 0x08;
240240   vga.svga_intf.crtc_regcount = 0x19;
241241
242   vga.memory   = auto_alloc_array_clear(machine(), UINT8, vga.svga_intf.vram_size);   
242   vga.memory   = auto_alloc_array_clear(machine(), UINT8, vga.svga_intf.vram_size);
243243}
244244
245245void ati_vga_device::device_start()
r18326r18327
15991599            case 3:
16001600               if (!vga.read_dipswitch.isnull() && vga.read_dipswitch(space, 0, mem_mask) & 0x01)
16011601                  data |= 0x10;
1602               else
1602               else
16031603                  data |= 0x10;
16041604               break;
16051605            case 2:
16061606               if (!vga.read_dipswitch.isnull() && vga.read_dipswitch(space, 0, mem_mask) & 0x02)
16071607                  data |= 0x10;
1608               else
1608               else
16091609                  data |= 0x10;
16101610               break;
16111611            case 1:
16121612               if (!vga.read_dipswitch.isnull() && vga.read_dipswitch(space, 0, mem_mask) & 0x04)
16131613                  data |= 0x10;
1614               else
1614               else
16151615                  data |= 0x10;
16161616               break;
16171617            case 0:
16181618               if (!vga.read_dipswitch.isnull() && vga.read_dipswitch(space, 0, mem_mask) & 0x08)
16191619                  data |= 0x10;
1620               else
1620               else
16211621                  data |= 0x10;
16221622               break;
16231623         }
r18326r18327
20452045   MCFG_SCREEN_UPDATE_DEVICE("vga", trident_vga_device, screen_update)
20462046
20472047   MCFG_PALETTE_LENGTH(0x100)
2048   
2048
20492049   MCFG_DEVICE_ADD("vga", TRIDENT_VGA, 0)
20502050MACHINE_CONFIG_END
20512051
r18326r18327
20552055   MCFG_SCREEN_UPDATE_DEVICE("vga", cirrus_vga_device, screen_update)
20562056
20572057   MCFG_PALETTE_LENGTH(0x100)
2058   
2058
20592059   MCFG_DEVICE_ADD("vga", CIRRUS_VGA, 0)
20602060MACHINE_CONFIG_END
20612061
trunk/src/emu/video/pc_vga.h
r18326r18327
2727
2828
2929   virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
30   
30
3131   virtual READ8_MEMBER(port_03b0_r);
3232   virtual WRITE8_MEMBER(port_03b0_w);
3333   virtual READ8_MEMBER(port_03c0_r);
r18326r18327
4848   void vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect);
4949   void vga_vh_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect);
5050   void vga_vh_mono(bitmap_rgb32 &bitmap, const rectangle &cliprect);
51   virtual UINT8 pc_vga_choosevideomode();   
51   virtual UINT8 pc_vga_choosevideomode();
5252   void recompute_params_clock(int divisor, int xtal);
5353   UINT8 crtc_reg_read(UINT8 index);
5454   void recompute_params();
r18326r18327
6464   inline UINT8 rotate_right(UINT8 val);
6565   inline UINT8 vga_logical_op(UINT8 data, UINT8 plane, UINT8 mask);
6666   inline UINT8 vga_latch_write(int offs, UINT8 data);
67   
67
6868protected:
6969   struct
7070   {
r18326r18327
183183
184184      /* oak vga */
185185      struct { UINT8 reg; } oak;
186   } vga;   
186   } vga;
187187};
188188
189189
r18326r18327
196196{
197197public:
198198    // construction/destruction
199   svga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);   
199   svga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
200200
201201   virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
202202protected:
r18326r18327
588588   virtual WRITE8_MEMBER(port_03d0_w);
589589   virtual READ8_MEMBER(mem_r);
590590   virtual WRITE8_MEMBER(mem_w);
591   
591
592592protected:
593593private:
594594};
trunk/src/emu/machine/seibu_cop.c
r18326r18327
178178WRITE16_MEMBER(seibu_cop_device::dma_unk_param_w)
179179{
180180   /*
181      This sets up a DMA mode of some sort
182         0x0e00: grainbow, cupsoc
183         0x0a00: legionna, godzilla, denjinmk
184         0x0600: heatbrl
185         0x1e00: zeroteam, xsedae
186      raiden2 and raidendx doesn't set this up, this could indicate that this is related to the non-private buffer DMAs
187       (both only uses 0x14 and 0x15 as DMAs afaik)
181        This sets up a DMA mode of some sort
182            0x0e00: grainbow, cupsoc
183            0x0a00: legionna, godzilla, denjinmk
184            0x0600: heatbrl
185            0x1e00: zeroteam, xsedae
186        raiden2 and raidendx doesn't set this up, this could indicate that this is related to the non-private buffer DMAs
187        (both only uses 0x14 and 0x15 as DMAs afaik)
188188    */
189189   COMBINE_DATA(&m_dma_unk_param);
190190}
r18326r18327
271271             0x86 is used by Seibu Cup Soccer
272272             0x87 is used by Denjin Makai
273273
274            TODO:
274            TODO:
275275             - Denjin Makai mode 4 is totally guessworked.
276276             - SD Gundam doesn't fade colors correctly, it should have the text layer / sprites with normal gradient and the rest dimmed in most cases,
277277               presumably bad RAM table or bad algorithm
trunk/src/emu/machine/s3c2400.c
r18326r18327
6262   space.install_legacy_readwrite_handler( *device, 0x15800000, 0x15800007, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
6363   space.install_legacy_readwrite_handler( *device, 0x15900000, 0x15900017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
6464   space.install_legacy_readwrite_handler( *device, 0x15a00000, 0x15a0003f, FUNC(s3c24xx_mmc_r), FUNC(s3c24xx_mmc_w));
65   
65
6666   s3c24xx_video_start( device, device->machine());
6767}
6868
trunk/src/emu/machine/mos6526.c
r18326r18327
99
1010/*
1111
12   TODO:
12    TODO:
1313
14   - pass Lorenz test suite 2.15
15      - ICR01
16      - IMR
17      - CIA1TA/TB
18      - CIA2TA/TB
19   - pass VICE cia tests
20   - 8520 read/write
21   - 5710 read/write
22   - optimize
14    - pass Lorenz test suite 2.15
15        - ICR01
16        - IMR
17        - CIA1TA/TB
18        - CIA2TA/TB
19    - pass VICE cia tests
20    - 8520 read/write
21    - 5710 read/write
22    - optimize
2323
2424*/
2525
r18326r18327
4949   SDR,
5050   ICR, IMR = ICR,
5151   CRA,
52   CRB   
52   CRB
5353};
5454
5555
r18326r18327
7979
8080#define CRA_START      0x01
8181#define CRA_STARTED      BIT(m_cra, 0)
82#define CRA_PBON       BIT(m_cra, 1)
82#define CRA_PBON      BIT(m_cra, 1)
8383#define CRA_OUTMODE    BIT(m_cra, 2)
8484#define CRA_RUNMODE    BIT(m_cra, 3)
8585#define CRA_LOAD      BIT(m_cra, 4)
86#define CRA_INMODE       BIT(m_cra, 5)
87#define CRA_SPMODE       BIT(m_cra, 6)
88#define CRA_TODIN       BIT(m_cra, 7)
86#define CRA_INMODE      BIT(m_cra, 5)
87#define CRA_SPMODE      BIT(m_cra, 6)
88#define CRA_TODIN      BIT(m_cra, 7)
8989
9090
9191// control register B
r18326r18327
9999
100100#define CRB_START      0x01
101101#define CRB_STARTED      BIT(m_crb, 0)
102#define CRB_PBON       BIT(m_crb, 1)
102#define CRB_PBON      BIT(m_crb, 1)
103103#define CRB_OUTMODE    BIT(m_crb, 2)
104104#define CRB_RUNMODE    BIT(m_crb, 3)
105#define CRB_LOAD       BIT(m_crb, 4)
106#define CRB_INMODE       ((m_crb & 0x60) >> 5)
107#define CRB_ALARM       BIT(m_crb, 7)
105#define CRB_LOAD      BIT(m_crb, 4)
106#define CRB_INMODE      ((m_crb & 0x60) >> 5)
107#define CRB_ALARM      BIT(m_crb, 7)
108108
109109
110110
r18326r18327
253253
254254   if ((value & 0x0f) >= 0x0a)
255255      value += 0x10 - 0x0a;
256   
256
257257   return value;
258258}
259259
r18326r18327
270270   UINT8 hour      = (UINT8) (m_tod >> 24);
271271
272272   m_tod_count++;
273   
273
274274   if (m_tod_count == (CRA_TODIN ? 5 : 6))
275275   {
276276      m_tod_count = 0;
r18326r18327
531531{
532532   // timer A pipeline
533533   m_count_a3 = m_count_a2;
534   
534
535535   switch (CRA_INMODE)
536536   {
537537   case CRA_INMODE_PHI2:
r18326r18327
566566   case CRB_INMODE_CNT:
567567      m_count_b2 = m_count_b1;
568568      break;
569     
569
570570   case CRB_INMODE_TA:
571571      m_count_b2 = m_ta_out;
572572      break;
573     
573
574574   case CRB_INMODE_CNT_TA:
575575      m_count_b2 = m_ta_out && m_cnt;
576576      break;
r18326r18327
594594
595595
596596//-------------------------------------------------
597//  synchronize -
597//  synchronize -
598598//-------------------------------------------------
599599
600600inline void mos6526_device::synchronize()
r18326r18327
709709   save_item(NAME(m_tb_latch));
710710   save_item(NAME(m_cra));
711711   save_item(NAME(m_crb));
712   
712
713713   save_item(NAME(m_tod_count));
714714   save_item(NAME(m_tod));
715715   save_item(NAME(m_tod_latch));
r18326r18327
838838
839839   case PRB:
840840      data = (m_in_pb_func(0) & ~m_ddrb) | (m_prb & m_ddrb);
841     
841
842842      if (CRA_PBON)
843843      {
844844         int pb6 = CRA_OUTMODE ? m_ta_pb6 : m_ta_out;
r18326r18327
854854         data &= ~0x80;
855855         data |= pb7 << 7;
856856      }
857     
857
858858      m_pc = 0;
859859      m_out_pc_func(m_pc);
860860      break;
861     
861
862862   case DDRA:
863863      data = m_ddra;
864864      break;
865     
865
866866   case DDRB:
867867      data = m_ddrb;
868868      break;
869     
869
870870   case TA_LO:
871871      data = m_ta & 0xff;
872872      break;
873     
873
874874   case TA_HI:
875875      data = m_ta >> 8;
876876      break;
877     
877
878878   case TB_LO:
879879      data = m_tb & 0xff;
880880      break;
881     
881
882882   case TB_HI:
883883      data = m_tb >> 8;
884884      break;
885     
885
886886   case TOD_10THS:
887887      data = read_tod(0);
888888
889889      m_tod_latched = false;
890890      break;
891     
891
892892   case TOD_SEC:
893893      data = read_tod(1);
894894      break;
895     
895
896896   case TOD_MIN:
897897      data = read_tod(2);
898898      break;
899     
899
900900   case TOD_HR:
901901      if (!m_tod_latched)
902902      {
r18326r18327
906906
907907      data = read_tod(3);
908908      break;
909     
909
910910   case SDR:
911911      data = m_sdr;
912912      break;
913     
913
914914   case ICR:
915915      data = (m_ir1 << 7) | m_icr;
916916
r18326r18327
922922      m_irq = false;
923923      m_out_irq_func(CLEAR_LINE);
924924      break;
925     
925
926926   case CRA:
927927      data = m_cra;
928928      break;
929     
929
930930   case CRB:
931931      data = m_crb;
932932      break;
r18326r18327
952952   case PRB:
953953      m_prb = data;
954954      update_pb();
955     
955
956956      m_pc = 0;
957957      m_out_pc_func(m_pc);
958958      break;
959     
959
960960   case DDRA:
961961      m_ddra = data;
962962      update_pa();
963963      break;
964     
964
965965   case DDRB:
966966      m_ddrb = data;
967967      update_pb();
968968      break;
969     
969
970970   case TA_LO:
971971      m_ta_latch = (m_ta_latch & 0xff00) | data;
972972
r18326r18327
975975         m_ta = (m_ta & 0xff00) | data;
976976      }
977977      break;
978     
978
979979   case TA_HI:
980980      m_ta_latch = (data << 8) | (m_ta_latch & 0xff);
981981
r18326r18327
989989         m_ta = (data << 8) | (m_ta & 0xff);
990990      }
991991      break;
992     
992
993993   case TB_LO:
994994      m_tb_latch = (m_tb_latch & 0xff00) | data;
995995
r18326r18327
998998         m_tb = (m_tb & 0xff00) | data;
999999      }
10001000      break;
1001     
1001
10021002   case TB_HI:
10031003      m_tb_latch = (data << 8) | (m_tb_latch & 0xff);
10041004
r18326r18327
10121012         m_tb = (data << 8) | (m_tb & 0xff);
10131013      }
10141014      break;
1015     
1015
10161016   case TOD_10THS:
10171017      write_tod(0, data);
10181018
10191019      m_tod_stopped = false;
10201020      break;
1021     
1021
10221022   case TOD_SEC:
10231023      write_tod(1, data);
10241024      break;
1025     
1025
10261026   case TOD_MIN:
10271027      write_tod(2, data);
10281028      break;
1029     
1029
10301030   case TOD_HR:
10311031      m_tod_stopped = true;
10321032
r18326r18327
10381038
10391039      write_tod(3, data);
10401040      break;
1041     
1041
10421042   case SDR:
10431043      m_sdr = data;
10441044      m_sdr_empty = false;
10451045      break;
1046     
1046
10471047   case IMR:
10481048      if (IMR_SET)
10491049      {
r18326r18327
10591059         m_ir0 = 1;
10601060      }
10611061      break;
1062     
1062
10631063   case CRA:
10641064      set_cra(data);
10651065      break;
1066     
1066
10671067   case CRB:
10681068      set_crb(data);
10691069      break;
r18326r18327
11341134      m_count_a0 = 1;
11351135      m_count_b0 = 1;
11361136   }
1137   
1137
11381138   m_cnt = state;
11391139}
11401140
trunk/src/emu/machine/rtc4543.c
r18326r18327
22
33    rtc4543.c - Epson R4543 real-time clock chip emulation
44    by R. Belmont
5
5
66    TODO: writing (not done by System 12 or 23 so no test case)
7
7
88**********************************************************************/
99
1010#include "rtc4543.h"
r18326r18327
9393{
9494   static const int weekday[7] = { 7, 1, 2, 3, 4, 5, 6 };
9595
96    m_regs[0] = make_bcd(second);               // seconds (BCD, 0-59) in bits 0-6, bit 7 = battery low
97    m_regs[1] = make_bcd(minute);               // minutes (BCD, 0-59)
96    m_regs[0] = make_bcd(second);               // seconds (BCD, 0-59) in bits 0-6, bit 7 = battery low
97    m_regs[1] = make_bcd(minute);               // minutes (BCD, 0-59)
9898    m_regs[2] = make_bcd(hour);                 // hour (BCD, 0-23)
9999    m_regs[3] = make_bcd(weekday[day_of_week]);   // low nibble = day of the week
100100    m_regs[3] |= (make_bcd(day) & 0x0f)<<4;       // high nibble = low digit of day
trunk/src/emu/machine/s3c2410.c
r18326r18327
6565   space.install_legacy_readwrite_handler( *device, 0x59000000, 0x59000017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
6666   space.install_legacy_readwrite_handler( *device, 0x59000020, 0x59000037, FUNC(s3c24xx_spi_1_r), FUNC(s3c24xx_spi_1_w));
6767   space.install_legacy_readwrite_handler( *device, 0x5a000000, 0x5a000043, FUNC(s3c24xx_sdi_r), FUNC(s3c24xx_sdi_w));
68   
68
6969   s3c24xx_video_start( device, device->machine());
7070}
7171
trunk/src/emu/machine/ds75160a.h
r18326r18327
8181   devcb_resolved_write8   m_out_bus_func;
8282
8383   UINT8 m_data;
84   
84
8585   int m_te;
8686   int m_pe;
8787};
trunk/src/emu/machine/53c810.c
r18326r18327
393393
394394UINT8 lsi53c810_device::lsi53c810_reg_r( int offset )
395395{
396//   logerror("53c810: read reg %d:0x%x (PC=%x)\n", offset, offset, space.device().safe_pc());
396//  logerror("53c810: read reg %d:0x%x (PC=%x)\n", offset, offset, space.device().safe_pc());
397397   switch(offset)
398398   {
399399      case 0x00:      /* SCNTL0 */
r18326r18327
476476
477477void lsi53c810_device::lsi53c810_reg_w(int offset, UINT8 data)
478478{
479//   logerror("53c810: %02x to reg %d:0x%x (PC=%x)\n", data, offset, offset, space.device().safe_pc());
479//  logerror("53c810: %02x to reg %d:0x%x (PC=%x)\n", data, offset, offset, space.device().safe_pc());
480480   switch(offset)
481481   {
482482      case 0x00:      /* SCNTL0 */
trunk/src/emu/machine/scsibus.c
r18326r18327
406406            if(state)
407407            {
408408               data_idx++;
409               
409
410410               // If the data buffer is full flush it to the SCSI disk
411411
412412               data_last = (bytes_left >= sectorbytes) ? sectorbytes : bytes_left;
trunk/src/emu/machine/ds75161a.c
r18326r18327
9595   m_in_eoi_func.resolve(m_in_eoi_cb, *this);
9696   m_in_atn_func.resolve(m_in_atn_cb, *this);
9797   m_in_srq_func.resolve(m_in_srq_cb, *this);
98   
98
9999   m_out_ren_func.resolve(m_out_ren_cb, *this);
100100   m_out_ifc_func.resolve(m_out_ifc_cb, *this);
101101   m_out_ndac_func.resolve(m_out_ndac_cb, *this);
trunk/src/emu/machine/ds75161a.h
r18326r18327
9191    DECLARE_READ_LINE_MEMBER( eoi_r );
9292    DECLARE_READ_LINE_MEMBER( atn_r );
9393    DECLARE_READ_LINE_MEMBER( srq_r );
94   
94
9595    DECLARE_WRITE_LINE_MEMBER( ren_w );
9696    DECLARE_WRITE_LINE_MEMBER( ifc_w );
9797    DECLARE_WRITE_LINE_MEMBER( ndac_w );
trunk/src/emu/sound/sn76496.c
r18326r18327
104104  frequency register, while the others have 0x400 as before. Should fix a bug
105105  or two on sega games, particularly Vigilante on Sega Master System. Verified
106106  on SMS hardware.
107 
107
108108  27/06/2012: Michael Zapf
109109  Converted to modern device, legacy devices were gradually removed afterwards.
110110
trunk/src/emu/device.h
r18326r18327
987987   // query relative to the parent, if we have one
988988   if (m_owner != NULL)
989989      return m_owner->subdevice(tag);
990   
990
991991   // otherwise, it's NULL unless the tag is absolute
992992   return (tag[0] == ':') ? subdevice(tag) : NULL;
993993}
trunk/src/emu/cpu/tms0980/tms0980.c
r18326r18327
269269   const tms0980_config   *config;
270270   address_space *program;
271271   address_space *data;
272   
272
273273   devcb_resolved_read8 m_read_k;
274274   devcb_resolved_write16 m_write_o;
275275   devcb_resolved_write16 m_write_r;
r18326r18327
509509
510510   cpustate->program = &device->space( AS_PROGRAM );
511511   cpustate->data = &device->space( AS_PROGRAM );
512   
512
513513   cpustate->m_read_k.resolve(cpustate->config->read_k, *device);
514514   cpustate->m_write_o.resolve(cpustate->config->write_o, *device);
515515   cpustate->m_write_r.resolve(cpustate->config->write_r, *device);
trunk/src/emu/devdelegate.c
r18326r18327
4242
4343//-------------------------------------------------
4444//  bound_object - use the device name to locate
45//   a device relative to the given search root;
46//   fatal error if not found
45//  a device relative to the given search root;
46//  fatal error if not found
4747//-------------------------------------------------
4848
4949delegate_late_bind &device_delegate_helper::bound_object(device_t &search_root)
r18326r18327
5757
5858//-------------------------------------------------
5959//  safe_tag - return a tag string or (unknown) if
60//   the object is not valid
60//  the object is not valid
6161//-------------------------------------------------
6262
6363const char *device_delegate_helper::safe_tag(device_t *object)
trunk/src/emu/devdelegate.h
r18326r18327
5757protected:
5858   // constructor
5959   device_delegate_helper(const char *devname) : m_device_name(devname) { }
60   
60
6161   // internal helpers
6262   delegate_late_bind &bound_object(device_t &search_root);
6363   static const char *safe_tag(device_t *object);
trunk/src/emu/driver.c
r18326r18327
4242
4343
4444//**************************************************************************
45//   ADDRESS_MAPS
45//  ADDRESS_MAPS
4646//**************************************************************************
4747
4848// default address map
trunk/src/emu/driver.h
r18326r18327
166166// ======================> driver_device
167167
168168// base class for machine driver-specific devices
169class driver_device :    public device_t,
169class driver_device :   public device_t,
170170                  public device_memory_interface
171171{
172172public:
r18326r18327
204204
205205   // dummy driver_init callbacks
206206   void init_0() { }
207   
207
208208   // memory helpers
209209   address_space &generic_space() const { return space(AS_PROGRAM); }
210210
trunk/src/mess/machine/a2arcadebd.c
r18326r18327
33    a2arcadeboard.c
44
55    Implementation of the Third Millenium Engineering Arcade Board
6
6
77    TODO:
88        - VDPTEST program seems to want more than 16K of RAM, but docs/ads/press releases say 16k, period
99        - MLDEMO program needs vsync IRQ from the TMS but doesn't program the registers the way our emulation
1010          wants to enable IRQs
11
11
1212*********************************************************************/
1313
1414#include "emu.h"
r18326r18327
120120        case 1:
121121            return m_tms->register_read(space, 0);
122122
123        case 6:
123        case 6:
124124            return ay8910_r(m_ay, space, 0);
125125    }
126126
r18326r18327
146146        case 6:
147147            ay8910_data_w(m_ay, space, 0, data);
148148            break;
149    }       
149    }
150150}
151151
152152WRITE_LINE_MEMBER( a2bus_arcboard_device::tms_irq_w )
trunk/src/mess/machine/amigakbd.h
r18326r18327
77//**************************************************************************
88
99#define MCFG_AMIGA_KEYBOARD_ADD(_tag) \
10   MCFG_DEVICE_ADD(_tag, AMIGAKBD, 0)
10   MCFG_DEVICE_ADD(_tag, AMIGAKBD, 0)
1111
1212
1313
r18326r18327
2525
2626   // optional information overrides
2727   virtual ioport_constructor device_input_ports() const;
28   
28
2929   DECLARE_INPUT_CHANGED_MEMBER( kbd_update );
30   
30
3131protected:
3232    // device-level overrides
3333    virtual void device_start();
3434   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
35   
35
3636   void kbd_sendscancode(UINT8 scancode );
37private:   
37private:
3838   UINT8 *m_buf;
3939   int m_buf_pos;
4040   int m_cur_pos;
41   emu_timer *m_timer;   
41   emu_timer *m_timer;
4242};
4343
4444// device type definition
trunk/src/mess/machine/kr2376.c
r18326r18327
344344   assert(device->tag() != NULL);
345345
346346   kr2376->intf = (const kr2376_interface*)device->static_config();
347   
347
348348   assert(kr2376->intf != NULL);
349349   assert(kr2376->intf->clock > 0);
350350
trunk/src/mess/machine/cbm2_graphic.c
r18326r18327
99
1010/*
1111
12   TODO:
12    TODO:
1313
14   - version A (EF9365, 512x512 interlaced, 1 page)
15   - version B (EF9366, 512x256 non-interlaced, 2 pages)
14    - version A (EF9365, 512x512 interlaced, 1 page)
15    - version B (EF9366, 512x256 non-interlaced, 2 pages)
1616
1717*/
1818
r18326r18327
4141//  ef9345_interface gdp_intf
4242//-------------------------------------------------
4343
44static const ef9345_interface gdp_intf =
44static const ef9345_interface gdp_intf =
4545{
4646   SCREEN_TAG
4747};
r18326r18327
145145      else if (offset == 0x7f90)
146146      {
147147         /*
148         
149             bit     description
150         
151             0       light pen
152             1       
153             2       
154             3       
155             4       
156             5       
157             6       
158             7       
159         
160         */
148
149                bit     description
150
151                0       light pen
152                1
153                2
154                3
155                4
156                5
157                6
158                7
159
160            */
161161      }
162162      else if (offset == 0x7fb0)
163163      {
r18326r18327
184184      if (offset == 0x7f80)
185185      {
186186         /*
187         
188             bit     description
189         
190             0       hard copy (0=active)
191             1       operating page select (version B)
192             2       
193             3       read-modify-write (1=active)
194             4       display switch (1=graphic)
195             5       display page select (version B)
196             6       
197             7       
198         
199         */
187
188                bit     description
189
190                0       hard copy (0=active)
191                1       operating page select (version B)
192                2
193                3       read-modify-write (1=active)
194                4       display switch (1=graphic)
195                5       display page select (version B)
196                6
197                7
198
199            */
200200      }
201201      else if (offset >= 0x7ff0)
202202      {
trunk/src/mess/machine/vtech2.c
r18326r18327
146146            write8_delegate(FUNC(vtech2_state::mwa_bank3), this),
147147            write8_delegate(FUNC(vtech2_state::mwa_bank4), this),
148148         };
149     
149
150150         machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(offset * 0x4000, offset * 0x4000 + 0x3fff, mra_bank_soft[offset], mwa_bank_soft[offset]);
151151      }
152152      else
trunk/src/mess/machine/bebox.c
r18326r18327
227227}
228228
229229WRITE64_MEMBER(bebox_state::bebox_cpu1_imask_w )
230{   
230{
231231   UINT32 old_imask = m_cpu_imask[1];
232232
233233   bebox_mbreg32_w(&m_cpu_imask[1], data, mem_mask);
r18326r18327
610610/*
611611static READ64_MEMBER(bebox_state::bebox_video_r )
612612{
613   UINT64 result = 0;
614   mem_mask = FLIPENDIAN_INT64(mem_mask);
615   if (ACCESSING_BITS_0_7)
616      result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 0, mem_mask >> 0) << 0;
617   if (ACCESSING_BITS_8_15)
618      result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 1, mem_mask >> 8) << 8;
619   if (ACCESSING_BITS_16_23)
620      result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 2, mem_mask >> 16) << 16;
621   if (ACCESSING_BITS_24_31)
622      result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 3, mem_mask >> 24) << 24;
623   if (ACCESSING_BITS_32_39)
624      result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 4, mem_mask >> 32) << 32;
625   if (ACCESSING_BITS_40_47)
626      result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 5, mem_mask >> 40) << 40;
627   if (ACCESSING_BITS_48_55)
628      result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 6, mem_mask >> 48) << 48;
629   if (ACCESSING_BITS_56_63)
630      result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 7, mem_mask >> 56) << 56;
631   return FLIPENDIAN_INT64(result);
613    UINT64 result = 0;
614    mem_mask = FLIPENDIAN_INT64(mem_mask);
615    if (ACCESSING_BITS_0_7)
616        result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 0, mem_mask >> 0) << 0;
617    if (ACCESSING_BITS_8_15)
618        result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 1, mem_mask >> 8) << 8;
619    if (ACCESSING_BITS_16_23)
620        result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 2, mem_mask >> 16) << 16;
621    if (ACCESSING_BITS_24_31)
622        result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 3, mem_mask >> 24) << 24;
623    if (ACCESSING_BITS_32_39)
624        result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 4, mem_mask >> 32) << 32;
625    if (ACCESSING_BITS_40_47)
626        result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 5, mem_mask >> 40) << 40;
627    if (ACCESSING_BITS_48_55)
628        result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 6, mem_mask >> 48) << 48;
629    if (ACCESSING_BITS_56_63)
630        result |= (UINT64)vga_mem_linear_r(space, offset * 8 + 7, mem_mask >> 56) << 56;
631    return FLIPENDIAN_INT64(result);
632632}
633633
634634
635635static WRITE64_MEMBER(bebox_state::bebox_video_w )
636636{
637   data = FLIPENDIAN_INT64(data);
638   mem_mask = FLIPENDIAN_INT64(mem_mask);
639   if (ACCESSING_BITS_0_7)
640      vga_mem_linear_w(space, offset * 8 + 0, data >> 0 , mem_mask >> 0);
641   if (ACCESSING_BITS_8_15)                       
642      vga_mem_linear_w(space, offset * 8 + 1, data >> 8 , mem_mask >> 8);
643   if (ACCESSING_BITS_16_23)                     
644      vga_mem_linear_w(space, offset * 8 + 2, data >> 16, mem_mask >> 16);
645   if (ACCESSING_BITS_24_31)                     
646      vga_mem_linear_w(space, offset * 8 + 3, data >> 24, mem_mask >> 24);
647   if (ACCESSING_BITS_32_39)                     
648      vga_mem_linear_w(space, offset * 8 + 4, data >> 32, mem_mask >> 32);
649   if (ACCESSING_BITS_40_47)                     
650      vga_mem_linear_w(space, offset * 8 + 5, data >> 40, mem_mask >> 40);
651   if (ACCESSING_BITS_48_55)                     
652      vga_mem_linear_w(space, offset * 8 + 6, data >> 48, mem_mask >> 48);
653   if (ACCESSING_BITS_56_63)                     
654      vga_mem_linear_w(space, offset * 8 + 7, data >> 56, mem_mask >> 56);
637    data = FLIPENDIAN_INT64(data);
638    mem_mask = FLIPENDIAN_INT64(mem_mask);
639    if (ACCESSING_BITS_0_7)
640        vga_mem_linear_w(space, offset * 8 + 0, data >> 0 , mem_mask >> 0);
641    if (ACCESSING_BITS_8_15)
642        vga_mem_linear_w(space, offset * 8 + 1, data >> 8 , mem_mask >> 8);
643    if (ACCESSING_BITS_16_23)
644        vga_mem_linear_w(space, offset * 8 + 2, data >> 16, mem_mask >> 16);
645    if (ACCESSING_BITS_24_31)
646        vga_mem_linear_w(space, offset * 8 + 3, data >> 24, mem_mask >> 24);
647    if (ACCESSING_BITS_32_39)
648        vga_mem_linear_w(space, offset * 8 + 4, data >> 32, mem_mask >> 32);
649    if (ACCESSING_BITS_40_47)
650        vga_mem_linear_w(space, offset * 8 + 5, data >> 40, mem_mask >> 40);
651    if (ACCESSING_BITS_48_55)
652        vga_mem_linear_w(space, offset * 8 + 6, data >> 48, mem_mask >> 48);
653    if (ACCESSING_BITS_56_63)
654        vga_mem_linear_w(space, offset * 8 + 7, data >> 56, mem_mask >> 56);
655655}
656656*/
657657/*************************************
r18326r18327
662662
663663
664664READ8_MEMBER(bebox_state::bebox_page_r)
665{   
665{
666666   UINT8 data = m_at_pages[offset % 0x10];
667667
668668   switch(offset % 8)
r18326r18327
685685
686686
687687WRITE8_MEMBER(bebox_state::bebox_page_w)
688{   
688{
689689   m_at_pages[offset % 0x10] = data;
690690
691691   switch(offset % 8)
r18326r18327
711711
712712
713713WRITE8_MEMBER(bebox_state::bebox_80000480_w)
714{   
714{
715715   switch(offset % 8)
716716   {
717717      case 1:
r18326r18327
910910
911911
912912READ64_MEMBER(bebox_state::scsi53c810_r )
913{   
913{
914914   int reg = offset*8;
915915   UINT64 r = 0;
916916   if (!(mem_mask & U64(0xff00000000000000))) {
r18326r18327
943943
944944
945945WRITE64_MEMBER(bebox_state::scsi53c810_w )
946{   
946{
947947   int reg = offset*8;
948948   if (!(mem_mask & U64(0xff00000000000000))) {
949949      m_lsi53c810->lsi53c810_reg_w(reg+0, data >> 56);
trunk/src/mess/machine/msx.c
r18326r18327
119119            { "SUPERLODE",         SLOT_SUPERLODERUNNER },
120120            { "MAJUTSUSHI",         SLOT_MAJUTSUSHI },
121121         };
122         
122
123123         for (int i = 0; i < ARRAY_LENGTH(mapper_types) && type < 0; i++)
124124         {
125125            if (!mame_stricmp(mapper, mapper_types[i].mapper_name))
trunk/src/mess/machine/pc.c
r18326r18327
924924   key |= machine().root_device().ioport("Y10")->read();
925925   key |= machine().root_device().ioport("Y11")->read();
926926   key |= machine().root_device().ioport("Y12")->read();
927//   DBG_LOG(1,"mc1502_k_s_c",("= %02X (%d) %s\n", key, mc1502_keyb.pulsing,
928//      (key || mc1502_keyb.pulsing) ? " will IRQ" : ""));
927//  DBG_LOG(1,"mc1502_k_s_c",("= %02X (%d) %s\n", key, mc1502_keyb.pulsing,
928//      (key || mc1502_keyb.pulsing) ? " will IRQ" : ""));
929929
930930   /*
931931       If a key is pressed and we're not pulsing yet, start pulsing the IRQ1;
r18326r18327
946946
947947READ8_MEMBER(pc_state::mc1502_ppi_porta_r)
948948{
949//   DBG_LOG(1,"mc1502_ppi_porta_r",("= %02X\n", mc1502_keyb.latch));
949//  DBG_LOG(1,"mc1502_ppi_porta_r",("= %02X\n", mc1502_keyb.latch));
950950   return mc1502_keyb.latch;
951951}
952952
953953WRITE8_MEMBER(pc_state::mc1502_ppi_porta_w)
954954{
955//   DBG_LOG(1,"mc1502_ppi_porta_w",("( %02X )\n", data));
955//  DBG_LOG(1,"mc1502_ppi_porta_w",("( %02X )\n", data));
956956   mc1502_keyb.latch = data;
957957   if (mc1502_keyb.pulsing)
958958      mc1502_keyb.pulsing--;
r18326r18327
961961
962962WRITE8_MEMBER(pc_state::mc1502_ppi_portb_w)
963963{
964//   DBG_LOG(2,"mc1502_ppi_portb_w",("( %02X )\n", data));
964//  DBG_LOG(2,"mc1502_ppi_portb_w",("( %02X )\n", data));
965965   m_ppi_portb = data;
966966   pit8253_gate2_w(machine().device("pit8253"), BIT(data, 0));
967967   pc_speaker_set_spkrdata( machine(), data & 0x02 );
r18326r18327
981981//  0x10 -- SNDOUT
982982   data = ( data & ~0x10 ) | ( (BIT(m_ppi_portb, 1) && timer2_output) ? 0x10 : 0x00 );
983983
984//   DBG_LOG(2,"mc1502_ppi_portc_r",("= %02X (tap_val %f t2out %d) at %s\n",
985//      data, tap_val, timer2_output, machine().describe_context()));
984//  DBG_LOG(2,"mc1502_ppi_portc_r",("= %02X (tap_val %f t2out %d) at %s\n",
985//      data, tap_val, timer2_output, machine().describe_context()));
986986   return data;
987987}
988988
r18326r18327
10031003   if (mc1502_keyb.mask & 0x0400) { key |= machine().root_device().ioport("Y11")->read(); }
10041004   if (mc1502_keyb.mask & 0x0800) { key |= machine().root_device().ioport("Y12")->read(); }
10051005   key ^= 0xff;
1006//   DBG_LOG(2,"mc1502_kppi_porta_r",("= %02X\n", key));
1006//  DBG_LOG(2,"mc1502_kppi_porta_r",("= %02X\n", key));
10071007   return key;
10081008}
10091009
r18326r18327
10151015      mc1502_keyb.mask |= 1 << 11;
10161016   else
10171017      mc1502_keyb.mask &= ~(1 << 11);
1018//   DBG_LOG(2,"mc1502_kppi_portb_w",("( %02X -> %04X )\n", data, mc1502_keyb.mask));
1018//  DBG_LOG(2,"mc1502_kppi_portb_w",("( %02X -> %04X )\n", data, mc1502_keyb.mask));
10191019}
10201020
10211021WRITE8_MEMBER(pc_state::mc1502_kppi_portc_w)
10221022{
10231023   mc1502_keyb.mask &= ~(7 << 8);
10241024   mc1502_keyb.mask |= ((data ^ 7) & 7) << 8;
1025//   DBG_LOG(2,"mc1502_kppi_portc_w",("( %02X -> %04X )\n", data, mc1502_keyb.mask));
1025//  DBG_LOG(2,"mc1502_kppi_portc_w",("( %02X -> %04X )\n", data, mc1502_keyb.mask));
10261026}
10271027
10281028
trunk/src/mess/machine/rx01.c
r18326r18327
176176
177177void rx01_device::data_write(UINT16 data)
178178{
179//   printf("data_write %04x\n",data);
179//  printf("data_write %04x\n",data);
180180   // data can be written only if TR is set
181181   if (BIT(m_rxcs,7)) m_rxdb = data;
182182   machine().scheduler().timer_set(attotime::from_msec(100), FUNC(command_execution_callback), 0, this);
r18326r18327
185185UINT16 rx01_device::data_read()
186186{
187187   if (m_state==RX01_EMPTY && BIT(m_rxcs,7)) m_rxcs &= (1<<7); // clear TR bit;
188//   printf("data_read %04x\n",m_rxdb);
188//  printf("data_read %04x\n",m_rxdb);
189189   return m_rxdb;
190190}
191191
trunk/src/mess/includes/vtech2.h
r18326r18327
5656   DECLARE_MACHINE_RESET(laser700);
5757   UINT32 screen_update_laser(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5858   INTERRUPT_GEN_MEMBER(vtech2_interrupt);
59   
59
6060   int mra_bank(int bank, int offs);
6161   void mwa_bank(int bank, int offs, int data);
62   
62
6363   DECLARE_WRITE8_MEMBER(mwa_bank1);
6464   DECLARE_WRITE8_MEMBER(mwa_bank2);
6565   DECLARE_WRITE8_MEMBER(mwa_bank3);
6666   DECLARE_WRITE8_MEMBER(mwa_bank4);
6767   DECLARE_READ8_MEMBER(mra_bank1);
68   DECLARE_READ8_MEMBER(mra_bank2);
68   DECLARE_READ8_MEMBER(mra_bank2);
6969   DECLARE_READ8_MEMBER(mra_bank3);
70   DECLARE_READ8_MEMBER(mra_bank4);   
70   DECLARE_READ8_MEMBER(mra_bank4);
7171};
7272
7373
trunk/src/mess/includes/concept.h
r18326r18327
5454   virtual void video_start();
5555   UINT32 screen_update_concept(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5656   INTERRUPT_GEN_MEMBER(concept_interrupt);
57   
57
5858   void install_expansion_slot(int slot,
5959      read8_delegate reg_read, write8_delegate reg_write,
6060      read8_delegate rom_read, write8_delegate rom_write);
61   
61
6262   void concept_fdc_init(int slot);
6363   void concept_hdc_init(int slot);
6464
r18326r18327
6868
6969   DECLARE_READ8_MEMBER(concept_hdc_reg_r);
7070   DECLARE_WRITE8_MEMBER(concept_hdc_reg_w);
71   DECLARE_READ8_MEMBER(concept_hdc_rom_r);   
71   DECLARE_READ8_MEMBER(concept_hdc_rom_r);
7272   DECLARE_READ8_MEMBER(via_in_a);
7373   DECLARE_WRITE8_MEMBER(via_out_a);
7474   DECLARE_READ8_MEMBER(via_in_b);
trunk/src/mess/includes/kramermc.h
r18326r18327
1919   DECLARE_DRIVER_INIT(kramermc);
2020   virtual void machine_reset();
2121   virtual void video_start();
22   UINT32 screen_update_kramermc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);   
22   UINT32 screen_update_kramermc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2323   DECLARE_READ8_MEMBER(kramermc_port_a_r);
2424   DECLARE_READ8_MEMBER(kramermc_port_b_r);
2525   DECLARE_WRITE8_MEMBER(kramermc_port_a_w);
trunk/src/mess/includes/cbm2.h
r18326r18327
100100   DECLARE_MACHINE_START( cbm2_pal );
101101   DECLARE_MACHINE_RESET( cbm2 );
102102
103   virtual void read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
103   virtual void read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
104104      int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4);
105105
106106   void bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen,
107      int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs,
107      int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs,
108108      int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs,
109109      int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs);
110110
r18326r18327
172172      : cbm2_state(mconfig, type, tag)
173173   { }
174174
175   virtual void read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
175   virtual void read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
176176      int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4);
177177
178178   DECLARE_READ8_MEMBER( tpi2_pc_r );
r18326r18327
203203
204204   void read_pla1(offs_t offset, int bras, int busy2, int sphi2, int clrnibcsb, int procvid, int refen, int ba, int aec, int srw,
205205      int *datxen, int *dramxen, int *clrniben, int *segf, int *_64kcasen, int *casenb, int *viddaten, int *viddat_tr);
206   
206
207207   void read_pla2(offs_t offset, offs_t va, int ba, int sphi2, int vicen, int ae, int segf, int bcas, int bank0,
208208      int *clrnibcsb, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *procvid, int *viccs, int *vidmatcs);
209209
r18326r18327
212212      int *clrnibcs, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *viccs, int *vidmatcs,
213213      int *csbank1, int *csbank2, int *csbank3, int *basiclocs, int *basichics, int *kernalcs,
214214      int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs, int *aec, int *vsysaden);
215   
215
216216   UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas, UINT8 *clrnib);
217217   void write_memory(address_space &space, offs_t offset, UINT8 data, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas);
218218
trunk/src/mess/includes/atarist.h
r18326r18327
333333
334334   TIMER_CALLBACK_MEMBER(atariste_dmasound_tick);
335335   TIMER_CALLBACK_MEMBER(atariste_microwire_tick);
336   
336
337337   void dmasound_set_state(int level);
338338   void dmasound_tick();
339339   void microwire_shift();
trunk/src/mess/includes/fmtowns.h
r18326r18327
252252   void poll_keyboard();
253253   void mouse_timeout();
254254   void wait_end();
255public:   
255public:
256256   INTERRUPT_GEN_MEMBER(towns_vsync_irq);
257257   TIMER_CALLBACK_MEMBER(towns_cd_status_ready);
258258   TIMER_CALLBACK_MEMBER(towns_cdrom_read_byte);
trunk/src/mess/includes/x68k.h
r18326r18327
297297   DECLARE_WRITE_LINE_MEMBER(mfp_irq_callback);
298298   DECLARE_WRITE_LINE_MEMBER(x68k_scsi_irq);
299299   DECLARE_WRITE_LINE_MEMBER(x68k_scsi_drq);
300   
300
301301   void mfp_init();
302302   void x68k_keyboard_ctrl_w(int data);
303303   int x68k_keyboard_pop_scancode();
r18326r18327
308308   void md_6button_init();
309309   UINT8 md_6button_r(int port);
310310   UINT8 xpd1lr_r(int port);
311   
311
312312   DECLARE_WRITE_LINE_MEMBER(x68k_fm_irq);
313313   DECLARE_WRITE_LINE_MEMBER(x68k_irq2_line);
314314
r18326r18327
345345   DECLARE_READ16_MEMBER(x68k_exp_r);
346346   DECLARE_WRITE16_MEMBER(x68k_exp_w);
347347   DECLARE_READ16_MEMBER(x68k_scc_r);
348   
348
349349   DECLARE_READ16_MEMBER(x68k_spritereg_r);
350350   DECLARE_WRITE16_MEMBER(x68k_spritereg_w);
351351   DECLARE_READ16_MEMBER(x68k_spriteram_r);
r18326r18327
367367   void x68k_draw_text(bitmap_ind16 &bitmap, int xscr, int yscr, rectangle rect);
368368   void x68k_draw_gfx_scanline(bitmap_ind16 &bitmap, rectangle cliprect, UINT8 priority);
369369   void x68k_draw_gfx(bitmap_ind16 &bitmap,rectangle cliprect);
370   void x68k_draw_sprites(bitmap_ind16 &bitmap, int priority, rectangle cliprect);   
370   void x68k_draw_sprites(bitmap_ind16 &bitmap, int priority, rectangle cliprect);
371371};
372372
373373
trunk/src/mess/includes/comquest.h
r18326r18327
2424   DECLARE_WRITE8_MEMBER(comquest_write);
2525   virtual void machine_reset();
2626   virtual void video_start();
27   UINT32 screen_update_comquest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);   
27   UINT32 screen_update_comquest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2828};
2929
3030#endif /* COMQUEST_H_ */
trunk/src/mess/includes/dccons.h
r18326r18327
88   DECLARE_DRIVER_INIT(dc);
99   DECLARE_DRIVER_INIT(dcus);
1010   DECLARE_DRIVER_INIT(dcjp);
11   
11
1212   DECLARE_READ64_MEMBER(dcus_idle_skip_r);
1313   DECLARE_READ64_MEMBER(dcjp_idle_skip_r);
14   
14
1515   DECLARE_MACHINE_RESET(dc_console);
1616   DECLARE_READ64_MEMBER(dc_pdtra_r);
1717   DECLARE_WRITE64_MEMBER(dc_pdtra_w);
1818   DECLARE_READ64_MEMBER(dc_arm_r);
1919   DECLARE_WRITE64_MEMBER(dc_arm_w);
2020   DECLARE_WRITE64_MEMBER(ta_texture_directpath0_w);
21   DECLARE_WRITE64_MEMBER(ta_texture_directpath1_w);   
22private:   
21   DECLARE_WRITE64_MEMBER(ta_texture_directpath1_w);
22private:
2323   UINT64 PDTRA, PCTRA;
24   
24
2525};
trunk/src/mess/video/isa_svga_cirrus.c
r18326r18327
2626   MCFG_SCREEN_UPDATE_DEVICE("vga", cirrus_vga_device, screen_update)
2727
2828   MCFG_PALETTE_LENGTH(0x100)
29   
29
3030   MCFG_DEVICE_ADD("vga", CIRRUS_VGA, 0)
3131MACHINE_CONFIG_END
3232
r18326r18327
7474   set_isa_device();
7575
7676   m_vga = subdevice<cirrus_vga_device>("vga");
77   
77
7878   m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "svga", "dm_clgd5430");
7979
8080   m_isa->install_device(0x03b0, 0x03bf, 0, 0, read8_delegate(FUNC(cirrus_vga_device::port_03b0_r),m_vga), write8_delegate(FUNC(cirrus_vga_device::port_03b0_w),m_vga));
trunk/src/mess/video/isa_svga_cirrus.h
r18326r18327
2424      // optional information overrides
2525      virtual machine_config_constructor device_mconfig_additions() const;
2626      virtual const rom_entry *device_rom_region() const;
27     
27
2828      DECLARE_READ8_MEMBER(input_port_0_r);
2929protected:
3030        // device-level overrides
3131        virtual void device_start();
3232        virtual void device_reset();
33private:     
34      cirrus_vga_device *m_vga;     
33private:
34      cirrus_vga_device *m_vga;
3535};
3636
3737
trunk/src/mess/video/isa_svga_tseng.c
r18326r18327
2626   MCFG_SCREEN_UPDATE_DEVICE("vga", tseng_vga_device, screen_update)
2727
2828   MCFG_PALETTE_LENGTH(0x100)
29   
29
3030   MCFG_DEVICE_ADD("vga", TSENG_VGA, 0)
3131MACHINE_CONFIG_END
3232
r18326r18327
7474   set_isa_device();
7575
7676   m_vga = subdevice<tseng_vga_device>("vga");
77   
77
7878   m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "et4000", "et4000");
7979
8080   m_isa->install_device(0x3b0, 0x3bf, 0, 0, read8_delegate(FUNC(tseng_vga_device::port_03b0_r),m_vga), write8_delegate(FUNC(tseng_vga_device::port_03b0_w),m_vga));
trunk/src/mess/video/isa_svga_tseng.h
r18326r18327
2424      // optional information overrides
2525      virtual machine_config_constructor device_mconfig_additions() const;
2626      virtual const rom_entry *device_rom_region() const;
27     
27
2828      DECLARE_READ8_MEMBER(input_port_0_r);
2929protected:
3030        // device-level overrides
3131        virtual void device_start();
3232        virtual void device_reset();
33private:     
33private:
3434      tseng_vga_device *m_vga;
3535};
3636
trunk/src/mess/video/isa_svga_s3.c
r18326r18327
2727   MCFG_SCREEN_UPDATE_DEVICE("vga", s3_vga_device, screen_update)
2828
2929   MCFG_PALETTE_LENGTH(0x100)
30   
30
3131   MCFG_DEVICE_ADD("vga", S3_VGA, 0)
3232MACHINE_CONFIG_END
3333
trunk/src/mess/video/isa_svga_s3.h
r18326r18327
2424      // optional information overrides
2525      virtual machine_config_constructor device_mconfig_additions() const;
2626      virtual const rom_entry *device_rom_region() const;
27     
27
2828      DECLARE_READ8_MEMBER(input_port_0_r);
2929protected:
3030        // device-level overrides
3131        virtual void device_start();
3232        virtual void device_reset();
33private:     
33private:
3434      s3_vga_device *m_vga;
3535      ibm8514a_device *m_8514;
3636};
trunk/src/mess/video/isa_vga_ati.c
r18326r18327
2929   MCFG_SCREEN_UPDATE_DEVICE("vga", ati_vga_device, screen_update)
3030
3131   MCFG_PALETTE_LENGTH(0x100)
32   
32
3333   MCFG_DEVICE_ADD("vga", ATI_VGA, 0)
3434MACHINE_CONFIG_END
3535
r18326r18327
7878
7979   m_vga = subdevice<ati_vga_device>("vga");
8080   m_8514 = subdevice<mach8_device>("vga:8514a");
81   
81
8282   m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "vga", "gfxultra");
8383
8484   m_isa->install_device(0x1ce, 0x1cf, 0, 0, read8_delegate(FUNC(ati_vga_device::ati_port_ext_r),m_vga), write8_delegate(FUNC(ati_vga_device::ati_port_ext_w),m_vga));
trunk/src/mess/video/isa_vga_ati.h
r18326r18327
3131      // optional information overrides
3232      virtual machine_config_constructor device_mconfig_additions() const;
3333      virtual const rom_entry *device_rom_region() const;
34     
34
3535      DECLARE_READ8_MEMBER(input_port_0_r);
3636protected:
3737        // device-level overrides
3838        virtual void device_start();
3939        virtual void device_reset();
40private:     
40private:
4141      ati_vga_device *m_vga;
4242      mach8_device *m_8514;
4343};
trunk/src/mess/video/nubus_vikbw.h
r18326r18327
2424      // optional information overrides
2525      virtual machine_config_constructor device_mconfig_additions() const;
2626      virtual const rom_entry *device_rom_region() const;
27     
27
2828      UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
2929protected:
3030        // device-level overrides
trunk/src/mess/video/isa_vga.c
r18326r18327
6262void isa8_vga_device::device_start()
6363{
6464   set_isa_device();
65   
65
6666   m_vga = subdevice<vga_device>("vga");
6767
6868   m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "ibm_vga", "ibm_vga");
trunk/src/mess/video/isa_vga.h
r18326r18327
2424      // optional information overrides
2525      virtual machine_config_constructor device_mconfig_additions() const;
2626      virtual const rom_entry *device_rom_region() const;
27     
27
2828      DECLARE_READ8_MEMBER(input_port_0_r);
2929protected:
3030        // device-level overrides
trunk/src/mess/drivers/xerox820.c
r18326r18327
559559
560560WRITE_LINE_MEMBER(xerox820_state::ctc_z0_w)
561561{
562//   device_t *device = machine().device(Z80CTC_TAG);
562//  device_t *device = machine().device(Z80CTC_TAG);
563563//  z80ctc_trg1_w(device, state);
564564}
565565
566566WRITE_LINE_MEMBER(xerox820_state::ctc_z2_w)
567567{
568//   device_t *device = machine().device(Z80CTC_TAG);
568//  device_t *device = machine().device(Z80CTC_TAG);
569569
570570//  z80ctc_trg3_w(device, state);
571571}
trunk/src/mess/drivers/n64.c
r18326r18327
1818{
1919public:
2020   n64_mess_state(const machine_config &mconfig, device_type type, const char *tag)
21      : n64_state(mconfig, type, tag)
21      : n64_state(mconfig, type, tag)
2222      { }
2323
2424   DECLARE_READ32_MEMBER(dd_null_r);
trunk/src/mess/drivers/jr100.c
r18326r18327
265265   DEVCB_NULL,                                /* in_ca2_func */
266266   DEVCB_NULL,                                /* in_cb2_func */
267267   DEVCB_DRIVER_MEMBER(jr100_state,jr100_via_write_a),               /* out_a_func */
268   DEVCB_DRIVER_MEMBER(jr100_state,jr100_via_write_b),               /* out_b_func */
268   DEVCB_DRIVER_MEMBER(jr100_state,jr100_via_write_b),             /* out_b_func */
269269   DEVCB_NULL,                                /* out_ca1_func */
270270   DEVCB_NULL,                                 /* out_cb1_func */
271271   DEVCB_NULL,                                /* out_ca2_func */
272   DEVCB_DRIVER_LINE_MEMBER(jr100_state, jr100_via_write_cb2),                /* out_cb2_func */
272   DEVCB_DRIVER_LINE_MEMBER(jr100_state, jr100_via_write_cb2),             /* out_cb2_func */
273273   DEVCB_NULL                                /* irq_func */
274274};
275275static const cassette_interface jr100_cassette_interface =
trunk/src/mess/drivers/tm990189.c
r18326r18327
144144   DECLARE_MACHINE_RESET(tm990_189);
145145   DECLARE_MACHINE_START(tm990_189_v);
146146   DECLARE_MACHINE_RESET(tm990_189_v);
147   
147
148148   TIMER_DEVICE_CALLBACK_MEMBER(display_callback);
149149   TIMER_CALLBACK_MEMBER(clear_load);
150150   void hold_load();
trunk/src/mess/drivers/x68k.c
r18326r18327
436436}
437437
438438void x68k_state::x68k_keyboard_push_scancode(unsigned char code)
439{   
439{
440440   m_keyboard.keynum++;
441441   if(m_keyboard.keynum >= 1)
442442   { // keyboard buffer full
trunk/src/mess/drivers/astrocde.c
r18326r18327
1717{
1818public:
1919   astrocde_mess_state(const machine_config &mconfig, device_type type, const char *tag)
20      : astrocde_state(mconfig, type, tag)
20      : astrocde_state(mconfig, type, tag)
2121      { }
2222
2323   void get_ram_expansion_settings(int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end);
trunk/src/mess/drivers/test_t400.c
r18326r18327
2121
2222WRITE8_MEMBER( t400_test_suite_state::port_l_w )
2323{
24//   printf("L: %u\n", data);
24//  printf("L: %u\n", data);
2525}
2626
2727static ADDRESS_MAP_START( cop_io, AS_IO, 8, t400_test_suite_state )
trunk/src/mess/drivers/c64.c
r18326r18327
422422READ8_MEMBER( c64_state::sid_potx_r )
423423{
424424   UINT8 cia1_pa = m_cia1->pa_r();
425   
425
426426   int sela = BIT(cia1_pa, 6);
427427   int selb = BIT(cia1_pa, 7);
428428
r18326r18327
437437READ8_MEMBER( c64_state::sid_poty_r )
438438{
439439   UINT8 cia1_pa = m_cia1->pa_r();
440   
440
441441   int sela = BIT(cia1_pa, 6);
442442   int selb = BIT(cia1_pa, 7);
443443
trunk/src/mess/drivers/indiana.c
r18326r18327
3737   AM_RANGE(0x7f6003b0, 0x7f6003bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
3838   AM_RANGE(0x7f6003c0, 0x7f6003cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
3939   AM_RANGE(0x7f6003d0, 0x7f6003df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
40   AM_RANGE(0x7f7a0000, 0x7f7bffff) AM_DEVREADWRITE8("vga", vga_device, mem_r, mem_w, 0xffffffff)   
41   AM_RANGE(0x80000000, 0x803fffff) AM_MIRROR(0x7fc00000) AM_RAM // 4 MB RAM   
40   AM_RANGE(0x7f7a0000, 0x7f7bffff) AM_DEVREADWRITE8("vga", vga_device, mem_r, mem_w, 0xffffffff)
41   AM_RANGE(0x80000000, 0x803fffff) AM_MIRROR(0x7fc00000) AM_RAM // 4 MB RAM
4242ADDRESS_MAP_END
4343
4444
trunk/src/mess/drivers/pv9234.c
r18326r18327
7979      {
8080         j = (data & 0xff000000) >> 24;
8181         data <<= 8;
82//         printf("%c",j); // this prints 'OFF' to the console.
82//          printf("%c",j); // this prints 'OFF' to the console.
8383         logerror("debug1=%02x %c\n",j,j);
8484      }
85//      printf("\n");
85//      printf("\n");
8686   }
8787}
8888
trunk/src/mess/drivers/ami1200.c
r18326r18327
326326   MCFG_FLOPPY_DRIVE_ADD("fd1", amiga_floppies, 0,      0, amiga_fdc::floppy_formats)
327327   MCFG_FLOPPY_DRIVE_ADD("fd2", amiga_floppies, 0,      0, amiga_fdc::floppy_formats)
328328   MCFG_FLOPPY_DRIVE_ADD("fd3", amiga_floppies, 0,      0, amiga_fdc::floppy_formats)
329   
329
330330   MCFG_AMIGA_KEYBOARD_ADD("kbd")
331331MACHINE_CONFIG_END
332332
trunk/src/mess/drivers/korgm1.c
r18326r18327
11/***************************************************************************
22
3   Korg M1 (c) 1988
3    Korg M1 (c) 1988
44
5   skeleton driver
5    skeleton driver
66
7   Note: driver isn't yet hooked up to mess.lst / mess.mak, until a ROM
8   dump is found.
7    Note: driver isn't yet hooked up to mess.lst / mess.mak, until a ROM
8    dump is found.
99
1010***************************************************************************/
1111
r18326r18327
5151
5252static ADDRESS_MAP_START( korgm1_map, AS_PROGRAM, 16, korgm1_state )
5353   AM_RANGE(0x00000, 0x0ffff) AM_RAM // 64 KB
54//   AM_RANGE(0x50000, 0x57fff) AM_RAM // memory card 32 KB
54//  AM_RANGE(0x50000, 0x57fff) AM_RAM // memory card 32 KB
5555   AM_RANGE(0xe0000, 0xfffff) AM_ROM AM_REGION("ipl", 0)
5656ADDRESS_MAP_END
5757
5858static ADDRESS_MAP_START( korgm1_io, AS_IO, 16, korgm1_state )
59//   AM_RANGE(0x0000, 0x00ff) internal peripheral (?)
60//   AM_RANGE(0x0100, 0x01ff) VDF 1 (MB87404)
61//   AM_RANGE(0x0200, 0x02ff) VDF 2 (MB87404)
62//   AM_RANGE(0x0500, 0x0503) MDE (MB87405)
63//   AM_RANGE(0x0600, 0x0601) OPZ 1 (8-bit port)
64//   AM_RANGE(0x0700, 0x0701) OPZ 2 (8-bit port)
65//   AM_RANGE(0x0800, 0x0801) SCAN (8-bit port) (keyboard)
66//   AM_RANGE(0x0900, 0x09??) A/D Converter (M58990P, Joystick, "value" and After Touch routes here) **
67//   AM_RANGE(0x0a00, 0x0a03) PPI (CXD1095, presumably i8255 compatible, LCD, LED and SW routes here) *
68//   AM_RANGE(0x0b00, 0x0b01) LCDC (8-bit port)
69//   AM_RANGE(0x1000, 0x11ff) TG (MB87402)
70//   AM_RANGE(0x2000, 0x23ff) SCSI
71//   AM_RANGE(0x3000, 0x33ff) FDC
59//  AM_RANGE(0x0000, 0x00ff) internal peripheral (?)
60//  AM_RANGE(0x0100, 0x01ff) VDF 1 (MB87404)
61//  AM_RANGE(0x0200, 0x02ff) VDF 2 (MB87404)
62//  AM_RANGE(0x0500, 0x0503) MDE (MB87405)
63//  AM_RANGE(0x0600, 0x0601) OPZ 1 (8-bit port)
64//  AM_RANGE(0x0700, 0x0701) OPZ 2 (8-bit port)
65//  AM_RANGE(0x0800, 0x0801) SCAN (8-bit port) (keyboard)
66//  AM_RANGE(0x0900, 0x09??) A/D Converter (M58990P, Joystick, "value" and After Touch routes here) **
67//  AM_RANGE(0x0a00, 0x0a03) PPI (CXD1095, presumably i8255 compatible, LCD, LED and SW routes here) *
68//  AM_RANGE(0x0b00, 0x0b01) LCDC (8-bit port)
69//  AM_RANGE(0x1000, 0x11ff) TG (MB87402)
70//  AM_RANGE(0x2000, 0x23ff) SCSI
71//  AM_RANGE(0x3000, 0x33ff) FDC
7272//  TG 2?
7373ADDRESS_MAP_END
7474
r18326r18327
145145#endif
146146
147147static GFXDECODE_START( korgm1 )
148//   GFXDECODE_ENTRY( "gfx1", 0, charlayout,     0, 1 )
148//  GFXDECODE_ENTRY( "gfx1", 0, charlayout,     0, 1 )
149149GFXDECODE_END
150150
151151
r18326r18327
202202   ROM_REGION( 0x200000, "pcm", ROMREGION_ERASE00 )
203203   ROM_LOAD( "pcm.rom", 0x00000, 0x200000, NO_DUMP )
204204
205//   ROM_REGION( 0x10000, "gfx1", ROMREGION_ERASE00 )
205//  ROM_REGION( 0x10000, "gfx1", ROMREGION_ERASE00 )
206206ROM_END
207207
208208GAME( 1988, korgm1,  0,   korgm1,  korgm1,  0,       ROT0, "Korg",      "M1", GAME_IS_SKELETON )
trunk/src/mess/drivers/pc8801.c
r18326r18327
23482348/*
23492349TIMER_DEVICE_CALLBACK_MEMBER(pc8801_state::pc8801_rtc_irq)
23502350{
2351   if(m_timer_irq_mask)
2352      pc8801_raise_irq(machine(),1<<(2),1);
2351    if(m_timer_irq_mask)
2352        pc8801_raise_irq(machine(),1<<(2),1);
23532353}
23542354*/
23552355
trunk/src/mess/drivers/cbm2.c
r18326r18327
22
33    TODO:
44
5   - CIA timers fail in burn-in test
6   - NTSC variants unable to load from disk
7   - shift lock
8   - Hungarian keyboard
9   - cbm620hu charom banking?
10   - read VIC video/color RAM thru PLA (Sphi2 = 1, AE = 0)
11   - user port
12   - co-processor bus
13   - 8088 co-processor board
5    - CIA timers fail in burn-in test
6    - NTSC variants unable to load from disk
7    - shift lock
8    - Hungarian keyboard
9    - cbm620hu charom banking?
10    - read VIC video/color RAM thru PLA (Sphi2 = 1, AE = 0)
11    - user port
12    - co-processor bus
13    - 8088 co-processor board
1414
1515*/
1616
r18326r18327
4545//  read_pla - low profile PLA read
4646//-------------------------------------------------
4747
48void cbm2_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
48void cbm2_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
4949   int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4)
5050{
5151   UINT32 input = P0 << 15 | P1 << 14 | P2 << 13 | P3 << 12 | busy2 << 11 | eras << 10 | ecas << 9 | refen << 8 | cas << 7 | ras << 6;
r18326r18327
6666//  read_pla - high profile PLA read
6767//-------------------------------------------------
6868
69void cbm2hp_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
69void cbm2hp_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
7070   int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4)
7171{
7272   UINT32 input = ras << 13 | cas << 12 | refen << 11 | eras << 10 | ecas << 9 | busy2 << 8 | P3 << 3 | P2 << 2 | P1 << 1 | P0;
r18326r18327
8888//-------------------------------------------------
8989
9090void cbm2_state::bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen,
91   int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs,
91   int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs,
9292   int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs,
9393   int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs)
9494{
r18326r18327
333333{
334334   UINT32 input = P0 << 15 | P2 << 14 | bras << 13 | P1 << 12 | P3 << 11 | busy2 << 10 | m_statvid << 9 | sphi2 << 8 |
335335         clrnibcsb << 7 | m_dramon << 6 | procvid << 5 | refen << 4 | m_vicdotsel << 3 | ba << 2 | aec << 1 | srw;
336   
336
337337   UINT32 data = m_pla1->read(input);
338338
339339   *datxen = BIT(data, 0);
r18326r18327
356356{
357357   UINT32 input = VA12 << 15 | ba << 14 | A13 << 13 | A15 << 12 | A14 << 11 | A11 << 10 | A10 << 9 | A12 << 8 |
358358         sphi2 << 7 | vicen << 6 | m_statvid << 5 | m_vicdotsel << 4 | ae << 3 | segf << 2 | bcas << 1 | bank0;
359   
359
360360   UINT32 data = m_pla2->read(input);
361361
362362   *clrnibcsb = BIT(data, 0);
r18326r18327
385385
386386   int clrnibcsb = 1, procvid = 1, segf = 1;
387387
388   read_pla1(offset, bras, busy2, sphi2, clrnibcsb, procvid, refen, ba, *aec, srw,
388   read_pla1(offset, bras, busy2, sphi2, clrnibcsb, procvid, refen, ba, *aec, srw,
389389      datxen, dramxen, clrniben, &segf, _64kcasen, casenb, viddaten, viddat_tr);
390390
391391   int bank0 = 1, vicen = 1;
r18326r18327
429429   *clrnibcs = clrnibcsb || bcas;
430430   *vidmatcs = vidmatcsb || bcas;
431431
432   read_pla1(offset, bras, busy2, sphi2, clrnibcsb, procvid, refen, ba, *aec, srw,
432   read_pla1(offset, bras, busy2, sphi2, clrnibcsb, procvid, refen, ba, *aec, srw,
433433      datxen, dramxen, clrniben, &segf, _64kcasen, casenb, viddaten, viddat_tr);
434434}
435435
r18326r18327
441441UINT8 p500_state::read_memory(address_space &space, offs_t offset, offs_t va, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas, UINT8 *clrnib)
442442{
443443   int srw = 1, busy2 = 1, refen = 0;
444   
444
445445   int datxen = 1, dramxen = 1, clrniben = 1, _64kcasen = 1, casenb = 1, viddaten = 1, viddat_tr = 1;
446446   int clrnibcs = 1, extbufcs = 1, discromcs = 1, buframcs = 1, charomcs = 1, viccs = 1, vidmatcs = 1;
447447   int csbank1 = 1, csbank2 = 1, csbank3 = 1, basiclocs = 1, basichics = 1, kernalcs = 1;
r18326r18327
476476         data = m_charom[va & 0xfff];
477477      }
478478   }
479   
479
480480   if (clrniben)
481481   {
482482      if (!clrnibcs && !vsysaden)
r18326r18327
564564{
565565   int srw = 0, busy2 = 1, refen = 0;
566566   offs_t va = 0xffff;
567   
567
568568   int datxen = 1, dramxen = 1, clrniben = 1, _64kcasen = 1, casenb = 1, viddaten = 1, viddat_tr = 1;
569569   int clrnibcs = 1, extbufcs = 1, discromcs = 1, buframcs = 1, charomcs = 1, viccs = 1, vidmatcs = 1;
570570   int csbank1 = 1, csbank2 = 1, csbank3 = 1, basiclocs = 1, basichics = 1, kernalcs = 1;
r18326r18327
675675READ8_MEMBER( p500_state::vic_videoram_r )
676676{
677677   /*
678   int sphi0 = 0, sphi1 = 1, sphi2 = 0, ba = 1, ae = 0, bras = 0, bcas = 0;
679   offs_t va = offset;
678    int sphi0 = 0, sphi1 = 1, sphi2 = 0, ba = 1, ae = 0, bras = 0, bcas = 0;
679    offs_t va = offset;
680680
681   return read_memory(space, 0, va, sphi0, sphi1, sphi2, ba, ae, bras, bcas);
682   */
681    return read_memory(space, 0, va, sphi0, sphi1, sphi2, ba, ae, bras, bcas);
682    */
683683   /*
684   int ba = 1, ae = 0, bras = 1, bcas = 0;
685   UINT8 clrnib = 0xf;
684    int ba = 1, ae = 0, bras = 1, bcas = 0;
685    UINT8 clrnib = 0xf;
686686
687    if (offset < 0x1000)
688    {
689        return read_memory(space, 0, offset, 0, 1, 0, ba, ae, bras, bcas, &clrnib);
690    }
691    else
692    {
693        return read_memory(space, 0, offset, 1, 0, 1, ba, ae, bras, bcas, &clrnib);
694    }
695    */
696
687697   if (offset < 0x1000)
688698   {
689      return read_memory(space, 0, offset, 0, 1, 0, ba, ae, bras, bcas, &clrnib);
690   }
691   else
692   {
693      return read_memory(space, 0, offset, 1, 0, 1, ba, ae, bras, bcas, &clrnib);
694   }
695   */
696   
697   if (offset < 0x1000)
698   {
699699      return m_charom[offset & 0xfff];
700700   }
701701   else
r18326r18327
961961      {
962962         int color = BIT(data, 7) ^ BIT(code, 7) ^ BIT(ma, 13);
963963         if (cursor_x == column) color ^= 1;
964         
964
965965         bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[color];
966966
967967         data <<= 1;
r18326r18327
10001000      {
10011001         int color = BIT(data, 7) ^ BIT(code, 7) ^ BIT(ma, 13);
10021002         if (cursor_x == column) color ^= 1;
1003         
1003
10041004         bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[color];
10051005
10061006         data <<= 1;
r18326r18327
11061106READ8_MEMBER( cbm2_state::tpi1_pa_r )
11071107{
11081108   /*
1109   
1110       bit     description
1111   
1112       0       0
1113       1       0
1114       2       REN
1115       3       ATN
1116       4       DAV
1117       5       EOI
1118       6       NDAC
1119       7       NRFD
1120   
1121   */
11221109
1110        bit     description
1111
1112        0       0
1113        1       0
1114        2       REN
1115        3       ATN
1116        4       DAV
1117        5       EOI
1118        6       NDAC
1119        7       NRFD
1120
1121    */
1122
11231123   UINT8 data = 0;
11241124
11251125   // IEEE-488
r18326r18327
11361136WRITE8_MEMBER( cbm2_state::tpi1_pa_w )
11371137{
11381138   /*
1139   
1140       bit     description
1141   
1142       0       75161A DC
1143       1       75161A TE
1144       2       REN
1145       3       ATN
1146       4       DAV
1147       5       EOI
1148       6       NDAC
1149       7       NRFD
1150   
1151   */
11521139
1140        bit     description
1141
1142        0       75161A DC
1143        1       75161A TE
1144        2       REN
1145        3       ATN
1146        4       DAV
1147        5       EOI
1148        6       NDAC
1149        7       NRFD
1150
1151    */
1152
11531153   // IEEE-488
11541154   m_ieee2->dc_w(BIT(data, 0));
11551155
r18326r18327
11671167READ8_MEMBER( cbm2_state::tpi1_pb_r )
11681168{
11691169   /*
1170   
1171       bit     description
1172   
1173       0       IFC
1174       1       SRQ
1175       2       user port PB2
1176       3       user port PB3
1177       4       
1178       5       
1179       6       
1180       7       CASS SW
1181   
1182   */
11831170
1171        bit     description
1172
1173        0       IFC
1174        1       SRQ
1175        2       user port PB2
1176        3       user port PB3
1177        4
1178        5
1179        6
1180        7       CASS SW
1181
1182    */
1183
11841184   UINT8 data = 0;
11851185
11861186   // IEEE-488
11871187   data |= m_ieee2->ifc_r();
11881188   data |= m_ieee2->srq_r() << 1;
1189   
1189
11901190   // user port
11911191   //data |= m_user->pb2_r() << 2;
11921192   //data |= m_user->pb3_r() << 3;
r18326r18327
12001200WRITE8_MEMBER( cbm2_state::tpi1_pb_w )
12011201{
12021202   /*
1203   
1204       bit     description
1205   
1206       0       IFC
1207       1       SRQ
1208       2       user port PB2
1209       3       user port PB3
1210       4       DRAMON
1211       5       CASS WRT
1212       6       CASS MTR
1213       7       
1214   
1215   */
12161203
1204        bit     description
1205
1206        0       IFC
1207        1       SRQ
1208        2       user port PB2
1209        3       user port PB3
1210        4       DRAMON
1211        5       CASS WRT
1212        6       CASS MTR
1213        7
1214
1215    */
1216
12171217   // IEEE-488
1218      m_ieee2->ifc_w(BIT(data, 0));
1219      m_ieee2->srq_w(BIT(data, 1));
1218   m_ieee2->ifc_w(BIT(data, 0));
1219   m_ieee2->srq_w(BIT(data, 1));
12201220
12211221   // user port
12221222   //m_user->pb2_w(BIT(data, 2));
r18326r18327
13131313READ8_MEMBER( cbm2_state::tpi2_pc_r )
13141314{
13151315   /*
1316   
1317       bit     description
1318   
1319       0       COLUMN 0
1320       1       COLUMN 1
1321       2       COLUMN 2
1322       3       COLUMN 3
1323       4       COLUMN 4
1324       5       COLUMN 5
1325       6       0=PAL, 1=NTSC
1326       7       0
1327   
1328   */
13291316
1317        bit     description
1318
1319        0       COLUMN 0
1320        1       COLUMN 1
1321        2       COLUMN 2
1322        3       COLUMN 3
1323        4       COLUMN 4
1324        5       COLUMN 5
1325        6       0=PAL, 1=NTSC
1326        7       0
1327
1328    */
1329
13301330   return (m_ntsc << 6) | (read_keyboard() & 0x3f);
13311331}
13321332
13331333READ8_MEMBER( cbm2hp_state::tpi2_pc_r )
13341334{
13351335   /*
1336   
1337       bit     description
1338   
1339       0       COLUMN 0
1340       1       COLUMN 1
1341       2       COLUMN 2
1342       3       COLUMN 3
1343       4       COLUMN 4
1344       5       COLUMN 5
1345       6       1
1346       7       1
1347   
1348   */
13491336
1337        bit     description
1338
1339        0       COLUMN 0
1340        1       COLUMN 1
1341        2       COLUMN 2
1342        3       COLUMN 3
1343        4       COLUMN 4
1344        5       COLUMN 5
1345        6       1
1346        7       1
1347
1348    */
1349
13501350   return read_keyboard();
13511351}
13521352
13531353READ8_MEMBER( p500_state::tpi2_pc_r )
13541354{
13551355   /*
1356   
1357       bit     description
1358   
1359       0       COLUMN 0
1360       1       COLUMN 1
1361       2       COLUMN 2
1362       3       COLUMN 3
1363       4       COLUMN 4
1364       5       COLUMN 5
1365       6       0
1366       7       0
1367   
1368   */
13691356
1357        bit     description
1358
1359        0       COLUMN 0
1360        1       COLUMN 1
1361        2       COLUMN 2
1362        3       COLUMN 3
1363        4       COLUMN 4
1364        5       COLUMN 5
1365        6       0
1366        7       0
1367
1368    */
1369
13701370   return read_keyboard();
13711371}
13721372
13731373WRITE8_MEMBER( p500_state::tpi2_pc_w )
13741374{
13751375   /*
1376   
1377       bit     description
1378   
1379       0       
1380       1       
1381       2       
1382       3       
1383       4       
1384       5       
1385       6       VICBNKSEL0
1386       7       VICBNKSEL1
1387   
1388   */
13891376
1377        bit     description
1378
1379        0
1380        1
1381        2
1382        3
1383        4
1384        5
1385        6       VICBNKSEL0
1386        7       VICBNKSEL1
1387
1388    */
1389
13901390   m_vicbnksel = data >> 6;
13911391}
13921392
r18326r18327
14371437READ8_MEMBER( cbm2_state::cia_pa_r )
14381438{
14391439   /*
1440   
1441       bit     description
1442   
1443       0       IEEE-488 D0, user port 1D0
1444       1       IEEE-488 D1, user port 1D1
1445       2       IEEE-488 D2, user port 1D2
1446       3       IEEE-488 D3, user port 1D3
1447       4       IEEE-488 D4, user port 1D4
1448       5       IEEE-488 D5, user port 1D5
1449       6       IEEE-488 D6, user port 1D6, LTPN
1450       7       IEEE-488 D7, user port 1D7, GAME TRIGGER 24
1451   
1452   */
14531440
1441        bit     description
1442
1443        0       IEEE-488 D0, user port 1D0
1444        1       IEEE-488 D1, user port 1D1
1445        2       IEEE-488 D2, user port 1D2
1446        3       IEEE-488 D3, user port 1D3
1447        4       IEEE-488 D4, user port 1D4
1448        5       IEEE-488 D5, user port 1D5
1449        6       IEEE-488 D6, user port 1D6, LTPN
1450        7       IEEE-488 D7, user port 1D7, GAME TRIGGER 24
1451
1452    */
1453
14541454   UINT8 data = 0;
14551455
14561456   // IEEE-488
r18326r18327
14691469WRITE8_MEMBER( cbm2_state::cia_pa_w )
14701470{
14711471   /*
1472   
1473       bit     description
1474   
1475       0       IEEE-488 D0, user port 1D0
1476       1       IEEE-488 D1, user port 1D1
1477       2       IEEE-488 D2, user port 1D2
1478       3       IEEE-488 D3, user port 1D3
1479       4       IEEE-488 D4, user port 1D4
1480       5       IEEE-488 D5, user port 1D5
1481       6       IEEE-488 D6, user port 1D6
1482       7       IEEE-488 D7, user port 1D7
1483   
1484   */
14851472
1473        bit     description
1474
1475        0       IEEE-488 D0, user port 1D0
1476        1       IEEE-488 D1, user port 1D1
1477        2       IEEE-488 D2, user port 1D2
1478        3       IEEE-488 D3, user port 1D3
1479        4       IEEE-488 D4, user port 1D4
1480        5       IEEE-488 D5, user port 1D5
1481        6       IEEE-488 D6, user port 1D6
1482        7       IEEE-488 D7, user port 1D7
1483
1484    */
1485
14861486   // IEEE-488
14871487   m_ieee1->write(space, 0, data);
14881488
r18326r18327
14961496READ8_MEMBER( cbm2_state::cia_pb_r )
14971497{
14981498   /*
1499   
1500       bit     description
1501   
1502       0       user port 2D0, GAME10
1503       1       user port 2D1, GAME11
1504       2       user port 2D2, GAME12
1505       3       user port 2D3, GAME13
1506       4       user port 2D4, GAME20
1507       5       user port 2D5, GAME21
1508       6       user port 2D6, GAME22
1509       7       user port 2D7, GAME23
1510   
1511   */
15121499
1500        bit     description
1501
1502        0       user port 2D0, GAME10
1503        1       user port 2D1, GAME11
1504        2       user port 2D2, GAME12
1505        3       user port 2D3, GAME13
1506        4       user port 2D4, GAME20
1507        5       user port 2D5, GAME21
1508        6       user port 2D6, GAME22
1509        7       user port 2D7, GAME23
1510
1511    */
1512
15131513   UINT8 data = 0;
15141514
15151515   // joystick
r18326r18327
15251525WRITE8_MEMBER( cbm2_state::cia_pb_w )
15261526{
15271527   /*
1528   
1529       bit     description
1530   
1531       0       user port 2D0
1532       1       user port 2D1
1533       2       user port 2D2
1534       3       user port 2D3
1535       4       user port 2D4
1536       5       user port 2D5
1537       6       user port 2D6
1538       7       user port 2D7
1539   
1540   */
15411528
1529        bit     description
1530
1531        0       user port 2D0
1532        1       user port 2D1
1533        2       user port 2D2
1534        3       user port 2D3
1535        4       user port 2D4
1536        5       user port 2D5
1537        6       user port 2D6
1538        7       user port 2D7
1539
1540    */
1541
15421542   //m_user->data2_w(data);
15431543}
15441544
trunk/src/mess/drivers/vic10.c
r18326r18327
254254READ8_MEMBER( vic10_state::sid_potx_r )
255255{
256256   UINT8 cia_pa = m_cia->pa_r();
257   
257
258258   int sela = BIT(cia_pa, 6);
259259   int selb = BIT(cia_pa, 7);
260260
r18326r18327
269269READ8_MEMBER( vic10_state::sid_poty_r )
270270{
271271   UINT8 cia_pa = m_cia->pa_r();
272   
272
273273   int sela = BIT(cia_pa, 6);
274274   int selb = BIT(cia_pa, 7);
275275
trunk/src/mess/drivers/c128.c
r18326r18327
969969READ8_MEMBER( c128_state::sid_potx_r )
970970{
971971   UINT8 cia1_pa = m_cia1->pa_r();
972   
972
973973   int sela = BIT(cia1_pa, 6);
974974   int selb = BIT(cia1_pa, 7);
975975
r18326r18327
984984READ8_MEMBER( c128_state::sid_poty_r )
985985{
986986   UINT8 cia1_pa = m_cia1->pa_r();
987   
987
988988   int sela = BIT(cia1_pa, 6);
989989   int selb = BIT(cia1_pa, 7);
990990
trunk/src/mess/drivers/d6800.c
r18326r18327
7878   UINT8 m_portb;
7979   virtual void machine_start();
8080   virtual void machine_reset();
81public:   
81public:
8282   UINT32 screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8383   TIMER_DEVICE_CALLBACK_MEMBER(d6800_p);
8484};
trunk/src/mess/drivers/ti99_4p.c
r18326r18327
9696   virtual void machine_start();
9797   DECLARE_MACHINE_RESET(ti99_4p);
9898   TIMER_DEVICE_CALLBACK_MEMBER(sgcpu_hblank_interrupt);
99   
99
100100   void set_tms9901_INT2_from_v9938(v99x8_device &vdp, int state);
101101
102102   tms9900_device*         m_cpu;
trunk/src/mess/drivers/ti99_4x.c
r18326r18327
8888
8989   DECLARE_INPUT_CHANGED_MEMBER( load_interrupt );
9090   TIMER_DEVICE_CALLBACK_MEMBER(ti99_4ev_hblank_interrupt);
91   
91
9292   // Some values to keep
9393   tms9900_device*      m_cpu;
9494   tms9901_device*      m_tms9901;
trunk/src/mess/drivers/elwro800.c
r18326r18327
4949   DECLARE_WRITE8_MEMBER(elwro800jr_fdc_control_w);
5050   DECLARE_READ8_MEMBER(elwro800jr_io_r);
5151   DECLARE_WRITE8_MEMBER(elwro800jr_io_w);
52   DECLARE_MACHINE_RESET(elwro800);   
52   DECLARE_MACHINE_RESET(elwro800);
5353   INTERRUPT_GEN_MEMBER(elwro800jr_interrupt);
5454   DECLARE_READ8_MEMBER(i8255_port_c_r);
5555   DECLARE_WRITE8_MEMBER(i8255_port_c_w);
trunk/src/mess/drivers/a2600.c
r18326r18327
4747   a2600_state(const machine_config &mconfig, device_type type, const char *tag)
4848      : driver_device(mconfig, type, tag)
4949      , m_riot_ram(*this, "riot_ram")
50//      , m_joy1(*this, CONTROL1_TAG)
51//      , m_joy2(*this, CONTROL2_TAG)
50//      , m_joy1(*this, CONTROL1_TAG)
51//      , m_joy2(*this, CONTROL2_TAG)
5252      { }
5353
5454   dpc_t m_dpc;
r18326r18327
128128   DECLARE_READ8_MEMBER(riot_input_port_8_r);
129129
130130protected:
131//   required_device<vcs_control_port_device> m_joy1;
132//   required_device<vcs_control_port_device> m_joy2;
131//  required_device<vcs_control_port_device> m_joy1;
132//  required_device<vcs_control_port_device> m_joy2;
133133   int next_bank();
134134   void modeF8_switch(UINT16 offset, UINT8 data);
135135   void modeFA_switch(UINT16 offset, UINT8 data);
r18326r18327
12761276   case 0x00:  /* Joystick */
12771277   case 0x05:   /* Joystick w/Boostergrip */
12781278      val |= machine().root_device().ioport("SWA_JOY")->read() & 0xF0;
1279//      val |= ( m_joy1->joy_r() & 0x0F ) << 4;
1279//      val |= ( m_joy1->joy_r() & 0x0F ) << 4;
12801280      break;
12811281   case 0x01:  /* Paddle */
12821282      val |= machine().root_device().ioport("SWA_PAD")->read() & 0xF0;
r18326r18327
23152315   /* devices */
23162316   MCFG_RIOT6532_ADD("riot", MASTER_CLOCK_NTSC / 3, r6532_interface)
23172317
2318//   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
2319//   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
2318//  MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
2319//  MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
23202320
23212321   MCFG_FRAGMENT_ADD(a2600_cartslot)
23222322   MCFG_SOFTWARE_LIST_FILTER("cart_list", "NTSC")
r18326r18327
23512351   /* devices */
23522352   MCFG_RIOT6532_ADD("riot", MASTER_CLOCK_PAL / 3, r6532_interface)
23532353
2354//   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
2355//   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
2354//  MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
2355//  MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
23562356
23572357   MCFG_FRAGMENT_ADD(a2600_cartslot)
23582358   MCFG_SOFTWARE_LIST_FILTER("cart_list", "PAL")
trunk/src/mess/drivers/xor100.c
r18326r18327
482482   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),   /* interrupt handler */
483483   DEVCB_DRIVER_LINE_MEMBER(xor100_state,ctc_z0_w),         /* ZC/TO0 callback */
484484   DEVCB_DRIVER_LINE_MEMBER(xor100_state,ctc_z1_w),         /* ZC/TO1 callback */
485   DEVCB_DRIVER_LINE_MEMBER(xor100_state,ctc_z2_w)          /* ZC/TO2 callback */
485   DEVCB_DRIVER_LINE_MEMBER(xor100_state,ctc_z2_w)       /* ZC/TO2 callback */
486486};
487487
488488/* WD1795-02 Interface */
trunk/src/mess/drivers/bml3.c
r18326r18327
111111   virtual void machine_start();
112112   virtual void video_start();
113113   virtual void palette_init();
114public:   
114public:
115115   UINT32 screen_update_bml3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
116116   INTERRUPT_GEN_MEMBER(bml3_irq);
117117   INTERRUPT_GEN_MEMBER(bml3_timer_firq);
r18326r18327
893893   MCFG_CPU_ADD("maincpu",M6809, XTAL_1MHz)
894894   MCFG_CPU_PROGRAM_MAP(bml3_mem)
895895   MCFG_CPU_VBLANK_INT_DRIVER("screen", bml3_state,  bml3_timer_firq)
896//   MCFG_CPU_PERIODIC_INT_DRIVER(bml3_state, bml3_firq, 45)
896//  MCFG_CPU_PERIODIC_INT_DRIVER(bml3_state, bml3_firq, 45)
897897
898898//  MCFG_MACHINE_RESET_OVERRIDE(bml3_state,bml3)
899899
trunk/src/mess/drivers/rainbow.c
r18326r18327
130130
131131    void update_kbd_irq();
132132   virtual void machine_reset();
133public:   
133public:
134134   UINT32 screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
135135   INTERRUPT_GEN_MEMBER(vblank_irq);
136136   TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
trunk/src/mess/drivers/amiga.c
r18326r18327
424424   MCFG_FLOPPY_DRIVE_ADD("fd1", amiga_floppies, 0,      0, amiga_fdc::floppy_formats)
425425   MCFG_FLOPPY_DRIVE_ADD("fd2", amiga_floppies, 0,      0, amiga_fdc::floppy_formats)
426426   MCFG_FLOPPY_DRIVE_ADD("fd3", amiga_floppies, 0,      0, amiga_fdc::floppy_formats)
427   
427
428428   MCFG_AMIGA_KEYBOARD_ADD("kbd")
429429MACHINE_CONFIG_END
430430
trunk/src/mame/drivers/pcat_nit.c
r18326r18327
212212   AM_RANGE(0x0280, 0x0283) AM_READNOP
213213   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
214214   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
215   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
215   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
216216   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ns16450_0", ns16450_device, ins8250_r, ins8250_w, 0xffffffff)
217217ADDRESS_MAP_END
218218
trunk/src/mame/drivers/kontest.c
r18326r18327
5353
5454   virtual void video_start();
5555   virtual void palette_init();
56public:   
56public:
5757   INTERRUPT_GEN_MEMBER(kontest_interrupt);
5858};
5959
trunk/src/mame/drivers/magtouch.c
r18326r18327
181181   AM_RANGE(0x02e0, 0x02e7) AM_READWRITE8(magtouch_io_r, magtouch_io_w, 0xffffffff)
182182   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
183183   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
184   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
184   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
185185   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ns16450_0", ns16450_device, ins8250_r, ins8250_w, 0xffffffff)
186186ADDRESS_MAP_END
187187
trunk/src/mame/drivers/techno.c
r18326r18327
4949private:
5050   bool m_digwait;
5151   UINT8 m_keyrow;
52public:   
52public:
5353   INTERRUPT_GEN_MEMBER(techno_intgen);
5454};
5555
trunk/src/mame/drivers/pangofun.c
r18326r18327
125125   AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff)
126126   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
127127   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
128   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
128   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
129129ADDRESS_MAP_END
130130
131131#define AT_KEYB_HELPER(bit, text, key1) \
trunk/src/mame/drivers/firebeat.c
r18326r18327
217217   DECLARE_WRITE32_MEMBER(lamp_output3_ppp_w);
218218   DECLARE_READ32_MEMBER(ppc_spu_share_r);
219219   DECLARE_WRITE32_MEMBER(ppc_spu_share_w);
220   DECLARE_READ16_MEMBER(spu_unk_r);   
220   DECLARE_READ16_MEMBER(spu_unk_r);
221221   TIMER_CALLBACK_MEMBER(keyboard_timer_callback);
222222};
223223
trunk/src/mame/drivers/cps1.c
r18326r18327
30633063
30643064   /* video hardware */
30653065   MCFG_SCREEN_ADD("screen", RASTER)
3066//   MCFG_SCREEN_REFRESH_RATE(59.61) /* verified on one of the input gates of the 74ls08@4J on GNG romboard 88620-b-2 */
3067//   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
3068//   MCFG_SCREEN_SIZE(64*8, 32*8)
3069//   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
3066//  MCFG_SCREEN_REFRESH_RATE(59.61) /* verified on one of the input gates of the 74ls08@4J on GNG romboard 88620-b-2 */
3067//  MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
3068//  MCFG_SCREEN_SIZE(64*8, 32*8)
3069//  MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
30703070   MCFG_SCREEN_RAW_PARAMS(XTAL_16MHz/2, 518, 64, 448, 259, 16, 240) /* guess: assume that CPS-1 uses the same exact timings as CPS-2 */
30713071   MCFG_SCREEN_UPDATE_DRIVER(cps_state, screen_update_cps1)
30723072   MCFG_SCREEN_VBLANK_DRIVER(cps_state, screen_eof_cps1)
trunk/src/mame/drivers/su2000.c
r18326r18327
102102   AM_IMPORT_FROM(pcat32_io_common)
103103   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
104104   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
105   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
105   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
106106ADDRESS_MAP_END
107107
108108
trunk/src/mame/drivers/blackt96.c
r18326r18327
362362   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )
363363   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
364364   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
365   
365
366366#if 0
367367   PORT_START("IN2")
368368   PORT_DIPNAME( 0x0001, 0x0001, "2" )
trunk/src/mame/drivers/magictg.c
r18326r18327
212212   virtual void machine_start();
213213   virtual void machine_reset();
214214   virtual void video_start();
215public:   
215public:
216216   UINT32 screen_update_magictg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
217217};
218218
trunk/src/mame/drivers/taitowlf.c
r18326r18327
489489   #if ENABLE_VGA
490490   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
491491   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
492   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
492   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
493493   #endif
494494   AM_RANGE(0x03f0, 0x03ff) AM_READWRITE(fdc_r, fdc_w)
495495   AM_RANGE(0x0a78, 0x0a7b) AM_WRITE(pnp_data_w)
trunk/src/mame/drivers/pntnpuzl.c
r18326r18327
311311   AM_RANGE(0x28001a, 0x28001b) AM_WRITENOP
312312
313313   /* standard VGA */
314   AM_RANGE(0x3a0000, 0x3bffff) AM_DEVREADWRITE8("vga", vga_device, mem_r, mem_w, 0xffff)   
314   AM_RANGE(0x3a0000, 0x3bffff) AM_DEVREADWRITE8("vga", vga_device, mem_r, mem_w, 0xffff)
315315   AM_RANGE(0x3c03b0, 0x3c03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffff)
316316   AM_RANGE(0x3c03c0, 0x3c03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffff)
317   AM_RANGE(0x3c03d0, 0x3c03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffff)   
317   AM_RANGE(0x3c03d0, 0x3c03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffff)
318318
319319   AM_RANGE(0x400000, 0x407fff) AM_RAM
320320ADDRESS_MAP_END
trunk/src/mame/drivers/spectra.c
r18326r18327
212212
213213static const sn76477_interface sn76477_intf =
214214{
215   RES_M(1000),   /*   4  noise_res      */
216   RES_M(1000),   /*   5  filter_res      */
217   CAP_N(0),   /*   6  filter_cap      */
218   RES_K(470),   /*   7  decay_res      */
219   CAP_N(1),   /*   8  attack_decay_cap */
220   RES_K(22),   /* 10  attack_res      */
221   RES_K(100),   /* 11  amplitude_res   */
222   RES_K(52),   /* 12  feedback_res    */
223   5.0,   /* 16  vco_voltage      */
224   CAP_U(0.01),   /* 17  vco_cap         */
225   RES_K(390),   /* 18  vco_res         */
226   0.0,  /* 19  pitch_voltage   */
227   RES_M(1),   /* 20  slf_res         */
228   CAP_U(0.1),   /* 21  slf_cap         */
229   CAP_U(0.47),   /* 23  oneshot_cap      */
230   RES_K(470),      /* 24  oneshot_res   */
215   RES_M(1000),   /*  4  noise_res        */
216   RES_M(1000),   /*  5  filter_res       */
217   CAP_N(0),   /*  6  filter_cap       */
218   RES_K(470),   /*  7  decay_res        */
219   CAP_N(1),   /*  8  attack_decay_cap */
220   RES_K(22),   /* 10  attack_res       */
221   RES_K(100),   /* 11  amplitude_res    */
222   RES_K(52),   /* 12  feedback_res     */
223   5.0,   /* 16  vco_voltage      */
224   CAP_U(0.01),   /* 17  vco_cap          */
225   RES_K(390),   /* 18  vco_res          */
226   0.0,  /* 19  pitch_voltage  */
227   RES_M(1),   /* 20  slf_res          */
228   CAP_U(0.1),   /* 21  slf_cap          */
229   CAP_U(0.47),   /* 23  oneshot_cap      */
230   RES_K(470),      /* 24  oneshot_res  */
231231   0,             /* 22  vco (variable)               */
232232   0,             /* 26  mixer A (grounded)           */
233233   0,             /* 25  mixer B (variable)           */
trunk/src/mame/drivers/raiden2.c
r18326r18327
19241924   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
19251925
19261926   MCFG_SCREEN_ADD("screen", RASTER)
1927//   MCFG_SCREEN_REFRESH_RATE(55.47)    /* verified on pcb */
1927//  MCFG_SCREEN_REFRESH_RATE(55.47)    /* verified on pcb */
19281928   MCFG_SCREEN_RAW_PARAMS(XTAL_32MHz/4,546,0,40*8,264,0,32*8) /* hand-tuned to match ~55.47 */
19291929   MCFG_SCREEN_UPDATE_DRIVER(raiden2_state, screen_update_raiden2)
19301930   MCFG_GFXDECODE(raiden2)
trunk/src/mame/drivers/gammagic.c
r18326r18327
15151 Motherboard MICRONICS M55Hi-Plus PCI/ISA, Chipset INTEL i430HX (TRITON II), 64 MB Ram (4 SIMM M x 16 MB SIMM)
1616On board Sound Blaster Vibra 16C chipset.
17171 TOSHIBA CD-ROM or DVD-ROM Drive w/Bootable CD-ROM with Game.
181 OAK SVGA PCI Video Board.
181 OAK SVGA PCI Video Board.
19191 Voodoo Graphics PCI Video Board, connected to the monitor.
20201 21" SVGA Color Monitor, 16x9 Aspect, Vertical mount, with touchscreen.
21211 Bally's IO-Board, Based on 68000 procesor as interface to all gaming devices
r18326r18327
8888   device_t   *m_pic8259_2;
8989   device_t   *m_dma8237_1;
9090   device_t   *m_dma8237_2;
91   
91
9292   emu_timer *m_atapi_timer;
9393   //SCSIInstance *m_inserted_cdrom;
9494
r18326r18327
101101   /* memory */
102102   UINT8 m_atapi_regs[ATAPI_REG_MAX];
103103   UINT8 m_atapi_data[ATAPI_DATA_SIZE];
104   
104
105105   DECLARE_DRIVER_INIT(gammagic);
106106};
107107
r18326r18327
221221/*
222222static READ32_HANDLER( atapi_r )
223223{
224   gammagic_state *state = space.machine().driver_data<gammagic_state>();
225   UINT8 *atapi_regs = state->m_atapi_regs;
226   //running_machine &machine = space.machine();
227   int reg, data;
224    gammagic_state *state = space.machine().driver_data<gammagic_state>();
225    UINT8 *atapi_regs = state->m_atapi_regs;
226    //running_machine &machine = space.machine();
227    int reg, data;
228228
229   if (mem_mask == 0x0000ffff)   // word-wide command read
230   {
229    if (mem_mask == 0x0000ffff) // word-wide command read
230    {
231231      logerror("ATAPI: packet read = %04x\n", state->m_atapi_data[state->m_atapi_data_ptr]);
232232
233      // assert IRQ and drop DRQ
234      if (state->m_atapi_data_ptr == 0 && state->m_atapi_data_len == 0)
235      {
236         // get the data from the device
237         if( state->m_atapi_xferlen > 0 )
238         {
239            SCSIReadData( state->m_inserted_cdrom, state->m_atapi_data, state->m_atapi_xferlen );
240            state->m_atapi_data_len = state->m_atapi_xferlen;
241         }
233        // assert IRQ and drop DRQ
234        if (state->m_atapi_data_ptr == 0 && state->m_atapi_data_len == 0)
235        {
236            // get the data from the device
237            if( state->m_atapi_xferlen > 0 )
238            {
239                SCSIReadData( state->m_inserted_cdrom, state->m_atapi_data, state->m_atapi_xferlen );
240                state->m_atapi_data_len = state->m_atapi_xferlen;
241            }
242242
243         if (state->m_atapi_xfermod > MAX_TRANSFER_SIZE)
244         {
245            state->m_atapi_xferlen = MAX_TRANSFER_SIZE;
246            state->m_atapi_xfermod = state->m_atapi_xfermod - MAX_TRANSFER_SIZE;
247         }
248         else
249         {
250            state->m_atapi_xferlen = state->m_atapi_xfermod;
251            state->m_atapi_xfermod = 0;
252         }
243            if (state->m_atapi_xfermod > MAX_TRANSFER_SIZE)
244            {
245                state->m_atapi_xferlen = MAX_TRANSFER_SIZE;
246                state->m_atapi_xfermod = state->m_atapi_xfermod - MAX_TRANSFER_SIZE;
247            }
248            else
249            {
250                state->m_atapi_xferlen = state->m_atapi_xfermod;
251                state->m_atapi_xfermod = 0;
252            }
253253
254         //verboselog\\( machine, 2, "atapi_r: atapi_xferlen=%d\n", state->m_atapi_xferlen );
255         if( state->m_atapi_xferlen != 0 )
256         {
257            atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ | ATAPI_STAT_SERVDSC;
258            atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
259         }
260         else
261         {
262            logerror("ATAPI: dropping DRQ\n");
263            atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
264            atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
265         }
254            //verboselog\\( machine, 2, "atapi_r: atapi_xferlen=%d\n", state->m_atapi_xferlen );
255            if( state->m_atapi_xferlen != 0 )
256            {
257                atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ | ATAPI_STAT_SERVDSC;
258                atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
259            }
260            else
261            {
262                logerror("ATAPI: dropping DRQ\n");
263                atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
264                atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
265            }
266266
267         atapi_regs[ATAPI_REG_COUNTLOW] = state->m_atapi_xferlen & 0xff;
268         atapi_regs[ATAPI_REG_COUNTHIGH] = (state->m_atapi_xferlen>>8)&0xff;
267            atapi_regs[ATAPI_REG_COUNTLOW] = state->m_atapi_xferlen & 0xff;
268            atapi_regs[ATAPI_REG_COUNTHIGH] = (state->m_atapi_xferlen>>8)&0xff;
269269
270         atapi_irq(space.machine(), ASSERT_LINE);
271      }
270            atapi_irq(space.machine(), ASSERT_LINE);
271        }
272272
273      if( state->m_atapi_data_ptr < state->m_atapi_data_len )
274      {
275         data = state->m_atapi_data[state->m_atapi_data_ptr++];
276         data |= ( state->m_atapi_data[state->m_atapi_data_ptr++] << 8 );
277         if( state->m_atapi_data_ptr >= state->m_atapi_data_len )
278         {
279             
280            state->m_atapi_data_ptr = 0;
281            state->m_atapi_data_len = 0;
273        if( state->m_atapi_data_ptr < state->m_atapi_data_len )
274        {
275            data = state->m_atapi_data[state->m_atapi_data_ptr++];
276            data |= ( state->m_atapi_data[state->m_atapi_data_ptr++] << 8 );
277            if( state->m_atapi_data_ptr >= state->m_atapi_data_len )
278            {
282279
283            if( state->m_atapi_xferlen == 0 )
284            {
285               atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
286               atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
287               atapi_irq(space.machine(), ASSERT_LINE);
288            }
289         }
290      }
291      else
292      {
293         data = 0;
294      }
295   }
296   else
297   {
298      atapi_irq(space.machine(), CLEAR_LINE);
299      int shift;
300      shift = 0;
301      reg = offset<<2;
302      switch(mem_mask)
303      {
304      case 0x000000ff:
305         break;   
306      case 0x0000ff00:
307         reg+=1;
308         data >>= 8;
309         shift=8;
310         break;
311      case 0x00ff0000:
312         reg+=2;
313         data >>=16;
314         shift=16;
315         break;
316      case 0xff000000:
317         reg+=3;
318         data >>=24;
319         shift=24;
320         break;
321      }         
322      data = atapi_regs[reg];
323            data <<= shift;
324   }
325   return data;
280                state->m_atapi_data_ptr = 0;
281                state->m_atapi_data_len = 0;
282
283                if( state->m_atapi_xferlen == 0 )
284                {
285                    atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
286                    atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
287                    atapi_irq(space.machine(), ASSERT_LINE);
288                }
289            }
290        }
291        else
292        {
293            data = 0;
294        }
295    }
296    else
297    {
298        atapi_irq(space.machine(), CLEAR_LINE);
299        int shift;
300        shift = 0;
301        reg = offset<<2;
302        switch(mem_mask)
303        {
304        case 0x000000ff:
305            break;
306        case 0x0000ff00:
307            reg+=1;
308            data >>= 8;
309            shift=8;
310            break;
311        case 0x00ff0000:
312            reg+=2;
313            data >>=16;
314            shift=16;
315            break;
316        case 0xff000000:
317            reg+=3;
318            data >>=24;
319            shift=24;
320            break;
321        }
322        data = atapi_regs[reg];
323            data <<= shift;
324    }
325    return data;
326326}
327327
328328static WRITE32_HANDLER( atapi_w )
329329{
330   gammagic_state *state = space.machine().driver_data<gammagic_state>();
331   UINT8 *atapi_regs = state->m_atapi_regs;
332   UINT8 *atapi_data = state->m_atapi_data;
333   int reg;
334   if (mem_mask == 0x0000ffff)   // word-wide command write
335   {
336      atapi_data[state->m_atapi_data_ptr++] = data & 0xff;
337      atapi_data[state->m_atapi_data_ptr++] = data >> 8;
330    gammagic_state *state = space.machine().driver_data<gammagic_state>();
331    UINT8 *atapi_regs = state->m_atapi_regs;
332    UINT8 *atapi_data = state->m_atapi_data;
333    int reg;
334    if (mem_mask == 0x0000ffff) // word-wide command write
335    {
336        atapi_data[state->m_atapi_data_ptr++] = data & 0xff;
337        atapi_data[state->m_atapi_data_ptr++] = data >> 8;
338338
339      if (state->m_atapi_cdata_wait)
340      {
341             logerror("ATAPI: waiting, ptr %d wait %d\n", state->m_atapi_data_ptr, state->m_atapi_cdata_wait);
342         if (state->m_atapi_data_ptr == state->m_atapi_cdata_wait)
343         {
344            // send it to the device
345            SCSIWriteData( state->m_inserted_cdrom, atapi_data, state->m_atapi_cdata_wait );
339        if (state->m_atapi_cdata_wait)
340        {
341            logerror("ATAPI: waiting, ptr %d wait %d\n", state->m_atapi_data_ptr, state->m_atapi_cdata_wait);
342            if (state->m_atapi_data_ptr == state->m_atapi_cdata_wait)
343            {
344                // send it to the device
345                SCSIWriteData( state->m_inserted_cdrom, atapi_data, state->m_atapi_cdata_wait );
346346
347            // assert IRQ
348            atapi_irq(space.machine(), ASSERT_LINE);
347                // assert IRQ
348                atapi_irq(space.machine(), ASSERT_LINE);
349349
350            // not sure here, but clear DRQ at least?
351            atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
352         }
353      }
350                // not sure here, but clear DRQ at least?
351                atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
352            }
353        }
354354
355      else if ( state->m_atapi_data_ptr == 12 )
356      {
357         int phase;
358         // reset data pointer for reading SCSI results
359         state->m_atapi_data_ptr = 0;
360         state->m_atapi_data_len = 0;
355        else if ( state->m_atapi_data_ptr == 12 )
356        {
357            int phase;
358            // reset data pointer for reading SCSI results
359            state->m_atapi_data_ptr = 0;
360            state->m_atapi_data_len = 0;
361361
362         // send it to the SCSI device
363         SCSISetCommand( state->m_inserted_cdrom, state->m_atapi_data, 12 );
364         SCSIExecCommand( state->m_inserted_cdrom, &state->m_atapi_xferlen );
365         SCSIGetPhase( state->m_inserted_cdrom, &phase );
362            // send it to the SCSI device
363            SCSISetCommand( state->m_inserted_cdrom, state->m_atapi_data, 12 );
364            SCSIExecCommand( state->m_inserted_cdrom, &state->m_atapi_xferlen );
365            SCSIGetPhase( state->m_inserted_cdrom, &phase );
366366
367         if (state->m_atapi_xferlen != -1)
368         {
369                       logerror("ATAPI: SCSI command %02x returned %d bytes from the device\n", atapi_data[0]&0xff, state->m_atapi_xferlen);
367            if (state->m_atapi_xferlen != -1)
368            {
369                        logerror("ATAPI: SCSI command %02x returned %d bytes from the device\n", atapi_data[0]&0xff, state->m_atapi_xferlen);
370370
371            // store the returned command length in the ATAPI regs, splitting into
372            // multiple transfers if necessary
373            state->m_atapi_xfermod = 0;
374            if (state->m_atapi_xferlen > MAX_TRANSFER_SIZE)
375            {
376               state->m_atapi_xfermod = state->m_atapi_xferlen - MAX_TRANSFER_SIZE;
377               state->m_atapi_xferlen = MAX_TRANSFER_SIZE;
378            }
379 
380            atapi_regs[ATAPI_REG_COUNTLOW] = state->m_atapi_xferlen & 0xff;
381            atapi_regs[ATAPI_REG_COUNTHIGH] = (state->m_atapi_xferlen>>8)&0xff;
371                // store the returned command length in the ATAPI regs, splitting into
372                // multiple transfers if necessary
373                state->m_atapi_xfermod = 0;
374                if (state->m_atapi_xferlen > MAX_TRANSFER_SIZE)
375                {
376                    state->m_atapi_xfermod = state->m_atapi_xferlen - MAX_TRANSFER_SIZE;
377                    state->m_atapi_xferlen = MAX_TRANSFER_SIZE;
378                }
382379
383            if (state->m_atapi_xferlen == 0)
384            {
385               // if no data to return, set the registers properly
386               atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRDY;
387               atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO|ATAPI_INTREASON_COMMAND;
388            }
389            else
390            {
391               // indicate data ready: set DRQ and DMA ready, and IO in INTREASON
392               atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ | ATAPI_STAT_SERVDSC;
393               atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
394            }
380                atapi_regs[ATAPI_REG_COUNTLOW] = state->m_atapi_xferlen & 0xff;
381                atapi_regs[ATAPI_REG_COUNTHIGH] = (state->m_atapi_xferlen>>8)&0xff;
395382
396            switch( phase )
397            {
398            case SCSI_PHASE_DATAOUT:
399               state->m_atapi_cdata_wait = state->m_atapi_xferlen;
400               break;
401            }
383                if (state->m_atapi_xferlen == 0)
384                {
385                    // if no data to return, set the registers properly
386                    atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRDY;
387                    atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO|ATAPI_INTREASON_COMMAND;
388                }
389                else
390                {
391                    // indicate data ready: set DRQ and DMA ready, and IO in INTREASON
392                    atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ | ATAPI_STAT_SERVDSC;
393                    atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
394                }
402395
403            // perform special ATAPI processing of certain commands
404            switch (atapi_data[0]&0xff)
405            {
406               case 0x00: // BUS RESET / TEST UNIT READY
407               case 0xbb: // SET CDROM SPEED
408                  atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
409                  break;
396                switch( phase )
397                {
398                case SCSI_PHASE_DATAOUT:
399                    state->m_atapi_cdata_wait = state->m_atapi_xferlen;
400                    break;
401                }
410402
411               case 0x45: // PLAY
412                  atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_BSY;
413                  state->m_atapi_timer->adjust( downcast<cpu_device *>(&space->device())->cycles_to_attotime( ATAPI_CYCLES_PER_SECTOR ) );
414                  break;
415            }
403                // perform special ATAPI processing of certain commands
404                switch (atapi_data[0]&0xff)
405                {
406                    case 0x00: // BUS RESET / TEST UNIT READY
407                    case 0xbb: // SET CDROM SPEED
408                        atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
409                        break;
416410
417            // assert IRQ
418            atapi_irq(space.machine(), ASSERT_LINE);
419         }
420         else
421         {
422                       logerror("ATAPI: SCSI device returned error!\n");
411                    case 0x45: // PLAY
412                        atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_BSY;
413                        state->m_atapi_timer->adjust( downcast<cpu_device *>(&space->device())->cycles_to_attotime( ATAPI_CYCLES_PER_SECTOR ) );
414                        break;
415                }
423416
424            atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ | ATAPI_STAT_CHECK;
425            atapi_regs[ATAPI_REG_ERRFEAT] = 0x50;   // sense key = ILLEGAL REQUEST
426            atapi_regs[ATAPI_REG_COUNTLOW] = 0;
427            atapi_regs[ATAPI_REG_COUNTHIGH] = 0;
428         }
429      }
430   }
431   else
432   {
433      reg = offset<<2;
434      switch(mem_mask)
435      {
436      case 0x000000ff:
437         break;   
438      case 0x0000ff00:
439         reg+=1;
440         data >>= 8;
441         break;
442      case 0x00ff0000:
443         reg+=2;
444         data >>=16;
445         break;
446      case 0xff000000:
447         reg+=3;
448         data >>=24;
449         break;
450      }         
417                // assert IRQ
418                atapi_irq(space.machine(), ASSERT_LINE);
419            }
420            else
421            {
422                        logerror("ATAPI: SCSI device returned error!\n");
451423
452      atapi_regs[reg] = data;
453            logerror("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, cpu_get_pc(&space->device()));
424                atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ | ATAPI_STAT_CHECK;
425                atapi_regs[ATAPI_REG_ERRFEAT] = 0x50;   // sense key = ILLEGAL REQUEST
426                atapi_regs[ATAPI_REG_COUNTLOW] = 0;
427                atapi_regs[ATAPI_REG_COUNTHIGH] = 0;
428            }
429        }
430    }
431    else
432    {
433        reg = offset<<2;
434        switch(mem_mask)
435        {
436        case 0x000000ff:
437            break;
438        case 0x0000ff00:
439            reg+=1;
440            data >>= 8;
441            break;
442        case 0x00ff0000:
443            reg+=2;
444            data >>=16;
445            break;
446        case 0xff000000:
447            reg+=3;
448            data >>=24;
449            break;
450        }
454451
455      if (reg == ATAPI_REG_CMDSTATUS)
456      {
457                logerror("ATAPI command %x issued! (PC=%x)\n", data, cpu_get_pc(&space->device()));
458         switch (data)
459         {
460            case 0xa0:   // PACKET
461               atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ;
462               atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_COMMAND;
452        atapi_regs[reg] = data;
453            logerror("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, cpu_get_pc(&space->device()));
463454
464               state->m_atapi_data_ptr = 0;
465               state->m_atapi_data_len = 0;
455        if (reg == ATAPI_REG_CMDSTATUS)
456        {
457                logerror("ATAPI command %x issued! (PC=%x)\n", data, cpu_get_pc(&space->device()));
458            switch (data)
459            {
460                case 0xa0:  // PACKET
461                    atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ;
462                    atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_COMMAND;
466463
467               // we have no data
468               state->m_atapi_xferlen = 0;
469               state->m_atapi_xfermod = 0;
464                    state->m_atapi_data_ptr = 0;
465                    state->m_atapi_data_len = 0;
470466
471               state->m_atapi_cdata_wait = 0;
472               break;
467                    // we have no data
468                    state->m_atapi_xferlen = 0;
469                    state->m_atapi_xfermod = 0;
473470
474            case 0xa1:   // IDENTIFY PACKET DEVICE
475               atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ;
471                    state->m_atapi_cdata_wait = 0;
472                    break;
476473
477               state->m_atapi_data_ptr = 0;
478               state->m_atapi_data_len = 512;
474                case 0xa1:  // IDENTIFY PACKET DEVICE
475                    atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ;
479476
480               // we have no data
481               state->m_atapi_xferlen = 0;
482               state->m_atapi_xfermod = 0;
477                    state->m_atapi_data_ptr = 0;
478                    state->m_atapi_data_len = 512;
483479
484               memset( atapi_data, 0, state->m_atapi_data_len );
480                    // we have no data
481                    state->m_atapi_xferlen = 0;
482                    state->m_atapi_xfermod = 0;
485483
486               atapi_data[ 0 ^ 1 ] = 0x85;   // ATAPI device, cmd set 5 compliant, DRQ within 3 ms of PACKET command
487               atapi_data[ 1 ^ 1 ] = 0x80;   // ATAPI device, removable media
484                    memset( atapi_data, 0, state->m_atapi_data_len );
488485
489               memset( &atapi_data[ 46 ], ' ', 8 );
490               atapi_data[ 46 ^ 1 ] = '1';
491               atapi_data[ 47 ^ 1 ] = '.';
492               atapi_data[ 48 ^ 1 ] = '0';
493               
494               
495               memset( &atapi_data[ 54 ], ' ', 40 );
496               atapi_data[ 54 ^ 1 ] = 'T';
497               atapi_data[ 55 ^ 1 ] = 'O';
498               atapi_data[ 56 ^ 1 ] = 'S';
499               atapi_data[ 57 ^ 1 ] = 'H';
500               atapi_data[ 58 ^ 1 ] = 'I';
501               atapi_data[ 59 ^ 1 ] = 'B';
502               atapi_data[ 60 ^ 1 ] = 'A';
503               atapi_data[ 61 ^ 1 ] = ' ';
504               atapi_data[ 62 ^ 1 ] = 'X';
505               atapi_data[ 63 ^ 1 ] = 'M';
506               atapi_data[ 64 ^ 1 ] = '-';
507               atapi_data[ 65 ^ 1 ] = '3';
508               atapi_data[ 66 ^ 1 ] = '3';
509               atapi_data[ 67 ^ 1 ] = '0';
510               atapi_data[ 68 ^ 1 ] = '1';
511               atapi_data[ 69 ^ 1 ] = ' ';
486                    atapi_data[ 0 ^ 1 ] = 0x85; // ATAPI device, cmd set 5 compliant, DRQ within 3 ms of PACKET command
487                    atapi_data[ 1 ^ 1 ] = 0x80; // ATAPI device, removable media
512488
513               atapi_data[ 98 ^ 1 ] = 0x06; // Word 49=Capabilities, IORDY may be disabled (bit_10), LBA Supported mandatory (bit_9)
514               atapi_data[ 99 ^ 1 ] = 0x00;
489                    memset( &atapi_data[ 46 ], ' ', 8 );
490                    atapi_data[ 46 ^ 1 ] = '1';
491                    atapi_data[ 47 ^ 1 ] = '.';
492                    atapi_data[ 48 ^ 1 ] = '0';
515493
516               atapi_regs[ATAPI_REG_COUNTLOW] = 0;
517               atapi_regs[ATAPI_REG_COUNTHIGH] = 2;
518494
519               atapi_irq(space.machine(), ASSERT_LINE);
520               break;
521            case 0xec:   //IDENTIFY DEVICE - Must abort here and set for packet data
522               atapi_regs[ATAPI_REG_ERRFEAT] = ATAPI_ERRFEAT_ABRT;
523               atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_CHECK;
524               
525               atapi_irq(space.machine(), ASSERT_LINE);
526               
527            case 0xef:   // SET FEATURES
528               atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
495                    memset( &atapi_data[ 54 ], ' ', 40 );
496                    atapi_data[ 54 ^ 1 ] = 'T';
497                    atapi_data[ 55 ^ 1 ] = 'O';
498                    atapi_data[ 56 ^ 1 ] = 'S';
499                    atapi_data[ 57 ^ 1 ] = 'H';
500                    atapi_data[ 58 ^ 1 ] = 'I';
501                    atapi_data[ 59 ^ 1 ] = 'B';
502                    atapi_data[ 60 ^ 1 ] = 'A';
503                    atapi_data[ 61 ^ 1 ] = ' ';
504                    atapi_data[ 62 ^ 1 ] = 'X';
505                    atapi_data[ 63 ^ 1 ] = 'M';
506                    atapi_data[ 64 ^ 1 ] = '-';
507                    atapi_data[ 65 ^ 1 ] = '3';
508                    atapi_data[ 66 ^ 1 ] = '3';
509                    atapi_data[ 67 ^ 1 ] = '0';
510                    atapi_data[ 68 ^ 1 ] = '1';
511                    atapi_data[ 69 ^ 1 ] = ' ';
529512
530               state->m_atapi_data_ptr = 0;
531               state->m_atapi_data_len = 0;
513                    atapi_data[ 98 ^ 1 ] = 0x06; // Word 49=Capabilities, IORDY may be disabled (bit_10), LBA Supported mandatory (bit_9)
514                    atapi_data[ 99 ^ 1 ] = 0x00;
532515
533               atapi_irq(space.machine(), ASSERT_LINE);
534               break;
516                    atapi_regs[ATAPI_REG_COUNTLOW] = 0;
517                    atapi_regs[ATAPI_REG_COUNTHIGH] = 2;
535518
536            default:
537               logerror("ATAPI: Unknown IDE command %x\n", data);
538               break;
539         }
540      }
541   }
519                    atapi_irq(space.machine(), ASSERT_LINE);
520                    break;
521                case 0xec:  //IDENTIFY DEVICE - Must abort here and set for packet data
522                    atapi_regs[ATAPI_REG_ERRFEAT] = ATAPI_ERRFEAT_ABRT;
523                    atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_CHECK;
524
525                    atapi_irq(space.machine(), ASSERT_LINE);
526
527                case 0xef:  // SET FEATURES
528                    atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
529
530                    state->m_atapi_data_ptr = 0;
531                    state->m_atapi_data_len = 0;
532
533                    atapi_irq(space.machine(), ASSERT_LINE);
534                    break;
535
536                default:
537                    logerror("ATAPI: Unknown IDE command %x\n", data);
538                    break;
539            }
540        }
541    }
542542}
543543*/
544544// Memory is mostly handled by the chipset
r18326r18327
569569   AM_RANGE(0x03f0, 0x0cf7) AM_NOP
570570   AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_bus_device, read, write)
571571   AM_RANGE(0x0400, 0xffff) AM_NOP
572   
573572
573
574574ADDRESS_MAP_END
575575
576576#define AT_KEYB_HELPER(bit, text, key1) \
r18326r18327
596596   AT_KEYB_HELPER( 0x0800, "F1",           KEYCODE_S           ) /* F1                          3B  BB */
597597   AT_KEYB_HELPER( 0x1000, "F2",           KEYCODE_D           ) /* F2                          3C  BC */
598598   AT_KEYB_HELPER( 0x4000, "F4",           KEYCODE_F           ) /* F4                          3E  BE */
599   
600599
600
601601   PORT_START("pc_keyboard_4")
602602   AT_KEYB_HELPER( 0x0004, "F8",           KEYCODE_F8          ) // f8=42  /f10=44 /minus 4a /plus=4e
603603   AT_KEYB_HELPER( 0x0010, "F10",          KEYCODE_F10         ) // f8=42  /f10=44 /minus 4a /plus=4e
r18326r18327
607607
608608   PORT_START("pc_keyboard_5")
609609   AT_KEYB_HELPER( 0x0001, "KP 2(DN)",     KEYCODE_2_PAD       ) /* Keypad 2  (Down arrow)      50  D0 */
610   
610
611611   PORT_START("pc_keyboard_6")
612612   AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up",      KEYCODE_UP          ) /* Up                          67  e7 */
613613   AT_KEYB_HELPER( 0x0080, "(MF2)Page Up",         KEYCODE_PGUP        ) /* Page Up                     68  e8 */
r18326r18327
643643static MACHINE_RESET( gammagic )
644644{
645645   //gammagic_state *state = machine.driver_data<gammagic_state>();
646   
646
647647   //void *cd;
648   //SCSIGetDevice( state->m_inserted_cdrom, &cd );   
649   
648   //SCSIGetDevice( state->m_inserted_cdrom, &cd );
649
650650}
651651
652652
653653/*static void atapi_irq(running_machine &machine, int state)
654654{
655   gammagic_state *drvstate = machine.driver_data<gammagic_state>();
656   pic8259_ir6_w(drvstate->m_pic8259_2, state);
655    gammagic_state *drvstate = machine.driver_data<gammagic_state>();
656    pic8259_ir6_w(drvstate->m_pic8259_2, state);
657657}
658658
659659static void atapi_exit(running_machine& machine)
660660{
661   gammagic_state *state = machine.driver_data<gammagic_state>();
662   SCSIDeleteInstance(state->m_inserted_cdrom);
661    gammagic_state *state = machine.driver_data<gammagic_state>();
662    SCSIDeleteInstance(state->m_inserted_cdrom);
663663
664664}
665665*/
r18326r18327
667667static void atapi_init(running_machine &machine)
668668{
669669   gammagic_state *state = machine.driver_data<gammagic_state>();
670   
670
671671   state->m_atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
672672   state->m_atapi_regs[ATAPI_REG_ERRFEAT] = 1;
673673   state->m_atapi_regs[ATAPI_REG_COUNTLOW] = 0x14;
r18326r18327
675675   state->m_atapi_data_ptr = 0;
676676   state->m_atapi_data_len = 0;
677677   state->m_atapi_cdata_wait = 0;
678     
678
679679   //SCSIAllocInstance( machine, &SCSIClassCr589, &state->m_inserted_cdrom, ":cdrom" );
680   
680
681681   //machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(atapi_exit), &machine));
682682
683683}
r18326r18327
782782   MCFG_PIC8259_ADD( "pic8259_1", gammagic_pic8259_1_config )
783783   MCFG_PIC8259_ADD( "pic8259_2", gammagic_pic8259_2_config )
784784   MCFG_MC146818_ADD( "rtc", MC146818_STANDARD )
785//   MCFG_I82371SB_ADD("i82371sb")
786//   MCFG_I82439TX_ADD("i82439tx", "maincpu", "user")
785//  MCFG_I82371SB_ADD("i82371sb")
786//  MCFG_I82439TX_ADD("i82439tx", "maincpu", "user")
787787   MCFG_PCI_BUS_ADD("pcibus", 0)
788//   MCFG_PCI_BUS_DEVICE(0, "i82439tx", i82439tx_pci_read, i82439tx_pci_write)
789//   MCFG_PCI_BUS_DEVICE(1, "i82371sb", i82371sb_pci_read, i82371sb_pci_write)
788//  MCFG_PCI_BUS_DEVICE(0, "i82439tx", i82439tx_pci_read, i82439tx_pci_write)
789//  MCFG_PCI_BUS_DEVICE(1, "i82371sb", i82371sb_pci_read, i82371sb_pci_write)
790790   /* video hardware */
791791   MCFG_FRAGMENT_ADD( pcvideo_vga )
792792
r18326r18327
797797{
798798   init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, gammagic_set_keyb_int);
799799   kbdc8042_init(machine(), &at8042);
800   atapi_init(machine());   
801}   
800   atapi_init(machine());
801}
802802
803803ROM_START( gammagic )
804804   ROM_REGION32_LE(0x40000, "user", 0)
805   //Original Memory Set   
805   //Original Memory Set
806806   //ROM_LOAD("m7s04.rom",   0, 0x40000, CRC(3689f5a9) SHA1(8daacdb0dc6783d2161680564ffe83ac2515f7ef))
807807   //ROM_LOAD("otivga_tx2953526.rom", 0x0000, 0x8000, CRC(916491af) SHA1(d64e3a43a035d70ace7a2d0603fc078f22d237e1))
808   
808
809809   //Temp. Memory Set (Only for initial driver development stage)
810810   ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) )
811811   ROM_CONTINUE(                                 0x0001, 0x4000 )
812812   ROM_LOAD("5hx29.bin",   0x20000, 0x20000, CRC(07719a55) SHA1(b63993fd5186cdb4f28c117428a507cd069e1f68))
813     
813
814814   DISK_REGION( "cdrom" )
815815   DISK_IMAGE_READONLY( "gammagic", 0,SHA1(caa8fc885d84dbc07fb0604c76cd23c873a65ce6) )
816816ROM_END
817817
818818ROM_START( 99bottles )
819819   ROM_REGION32_LE(0x40000, "user", 0)
820   //Original BIOS/VGA-BIOS Rom Set   
821   //ROM_LOAD("m7s04.rom",   0, 0x40000, CRC(3689f5a9) SHA1(8daacdb0dc6783d2161680564ffe83ac2515f7ef))
820   //Original BIOS/VGA-BIOS Rom Set
821   //ROM_LOAD("m7s04.rom",   0, 0x40000, CRC(3689f5a9) SHA1(8daacdb0dc6783d2161680564ffe83ac2515f7ef))
822822   //ROM_LOAD("otivga_tx2953526.rom", 0x0000, 0x8000, CRC(916491af) SHA1(d64e3a43a035d70ace7a2d0603fc078f22d237e1))
823   
823
824824   //Temporary (Chipset compatible Rom Set, only for driver development stage)
825825   ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) )
826826   ROM_CONTINUE(                                 0x0001, 0x4000 )
trunk/src/mame/drivers/cdi.c
r18326r18327
625625
626626// The Quizard games are RETAIL CD-i units, with additional JAMMA adapters & dongles for protection, hence being 'clones' of the system.
627627
628GAME( 1995, cdibios,  0,           cdi_base,      quizard, driver_device,      0, ROT0,     "Philips",       "CD-i Bios", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_IS_BIOS_ROOT )
628GAME( 1995, cdibios,  0,           cdi_base,      quizard, driver_device,      0, ROT0,     "Philips",     "CD-i Bios", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_IS_BIOS_ROOT )
629629// Working
630630GAME( 1995, quizrd12, cdibios,      quizrd12,      quizard, driver_device,      0, ROT0,     "TAB Austria",  "Quizard 1.2", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
631631GAME( 1995, quizrd17, cdibios,      quizrd17,      quizard, driver_device,      0, ROT0,     "TAB Austria",  "Quizard 1.7", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
trunk/src/mame/drivers/nsm.c
r18326r18327
9090      m_cru_data[m_cru_count] = 0;
9191   }
9292   m_cru_data[m_cru_count] |= (data << offset);
93   
93
9494   UINT8 i,j;
9595   int segments;
9696   if (!m_cru_count && (offset == 7))
trunk/src/mame/drivers/queen.c
r18326r18327
543543   AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide_r, ide_w)
544544   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
545545   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
546   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
546   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
547547   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE(fdc_r, fdc_w)
548548
549549   AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_bus_legacy_device, read, write)
trunk/src/mame/drivers/xtom3d.c
r18326r18327
551551   AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide_r, ide_w)
552552   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
553553   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
554   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
554   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
555555   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE(fdc_r, fdc_w)
556556
557557   AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_bus_legacy_device, read, write)
trunk/src/mame/drivers/jpmsys5.c
r18326r18327
1212        * Monopoly Deluxe
1313
1414    Known Issues:
15        * Some features used by the AWP games such as reels and meters
16      are not emulated.
17      * Timing for reels, and other opto devices is controlled by the same clock
18      as the lamps, in a weird daisychain setup.
15        * Some features used by the AWP games such as reels and meters
16        are not emulated.
17        * Timing for reels, and other opto devices is controlled by the same clock
18        as the lamps, in a weird daisychain setup.
1919
2020    AWP game notes:
2121      The byte at 0x81 of the EVEN 68k rom appears to be some kind of
r18326r18327
766766   {
767767      case 2:
768768      {
769         return ioport("COINS")->read() << 8;   
769         return ioport("COINS")->read() << 8;
770770      }
771771      break;
772772      default:
r18326r18327
856856   PORT_CONFSETTING(   0x02, "13")
857857   PORT_CONFSETTING(   0x01, "14")
858858   PORT_CONFSETTING(   0x00, "15")
859     
859
860860   PORT_START("DIRECT")
861861   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE
862862   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE
trunk/src/mame/drivers/ninjakd2.c
r18326r18327
911911   int num_banks = (machine().root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
912912   machine().root_device().membank("bank1")->configure_entries(0, num_banks, machine().root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
913913   machine().root_device().membank("bank1")->set_entry(0);
914   
914
915915   m_rom_bank_mask = num_banks - 1;
916916}
917917
918918MACHINE_START_MEMBER(ninjakd2_state,omegaf)
919919{
920920   omegaf_io_protection_start();
921   
921
922922   machine_start();
923923}
924924
925925MACHINE_RESET_MEMBER(ninjakd2_state,omegaf)
926926{
927927   omegaf_io_protection_reset();
928   
928
929929   machine_reset();
930930}
931931
r18326r18327
14811481   ROM[1] = 0x03; // and 3
14821482   ROM[2] = 0x18;
14831483   ROM[3] = 0xf6; // jr $-8
1484   
1484
14851485   m_maincpu->space(AS_PROGRAM).install_read_handler(offset, offset, read8_delegate(FUNC(ninjakd2_state::robokid_motion_error_verbose_r), this));
14861486}
14871487
trunk/src/mame/drivers/pipedrm.c
r18326r18327
191191   state->membank("bank1")->set_entry(data & 0x7);
192192
193193   /* map to the fromance gfx register */
194   state->fromance_gfxreg_w(space, offset, ((data >> 6) & 0x01) |    /* flipscreen */
194   state->fromance_gfxreg_w(space, offset, ((data >> 6) & 0x01) |   /* flipscreen */
195195                       ((~data >> 2) & 0x02));   /* videoram select */
196196}
197197
trunk/src/mame/drivers/mediagx.c
r18326r18327
186186   virtual void machine_reset();
187187   virtual void video_start();
188188   UINT32 screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
189   DECLARE_READ32_MEMBER(speedup0_r);   
190   DECLARE_READ32_MEMBER(speedup1_r);   
191   DECLARE_READ32_MEMBER(speedup2_r);   
192   DECLARE_READ32_MEMBER(speedup3_r);   
193   DECLARE_READ32_MEMBER(speedup4_r);   
194   DECLARE_READ32_MEMBER(speedup5_r);   
195   DECLARE_READ32_MEMBER(speedup6_r);   
196   DECLARE_READ32_MEMBER(speedup7_r);   
197   DECLARE_READ32_MEMBER(speedup8_r);   
198   DECLARE_READ32_MEMBER(speedup9_r);   
199   DECLARE_READ32_MEMBER(speedup10_r);   
200   DECLARE_READ32_MEMBER(speedup11_r);   
189   DECLARE_READ32_MEMBER(speedup0_r);
190   DECLARE_READ32_MEMBER(speedup1_r);
191   DECLARE_READ32_MEMBER(speedup2_r);
192   DECLARE_READ32_MEMBER(speedup3_r);
193   DECLARE_READ32_MEMBER(speedup4_r);
194   DECLARE_READ32_MEMBER(speedup5_r);
195   DECLARE_READ32_MEMBER(speedup6_r);
196   DECLARE_READ32_MEMBER(speedup7_r);
197   DECLARE_READ32_MEMBER(speedup8_r);
198   DECLARE_READ32_MEMBER(speedup9_r);
199   DECLARE_READ32_MEMBER(speedup10_r);
200   DECLARE_READ32_MEMBER(speedup11_r);
201201   TIMER_DEVICE_CALLBACK_MEMBER(sound_timer_callback);
202202};
203203
trunk/src/mame/drivers/deshoros.c
r18326r18327
5959   virtual void machine_start();
6060   virtual void machine_reset();
6161   virtual void video_start();
62public:   
62public:
6363   UINT32 screen_update_destiny(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6464};
6565
trunk/src/mame/drivers/ggconnie.c
r18326r18327
3030      : pce_common_state(mconfig, type, tag) { }
3131
3232   DECLARE_WRITE8_MEMBER(lamp_w);
33   DECLARE_WRITE8_MEMBER(output_w);   
33   DECLARE_WRITE8_MEMBER(output_w);
3434};
3535
3636
trunk/src/mame/drivers/8080bw.c
r18326r18327
23432343
23442344TIMER_DEVICE_CALLBACK_MEMBER(_8080bw_state::claybust_gun_callback)
23452345{
2346   
2346
23472347   // reset gun latch
23482348   m_claybust_gun_pos = 0;
23492349}
r18326r18327
23582358   if (newval)
23592359   {
23602360      /*
2361         The game registers a valid shot after the gun trigger is pressed, and IN1 d0 is high.
2362         It latches the gun position and then compares it with VRAM contents: 1 byte/8 pixels, 0 means miss.
2363         IN1 d0 probably indicates if the latch is ready or not (glitches happen otherwise)
2361            The game registers a valid shot after the gun trigger is pressed, and IN1 d0 is high.
2362            It latches the gun position and then compares it with VRAM contents: 1 byte/8 pixels, 0 means miss.
2363            IN1 d0 probably indicates if the latch is ready or not (glitches happen otherwise)
23642364
2365         in   $06
2366         cpi  $04
2367         rc
2368         mov  h,a
2369         in   $02
2370         mov  l,a
2371         lxi  d,$1ffe  <-- this is where the +2 comes from
2372         dad  d
2373         out  $00
2374         mov  a,m
2375         ana  a
2376         rz
2377      */
2365            in   $06
2366            cpi  $04
2367            rc
2368            mov  h,a
2369            in   $02
2370            mov  l,a
2371            lxi  d,$1ffe  <-- this is where the +2 comes from
2372            dad  d
2373            out  $00
2374            mov  a,m
2375            ana  a
2376            rz
2377        */
23782378      UINT8 gunx = ioport("GUNX")->read_safe(0x00);
23792379      UINT8 guny = ioport("GUNY")->read_safe(0x20);
23802380      m_claybust_gun_pos = ((gunx >> 3) | (guny << 5)) + 2;
r18326r18327
24262426
24272427static INPUT_PORTS_START( gunchamp )
24282428   PORT_INCLUDE( claybust )
2429   
2429
24302430   PORT_MODIFY("IN1")
24312431
24322432   // switch is 6-pos, but DNS06:5 and DNS06:6 are not connected
r18326r18327
24612461
24622462   MCFG_TIMER_DRIVER_ADD("claybust_gun", _8080bw_state, claybust_gun_callback)
24632463
2464   MCFG_MACHINE_START_OVERRIDE(_8080bw_state, claybust)
2464   MCFG_MACHINE_START_OVERRIDE(_8080bw_state, claybust)
24652465
24662466   /* sound hardware */
24672467   // TODO: discrete sound
trunk/src/mame/drivers/vlc.c
r18326r18327
1313    - 2x 62256 NVRAM  + batt  (connect in 16bits)
1414    - 2x 6264  BACKUP + batt  (connect in  8bits)
1515    - 1x MODEM XE1214 from XECOM (300/1200 Baud)
16   
17   
18   
16
17
18
1919on MAME 0.145u4
2020Yves
2121Todo :
r18326r18327
3737
3838U50 4Bit D Flop Register is connect on D3..D0
3939this one seem to have 2 use.
401. keep track of the PAL16R8 state
401. keep track of the PAL16R8 state
41412. DOOR SWITCH is connect on U50 Clear pin (D3..D0 LOW = Door Open)
4242Write Clock 4 bits in D-Flop Register
4343Read  OE    4 bits on D3..D0
r18326r18327
8989BOOT:FE1AA9 0000                                dc.b   0
9090
9191
92BOOT:FE19F0                     INI_CRTC6845:                           
92BOOT:FE19F0                     INI_CRTC6845:
9393BOOT:FE19F0 48E7 8140                           movem.l d0/d7/a1,-(sp)
9494BOOT:FE19F4 2258                                movea.l (a0)+,a1        * type1 = 0xA50000, type2 = 0xA80000
9595BOOT:FE19F6 50D1                                st      (a1)
r18326r18327
102102BOOT:FE1A0A                                                             * A0 = 0xB00000
103103BOOT:FE1A0E 7E0D                                moveq   #$D,d7
104104BOOT:FE1A10
105BOOT:FE1A10                     LOOP:                                   
105BOOT:FE1A10                     LOOP:
106106BOOT:FE1A10 13C7 0090 0001                      move.b  d7,(CRTC_ADR)
107107BOOT:FE1A16 13D9 0090 8001                      move.b  (a1)+,(CRTC_DAT)
108108BOOT:FE1A1C 51CF FFF2                           dbf     d7,LOOP
r18326r18327
111111
112112
113113    *** MC6845 Initialization ***
114                Htotal   Hdisp   HsyncPos HsyncW   Vtotal  VtotalAdj Vdisp  VsyncPos InterMode MaxScanAdr CurStart CurEnd StartAdrH StartAdrL CurH  CurL  LightPenH LightPenL
114                Htotal   Hdisp   HsyncPos HsyncW   Vtotal  VtotalAdj Vdisp  VsyncPos InterMode MaxScanAdr CurStart CurEnd StartAdrH StartAdrL CurH  CurL  LightPenH LightPenL
115115    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
116116    register:   00       01      02       03       04      05        06     07       08        09         10       11     12        13        14    15    16        17
117117    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
118118nevada TYPE1 :  42       31      35       03       32      02        31     31       00        07         00       00     00        00        00    00    00        00
119119nevada TYPE2 :  64       45      51       06       32      02        31     31       00        07         00       00     00        00        00    00    00        00
120       
120
121121*/
122122
123123
r18326r18327
160160   device_t *m_duart18_68681;
161161   device_t *m_duart39_68681;
162162   device_t *m_duart40_68681;
163   
163
164164   required_device<cpu_device> m_maincpu;
165165   optional_device<microtouch_device> m_microtouch;
166166
167167   required_shared_ptr<UINT16>   m_nvram;
168168   required_shared_ptr<UINT16> m_backup;
169   
169
170170   UINT16  m_datA40000;
171   
171
172172        //UINT8* m_videoram;
173173        //UINT8* m_colorram;
174       
174
175175   UINT16* m_videoram;
176176   tilemap_t *m_bg_tilemap;
177177
178   
178
179179   DECLARE_DRIVER_INIT(nevada);
180180};
181181
r18326r18327
185185
186186PAL is connected on the UPPER byte D15..D8
187187Adress A40000..A40001
1882 Type of PAL (one for game, the other is to set game to fabric default)       
1882 Type of PAL (one for game, the other is to set game to fabric default)
189189
190there is a 74LS173 on the LOWER byte that used bit D3..D0
190there is a 74LS173 on the LOWER byte that used bit D3..D0
191191funny thing , the DOOR ACCESS Switch is connected on the CLEAR  PIN of this 4bits register
192192so when D3..D0 are LOW , DOOR is OPEN
193193*/
194194static const UINT8 pal35[256] = {
1950x11, 0x42, 0x5B, 0xCA, 0x19, 0x42, 0x5B, 0xCA, 0x38, 0x63, 0x3A, 0x63, 0x3A, 0x63, 0x3A, 0x63,
1960xD3, 0x08, 0x5B, 0xCA, 0x19, 0xCA, 0x19, 0xCA, 0x18, 0xEB, 0x18, 0xEB, 0x18, 0xEB, 0x18, 0xEB,
1970xD3, 0xCA, 0x5B, 0xCC, 0x5B, 0xCC, 0x5B, 0xCC, 0xBA, 0x63, 0x38, 0x65, 0x38, 0x65, 0x38, 0x65,
1980xD1, 0xCA, 0x5B, 0xC8, 0x5B, 0xC8, 0x5B, 0xC8, 0x9A, 0xEB, 0x1A, 0xED, 0x1A, 0xED, 0x1A, 0xED,
1990x0C, 0x65, 0xF0, 0x00, 0x64, 0xF5, 0x04, 0x65, 0xB8, 0x25, 0x20, 0x20, 0x24, 0x24, 0x24, 0x24,
2000xF0, 0x00, 0xF8, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0xB8, 0x3D, 0xFC, 0x19, 0xFC, 0x19, 0xFC, 0x19,
2010x44, 0xF9, 0xC4, 0xF9, 0xC4, 0xFD, 0xC4, 0xFD, 0xFC, 0xFD, 0xFC, 0xFD, 0xFC, 0xFD, 0xFC, 0xFD,
2020xC0, 0xD9, 0xC8, 0xD9, 0xC8, 0xD9, 0xC8, 0xD9, 0xD8, 0xD9, 0xD8, 0xD9, 0xD8, 0xD9, 0xD8, 0xD9,
2030x0C, 0x44, 0xFB, 0x04, 0x67, 0xD4, 0x0C, 0x44, 0xBA, 0x24, 0x22, 0x02, 0x26, 0x06, 0x26, 0x06,
2040xFB, 0x00, 0xFB, 0x00, 0xEF, 0x10, 0xCE, 0x18, 0xEF, 0x18, 0xEF, 0x18, 0xFF, 0x18, 0xFF, 0x18,
2050x44, 0xF8, 0xC6, 0xD8, 0xCE, 0xDC, 0xCE, 0xDC, 0xEF, 0x9E, 0x67, 0xB8, 0x67, 0xBC, 0x67, 0xBC,
2060xC6, 0xD8, 0xCA, 0xD8, 0xCA, 0xD8, 0xCA, 0xD8, 0xCB, 0x9A, 0xEF, 0x9A, 0xFF, 0xD8, 0xDB, 0xD8,
2070x66, 0xF4, 0x00, 0x64, 0xBA, 0x25, 0x22, 0x22, 0x26, 0x26, 0x26, 0x26, 0xF2, 0x00, 0xFA, 0x00,
2080xFA, 0x00, 0xFA, 0x00, 0xBA, 0x3D, 0xFA, 0x19, 0xFA, 0x19, 0xFA, 0x19, 0x44, 0xF9, 0xC2, 0xF0,
2090xC2, 0xF4, 0xC2, 0xF4, 0xFA, 0xF4, 0xFA, 0xF4, 0xFA, 0xF4, 0xFA, 0xF4, 0xC2, 0xD0, 0xCA, 0xD0,
2100xCA, 0xD0, 0xCA, 0xD0, 0xDA, 0xD0, 0xDA, 0xD0, 0xDA, 0xD0, 0xDA, 0xD0, 0x08, 0x63, 0xD3, 0x08   
1950x11, 0x42, 0x5B, 0xCA, 0x19, 0x42, 0x5B, 0xCA, 0x38, 0x63, 0x3A, 0x63, 0x3A, 0x63, 0x3A, 0x63,
1960xD3, 0x08, 0x5B, 0xCA, 0x19, 0xCA, 0x19, 0xCA, 0x18, 0xEB, 0x18, 0xEB, 0x18, 0xEB, 0x18, 0xEB,
1970xD3, 0xCA, 0x5B, 0xCC, 0x5B, 0xCC, 0x5B, 0xCC, 0xBA, 0x63, 0x38, 0x65, 0x38, 0x65, 0x38, 0x65,
1980xD1, 0xCA, 0x5B, 0xC8, 0x5B, 0xC8, 0x5B, 0xC8, 0x9A, 0xEB, 0x1A, 0xED, 0x1A, 0xED, 0x1A, 0xED,
1990x0C, 0x65, 0xF0, 0x00, 0x64, 0xF5, 0x04, 0x65, 0xB8, 0x25, 0x20, 0x20, 0x24, 0x24, 0x24, 0x24,
2000xF0, 0x00, 0xF8, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0xB8, 0x3D, 0xFC, 0x19, 0xFC, 0x19, 0xFC, 0x19,
2010x44, 0xF9, 0xC4, 0xF9, 0xC4, 0xFD, 0xC4, 0xFD, 0xFC, 0xFD, 0xFC, 0xFD, 0xFC, 0xFD, 0xFC, 0xFD,
2020xC0, 0xD9, 0xC8, 0xD9, 0xC8, 0xD9, 0xC8, 0xD9, 0xD8, 0xD9, 0xD8, 0xD9, 0xD8, 0xD9, 0xD8, 0xD9,
2030x0C, 0x44, 0xFB, 0x04, 0x67, 0xD4, 0x0C, 0x44, 0xBA, 0x24, 0x22, 0x02, 0x26, 0x06, 0x26, 0x06,
2040xFB, 0x00, 0xFB, 0x00, 0xEF, 0x10, 0xCE, 0x18, 0xEF, 0x18, 0xEF, 0x18, 0xFF, 0x18, 0xFF, 0x18,
2050x44, 0xF8, 0xC6, 0xD8, 0xCE, 0xDC, 0xCE, 0xDC, 0xEF, 0x9E, 0x67, 0xB8, 0x67, 0xBC, 0x67, 0xBC,
2060xC6, 0xD8, 0xCA, 0xD8, 0xCA, 0xD8, 0xCA, 0xD8, 0xCB, 0x9A, 0xEF, 0x9A, 0xFF, 0xD8, 0xDB, 0xD8,
2070x66, 0xF4, 0x00, 0x64, 0xBA, 0x25, 0x22, 0x22, 0x26, 0x26, 0x26, 0x26, 0xF2, 0x00, 0xFA, 0x00,
2080xFA, 0x00, 0xFA, 0x00, 0xBA, 0x3D, 0xFA, 0x19, 0xFA, 0x19, 0xFA, 0x19, 0x44, 0xF9, 0xC2, 0xF0,
2090xC2, 0xF4, 0xC2, 0xF4, 0xFA, 0xF4, 0xFA, 0xF4, 0xFA, 0xF4, 0xFA, 0xF4, 0xC2, 0xD0, 0xCA, 0xD0,
2100xCA, 0xD0, 0xCA, 0xD0, 0xDA, 0xD0, 0xDA, 0xD0, 0xDA, 0xD0, 0xDA, 0xD0, 0x08, 0x63, 0xD3, 0x08
211211};
212212
213213
r18326r18327
231231
232232static const gfx_layout charlayout =
233233{
234 /* Todo  , just for sample */   
235   
234 /* Todo  , just for sample */
235
236236   8,8,
237237   RGN_FRAC(1,4),
238238   4,
r18326r18327
246246/*
247247static WRITE16_HANDLER( nevada_videoram_w )
248248{
249// Todo, Just for sample   
249// Todo, Just for sample
250250
251   nevada_state *state = space->machine().driver_data<nevada_state>();
252   state->m_videoram[offset] = data;
253   state->m_bg_tilemap->mark_tile_dirty(offset);
251    nevada_state *state = space->machine().driver_data<nevada_state>();
252    state->m_videoram[offset] = data;
253    state->m_bg_tilemap->mark_tile_dirty(offset);
254254
255255}
256256*/
257257/***************************************************************************/
258258static GFXDECODE_START( nevada )
259  /* Todo  , just for sample */   
259  /* Todo  , just for sample */
260260  GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout,   0, 8 )
261261GFXDECODE_END
262262
r18326r18327
264264/*
265265static TILE_GET_INFO( get_bg_tile_info )
266266{
267// Todo, Just for sample   
268   nevada_state *state = machine.driver_data<nevada_state>();
267// Todo, Just for sample
268    nevada_state *state = machine.driver_data<nevada_state>();
269269
270   int attr = state->m_colorram[tile_index];
271   int code = ((attr & 1) << 8) | state->m_videoram[tile_index];
272   int bank = (attr & 0x02) >> 1;
273   int color = (attr & 0x3c) >> 2;
270    int attr = state->m_colorram[tile_index];
271    int code = ((attr & 1) << 8) | state->m_videoram[tile_index];
272    int bank = (attr & 0x02) >> 1;
273    int color = (attr & 0x3c) >> 2;
274274
275   SET_TILE_INFO(bank, code, color, 0);
275    SET_TILE_INFO(bank, code, color, 0);
276276
277277}
278278*/
r18326r18327
280280/***************************************************************************/
281281static VIDEO_START( nevada )
282282{
283// todo   
283// todo
284284/*
285   nevada_state *state = machine.driver_data<nevada_state>();
286   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
287*/   
285    nevada_state *state = machine.driver_data<nevada_state>();
286    state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
287*/
288288}
289289
290290/***************************************************************************/
291291static SCREEN_UPDATE_IND16( nevada )
292292{
293293 // Todo
294/*
295   nevada_state *state = screen.machine().driver_data<nevada_state>();
296   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
297*/   
298  return 0;   
294/*
295    nevada_state *state = screen.machine().driver_data<nevada_state>();
296    state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
297*/
298  return 0;
299299}
300300
301301/***************************************************************************/
r18326r18327
319319      if (file)
320320         file->read(state->m_nvram,state->m_nvram.bytes());
321321      else
322      {   
322      {
323323        UINT16* defaultram = (UINT16 *) state->memregion("defaults")->base();
324324        memset(state->m_nvram,0x00,state->m_nvram.bytes());
325325        if (defaultram) memcpy(state->m_nvram, state->memregion("defaults")->base(), state->memregion("defaults")->bytes());
326      }     
326      }
327327   }
328328}
329329
330330/***************************************************************************
331331
332    U18 MC68681 RS232 UART  SIDEA = MODEM 1200 Baud
332    U18 MC68681 RS232 UART  SIDEA = MODEM 1200 Baud
333333    U18 MC68681 RS232 UART  SIDEB = not used
334334    Interrupt 4
335335***************************************************************************/
336336
337337static void duart18_irq_handler(device_t *device, int state, UINT8 vector )
338{     
338{
339339   device->machine().device("maincpu")->execute().set_input_line_and_vector(4, state, vector);
340340};
341341
342342/***************************************************************************/
343343static void duart18_tx(device_t *device, int channel, UINT8 data)
344344{
345//   nevada_state *state = device->machine().driver_data<nevada_state>();
346/* Todo  , just for sample */     
345//  nevada_state *state = device->machine().driver_data<nevada_state>();
346/* Todo  , just for sample */
347347   if ( channel == 0 )
348348   {
349            // Modem 1200 Baud
350   }     
349            // Modem 1200 Baud
350   }
351351};
352352
353353/***************************************************************************/
r18326r18327
367367***************************************************************************/
368368
369369static void duart39_irq_handler( device_t *device, int state, UINT8 vector )
370{   
370{
371371   device->machine().device("maincpu")->execute().set_input_line_and_vector(3, state, vector);
372372};
373373
374374/***************************************************************************/
375375static void duart39_tx(device_t *device, int channel, UINT8 data)
376376{
377//   nevada_state *state = device->machine().driver_data<nevada_state>();
378/* Todo  , just for sample */     
377//  nevada_state *state = device->machine().driver_data<nevada_state>();
378/* Todo  , just for sample */
379379   if ( channel == 0 )
380380   {
381381            // Printer
382   }   
382   }
383383   else
384384   {
385385     // Player Tracking Interface J2 (not used)
386   }   
387         
386   }
387
388388};
389389
390390/***************************************************************************/
r18326r18327
406406
407407static void duart40_irq_handler( device_t *device, int state, UINT8 vector )
408408{
409/* Todo  , just for sample */   
409/* Todo  , just for sample */
410410   device->machine().device("maincpu")->execute().set_input_line_and_vector(5, state, vector);
411411};
412412
413413/***************************************************************************/
414414static void duart40_tx( device_t *device, int channel, UINT8 data )
415415{
416/* Todo  , just for sample */   
416/* Todo  , just for sample */
417417          nevada_state *state = device->machine().driver_data<nevada_state>();
418418   if ( channel == 0 )
419419   {
r18326r18327
421421   }
422422   else
423423          {
424           // JCM Bill Acceptor   
425          }     
424           // JCM Bill Acceptor
425          }
426426};
427427/***************************************************************************/
428428WRITE8_MEMBER( nevada_state::microtouch_tx )
429429{
430   /* Todo  , just for sample */   
430   /* Todo  , just for sample */
431431   duart68681_rx_data(m_duart40_68681, 0, data);
432432}
433433
r18326r18327
464464{
465465   AY8910_LEGACY_OUTPUT,
466466   AY8910_DEFAULT_LOADS,
467//   DEVCB_INPUT_PORT("DSW1"),  /* not used */
468//   DEVCB_INPUT_PORT("DSW2"),  /* not used */
467//  DEVCB_INPUT_PORT("DSW1"),  /* not used */
468//  DEVCB_INPUT_PORT("DSW2"),  /* not used */
469469   DEVCB_NULL,   /* callback for display state changes */
470470   DEVCB_NULL,   /* callback for cursor state changes */
471471   DEVCB_NULL,
r18326r18327
474474
475475/***************************************************************************/
476476static READ16_HANDLER(io_board_r)
477{   
478  // IO board Serial communication 0xA00000     
479  return 1;   
477{
478  // IO board Serial communication 0xA00000
479  return 1;
480480}
481481/***************************************************************************/
482482static WRITE16_HANDLER(io_board_w)
r18326r18327
491491
492492/***************************************************************************/
493493static READ16_HANDLER( nevada_sec_r )
494{         
495   nevada_state *state = space.machine().driver_data<nevada_state>();   
496//   D3..D0 = DOOR OPEN or Track STATE of PAL35
497  UINT16 res;   
498    /* UPPER byte is use for input in PAL35 */         
494{
495   nevada_state *state = space.machine().driver_data<nevada_state>();
496//  D3..D0 = DOOR OPEN or Track STATE of PAL35
497  UINT16 res;
498    /* UPPER byte is use for input in PAL35 */
499499           // 74LS173 $bits Register used LOWER bits D3..D0 for PAL35 state and DOOR LOGIC SWITCH
500          res = pal35[state->m_datA40000 >> 8];
500          res = pal35[state->m_datA40000 >> 8];
501501          res = res << 8;
502502          res = res | (state->m_datA40000 & 0x00FF);
503         
503
504504   return res;
505505}
506506/***************************************************************************/
507507static WRITE16_HANDLER( nevada_sec_w )
508{   
509   nevada_state *state = space.machine().driver_data<nevada_state>();   
508{
509   nevada_state *state = space.machine().driver_data<nevada_state>();
510510   // 74LS173 $bits Register used LOWER bits D3..D0 for DOOR LOGIC SWITCH
511   state->m_datA40000 = data | 0x00f0;     // since D7..D4 are not used and are connected to PULLUP
512//   popmessage("WRITE %04x %04x  ",datA40000,data);
511   state->m_datA40000 = data | 0x00f0;    // since D7..D4 are not used and are connected to PULLUP
512//  popmessage("WRITE %04x %04x  ",datA40000,data);
513513}
514514
515515/***************************************************************************/
r18326r18327
5215211 x COIN DOOR SW
5225221 x TOP DOOR SW
5235231 x COMPUTER DOOR SW
524
524
525525Interrupt Vector
526526INT1  RTC MSM6242
527527INT2  nc
r18326r18327
539539
540540U18 MC68681 RS232 UART SIDEA = MODEM LOW SPEED 1200 BAUD from XECOM
541541
542U18 MC68681 PIN4  IP1  from U16 (75HC189 pin6) from PIN2 J90 UNKNOWN !
542U18 MC68681 PIN4  IP1  from U16 (75HC189 pin6) from PIN2 J90 UNKNOWN !
543543U18 MC68681 PIN36 IP2  ACCESS DOOR SWITCH
544544U18 MC68681 PIN2  IP3  LOW Battery Detector for ACCESS DOOR SWITCH
545545U18 MC68681 PIN39 IP4  from U12 75174  UNKNOWN !
r18326r18327
561561// missing adress for :
562562// external I/O board communication via PAL23
563563
564    A23 A22 A21 A20  | A19 A18 A17 A16 | A15 A14 A13 A12 | A11 A10 A9 A8 | A7 A6 A5 A4 | A3 A2 A1 xx
564    A23 A22 A21 A20  | A19 A18 A17 A16 | A15 A14 A13 A12 | A11 A10 A9 A8 | A7 A6 A5 A4 | A3 A2 A1 xx
565565    Memory Map (generic)
566566    --------------------
567567    00000000 0000FFFF  NVRAM  (only 0..FFFF vector and jump)  16bits
568568    00010000 00011FFF  BACKUP1                                 8bits
569    00020000 00021FFF  BACKUP2                                 8bits 
569    00020000 00021FFF  BACKUP2                                 8bits
570570    00B00000 00B01FFF  VIDEO RAM                               8bits
571571    00FA0000 00FBFFFF  Not used (Expension board  SRAM)
572572    00FC0000 00FDFFFF  PROGRAM                                16bits
573573    00FE0000 00FFFFFF  BOOTLOADER                             16bits
574574
575    00010001
575    00010001
576576    00014001
577577    00020001
578578    00024001
r18326r18327
582582    00A08001           I/O Board Communication
583583    00A10000 WDT    STROBE DS1232 WatchDog Controller (this adress reset Strobe of Ds1232)
584584    00A20001 AY8912 BDIR  AUDIO  Data bus on D7..D0
585    00A28001 AY8912 BC1   AUDIO   
585    00A28001 AY8912 BC1   AUDIO
586586    00A300x1 6242  CS  RTC  U41 A0..A3   (A4..A7 ON A0..A3)  Data bus on D3..D0
587587    00A4000x PAL   CS  READ   U35 SECURITY PAL16R8           Data bus on D15..D8
588588    00A4000x PAL   CLK WRITE  U35 SECURITY PAL16R8
r18326r18327
591591    00B100x0 68681 CS  UART U40 RS1..RS4 REGISTER (A4..A7 ON RS1..RS4)  Data bus on D7..D0
592592    00B200x0 68681 CS  UART U39 RS1..RS4 REGISTER (A4..A7 ON RS1..RS4)  Data bus on D7..D0
593593    00E000x0 68681 CS  UART U18 RS1..RS4 REGISTER (A4..A7 ON RS1..RS4)  Data bus on D15..D8
594*/   
594*/
595595/***************************************************************************/
596596static ADDRESS_MAP_START( nevada_map, AS_PROGRAM, 16,nevada_state )
597597   AM_RANGE(0x00000000, 0x0000ffff) AM_RAM AM_SHARE("nvram")
598598   AM_RANGE(0x00010000, 0x00021fff) AM_RAM AM_SHARE("backup")
599   AM_RANGE(0x00900000, 0x00900001) AM_DEVWRITE8("crtc",mc6845_device, address_w,0x00ff ) 
599   AM_RANGE(0x00900000, 0x00900001) AM_DEVWRITE8("crtc",mc6845_device, address_w,0x00ff )
600600   AM_RANGE(0x00908000, 0x00908001) AM_DEVWRITE8("crtc",mc6845_device,register_w,0x00ff )
601601   AM_RANGE(0x00a00000, 0x00a00001) AM_READWRITE_LEGACY (io_board_r,io_board_w)
602602   AM_RANGE(0x00a08000, 0x00a08001) AM_WRITE_LEGACY(io_board_x)
603603   AM_RANGE(0x00a10000, 0x00a10001) AM_WRITE(watchdog_reset16_w )
604   AM_RANGE(0x00a20000, 0x00a20001) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_w,0x00ff ) 
605   AM_RANGE(0x00a28000, 0x00a28001) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_w   ,0x00ff )   
604   AM_RANGE(0x00a20000, 0x00a20001) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_w,0x00ff )
605   AM_RANGE(0x00a28000, 0x00a28001) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_w   ,0x00ff )
606606   AM_RANGE(0x00a30000, 0x00A300ff) AM_DEVREADWRITE8("rtc",msm6242_device, read, write, 0x00ff)
607607   AM_RANGE(0x00a40000, 0x00A40001) AM_READWRITE_LEGACY( nevada_sec_r, nevada_sec_w)
608608        //AM_RANGE(0x00b00000, 0x00b01fff) AM_RAM_WRITE(nevada_videoram_w) AM_BASE_MEMBER(nevada_state, m_videoram)
r18326r18327
621621
622622ADDRESS_MAP_END
623623/*
624U18 MC68681 PIN4  IP1  from U16 (75HC189 pin6) from PIN2 J90 UNKNOWN !
624U18 MC68681 PIN4  IP1  from U16 (75HC189 pin6) from PIN2 J90 UNKNOWN !
625625U18 MC68681 PIN36 IP2  ACCESS DOOR SWITCH
626626U18 MC68681 PIN2  IP3  LOW Battery Detector for ACCESS DOOR SWITCH
627627U18 MC68681 PIN39 IP4  from U12 75174  UNKNOWN !
r18326r18327
656656   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_COIN2    )
657657   PORT_START("DSW3")
658658   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_COIN3    )
659   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_COIN4    )   
659   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_COIN4    )
660660   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_BUTTON7  ) PORT_NAME("LOW BATT U51")
661661INPUT_PORTS_END
662662
r18326r18327
694694{
695695
696696  nevada_state *state = machine.driver_data<nevada_state>();
697 
697
698698  state->m_duart18_68681 = machine.device( "duart18_68681" );
699699  state->m_duart39_68681 = machine.device( "duart39_68681" );
700700  state->m_duart40_68681 = machine.device( "duart40_68681" );
r18326r18327
710710   MCFG_CPU_ADD("maincpu", M68000, MASTER_CPU)
711711   MCFG_CPU_PROGRAM_MAP(nevada_map)
712712   MCFG_CPU_IO_MAP(nevada_iomap)  //0x10000 0x20000
713     
713
714714   MCFG_MACHINE_RESET(nevada)
715715          MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(150))   /* 150ms Ds1232 TD to Ground */
716   
717   
718   MCFG_NVRAM_HANDLER(nevada)   
719716
717
718   MCFG_NVRAM_HANDLER(nevada)
719
720720   // video hardware
721721   MCFG_SCREEN_ADD("screen", RASTER)
722722   MCFG_SCREEN_REFRESH_RATE(60)
723   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))         
723   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
724724   MCFG_SCREEN_SIZE((42+1)*8, (32+1)*8)                  /* From MC6845 init, registers 00 & 04 (programmed with value-1). */
725725   MCFG_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 31*8-1)    /* From MC6845 init, registers 01 & 06. */
726726   MCFG_SCREEN_UPDATE_STATIC(nevada)
r18326r18327
729729          MCFG_PALETTE_LENGTH(256)
730730   MCFG_PALETTE_INIT(nevada)
731731   MCFG_VIDEO_START(nevada)
732   
732
733733   MCFG_MC6845_ADD("crtc", MC6845, MC6845_CLOCK, mc6845_intf)
734   
734
735735   // sound hardware
736736   MCFG_SPEAKER_STANDARD_MONO("mono")
737737
738738   MCFG_SOUND_ADD("aysnd", AY8912, SOUND_CLOCK)
739739   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
740   
740
741741   MCFG_DUART68681_ADD( "duart18_68681", XTAL_3_6864MHz , nevada_duart18_68681_config )  // UARTA = Modem 1200Baud
742742   MCFG_DUART68681_ADD( "duart39_68681", XTAL_3_6864MHz , nevada_duart39_68681_config )  // UARTA = Printer
743743   MCFG_DUART68681_ADD( "duart40_68681", XTAL_3_6864MHz , nevada_duart40_68681_config )  // UARTA = Touch , UARTB = Bill Acceptor
744744   MCFG_MICROTOUCH_ADD( "microtouch", nevada_microtouch_config )
745745   /* devices */
746746   MCFG_MSM6242_ADD("rtc", nevada_rtc_intf)
747     
747
748748MACHINE_CONFIG_END
749749
750750/***************************************************************************/
751751ROM_START( nevada )
752   ROM_REGION( 0x1000000, "maincpu", 0 )   /* 2 x 27C512 */     
752   ROM_REGION( 0x1000000, "maincpu", 0 )   /* 2 x 27C512 */
753753   ROM_LOAD16_BYTE( "u9even.bin" ,     0xfc0000, 0x010000, CRC(ADB207BD) SHA1(3E3509B78FDF32785F92CB21272694673D25C563) )  // program fc0000..fdffff
754754   ROM_LOAD16_BYTE( "u10odd.bin" ,     0xfc0001, 0x010000, CRC(A79778D7) SHA1(6FF969F09D9781479360BCA3403B927099AD6481) )
755   
755
756756   ROM_LOAD16_BYTE( "u31even.bin",     0xfe0000, 0x010000, CRC(C9779F30) SHA1(5310B3D8B5E887313CE8059BD72D0730A295074F) )  // Boot fe0000..ffffff
757   ROM_LOAD16_BYTE( "u32odd.bin" ,     0xfe0001, 0x010000, CRC(51035ED1) SHA1(66CBF582CDF34CF3DDE30CF8A99BBCED4AF1CE6F) )   
758     
757   ROM_LOAD16_BYTE( "u32odd.bin" ,     0xfe0001, 0x010000, CRC(51035ED1) SHA1(66CBF582CDF34CF3DDE30CF8A99BBCED4AF1CE6F) )
758
759759   ROM_REGION16_BE( 0x0010000, "defaults", 0 )   /* 2 x 62256  NVRAM */
760760   ROM_LOAD16_BYTE( "u30nv_even.bin",  0x000000, 0x008000, CRC(11f5c663) SHA1(f447fd59010bc7fbbda321c5aaf13e23c2aebd40) )  // NVRAM even  (RESET + Vector table in NVRAM)
761761   ROM_LOAD16_BYTE( "u33nv_odd.bin" ,  0x000001, 0x008000, CRC(20623da2) SHA1(2dd31a96f0a3454855cd975e8ee95e43316344e0) )  // NVRAM odd
r18326r18327
766766        /*
767767        BACKUP RAM
768768        PAL DUMP
769        */ 
769        */
770770ROM_END
771771
772772/***************************************************************************/
r18326r18327
775775*************************/
776776DRIVER_INIT_MEMBER(nevada_state,nevada)
777777{
778  UINT16 *ROM = (UINT16 *)memregion("maincpu")->base();   
779 
778  UINT16 *ROM = (UINT16 *)memregion("maincpu")->base();
779
780780   memset(m_backup,0x00,m_backup.bytes()); // temp
781   
781
782782  /* Patch for WDT test with int Level7 */
783783  /* PATCH FE0086   4278 0414 Clrf $0414 */
784784  /* this skip the test for the WDT */
785//   ROM[0xFE0086/2] = 0x4278; 
786//   ROM[0xFE0088/2] = 0x0414; 
787   
788 // Skip PAL SECURITY   
785//  ROM[0xFE0086/2] = 0x4278;
786//  ROM[0xFE0088/2] = 0x0414;
787
788 // Skip PAL SECURITY
789789   ROM[0xFE0248/2] = 0x4E71; // nop
790790   ROM[0xFE05D0/2] = 0x4E71; // nop
791791   ROM[0xFE05D8/2] = 0x6014; // bra
792792   ROM[0xFE0606/2] = 0x600A; // bra
793//   ROM[0xFE18B4/2] = 0x4E71; // nop
794 
795 
793//  ROM[0xFE18B4/2] = 0x4E71; // nop
794
795
796796}
797797/***************************************************************************/
798798
trunk/src/mame/drivers/jack.c
r18326r18327
7474    - When On  (0x80), lives are set to 255 (0xff) but they are NOT infinite
7575
7676  Other bits from DSW2 (but bit 5) don't seem to be read / tested at all ...
77 
7877
78
7979***************************************************************************/
8080
8181#include "emu.h"
r18326r18327
146146   // d0: related to test mode?
147147   // d1: unused?
148148   // d2: ?
149   
149
150150   // d3-d4: palette bank
151151   int palette_bank = data & (machine().total_colors() - 1) >> 3 & 0x18;
152152   if (m_joinem_palette_bank != palette_bank)
r18326r18327
157157
158158   // d5: assume nmi enable
159159   m_joinem_nmi_enable = data & 0x20;
160   
160
161161   // d6: unused?
162162
163163   // d7: flip screen
r18326r18327
890890MACHINE_START_MEMBER(jack_state,joinem)
891891{
892892   m_joinem_palette_bank = 0;
893   
893
894894   save_item(NAME(m_joinem_nmi_enable));
895895   save_item(NAME(m_joinem_palette_bank));
896896}
trunk/src/mame/drivers/shangha3.c
r18326r18327
557557   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
558558
559559   MCFG_SCREEN_ADD("screen", RASTER)
560//   MCFG_SCREEN_REFRESH_RATE(60)
561//   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
562//   MCFG_SCREEN_SIZE(24*16, 16*16)
563//   MCFG_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1)
560//  MCFG_SCREEN_REFRESH_RATE(60)
561//  MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
562//  MCFG_SCREEN_SIZE(24*16, 16*16)
563//  MCFG_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1)
564564   MCFG_SCREEN_RAW_PARAMS(BLOCKEN_MASTER_CLOCK/6,512,0,24*16,263,1*16,15*16) /* refresh rate is unknown */
565565
566566   MCFG_SCREEN_UPDATE_DRIVER(shangha3_state, screen_update_shangha3)
trunk/src/mame/drivers/savquest.c
r18326r18327
419419   AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide_r, ide_w)
420420   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
421421   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
422   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
422   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
423423   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE(fdc_r, fdc_w)
424424
425425   AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_bus_legacy_device, read, write)
trunk/src/mame/drivers/vicdual.c
r18326r18327
108108      /* increment the coin counter */
109109      coin_counter_w(machine(), 0, 1);
110110      coin_counter_w(machine(), 0, 0);
111     
111
112112      coin_in();
113113   }
114114}
r18326r18327
460460   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("DOOR:1") // 1 switch located on the inside of the coin door
461461   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
462462   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
463   
463
464464   // There is no dipswitch: on a physical level, these settings are applied by grounding
465465   // otherwise floating pins (ground wires are provided on pin 1/30)
466466   PORT_DIPNAME( 0x10, 0x10, "Allow Free Game" )      PORT_DIPLOCATION("PIN:5") // 26
r18326r18327
921921   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
922922
923923   PORT_START("IN2")
924//   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)         // it's like this according to the schematics, but gameplay speed is too fast;
924//  PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)          // it's like this according to the schematics, but gameplay speed is too fast;
925925   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL) // gameplay speed is correct now, there's likely an error in the schematics then...
926926   PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
927927   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
r18326r18327
12781278   PORT_DIPNAME( 0x03, 0x01, "Head On 2 Lives" )   PORT_DIPLOCATION("SW1:1,2")
12791279   PORT_DIPSETTING(    0x00, "2" )
12801280   PORT_DIPSETTING(    0x01, "3" )
1281//   PORT_DIPSETTING(    0x02, "3" ) // dupe
1281//  PORT_DIPSETTING(    0x02, "3" ) // dupe
12821282   PORT_DIPSETTING(    0x03, "4" )
12831283
12841284   /* There's probably a bug in the Invinco game code:
r18326r18327
12901290   PORT_DIPNAME( 0x03, 0x03, "Invinco Lives" )      PORT_DIPLOCATION("SW1:3,4")
12911291   PORT_DIPSETTING(    0x03, "3" )
12921292   PORT_DIPSETTING(    0x02, "4" )
1293//   PORT_DIPSETTING(    0x01, "5" ) // results in 3, see above
1294//   PORT_DIPSETTING(    0x00, "6" ) // results in 4, see above
1293//  PORT_DIPSETTING(    0x01, "5" ) // results in 3, see above
1294//  PORT_DIPSETTING(    0x00, "6" ) // results in 4, see above
12951295
12961296INPUT_PORTS_END
12971297
r18326r18327
16461646   PORT_DIPSETTING(    0x00, "3" )
16471647   PORT_DIPSETTING(    0x01, "4" )
16481648   PORT_DIPSETTING(    0x02, "5" )
1649//   PORT_DIPSETTING(    0x03, "5" ) // dupe
1649//  PORT_DIPSETTING(    0x03, "5" ) // dupe
16501650INPUT_PORTS_END
16511651
16521652
r18326r18327
17001700   PORT_DIPSETTING(    0x00, "3" )
17011701   PORT_DIPSETTING(    0x01, "4" )
17021702   PORT_DIPSETTING(    0x02, "5" )
1703//   PORT_DIPSETTING(    0x03, "5" ) // dupe
1703//  PORT_DIPSETTING(    0x03, "5" ) // dupe
17041704INPUT_PORTS_END
17051705
17061706
r18326r18327
20642064   PORT_START("IN1")
20652065   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
20662066   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,samurai_protection_r, (void *)1)
2067   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW1:2") // unknown, but used
2067   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )         PORT_DIPLOCATION("SW1:2") // unknown, but used
20682068   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
20692069   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
20702070   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
r18326r18327
22012201                  m_nsub_play_counter++;
22022202               }
22032203            }
2204           
2204
22052205            // increment coin counter
22062206            coin_counter_w(machine(), which, 1);
22072207            coin_counter_w(machine(), which, 0);
r18326r18327
22112211         case 2:
22122212            m_nsub_play_counter++;
22132213            break;
2214         
2214
22152215         default:
22162216            break;
22172217      }
r18326r18327
22492249   PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
22502250   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
22512251   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
2252//   PORT_DIPSETTING(    0x00, DEF_STR( 0C_1C ) ) // invalid
2252//  PORT_DIPSETTING(    0x00, DEF_STR( 0C_1C ) ) // invalid
22532253   PORT_DIPNAME( 0x78, 0x08, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW:4,5,6,7")
22542254   PORT_DIPSETTING(    0x40, "Shared With Coin A" )
2255//   PORT_DIPSETTING(    0x00, DEF_STR( 1C_0C ) ) // invalid
2255//  PORT_DIPSETTING(    0x00, DEF_STR( 1C_0C ) ) // invalid
22562256   PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )
22572257   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
22582258   PORT_DIPSETTING(    0x18, DEF_STR( 1C_3C ) )
r18326r18327
22802280MACHINE_RESET_MEMBER(vicdual_state,nsub)
22812281{
22822282   m_nsub_coin_counter = ioport("COINAGE")->read() & 7;
2283   
2283
22842284   machine_reset();
22852285}
22862286
trunk/src/mame/drivers/cd32.c
r18326r18327
14751475/***************************************************************************************************/
14761476
14771477// these are clones of the cd32 SYSTEM because they run on a stock retail unit, with additional HW
1478GAME( 1993, cd32bios, 0,         cd32base, cd32,    cd32_state, cd32,    ROT0, "Commodore Business Machines", "CD32 Bios",       GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND | GAME_IS_BIOS_ROOT )
1478GAME( 1993, cd32bios, 0,      cd32base, cd32,    cd32_state, cd32,    ROT0, "Commodore Business Machines", "CD32 Bios",       GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND | GAME_IS_BIOS_ROOT )
14791479GAME( 1995, cndypuzl, cd32bios, cd32base, cndypuzl, cd32_state, cndypuzl, ROT0, "CD Express", "Candy Puzzle (v1.0)",       GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
14801480GAME( 1995, haremchl, cd32bios, cd32base, haremchl, cd32_state, haremchl, ROT0, "CD Express", "Harem Challenge",           GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
14811481GAME( 1995, lsrquiz,  cd32bios, cd32base, lsrquiz,  cd32_state,  lsrquiz,  ROT0, "CD Express", "Laser Quiz Italy",          GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )  /* no player 2 inputs (ingame) */
trunk/src/mame/drivers/intrscti.c
r18326r18327
9090static ADDRESS_MAP_START( intrscti_sub_map, AS_PROGRAM, 8, intrscti_state )
9191   AM_RANGE(0x0000, 0x07ff) AM_ROM
9292   AM_RANGE(0x2000, 0x23ff) AM_RAM
93//   AM_RANGE(0x0000, 0xffff) AM_WRITENOP
93//  AM_RANGE(0x0000, 0xffff) AM_WRITENOP
9494ADDRESS_MAP_END
9595
9696static ADDRESS_MAP_START( intrscti_sub_io_map, AS_IO, 8, intrscti_state )
9797   ADDRESS_MAP_GLOBAL_MASK(0xff)
98//   AM_RANGE(0x00, 0xff) AM_NOP
98//  AM_RANGE(0x00, 0xff) AM_NOP
9999ADDRESS_MAP_END
100100
101101
trunk/src/mame/drivers/saturn.c
r18326r18327
19861986MACHINE_RESET_MEMBER(saturn_state,saturn)
19871987{
19881988   m_scsp_last_line = 0;
1989   
1989
19901990   // don't let the slave cpu and the 68k go anywhere
19911991   machine().device("slave")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
19921992   machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
r18326r18327
20672067MACHINE_RESET_MEMBER(saturn_state,stv)
20682068{
20692069   m_scsp_last_line = 0;
2070   
2070
20712071   // don't let the slave cpu and the 68k go anywhere
20722072   machine().device("slave")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
20732073   machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
trunk/src/mame/drivers/calchase.c
r18326r18327
601601   AM_RANGE(0x03a0, 0x03a7) AM_NOP //To debug
602602   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", trident_vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
603603   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", trident_vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
604   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", trident_vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
604   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", trident_vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
605605   AM_RANGE(0x03e0, 0x03ef) AM_NOP //To debug
606606   AM_RANGE(0x0378, 0x037f) AM_NOP //To debug
607607   // AM_RANGE(0x0300, 0x03af) AM_NOP
trunk/src/mame/drivers/pcat_dyn.c
r18326r18327
7070   AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff)
7171   AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff)
7272   AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff)
73   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)   
73   AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff)
7474ADDRESS_MAP_END
7575
7676#define AT_KEYB_HELPER(bit, text, key1) \
trunk/src/mame/machine/megacd.c
r18326r18327
159159   MCFG_TIMER_DRIVER_ADD("stamp_timer", sega_segacd_device, segacd_gfx_conversion_timer_callback)
160160   MCFG_TIMER_DRIVER_ADD("scd_dma_timer", sega_segacd_device, scd_dma_timer_callback)
161161
162   
163162
163
164164   MCFG_DEFAULT_LAYOUT( layout_megacd )
165165
166166   MCFG_SOUND_ADD( "cdda", CDDA, 0 )
r18326r18327
11001100
11011101WRITE16_MEMBER( sega_segacd_device::scd_a12000_halt_reset_w )
11021102{
1103   
11041103
1104
11051105   UINT16 old_halt = a12000_halt_reset_reg;
11061106
11071107   COMBINE_DATA(&a12000_halt_reset_reg);
r18326r18327
11701170
11711171READ16_MEMBER( sega_segacd_device::scd_a12002_memory_mode_r )
11721172{
1173   
11741173
1174
11751175   int temp = scd_rammode;
11761176   int temp2 = 0;
11771177
r18326r18327
12081208
12091209WRITE8_MEMBER( sega_segacd_device::scd_a12002_memory_mode_w_0_7 )
12101210{
1211   
12121211
12131212
1213
12141214   //printf("scd_a12002_memory_mode_w_0_7 %04x\n",data);
12151215
12161216   segacd_4meg_prgbank = (data&0x00c0)>>6;
r18326r18327
12341234
12351235WRITE16_MEMBER( sega_segacd_device::scd_a12002_memory_mode_w )
12361236{
1237   
12381237
1238
12391239   if (ACCESSING_BITS_8_15)
12401240      scd_a12002_memory_mode_w_8_15(space, 0, data>>8, mem_mask>>8);
12411241
r18326r18327
12481248
12491249READ16_MEMBER( sega_segacd_device::segacd_sub_memory_mode_r )
12501250{
1251   
12521251
1252
12531253   int temp = scd_rammode;
12541254   int temp2 = 0;
12551255
r18326r18327
12701270
12711271WRITE8_MEMBER( sega_segacd_device::segacd_sub_memory_mode_w_0_7 )
12721272{
1273   
12741273
12751274
1275
12761276   segacd_memory_priority_mode = (data&0x0018)>>3;
12771277
12781278   // If the mode bit is 0 then we're requesting a change to
r18326r18327
13301330WRITE16_MEMBER( sega_segacd_device::segacd_sub_memory_mode_w )
13311331{
13321332   //printf("segacd_sub_memory_mode_w %04x %04x\n", data, mem_mask);
1333   
13341333
1334
13351335   if (ACCESSING_BITS_8_15)
13361336      segacd_sub_memory_mode_w_8_15(space, 0, data>>8, mem_mask>>8);
13371337
r18326r18327
13521352
13531353READ16_MEMBER( sega_segacd_device::segacd_comms_flags_r )
13541354{
1355   
1355
13561356   return segacd_comms_flags;
13571357}
13581358
13591359WRITE16_MEMBER( sega_segacd_device::segacd_comms_flags_subcpu_w )
13601360{
1361   
13621361
1362
13631363   if (ACCESSING_BITS_8_15) // Dragon's Lair
13641364   {
13651365      segacd_comms_flags = (segacd_comms_flags & 0xff00) | ((data >> 8) & 0x00ff);
r18326r18327
13741374
13751375WRITE16_MEMBER( sega_segacd_device::segacd_comms_flags_maincpu_w )
13761376{
1377   
13781377
1378
13791379   if (ACCESSING_BITS_8_15)
13801380   {
13811381      segacd_comms_flags = (segacd_comms_flags & 0x00ff) | (data & 0xff00);
r18326r18327
14101410
14111411READ16_MEMBER( sega_segacd_device::segacd_comms_main_part1_r )
14121412{
1413   
1413
14141414   return segacd_comms_part1[offset];
14151415}
14161416
14171417WRITE16_MEMBER( sega_segacd_device::segacd_comms_main_part1_w )
14181418{
1419   
1419
14201420   COMBINE_DATA(&segacd_comms_part1[offset]);
14211421}
14221422
14231423READ16_MEMBER( sega_segacd_device::segacd_comms_main_part2_r )
14241424{
1425   
1425
14261426   return segacd_comms_part2[offset];
14271427}
14281428
r18326r18327
14341434
14351435READ16_MEMBER( sega_segacd_device::segacd_comms_sub_part1_r )
14361436{
1437   
1437
14381438   return segacd_comms_part1[offset];
14391439}
14401440
r18326r18327
14451445
14461446READ16_MEMBER( sega_segacd_device::segacd_comms_sub_part2_r )
14471447{
1448   
1448
14491449   return segacd_comms_part2[offset];
14501450}
14511451
14521452WRITE16_MEMBER( sega_segacd_device::segacd_comms_sub_part2_w )
14531453{
1454   
1454
14551455   COMBINE_DATA(&segacd_comms_part2[offset]);
14561456}
14571457
r18326r18327
16201620
16211621READ16_MEMBER( sega_segacd_device::scd_a12006_hint_register_r )
16221622{
1623   
1623
16241624   return segacd_hint_register;
16251625}
16261626
16271627WRITE16_MEMBER( sega_segacd_device::scd_a12006_hint_register_w )
16281628{
1629   
1629
16301630   COMBINE_DATA(&segacd_hint_register);
16311631}
16321632
r18326r18327
21292129
21302130READ16_MEMBER( sega_segacd_device::segacd_irq_mask_r )
21312131{
2132   
2132
21332133   return segacd_irq_mask;
21342134}
21352135
r18326r18327
21382138   if (ACCESSING_BITS_0_7)
21392139   {
21402140      UINT16 control = CDD_CONTROL;
2141     
2141
21422142   //  printf("segacd_irq_mask_w %04x %04x (CDD control is %04x)\n",data, mem_mask, control);
21432143
21442144      if (data & 0x10)
r18326r18327
21662166
21672167READ16_MEMBER( sega_segacd_device::segacd_cdd_ctrl_r )
21682168{
2169   
2169
21702170   return CDD_CONTROL;
21712171}
21722172
r18326r18327
21762176   if (ACCESSING_BITS_0_7)
21772177   {
21782178      UINT16 control = CDD_CONTROL;
2179     
21802179
2180
21812181      //printf("segacd_cdd_ctrl_w %04x %04x (control %04x irq %04x\n", data, mem_mask, control, segacd_irq_mask);
21822182
21832183      data &=0x4; // only HOCK bit is writable
r18326r18327
25802580   segacd_irq3_timer = machine().device<timer_device>(":segacd:irq3_timer");
25812581
25822582   address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
2583   
2583
25842584   segacd_font_bits = reinterpret_cast<UINT16 *>(machine().root_device().memshare(":segacd:segacd_font")->ptr());
25852585   segacd_backupram = reinterpret_cast<UINT16 *>(machine().root_device().memshare(":segacd:backupram")->ptr());
25862586   segacd_dataram = reinterpret_cast<UINT16 *>(machine().root_device().memshare(":segacd:dataram")->ptr());
2587//   segacd_dataram2 = reinterpret_cast<UINT16 *>(machine().root_device().memshare(":segacd:dataram2")->ptr());
2587//  segacd_dataram2 = reinterpret_cast<UINT16 *>(machine().root_device().memshare(":segacd:dataram2")->ptr());
25882588   segacd_4meg_prgram = reinterpret_cast<UINT16 *>(machine().root_device().memshare(":segacd:segacd_program")->ptr());
2589   
2589
25902590   segacd_4meg_prgbank = 0;
25912591
25922592
r18326r18327
26182618
26192619   space.install_read_handler (0x0000070, 0x0000073, read16_delegate(FUNC(sega_segacd_device::scd_hint_vector_r),this) );
26202620
2621   
26222621
26232622
26242623
2624
26252625   /* create the char set (gfx will then be updated dynamically from RAM) */
26262626   machine().gfx[0] = auto_alloc(machine(), gfx_element(machine(), sega_16x16_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0));
26272627   machine().gfx[1] = auto_alloc(machine(), gfx_element(machine(), sega_16x16_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0));
r18326r18327
26982698
26992699
27002700   // initialize some stuff on reset
2701   
2701
27022702   segacd_ram_writeprotect_bits = 0;
27032703   segacd_4meg_prgbank = 0;
27042704   segacd_memory_priority_mode = 0;
trunk/src/mame/machine/megacd.h
r18326r18327
370370   UINT16 segacd_imagebuffer_start_address;
371371   UINT16 segacd_imagebuffer_offset;
372372
373   
373
374374   UINT16 segacd_comms_flags;// = 0x0000;
375375   UINT16 segacd_comms_part1[0x8];
376376   UINT16 segacd_comms_part2[0x8];
r18326r18327
422422   UINT32 CDD_EXT;
423423   UINT16 CDD_CONTROL;
424424   INT16  CDD_DONE;
425   
425
426426   TIMER_DEVICE_CALLBACK_MEMBER( segacd_irq3_timer_callback );
427427   TIMER_DEVICE_CALLBACK_MEMBER( scd_dma_timer_callback );
428428   TIMER_DEVICE_CALLBACK_MEMBER( segacd_access_timer_callback );
r18326r18327
480480   void SCD_GET_TILE_INFO_32x32_1x1( int& tile_region, int& tileno, int tile_index );
481481   void SCD_GET_TILE_INFO_16x16_16x16( int& tile_region, int& tileno, int tile_index );
482482   void SCD_GET_TILE_INFO_32x32_16x16( int& tile_region, int& tileno, int tile_index );
483   
483
484484   TILE_GET_INFO_MEMBER( get_stampmap_16x16_1x1_tile_info );
485485   TILE_GET_INFO_MEMBER( get_stampmap_32x32_1x1_tile_info );
486486   TILE_GET_INFO_MEMBER( get_stampmap_16x16_16x16_tile_info );
r18326r18327
556556   WRITE16_MEMBER( segacd_stampmap_base_address_w );
557557   READ16_MEMBER( segacd_imagebuffer_start_address_r );
558558   WRITE16_MEMBER( segacd_imagebuffer_start_address_w );
559   READ16_MEMBER( segacd_imagebuffer_offset_r );   
559   READ16_MEMBER( segacd_imagebuffer_offset_r );
560560   WRITE16_MEMBER( segacd_imagebuffer_offset_w );
561   READ16_MEMBER( segacd_imagebuffer_vcell_size_r );   
561   READ16_MEMBER( segacd_imagebuffer_vcell_size_r );
562562   WRITE16_MEMBER( segacd_imagebuffer_vcell_size_w );
563563   READ16_MEMBER( segacd_imagebuffer_hdot_size_r );
564564   WRITE16_MEMBER( segacd_imagebuffer_hdot_size_w );
r18326r18327
569569   READ16_MEMBER( segacd_cdfader_r );
570570   WRITE16_MEMBER( segacd_cdfader_w );
571571   READ16_MEMBER( segacd_backupram_r );
572   WRITE16_MEMBER( segacd_backupram_w );   
572   WRITE16_MEMBER( segacd_backupram_w );
573573   READ16_MEMBER( segacd_font_color_r );
574574   WRITE16_MEMBER( segacd_font_color_w );
575575   READ16_MEMBER( segacd_font_converted_r );
trunk/src/mame/machine/seicop.c
r18326r18327
20482048
20492049   {
20502050      height = UINT8(cop_collision_info[offs].hitbox_y >> 8);
2051       start_y = INT8(cop_collision_info[offs].hitbox_y);
2051      start_y = INT8(cop_collision_info[offs].hitbox_y);
20522052      width = UINT8(cop_collision_info[offs].hitbox_x >> 8);
2053       start_x = INT8(cop_collision_info[offs].hitbox_x);
2054    }
2053      start_x = INT8(cop_collision_info[offs].hitbox_x);
2054   }
20552055
20562056   cop_collision_info[offs].min_x = (cop_collision_info[offs].x >> 16) + start_x;
20572057   cop_collision_info[offs].max_x = cop_collision_info[offs].min_x + width;
r18326r18327
20892089
20902090   //if(res == 0)
20912091   //popmessage("0:%08x %08x %08x 1:%08x %08x %08x\n",cop_collision_info[0].x,cop_collision_info[0].y,cop_collision_info[0].hitbox,cop_collision_info[1].x,cop_collision_info[1].y,cop_collision_info[1].hitbox);
2092//   popmessage("0:%08x %08x %08x %08x 1:%08x %08x %08x %08x\n",cop_collision_info[0].min_x,cop_collision_info[0].max_x,cop_collision_info[0].min_y, cop_collision_info[0].max_y,
2093//                                                    cop_collision_info[1].min_x,cop_collision_info[1].max_x,cop_collision_info[1].min_y, cop_collision_info[1].max_y);
2092//  popmessage("0:%08x %08x %08x %08x 1:%08x %08x %08x %08x\n",cop_collision_info[0].min_x,cop_collision_info[0].max_x,cop_collision_info[0].min_y, cop_collision_info[0].max_y,
2093//                                                   cop_collision_info[1].min_x,cop_collision_info[1].max_x,cop_collision_info[1].min_y, cop_collision_info[1].max_y);
20942094
20952095   return res;
20962096}
r18326r18327
27792779            cur_angle = INT8(space.read_byte(cop_register[0] + (0x34 ^ 3)));
27802780            //space.write_byte(cop_register[0] + (0^3),space.read_byte(cop_register[0] + (0^3)) & 0xfb); //correct?
27812781            /*
2782            0x00      0x00          0x60            0x00
2783            0x00      0x20          0x60            0x20
2784            0x00      0x40          0x60            0x60
2785            0x00      0x60          0x60            0x60
2786            0x00      0x80          0x60            0xa0
2787            0x00      0xa0          0x60            0xa0
2788            0x00      0xc0          0x60            0xc0
2789            0x00      0xe0          0x60            0xe0
2790            */
2782                0x00      0x00          0x60            0x00
2783                0x00      0x20          0x60            0x20
2784                0x00      0x40          0x60            0x60
2785                0x00      0x60          0x60            0x60
2786                0x00      0x80          0x60            0xa0
2787                0x00      0xa0          0x60            0xa0
2788                0x00      0xc0          0x60            0xc0
2789                0x00      0xe0          0x60            0xe0
2790                */
27912791
27922792            if(cur_angle > cop_angle_compare)
27932793            {
trunk/src/mame/machine/pcecommn.h
r18326r18327
1818      : driver_device(mconfig, type, tag) { }
1919
2020   DECLARE_WRITE8_MEMBER(pce_joystick_w);
21   DECLARE_READ8_MEMBER(pce_joystick_r);     
22   
21   DECLARE_READ8_MEMBER(pce_joystick_r);
22
2323   DECLARE_DRIVER_INIT(pce_common);
24   
24
2525   virtual UINT8 joy_read();
2626private:
27   UINT8 m_io_port_options;    /*driver-specific options for the PCE*/
27   UINT8 m_io_port_options;   /*driver-specific options for the PCE*/
2828   int m_joystick_port_select; /* internal index of joystick ports */
2929   int m_joystick_data_select; /* which nibble of joystick data we want */
3030};
trunk/src/mame/machine/archimds.c
r18326r18327
867867         case VIDC_HCR:  m_vidc_regs[VIDC_HCR] =  ((val >> 14)<<1)+1;   break;
868868//          case VIDC_HSWR: m_vidc_regs[VIDC_HSWR] = (val >> 14)+1;   break;
869869         case VIDC_HBSR: m_vidc_regs[VIDC_HBSR] = ((val >> 14)<<1)+1;   break;
870         case VIDC_HDSR: m_vidc_regs[VIDC_HDSR] = (val >> 14);    break;
871         case VIDC_HDER: m_vidc_regs[VIDC_HDER] = (val >> 14);    break;
870         case VIDC_HDSR: m_vidc_regs[VIDC_HDSR] = (val >> 14);   break;
871         case VIDC_HDER: m_vidc_regs[VIDC_HDER] = (val >> 14);   break;
872872         case VIDC_HBER: m_vidc_regs[VIDC_HBER] = ((val >> 14)<<1)+1;   break;
873873//          #define VIDC_HCSR       0x98
874874//          #define VIDC_HIR        0x9c
trunk/src/mame/machine/genpin.h
r18326r18327
3030MACHINE_CONFIG_EXTERN( genpin_audio );
3131
3232
33#endif /* GENPIN_H_ */
No newline at end of file
33#endif /* GENPIN_H_ */
trunk/src/mame/includes/decocass.h
r18326r18327
210210   DECLARE_WRITE8_MEMBER(decocass_center_v_shift_w);
211211
212212   void decocass_video_state_save_init();
213   
213
214214   DECLARE_WRITE8_MEMBER(ram_w);
215215   DECLARE_WRITE8_MEMBER(charram_w);
216216   DECLARE_WRITE8_MEMBER(fgvideoram_w);
r18326r18327
239239   DECLARE_READ8_MEMBER(decocass_type5_r);
240240   DECLARE_WRITE8_MEMBER(decocass_type5_w);
241241   DECLARE_READ8_MEMBER(decocass_nodong_r);
242   
242
243243   void draw_object(bitmap_ind16 &bitmap, const rectangle &cliprect);
244244   void draw_center(bitmap_ind16 &bitmap, const rectangle &cliprect);
245245   void mark_bg_tile_dirty(offs_t offset);
246246   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int color,
247247               int sprite_y_adjust, int sprite_y_adjust_flip_screen,
248248               UINT8 *sprite_ram, int interleave);
249               
249
250250   void draw_missiles(bitmap_ind16 &bitmap, const rectangle &cliprect,
251251               int missile_y_adjust, int missile_y_adjust_flip_screen,
252               UINT8 *missile_ram, int interleave);                     
252               UINT8 *missile_ram, int interleave);
253253};
254254
trunk/src/mame/includes/m79amb.h
r18326r18327
1414   required_shared_ptr<UINT8> m_mask;
1515
1616   required_device<discrete_device> m_discrete;
17   
17
1818   /* misc */
1919   UINT8 m_lut_gun1[0x100];
2020   UINT8 m_lut_gun2[0x100];
trunk/src/mame/includes/bzone.h
r18326r18327
1818        m_discrete(*this, "discrete") { }
1919
2020   optional_device<discrete_device> m_discrete;
21   
21
2222   UINT8 m_analog_data;
2323   UINT8 m_rb_input_select;
2424   DECLARE_WRITE8_MEMBER(bzone_coin_counter_w);
trunk/src/mame/includes/orbit.h
r18326r18327
2727   /* memory pointers */
2828   required_shared_ptr<UINT8> m_playfield_ram;
2929   required_shared_ptr<UINT8> m_sprite_ram;
30   
30
3131   required_device<discrete_device> m_discrete;
3232
3333   /* video-related */
trunk/src/mame/includes/archimds.h
r18326r18327
6868   UINT8 m_ioc_regs[0x80/4];
6969   UINT8 m_vidc_bpp_mode;
7070   UINT8 m_vidc_interlace;
71     
71
7272   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7373   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7474private:
r18326r18327
7777   static const device_timer_id TIMER_VIDEO = 1;
7878   static const device_timer_id TIMER_AUDIO = 2;
7979   static const device_timer_id TIMER_IOC = 3;
80   
80
8181   void vidc_vblank();
8282   void vidc_video_tick();
8383   void vidc_audio_tick();
8484   void ioc_timer(int param);
85   
86   void vidc_dynamic_res_change();   
85
86   void vidc_dynamic_res_change();
8787   void latch_timer_cnt(int tmr);
8888   void a310_set_timer(int tmr);
8989   DECLARE_READ32_MEMBER(ioc_ctrl_r);
r18326r18327
9999   UINT8 m_vidc_pixel_clk;
100100   UINT8 m_vidc_stereo_reg[8];
101101   emu_timer *m_timer[4], *m_snd_timer, *m_vid_timer;
102   emu_timer *m_vbl_timer;   
102   emu_timer *m_vbl_timer;
103103};
104104
105105/* IOC registers */
trunk/src/mame/includes/dkong.h
r18326r18327
110110   const UINT8 *     m_color_codes;
111111   emu_timer *       m_scanline_timer;
112112   INT8              m_vidhw;         /* Selected video hardware RS Conversion / TKG04 */
113   
113
114114   optional_device<discrete_device> m_discrete;
115115   /* radar scope */
116116
trunk/src/mame/includes/irobot.h
r18326r18327
7474   DECLARE_READ8_MEMBER(irobot_status_r);
7575   DECLARE_WRITE8_MEMBER(irobot_paletteram_w);
7676   DECLARE_READ8_MEMBER(quad_pokeyn_r);
77   DECLARE_WRITE8_MEMBER(quad_pokeyn_w);   
77   DECLARE_WRITE8_MEMBER(quad_pokeyn_w);
7878   DECLARE_DRIVER_INIT(irobot);
7979   virtual void machine_reset();
8080   virtual void video_start();
trunk/src/mame/includes/vicdual.h
r18326r18327
3333
3434   void coin_in();
3535   void assert_coin_status();
36   
36
3737   DECLARE_WRITE8_MEMBER(vicdual_videoram_w);
3838   DECLARE_WRITE8_MEMBER(vicdual_characterram_w);
3939   DECLARE_READ8_MEMBER(depthch_io_r);
trunk/src/mame/includes/megadriv.h
r18326r18327
107107   : driver_device(mconfig, type, tag),
108108      m_vdp(*this,"gen_vdp"),
109109      m_megadrive_ram(*this,"megadrive_ram")
110   {
110   {
111111      sega_cd_connected = 0;
112112   }
113113   required_device<sega_genesis_vdp_device> m_vdp;
r18326r18327
273273   DECLARE_VIDEO_START(segac2_new);
274274   DECLARE_MACHINE_START(segac2);
275275   DECLARE_MACHINE_RESET(segac2);
276   
276
277277   UINT32 screen_update_segac2_new(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
278278};
279279
r18326r18327
313313   DECLARE_DRIVER_INIT(megaplay);
314314   DECLARE_VIDEO_START(megplay);
315315   DECLARE_MACHINE_RESET(megaplay);
316   
316
317317   UINT32 screen_update_megplay(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
318318   void screen_eof_megaplay(screen_device &screen, bool state);
319319};
trunk/src/mame/includes/kaneko16.h
r18326r18327
116116   DECLARE_DRIVER_INIT(berlwall);
117117   DECLARE_PALETTE_INIT(berlwall);
118118   DECLARE_VIDEO_START(berlwall);
119   UINT32 screen_update_berlwall(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);   
119   UINT32 screen_update_berlwall(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
120120};
121121
122122class kaneko16_shogwarr_state : public kaneko16_state
trunk/src/mame/includes/mw8080bw.h
r18326r18327
4747   required_shared_ptr<UINT8> m_main_ram;
4848   optional_shared_ptr<UINT8> m_colorram;
4949   optional_device<discrete_device> m_discrete;
50   
50
5151   /* sound-related */
5252   UINT8       m_port_1_last;
5353   UINT8       m_port_2_last;
r18326r18327
7878   samples_device *m_samples2;
7979   device_t *m_sn1;
8080   device_t *m_sn2;
81   device_t *m_sn;   
81   device_t *m_sn;
8282
8383   DECLARE_READ8_MEMBER(mw8080bw_shift_result_rev_r);
8484   DECLARE_READ8_MEMBER(mw8080bw_reversable_shift_result_r);
trunk/src/mame/includes/deco32.h
r18326r18327
107107   DECLARE_VIDEO_START(nslasher);
108108   UINT32 screen_update_captaven(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
109109   UINT32 screen_update_fghthist(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
110   UINT32 screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);   
110   UINT32 screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
111111   void screen_eof_captaven(screen_device &screen, bool state);
112112   INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
113113   TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
trunk/src/mame/includes/crbaloon.h
r18326r18327
2424   required_shared_ptr<UINT8> m_colorram;
2525   required_shared_ptr<UINT8> m_spriteram;
2626   required_shared_ptr<UINT8> m_pc3092_data;
27   required_device<discrete_device> m_discrete;   
27   required_device<discrete_device> m_discrete;
2828   UINT16 m_collision_address;
2929   UINT8 m_collision_address_clear;
3030   tilemap_t *m_bg_tilemap;
trunk/src/mame/includes/ninjakd2.h
r18326r18327
4747   void omegaf_io_protection_reset();
4848   void robokid_motion_error_kludge(UINT16 offset);
4949   void video_init_common(UINT32 vram_alloc_size);
50   
50
5151   DECLARE_WRITE8_MEMBER(ninjakd2_bankselect_w);
5252   DECLARE_WRITE8_MEMBER(ninjakd2_soundreset_w);
5353   DECLARE_WRITE8_MEMBER(ninjakd2_pcm_play_w);
trunk/src/mame/includes/stv.h
r18326r18327
202202   UINT32 screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
203203   TIMER_DEVICE_CALLBACK_MEMBER(saturn_scanline);
204204   TIMER_DEVICE_CALLBACK_MEMBER(saturn_slave_scanline);
205   
205
206206   void scu_do_transfer(UINT8 event);
207207   void scu_test_pending_irq();
208208   DECLARE_READ32_MEMBER(saturn_scu_r);
r18326r18327
233233   void saturn_init_driver(int rgn);
234234
235235   int m_scsp_last_line;
236   
236
237237};
238238
239239#define MASTER_CLOCK_352 57272720
trunk/src/mame/includes/bfm_sc45.h
r18326r18327
5656
5757   int m_chk41addr;
5858   bool m_dochk41;
59   
59
6060   UINT16 m_mainram[0x10000/2];
6161
6262
trunk/src/mame/video/ninjakd2.c
r18326r18327
11/******************************************************************************
22
33    UPL "sprite framebuffer" hardware
4   
4
55    Functions to emulate the video hardware
66
77******************************************************************************/
r18326r18327
118118      m_robokid_bg0_videoram = auto_alloc_array_clear(machine(), UINT8, vram_alloc_size);
119119      m_robokid_bg1_videoram = auto_alloc_array_clear(machine(), UINT8, vram_alloc_size);
120120      m_robokid_bg2_videoram = auto_alloc_array_clear(machine(), UINT8, vram_alloc_size);
121     
121
122122      save_pointer(NAME(m_robokid_bg0_videoram), vram_alloc_size);
123123      save_pointer(NAME(m_robokid_bg1_videoram), vram_alloc_size);
124124      save_pointer(NAME(m_robokid_bg2_videoram), vram_alloc_size);
r18326r18327
352352       counts as one sprite drawn.
353353       This is proven by Mutant Night, which doesn't work correctly (leaves shots
354354       on screen) if we don't take big sprites into account.
355   */
355    */
356356
357357   for (;;)
358358   {
trunk/src/mame/video/awpvid.c
r18326r18327
77
88    This is a primitive handler for generating reels with multiple symbols visible
99    hanging off steppers.c .
10   
11   TODO: Add any lamping persistance simulations we need.
1210
11    TODO: Add any lamping persistance simulations we need.
12
1313**************************************************************************************/
1414
1515#include "emu.h"
trunk/src/mame/video/jack.c
r18326r18327
133133      case 0:
134134         m_bg_tilemap->set_scrolly(offset >> 2, -data);
135135         break;
136     
136
137137      // byte 1/2/3: no effect?
138138      default:
139139         break;
140140   }
141   
141
142142   m_scrollram[offset] = data;
143143}
144144
trunk/src/mame/video/dkong.c
r18326r18327
129129   {
130130      { RES_NET_AMP_DARLINGTON, 470 * TRS_J1, 470*(1-TRS_J1), 3, { 1000, 470, 220 } },
131131      { RES_NET_AMP_DARLINGTON, 470 * TRS_J1, 470*(1-TRS_J1), 3, { 1000, 470, 220 } },
132      { RES_NET_AMP_EMITTER,      680 * TRS_J1, 680*(1-TRS_J1), 2, {  470, 220,   0 } }    /*  radarscp */
132      { RES_NET_AMP_EMITTER,     680 * TRS_J1, 680*(1-TRS_J1), 2, {  470, 220,   0 } }    /*  radarscp */
133133   }
134134};
135135
r18326r18327
139139   {
140140      { RES_NET_AMP_DARLINGTON, 470, 4700, 0, { 0 } },
141141      { RES_NET_AMP_DARLINGTON, 470, 4700, 0, { 0 } },
142      { RES_NET_AMP_EMITTER,      470, 4700, 0, { 0 } }    /*  radarscp */
142      { RES_NET_AMP_EMITTER,     470, 4700, 0, { 0 } }    /*  radarscp */
143143   }
144144};
145145
r18326r18327
713713   int sig;
714714
715715   /* vsync is divided by 2 by a LS161
716    * The resulting 30 Hz signal clocks a LFSR (LS164) operating as a
717    * random number generator.
718    */
716     * The resulting 30 Hz signal clocks a LFSR (LS164) operating as a
717     * random number generator.
718     */
719719
720720   if ( line_cnt == 0)
721721   {

Previous 199869 Revisions Next


© 1997-2024 The MAME Team