Previous 199869 Revisions Next

r34433 Friday 16th January, 2015 at 00:09:11 UTC by Couriersud
Remove unnecessary oscore.h include
[hash]apple3.xml
[src/emu]emu.mak emuopts.h
[src/emu/bus/vcs]dpc.c
[src/emu/cpu/tms0980]tms0980.c tms0980.h
[src/emu/machine]atahle.c idehd.c
[src/emu/sound]tiaintf.c tiasound.c tiasound.h
[src/emu/ui]devopt.c devopt.h filemngr.c filemngr.h slotopt.c
[src/lib/util]chd.c
[src/mame]mame.lst
[src/mame/drivers]aleck64.c chihiro.c peplus.c stfight.c stlforce.c strnskil.c tourtabl.c
[src/mame/includes]stfight.h stlforce.h strnskil.h
[src/mame/machine]stfight.c
[src/mame/video]strnskil.c tia.c tia.h
[src/mess/drivers]a2600.c apple3.c comp4.c elecdet.c fmtowns.c ngen.c
[src/mess/machine]ngen_kb.c
[src/osd/osdmini]minimain.c osdmini.h osdmini.mak
[src/regtests/chdman/input/createhd_4]in.params
[src/regtests/chdman/input/createhd_5]in.params
[src/regtests/chdman/output/createhd_4]out.chd
[src/regtests/chdman/output/createhd_5]out.chd
[src/tools]chdman.c

trunk/hash/apple3.xml
r242944r242945
1<?xml version="1.0"?>
2<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
3
4<softwarelist name="apple3" description="Apple III 5.25 disks">
5
6   <software name="magneto">
7      <description>Capt'n Magneto (PD release APPLE-3-WAP-GAM-03)</description> <!-- was also released commercially - need those images, original game is 1983, this is a PD release of it from 1995 -->
8      <year>1995</year>
9      <publisher>Al Evans / WAP</publisher>
10
11      <part name="flop1" interface="floppy_5_25">
12         <dataarea name="flop" size="143360">
13            <rom name="apple-3-wap-gam-03a.dsk" size="143360" crc="fec20dbb" sha1="5ee6b1610649ad32df8ab00a2a272c3b79a92f26" offset="0x0000" />
14         </dataarea>
15      </part>
16      <part name="flop2" interface="floppy_5_25">
17         <dataarea name="flop" size="143360">
18            <rom name="apple-3-wap-gam-03b.dsk" size="143360" crc="a489f0b3" sha1="82c369ffec141b551732522edbe6d726b28da181" offset="0x0000" />
19         </dataarea>
20      </part>
21   </software>
22
23
24</softwarelist>
trunk/src/emu/bus/vcs/dpc.c
r242944r242945
2626{
2727   m_oscillator = timer_alloc(TIMER_OSC);
2828   m_oscillator->reset();
29
30   for (int i = 0; i < 8; i++)
31   {
32      save_item(NAME(m_df[i].top), i);
33      save_item(NAME(m_df[i].bottom), i);
34      save_item(NAME(m_df[i].low), i);
35      save_item(NAME(m_df[i].high), i);
36      save_item(NAME(m_df[i].flag), i);
37      save_item(NAME(m_df[i].music_mode), i);
38      save_item(NAME(m_df[i].osc_clk), i);
39   }
40   
41   save_item(NAME(m_movamt));
42   save_item(NAME(m_latch_62));
43   save_item(NAME(m_latch_64));
44   save_item(NAME(m_dlc));
45   save_item(NAME(m_shift_reg));
4629}
4730
4831void dpc_device::device_reset()
trunk/src/emu/cpu/tms0980/tms0980.c
r242944r242945
6969*/
7070
7171/* Microinstructions */
72#define M_15TN              (1<<0)  /* 15 to -ALU */
73#define M_ATN               (1<<1)  /* ACC to -ALU */
74#define M_AUTA              (1<<2)  /* ALU to ACC */
75#define M_AUTY              (1<<3)  /* ALU to Y */
76#define M_C8                (1<<4)  /* CARRY8 to STATUS */
77#define M_CIN               (1<<5)  /* Carry In to ALU */
78#define M_CKM               (1<<6)  /* CKB to MEM */
79#define M_CKN               (1<<7)  /* CKB to -ALU */
80#define M_CKP               (1<<8)  /* CKB to +ALU */
81#define M_MTN               (1<<9)  /* MEM to -ALU */
82#define M_MTP               (1<<10) /* MEM to +ALU */
83#define M_NATN              (1<<11) /* ~ACC to -ALU */
84#define M_NE                (1<<12) /* COMP to STATUS */
85#define M_STO               (1<<13) /* ACC to MEM */
86#define M_STSL              (1<<14) /* STATUS to Status Latch */
87#define M_YTP               (1<<15) /* Y to +ALU */
72#define M_15TN              0x00000001 /* 15 to -ALU */
73#define M_ATN               0x00000002 /* ACC to -ALU */
74#define M_AUTA              0x00000004 /* ALU to ACC */
75#define M_AUTY              0x00000008 /* ALU to Y */
76#define M_C8                0x00000010 /* CARRY8 to STATUS */
77#define M_CIN               0x00000020 /* Carry In to ALU */
78#define M_CKM               0x00000040 /* CKB to MEM */
79#define M_CKN               0x00000080 /* CKB to -ALU */
80#define M_CKP               0x00000100 /* CKB to +ALU */
81#define M_MTN               0x00000200 /* MEM to -ALU */
82#define M_MTP               0x00000400 /* MEM to +ALU */
83#define M_NATN              0x00000800 /* ~ACC to -ALU */
84#define M_NE                0x00001000 /* COMP to STATUS */
85#define M_STO               0x00002000 /* ACC to MEM */
86#define M_STSL              0x00004000 /* STATUS to Status Latch */
87#define M_YTP               0x00008000 /* Y to +ALU */
8888
89#define M_CME               (1<<16) /* Conditional Memory Enable */
90#define M_DMTP              (1<<17) /* DAM to +ALU */
91#define M_NDMTP             (1<<18) /* ~DAM to +ALU */
92#define M_SSE               (1<<19) /* Special Status Enable */
93#define M_SSS               (1<<20) /* Special Status Sample */
89#define M_CME               0x00010000 /* Conditional Memory Enable */
90#define M_DMTP              0x00020000 /* DAM to +ALU */
91#define M_NDMTP             0x00040000 /* ~DAM to +ALU */
92#define M_SSE               0x00080000 /* Special Status Enable */
93#define M_SSS               0x00100000 /* Special Status Sample */
9494
95#define M_RSTR              (1<<21) /* -> line #36, F_RSTR (TMS02x0 custom) */
96#define M_UNK1              (1<<22) /* -> line #37, F_???? (TMS0270 custom) */
95#define M_RSTR              0x00200000 /* -> line #36, F_RSTR (TMS02x0 custom) */
96#define M_UNK1              0x00400000 /* -> line #37, F_???? (TMS0270 custom) */
9797
9898/* Standard/fixed instructions - these are documented more in their specific handlers below */
99#define F_BR                (1<<0)
100#define F_CALL              (1<<1)
101#define F_CLO               (1<<2)
102#define F_COMC              (1<<3)
103#define F_COMX              (1<<4)
104#define F_COMX8             (1<<5)
105#define F_LDP               (1<<6)
106#define F_LDX               (1<<7)
107#define F_RBIT              (1<<8)
108#define F_RETN              (1<<9)
109#define F_RSTR              (1<<10)
110#define F_SBIT              (1<<11)
111#define F_SETR              (1<<12)
112#define F_TDO               (1<<13)
113#define F_TPC               (1<<14)
99#define F_BR                0x00000001
100#define F_CALL              0x00000002
101#define F_CLO               0x00000004
102#define F_COMC              0x00000008
103#define F_COMX              0x00000010
104#define F_COMX8             0x00000020
105#define F_LDP               0x00000040
106#define F_LDX               0x00000080
107#define F_RBIT              0x00000100
108#define F_RETN              0x00000200
109#define F_RSTR              0x00000400
110#define F_SBIT              0x00000800
111#define F_SETR              0x00001000
112#define F_TDO               0x00002000
114113
115#define F_OFF               (1<<15)
116#define F_REAC              (1<<16)
117#define F_SAL               (1<<17)
118#define F_SBL               (1<<18)
119#define F_SEAC              (1<<19)
120#define F_XDA               (1<<20)
114#define F_OFF               0x00004000
115#define F_REAC              0x00008000
116#define F_SAL               0x00010000
117#define F_SBL               0x00020000
118#define F_SEAC              0x00040000
119#define F_XDA               0x00080000
121120
122121
123122// supported types:
r242944r242945
133132// - 20-term output PLA(opla) at the top-left
134133// - the ALU is between the opla and mpla
135134const device_type TMS1000 = &device_creator<tms1000_cpu_device>; // 28-pin DIP, 11 R pins
136const device_type TMS1070 = &device_creator<tms1070_cpu_device>; // almost same as tms1000, just supports higher voltage
135const device_type TMS1070 = &device_creator<tms1070_cpu_device>; // same as tms1000, just supports higher voltage
137136const device_type TMS1200 = &device_creator<tms1200_cpu_device>; // 40-pin DIP, 13 R pins
138137// TMS1270 has 10 O pins, how does that work?
139138
140139// TMS1100 is nearly the same as TMS1000, some different opcodes, and with double the RAM and ROM
141140const device_type TMS1100 = &device_creator<tms1100_cpu_device>; // 28-pin DIP, 11 R pins
142const device_type TMS1170 = &device_creator<tms1170_cpu_device>; // almost same as tms1100, just supports higher voltage
143141const device_type TMS1300 = &device_creator<tms1300_cpu_device>; // 40-pin DIP, 16 R pins
144const device_type TMS1370 = &device_creator<tms1370_cpu_device>; // almost same as tms1300, just supports higher voltage
145142
146// TMS1400 follows the TMS1100, it doubles the ROM size again (4 chapters of 16 pages), and adds a 3-level callstack
147// - rotate the view and mirror the OR-mask to get the proper layout of the mpla, the default is identical to tms1100
148// - the opla size is increased from 20 to 32 terms
149const device_type TMS1400 = &device_creator<tms1400_cpu_device>; // 28-pin DIP, 11 R pins
150const device_type TMS1470 = &device_creator<tms1470_cpu_device>; // almost same as tms1400, just supports higher voltage
151
152143// TMS0980
153144// - 64x9bit RAM array at the bottom-left (set up as 144x4)
154145// - 2048x9bit ROM array at the bottom-left
r242944r242945
186177   AM_RANGE(0x000, 0x7ff) AM_ROM
187178ADDRESS_MAP_END
188179
189static ADDRESS_MAP_START(program_12bit_8, AS_PROGRAM, 8, tms1xxx_cpu_device)
190   AM_RANGE(0x000, 0xfff) AM_ROM
191ADDRESS_MAP_END
192180
193
194181static ADDRESS_MAP_START(data_64x4, AS_DATA, 8, tms1xxx_cpu_device)
195182   AM_RANGE(0x00, 0x3f) AM_RAM
196183ADDRESS_MAP_END
r242944r242945
230217   : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source)
231218{ }
232219
233tms1170_cpu_device::tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
234   : tms1100_cpu_device(mconfig, TMS1170, "TMS1170", tag, owner, clock, 8, 11, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1170", __FILE__)
235{ }
236
237220tms1300_cpu_device::tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
238   : tms1100_cpu_device(mconfig, TMS1300, "TMS1300", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1300", __FILE__)
221   : tms1100_cpu_device(mconfig, TMS1300, "TMS1200", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1300", __FILE__)
239222{ }
240223
241tms1370_cpu_device::tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
242   : tms1100_cpu_device(mconfig, TMS1370, "TMS1370", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1370", __FILE__)
243{ }
244224
245
246tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
247   : tms1100_cpu_device(mconfig, TMS1400, "TMS1400", tag, owner, clock, 8, 11, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1400", __FILE__)
248{ }
249
250tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
251   : tms1100_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source)
252{ }
253
254tms1470_cpu_device::tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
255   : tms1400_cpu_device(mconfig, TMS1470, "TMS1470", tag, owner, clock, 8, 10, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1470", __FILE__)
256{ }
257
258
259225tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
260226   : tms1000_cpu_device(mconfig, TMS0970, "TMS0970", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms0970", __FILE__)
261227{ }
r242944r242945
298264}
299265
300266
301static MACHINE_CONFIG_FRAGMENT(tms1400)
302
303   // microinstructions PLA, output PLA
304   MCFG_PLA_ADD("mpla", 8, 16, 30)
305   MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY)
306   MCFG_PLA_ADD("opla", 5, 8, 32)
307   MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY)
308MACHINE_CONFIG_END
309
310machine_config_constructor tms1400_cpu_device::device_mconfig_additions() const
311{
312   return MACHINE_CONFIG_NAME(tms1400);
313}
314
315
316267static MACHINE_CONFIG_FRAGMENT(tms0970)
317268
318269   // main opcodes PLA, microinstructions PLA, output PLA, segment PLA
r242944r242945
631582   for (int i = 0x3c; i < 0x40; i++) m_fixed_decode[i] = 0;
632583}
633584
634void tms1400_cpu_device::device_reset()
635{
636   tms1100_cpu_device::device_reset();
637585
638   // small differences in 00-3f area
639   m_fixed_decode[0x09] = F_COMX; // !
640   m_fixed_decode[0x0b] = F_TPC;
641}
642
643
644586void tms0970_cpu_device::device_reset()
645587{
646588   // common reset
r242944r242945
957899//  fixed opcode set
958900//-------------------------------------------------
959901
960// handle branches:
961// note: add(latch) and bl(branch latch) are specific to 0980 series,
962// c(chapter) bits are specific to 1100(and 1400) series
963
964902// TMS1000/common:
965903
966void tms1xxx_cpu_device::op_br()
967{
968   // BR/BL: conditional branch
969   if (!m_status)
970      return;
971
972   if (!m_clatch)
973      m_pa = m_pb;
974   m_ca = m_cb;
975   m_pc = m_opcode & m_pc_mask;
976}
977
978void tms1xxx_cpu_device::op_call()
979{
980   // CALL/CALLL: conditional call
981   if (!m_status)
982      return;
983
984   UINT8 prev_pa = m_pa;
985   if (!m_clatch)
986   {
987      m_sr = m_pc;
988      m_clatch = 1;
989      m_pa = m_pb;
990      m_cs = m_ca;
991   }
992   m_ca = m_cb;
993   m_pb = prev_pa;
994   m_pc = m_opcode & m_pc_mask;
995}
996
997void tms1xxx_cpu_device::op_retn()
998{
999   // RETN: return from subroutine
1000   if (m_clatch)
1001   {
1002      m_pc = m_sr;
1003      m_clatch = 0;
1004      m_ca = m_cs;
1005   }
1006   m_add = 0;
1007   m_bl = 0;
1008   m_pa = m_pb;
1009}
1010
1011
1012// TMS1400-specific
1013
1014void tms1400_cpu_device::op_br()
1015{
1016   // BR/BL: conditional branch
1017   if (!m_status)
1018      return;
1019   
1020   //..
1021}
1022
1023void tms1400_cpu_device::op_call()
1024{
1025   // CALL/CALLL: conditional call
1026   if (!m_status)
1027      return;
1028
1029   //..
1030}
1031
1032void tms1400_cpu_device::op_retn()
1033{
1034   // RETN: return from subroutine
1035   //..
1036}
1037
1038
1039// handle other:
1040
1041// TMS1000/common:
1042
1043904void tms1xxx_cpu_device::op_sbit()
1044905{
1045906   // SBIT: set memory bit
r242944r242945
1131992}
1132993
1133994
1134// TMS1400-specific
1135
1136void tms1xxx_cpu_device::op_tpc()
1137{
1138   // TPC: transfer page buffer to chapter buffer
1139   m_cb = m_pb & 3;
1140}
1141
1142
1143995// TMS0970-specific (and possibly child classes)
1144996void tms0970_cpu_device::op_setr()
1145997{
r242944r242945
12431095         // fetch: rom address 1/2
12441096
12451097         // execute: br/call 2/2
1246         if (m_fixed & F_BR)    op_br();
1247         if (m_fixed & F_CALL)  op_call();
1248         if (m_fixed & F_RETN)  op_retn();
1098         // note: add(latch) and bl(branch latch) are specific to 0980 series,
1099         // c(chapter) bits are specific to 1100 series
1100         if (m_status)
1101         {
1102            UINT8 new_pc = m_opcode & m_pc_mask;
12491103
1104            // BR: conditional branch
1105            if (m_fixed & F_BR)
1106            {
1107               if (m_clatch == 0)
1108                  m_pa = m_pb;
1109               m_ca = m_cb;
1110               m_pc = new_pc;
1111            }
1112
1113            // CALL: conditional call
1114            if (m_fixed & F_CALL)
1115            {
1116               UINT8 prev_pa = m_pa;
1117               if (m_clatch == 0)
1118               {
1119                  m_sr = m_pc;
1120                  m_clatch = 1;
1121                  m_pa = m_pb;
1122                  m_cs = m_ca;
1123               }
1124               m_ca = m_cb;
1125               m_pb = prev_pa;
1126               m_pc = new_pc;
1127            }
1128         }
1129
1130         // RETN: return from subroutine
1131         if (m_fixed & F_RETN)
1132         {
1133            if (m_clatch == 1)
1134            {
1135               m_pc = m_sr;
1136               m_clatch = 0;
1137               m_ca = m_cs;
1138            }
1139            m_add = 0;
1140            m_bl = 0;
1141            m_pa = m_pb;
1142         }
1143
12501144         // execute: k input valid, read ram, clear alu inputs
12511145         dynamic_output();
12521146         set_cki_bus();
r242944r242945
13221216         if (m_fixed & F_COMX8) op_comx8();
13231217         if (m_fixed & F_LDP)   op_ldp();
13241218         if (m_fixed & F_COMC)  op_comc();
1325         if (m_fixed & F_TPC)   op_tpc();
13261219         if (m_fixed & F_OFF)   op_off();
13271220         if (m_fixed & F_SEAC)  op_seac();
13281221         if (m_fixed & F_REAC)  op_reac();
trunk/src/emu/cpu/tms0980/tms0980.h
r242944r242945
106106   virtual void dynamic_output() { ; } // not used by default
107107   virtual void read_opcode();
108108
109   virtual void op_br();
110   virtual void op_call();
111   virtual void op_retn();
112
113109   virtual void op_sbit();
114110   virtual void op_rbit();
115111   virtual void op_setr();
r242944r242945
122118   virtual void op_ldp();
123119
124120   virtual void op_comc();
125   virtual void op_tpc();
126121   virtual void op_xda();
127122   virtual void op_off();
128123   virtual void op_seac();
r242944r242945
249244   virtual void op_rstr();
250245};
251246
252class tms1170_cpu_device : public tms1100_cpu_device
253{
254public:
255   tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
256};
257
258247class tms1300_cpu_device : public tms1100_cpu_device
259248{
260249public:
261250   tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
262251};
263252
264class tms1370_cpu_device : public tms1100_cpu_device
265{
266public:
267   tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
268};
269253
270
271class tms1400_cpu_device : public tms1100_cpu_device
272{
273public:
274   tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
275   tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
276
277protected:
278   // overrides
279   virtual void device_reset();
280   virtual machine_config_constructor device_mconfig_additions() const;
281
282   virtual void op_br();
283   virtual void op_call();
284   virtual void op_retn();
285
286   virtual void op_setr() { tms1xxx_cpu_device::op_setr(); } // no anomaly with MSB of X register
287   virtual void op_rstr() { tms1xxx_cpu_device::op_rstr(); } // "
288};
289
290class tms1470_cpu_device : public tms1400_cpu_device
291{
292public:
293   tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
294};
295
296
297254class tms0970_cpu_device : public tms1000_cpu_device
298255{
299256public:
r242944r242945
387344extern const device_type TMS1070;
388345extern const device_type TMS1200;
389346extern const device_type TMS1100;
390extern const device_type TMS1170;
391347extern const device_type TMS1300;
392extern const device_type TMS1370;
393extern const device_type TMS1400;
394extern const device_type TMS1470;
395348extern const device_type TMS0970;
396349extern const device_type TMS0980;
397350extern const device_type TMS0270;
trunk/src/emu/emu.mak
r242944r242945
120120   $(EMUOBJ)/ui/mainmenu.o \
121121   $(EMUOBJ)/ui/miscmenu.o \
122122   $(EMUOBJ)/ui/barcode.o \
123   $(EMUOBJ)/ui/devopt.o \
124123   $(EMUOBJ)/ui/filemngr.o \
125124   $(EMUOBJ)/ui/filesel.o \
126125   $(EMUOBJ)/ui/imgcntrl.o \
trunk/src/emu/emuopts.h
r242944r242945
354354
355355   const char *main_value(astring &buffer, const char *option) const;
356356   const char *sub_value(astring &buffer, const char *name, const char *subname) const;
357   bool add_slot_options(bool isfirst);
358
359357private:
360358   // device-specific option handling
361359   void add_device_options(bool isfirst);
360   bool add_slot_options(bool isfirst);
362361   void update_slot_options();
363362
364363   // INI parsing helper
trunk/src/emu/machine/atahle.c
r242944r242945
8282   m_buffer.resize(sector_length());
8383   save_item(NAME(m_buffer));
8484   save_item(NAME(m_buffer_offset));
85   save_item(NAME(m_buffer_size));
8685   save_item(NAME(m_error));
8786   save_item(NAME(m_feature));
8887   save_item(NAME(m_sector_count));
trunk/src/emu/machine/idehd.c
r242944r242945
179179   ata_hle_device::device_start();
180180
181181   save_item(NAME(m_can_identify_device));
182   save_item(NAME(m_num_cylinders));
183   save_item(NAME(m_num_sectors));
184   save_item(NAME(m_num_heads));
185
186182   save_item(NAME(m_cur_lba));
187183   save_item(NAME(m_sectors_until_int));
188184   save_item(NAME(m_master_password_enable));
trunk/src/emu/sound/tiaintf.c
r242944r242945
3030void tia_device::device_start()
3131{
3232   m_channel = stream_alloc(0, 1, clock());
33   m_chip = tia_sound_init(this, clock(), clock(), 16);
33   m_chip = tia_sound_init(clock(), clock(), 16);
3434   assert_always(m_chip != NULL, "Error creating TIA chip");
3535}
3636
trunk/src/emu/sound/tiasound.c
r242944r242945
526526   }
527527}
528528
529static void tia_save_state(device_t *device, tia *tia)
530{
531   device->save_item(NAME(tia->AUDC));
532   device->save_item(NAME(tia->AUDF));
533   device->save_item(NAME(tia->AUDV));
534   device->save_item(NAME(tia->Outvol));
535   device->save_item(NAME(tia->P4));
536   device->save_item(NAME(tia->P5));
537   device->save_item(NAME(tia->P9));
538   device->save_item(NAME(tia->Div_n_cnt));
539   device->save_item(NAME(tia->Div_n_max));
540   device->save_item(NAME(tia->Div_3_cnt));
541   device->save_item(NAME(tia->Samp_n_cnt));
542   device->save_item(NAME(tia->oversampling));
543}
544
545529/*****************************************************************************/
546530/* Module:  tia_sh_start()                                                   */
547531/* Purpose: to handle the power-up initialization functions                  */
r242944r242945
557541/*                                                                           */
558542/*****************************************************************************/
559543
560void *tia_sound_init(device_t *device, int clock, int sample_rate, int gain)
544void *tia_sound_init(int clock, int sample_rate, int gain)
561545{
562546   struct tia *chip;
563547   int chan;
r242944r242945
597581      chip->P5[chan] = 0;
598582      chip->P9[chan] = 0;
599583   }
600   
601   tia_save_state(device, chip);
602584
603585   return chip;
604586}
trunk/src/emu/sound/tiasound.h
r242944r242945
3737#ifndef __TIASOUND_H__
3838#define __TIASOUND_H__
3939
40void *tia_sound_init(device_t *device, int clock, int sample_rate, int gain);
40void *tia_sound_init(int clock, int sample_rate, int gain);
4141void tia_sound_free(void *chip);
4242void tia_process (void *chip, stream_sample_t *buffer, int length);
4343void tia_write(void *chip, offs_t offset, UINT8 data);
trunk/src/emu/ui/devopt.c
r242944r242945
1/*********************************************************************
2
3    ui/devopt.c
4
5    Internal menu for the device configuration.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10*********************************************************************/
11
12#include "emu.h"
13#include "ui/ui.h"
14#include "ui/devopt.h"
15
16/*-------------------------------------------------
17 ui_device_config - handle the game information
18 menu
19 -------------------------------------------------*/
20
21ui_menu_device_config::ui_menu_device_config(running_machine &machine, render_container *container, device_slot_interface *slot, device_slot_option *option) : ui_menu(machine, container)
22{
23   astring tmp_tag;
24   tmp_tag.cpy(slot->device().tag()).cat(":").cat(option->name());
25   m_option = option;
26   m_owner = slot;
27   m_mounted = false;
28
29   device_iterator deviter(machine.config().root_device());
30   for (device_t *device = deviter.first(); device != NULL; device = deviter.next())
31   {
32      if (strcmp(device->tag(), tmp_tag.cstr()) == 0)
33      {
34         m_mounted = true;
35         break;
36      }
37   }
38}
39
40void ui_menu_device_config::populate()
41{
42   astring string;
43   device_t *dev;
44
45   string.printf("[This option is%s currently mounted in the running system]\n\n", m_mounted ? "" : " NOT");
46   string.catprintf("Option: %s\n", m_option->name());
47
48   dev = const_cast<machine_config &>(machine().config()).device_add(&machine().config().root_device(), m_option->name(), m_option->devtype(), 0);
49     
50   string.catprintf("Device: %s\n", dev->name());
51   if (!m_mounted)
52      string.cat("\nIf you select this option, the following items will be enabled:\n");
53   else
54      string.cat("\nThe selected option enables the following items:\n");
55
56   // loop over all CPUs
57   execute_interface_iterator execiter(*dev);
58   if (execiter.count() > 0)
59   {
60      string.cat("* CPU:\n");
61      tagmap_t<UINT8> exectags;
62      for (device_execute_interface *exec = execiter.first(); exec != NULL; exec = execiter.next())
63      {
64         if (exectags.add(exec->device().tag(), 1, FALSE) == TMERR_DUPLICATE)
65            continue;
66
67         // get cpu specific clock that takes internal multiplier/dividers into account
68         int clock = exec->device().clock();
69         
70         // count how many identical CPUs we have
71         int count = 1;
72         const char *name = exec->device().name();
73         execute_interface_iterator execinneriter(*dev);
74         for (device_execute_interface *scan = execinneriter.first(); scan != NULL; scan = execinneriter.next())
75         {
76            if (exec->device().type() == scan->device().type() && strcmp(name, scan->device().name()) == 0 && exec->device().clock() == scan->device().clock())
77               if (exectags.add(scan->device().tag(), 1, FALSE) != TMERR_DUPLICATE)
78                  count++;
79         }
80         
81         // if more than one, prepend a #x in front of the CPU name
82         if (count > 1)
83            string.catprintf("  %d" UTF8_MULTIPLY, count);
84         else
85            string.cat("  ");
86         string.cat(name);
87         
88         // display clock in kHz or MHz
89         if (clock >= 1000000)
90            string.catprintf(" %d.%06d" UTF8_NBSP "MHz\n", clock / 1000000, clock % 1000000);
91         else
92            string.catprintf(" %d.%03d" UTF8_NBSP "kHz\n", clock / 1000, clock % 1000);
93      }
94   }
95   
96   // display screen information
97   screen_device_iterator scriter(*dev);
98   if (scriter.count() > 0)
99   {
100      string.cat("* Video:\n");
101      for (screen_device *screen = scriter.first(); screen != NULL; screen = scriter.next())
102      {
103         string.catprintf("  Screen '%s': ", screen->tag());
104         
105         if (screen->screen_type() == SCREEN_TYPE_VECTOR)
106            string.cat("Vector\n");
107         else
108         {
109            const rectangle &visarea = screen->visible_area();
110           
111            string.catprintf("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
112                         visarea.width(), visarea.height(),
113                         (machine().system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
114                         ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds));
115         }
116      }
117   }
118   
119   // loop over all sound chips
120   sound_interface_iterator snditer(*dev);
121   if (snditer.count() > 0)
122   {
123      string.cat("* Sound:\n");
124      tagmap_t<UINT8> soundtags;
125      for (device_sound_interface *sound = snditer.first(); sound != NULL; sound = snditer.next())
126      {
127         if (soundtags.add(sound->device().tag(), 1, FALSE) == TMERR_DUPLICATE)
128            continue;
129         
130         // count how many identical sound chips we have
131         int count = 1;
132         sound_interface_iterator sndinneriter(*dev);
133         for (device_sound_interface *scan = sndinneriter.first(); scan != NULL; scan = sndinneriter.next())
134         {
135            if (sound->device().type() == scan->device().type() && sound->device().clock() == scan->device().clock())
136               if (soundtags.add(scan->device().tag(), 1, FALSE) != TMERR_DUPLICATE)
137                  count++;
138         }
139         // if more than one, prepend a #x in front of the CPU name
140         if (count > 1)
141            string.catprintf("  %d" UTF8_MULTIPLY, count);
142         else
143            string.cat("  ");
144         string.cat(sound->device().name());
145         
146         // display clock in kHz or MHz
147         int clock = sound->device().clock();
148         if (clock >= 1000000)
149            string.catprintf(" %d.%06d" UTF8_NBSP "MHz\n", clock / 1000000, clock % 1000000);
150         else if (clock != 0)
151            string.catprintf(" %d.%03d" UTF8_NBSP "kHz\n", clock / 1000, clock % 1000);
152         else
153            string.cat("\n");
154      }
155   }
156   
157   int input = 0, input_mj = 0, input_hana = 0, input_gamble = 0, input_analog = 0, input_adjust = 0;
158   int dips = 0, confs = 0;
159   astring errors, dips_opt, confs_opt;
160   ioport_list portlist;
161   device_iterator iptiter(*dev);
162   for (device_t *iptdev = iptiter.first(); iptdev != NULL; iptdev = iptiter.next())
163      portlist.append(*iptdev, errors);
164
165   // check if the device adds inputs to the system
166   for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
167      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
168      {
169         if (field->type() >= IPT_MAHJONG_FIRST && field->type() < IPT_MAHJONG_LAST)
170            input_mj++;
171         else if (field->type() >= IPT_HANAFUDA_FIRST && field->type() < IPT_HANAFUDA_LAST)
172            input_hana++;
173         else if (field->type() >= IPT_GAMBLING_FIRST && field->type() < IPT_GAMBLING_LAST)
174            input_gamble++;
175         else if (field->type() >= IPT_ANALOG_FIRST && field->type() < IPT_ANALOG_LAST)
176            input_analog++;
177         else if (field->type() == IPT_ADJUSTER)
178            input_adjust++;
179         else if (field->type() >= IPT_START1 && field->type() < IPT_UI_FIRST)
180            input++;
181         else if (field->type() == IPT_DIPSWITCH)
182         {
183            dips++;
184            dips_opt.cat("  ").cat(field->name());
185            for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
186            {
187               if (setting->value() == field->defvalue())
188               {
189                  dips_opt.catprintf("    [default: %s]\n", setting->name());
190                  break;
191               }
192            }
193         }
194         else if (field->type() == IPT_CONFIG)
195         {
196            confs++;
197            confs_opt.cat("  ").cat(field->name());
198            for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
199            {
200               if (setting->value() == field->defvalue())
201               {
202                  confs_opt.catprintf("    [default: %s]\n", setting->name());
203                  break;
204               }
205            }
206         }
207      }
208
209   if (dips)
210      string.cat("* Dispwitch settings:\n").cat(dips_opt);
211   if (confs)
212      string.cat("* Configuration settings:\n").cat(confs_opt);
213   if (input + input_mj + input_hana + input_gamble + input_analog + input_adjust)
214      string.cat("* Input device(s):\n");
215   if (input)
216      string.catprintf("  Player inputs    [%d inputs]\n", input);
217   if (input_mj)
218      string.catprintf("  Mahjong inputs    [%d inputs]\n", input_mj);
219   if (input_hana)
220      string.catprintf("  Hanafuda inputs    [%d inputs]\n", input_hana);
221   if (input_gamble)
222      string.catprintf("  Gambling inputs    [%d inputs]\n", input_gamble);
223   if (input_analog)
224      string.catprintf("  Analog inputs    [%d inputs]\n", input_analog);
225   if (input_adjust)
226      string.catprintf("  Adjuster inputs    [%d inputs]\n", input_adjust);
227
228   image_interface_iterator imgiter(*dev);
229   if (imgiter.count() > 0)
230   {
231      string.cat("* Media Options:\n");
232      for (const device_image_interface *imagedev = imgiter.first(); imagedev != NULL; imagedev = imgiter.next())
233         string.catprintf("  %s    [tag: %s]\n", imagedev->image_type_name(), imagedev->device().tag());
234   }
235   
236   slot_interface_iterator slotiter(*dev);
237   if (slotiter.count() > 0)
238   {
239      string.cat("* Slot Options:\n");
240      for (const device_slot_interface *slot = slotiter.first(); slot != NULL; slot = slotiter.next())
241         string.catprintf("  %s    [default: %s]\n", slot->device().tag(), slot->default_option() ? slot->default_option() : "----");
242   }
243
244   if ((execiter.count() + scriter.count() + snditer.count() + imgiter.count() + slotiter.count() + input + input_mj + input_hana + input_gamble + input_analog + input_adjust) == 0)
245      string.cat("[None]\n");
246
247   const_cast<machine_config &>(machine().config()).device_remove(&machine().config().root_device(), m_option->name());
248   item_append(string, NULL, MENU_FLAG_MULTILINE, NULL);
249}
250
251void ui_menu_device_config::handle()
252{
253   /* process the menu */
254   process(0);
255}
256
257ui_menu_device_config::~ui_menu_device_config()
258{
259}
trunk/src/emu/ui/devopt.h
r242944r242945
1/***************************************************************************
2
3    ui/devopt.h
4 
5    Internal menu for the device configuration.
6 
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
12#pragma once
13
14#ifndef __UI_DEVOPT_H__
15#define __UI_DEVOPT_H__
16
17class ui_menu_device_config : public ui_menu {
18public:
19   ui_menu_device_config(running_machine &machine, render_container *container, device_slot_interface *slot, device_slot_option *option);
20   virtual ~ui_menu_device_config();
21   virtual void populate();
22   virtual void handle();
23
24private:
25   device_slot_interface *m_owner;
26   device_slot_option *m_option;
27   bool m_mounted;
28};
29
30
31#endif  /* __UI_DEVOPT_H__ */
trunk/src/emu/ui/filemngr.c
r242944r242945
5959}
6060
6161
62void ui_menu_file_manager::fill_image_line(device_image_interface *img, astring &instance, astring &filename)
63{
64   // get the image type/id
65   instance.printf("%s (%s)", img->instance_name(), img->brief_instance_name());
66   
67   // get the base name
68   if (img->basename() != NULL)
69   {
70      filename.cpy(img->basename());
71     
72      // if the image has been loaded through softlist, also show the loaded part
73      if (img->part_entry() != NULL)
74      {
75         const software_part *tmp = img->part_entry();
76         if (tmp->name() != NULL)
77         {
78            filename.cat(" (");
79            filename.cat(tmp->name());
80            // also check if this part has a specific part_id (e.g. "Map Disc", "Bonus Disc", etc.), and in case display it
81            if (img->get_feature("part_id") != NULL)
82            {
83               filename.cat(": ");
84               filename.cat(img->get_feature("part_id"));
85            }
86            filename.cat(")");
87         }
88      }
89   }
90   else
91      filename.cpy("---");
92}
93
9462//-------------------------------------------------
9563//  populate
9664//-------------------------------------------------
9765
9866void ui_menu_file_manager::populate()
9967{
100   astring buffer, tmp_inst, tmp_name;
101   bool first_entry = true;
102   astring prev_owner;
68   astring buffer;
69   bool first = true;
10370
10471   // cycle through all devices for this system
105   device_iterator iter(machine().root_device());
106   tagmap_t<UINT8> devtags;
107   for (device_t *dev = iter.first(); dev != NULL; dev = iter.next())
72   image_interface_iterator iter(machine().root_device());
73   for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
10874   {
109      bool tag_appended = false;
110      if (devtags.add(dev->tag(), 1, FALSE) == TMERR_DUPLICATE)
111         continue;
75      if (first)
76         first = false;
77      else
78         item_append("", NULL, MENU_FLAG_DISABLE, NULL);
11279
113      // check whether it owns an image interface
114      image_interface_iterator subiter(*dev);
115      if (subiter.count() > 0)
116      {         
117         // if so, cycle through all its image interfaces
118         image_interface_iterator subiter(*dev);
119         for (device_image_interface *scan = subiter.first(); scan != NULL; scan = subiter.next())
80      // get the image type/id
81      buffer.printf("%s (%s)", image->instance_name(), image->brief_instance_name());
82      item_append(buffer, "", MENU_FLAG_DISABLE, NULL);
83      item_append("Device", image->device().tag(), MENU_FLAG_DISABLE, NULL);
84
85      // get the base name
86      if (image->basename() != NULL)
87      {
88         buffer.cpy(image->basename());
89
90         // if the image has been loaded through softlist, also show the loaded part
91         if (image->part_entry() != NULL)
12092         {
121            // if it is a children device, and not something further down the device tree, we want it in the menu!
122            if (strcmp(scan->device().owner()->tag(), dev->tag()) == 0)
123               if (devtags.add(scan->device().tag(), 1, FALSE) != TMERR_DUPLICATE)
93            const software_part *tmp = image->part_entry();
94            if (tmp->name() != NULL)
95            {
96               buffer.cat(" (");
97               buffer.cat(tmp->name());
98               // also check if this part has a specific part_id (e.g. "Map Disc", "Bonus Disc", etc.), and in case display it
99               if (image->get_feature("part_id") != NULL)
124100               {
125                  // check whether we already had some devices with the same owner: if not, output the owner tag!
126                  if (!tag_appended)
127                  {
128                     if (first_entry)
129                        first_entry = false;
130                     else
131                        item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
132                     buffer.printf("[root%s]", dev->tag());
133                     item_append(buffer, NULL, 0, NULL);
134                     tag_appended = true;
135                  }
136                  // finally, append the image interface to the menu
137                  fill_image_line(scan, tmp_inst, tmp_name);
138                  item_append(tmp_inst, tmp_name, 0, (void *) scan);
101                  buffer.cat(": ");
102                  buffer.cat(image->get_feature("part_id"));
139103               }
104               buffer.cat(")");
105            }
140106         }
141107      }
108      else
109         buffer.cpy("---");
110
111      // record the menu item
112      item_append("Mounted File", buffer, 0, (void *) image);
142113   }
143114   item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
144115   item_append("Reset",  NULL, 0, (void *)1);
trunk/src/emu/ui/filemngr.h
r242944r242945
2525   virtual void populate();
2626   virtual void handle();
2727   virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
28
29   void fill_image_line(device_image_interface *img, astring &instance, astring &filename);
3028};
3129
3230#endif  /* __UI_FILEMNGR_H__ */
trunk/src/emu/ui/slotopt.c
r242944r242945
1313
1414#include "ui/ui.h"
1515#include "ui/slotopt.h"
16#include "ui/devopt.h"
1716
1817
1918/*-------------------------------------------------
r242944r242945
188187   if (menu_event != NULL && menu_event->itemref != NULL)
189188   {
190189      if ((FPTR)menu_event->itemref == 1 && menu_event->iptkey == IPT_UI_SELECT)
191      {
192         machine().options().add_slot_options(false);
193190         machine().schedule_hard_reset();
194      }
195191      else if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT)
196192      {
197193         device_slot_interface *slot = (device_slot_interface *)menu_event->itemref;
r242944r242945
199195         set_slot_device(slot, val);
200196         reset(UI_MENU_RESET_REMEMBER_REF);
201197      }
202      else if (menu_event->iptkey == IPT_UI_SELECT)
203      {
204         device_slot_interface *slot = (device_slot_interface *)menu_event->itemref;
205         device_slot_option *option = slot_get_current_option(slot);
206         if (option)
207            ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_device_config(machine(), container, slot, option)));
208      }
209198   }
210199}
trunk/src/lib/util/chd.c
r242944r242945
26652665      // advance the read pointer
26662666      m_read_done_offset += numbytes;
26672667   }
2668   catch (chd_error& err)
2669   {
2670      fprintf(stderr, "CHD error occured: %s\n", chd_file::error_string(err));
2671      m_read_error = true;
2672   }
26732668   catch (std::exception& ex)
26742669   {
26752670      fprintf(stderr, "exception occured: %s\n", ex.what());
trunk/src/mame/drivers/aleck64.c
r242944r242945
103103        JAPAN
104104
105105
106On bootup, they also mention 'T.L.S' (Temporary Landing System), which seems
107to be the hardware system, designed by Arika Co. Ltd.
106108
107109
108110PCB Layout
r242944r242945
183185   DECLARE_DRIVER_INIT(aleck64);
184186   DECLARE_WRITE32_MEMBER(aleck_dips_w);
185187   DECLARE_READ32_MEMBER(aleck_dips_r);
186   DECLARE_READ16_MEMBER(e90_prot_r);
187   DECLARE_WRITE16_MEMBER(e90_prot_w);
188188private:
189189   UINT32 m_dip_read_offset;
190190};
r242944r242945
311311   AM_RANGE(0x1fc00000, 0x1fc007bf) AM_ROM AM_REGION("user1", 0)   // PIF ROM
312312   AM_RANGE(0x1fc007c0, 0x1fc007ff) AM_DEVREADWRITE("rcp", n64_periphs, pif_ram_r, pif_ram_w)
313313
314   AM_RANGE(0xc0000000, 0xc07fffff) AM_RAM // SDRAM, Aleck 64 specific
314   /*
315       Surely this should mirror main ram? srmvs crashes, and
316       vivdolls overwrites it's memory test code if it does mirror
317   */
318   AM_RANGE(0xc0000000, 0xc07fffff) AM_RAM
315319
316320   AM_RANGE(0xc0800000, 0xc0800fff) AM_READWRITE(aleck_dips_r,aleck_dips_w)
317ADDRESS_MAP_END
321   AM_RANGE(0xd0000000, 0xd00fffff) AM_RAM // mtetrisc, write only, mirror?
318322
319/*
320 E90 protection handlers
321*/
322
323READ16_MEMBER(aleck64_state::e90_prot_r)
324{
325// offset 0 $800 = status ready, active high
326   return 0;
327}
328
329WRITE16_MEMBER(aleck64_state::e90_prot_w)
330{   
331   switch(offset*2)
332   {
333      case 0x16:
334         if(data != 6 && data != 7)
335            printf("! %04x %04x %08x\n",offset*2,data,mem_mask);
336
337         if(data & 1) // 0 -> 1 transition
338         {
339            for(int i=0;i<0x1000;i+=4)
340               space.write_dword(0x007502f4+i,space.read_dword(0xd0000000+i));
341         }
342         break;
343      //0x1e bit 0 probably enables the chip
344      default:
345         printf("%04x %04x %08x\n",offset*2,data,mem_mask);
346         break;
347   }
348}
349
350static ADDRESS_MAP_START( e90_map, AS_PROGRAM, 32, aleck64_state )
351   AM_IMPORT_FROM( n64_map )
352   AM_RANGE(0xd0000000, 0xd0000fff) AM_RAM
353   AM_RANGE(0xd0010000, 0xd0010fff) AM_RAM
354   AM_RANGE(0xd0030000, 0xd003001f) AM_READWRITE16(e90_prot_r, e90_prot_w,0xffffffff)
355323ADDRESS_MAP_END
356324
357325static ADDRESS_MAP_START( rsp_map, AS_PROGRAM, 32, aleck64_state )
r242944r242945
383351   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1)
384352
385353   PORT_START("P1_ANALOG_Y")
386   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1) PORT_REVERSE
354   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0xff,0x00) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1)
387355
388356   PORT_START("P2")
389357   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)          // Button A
r242944r242945
406374   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2)
407375
408376   PORT_START("P2_ANALOG_Y")
409   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2) PORT_REVERSE
377   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0xff,0x00) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2)
410378
411379   PORT_START("IN0")
412380   PORT_DIPNAME( 0x80000000, 0x80000000, "DIPSW1 #8" ) PORT_DIPLOCATION("SW1:8")
r242944r242945
489457   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
490458   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
491459   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2)
460
492461INPUT_PORTS_END
493462
494463static INPUT_PORTS_START( mtetrisc )
r242944r242945
873842   MCFG_N64_PERIPHS_ADD("rcp");
874843MACHINE_CONFIG_END
875844
876static MACHINE_CONFIG_DERIVED( a64_e90, aleck64 )
877   MCFG_CPU_MODIFY("maincpu")
878   MCFG_CPU_PROGRAM_MAP(e90_map)
879MACHINE_CONFIG_END
880
881845DRIVER_INIT_MEMBER(aleck64_state,aleck64)
882846{
883847   UINT8 *rom = memregion("user2")->base();
r242944r242945
11111075GAME( 1998, aleck64,  0,        aleck64, aleck64, aleck64_state,  aleck64, ROT0, "Nintendo / Seta", "Aleck64 PIF BIOS", GAME_IS_BIOS_ROOT)
11121076
11131077// games
1114GAME( 1998, 11beat,   aleck64,  aleck64, 11beat, aleck64_state,   aleck64, ROT0, "Hudson", "Eleven Beat", GAME_NOT_WORKING ) // crashes at kick off / during attract with DRC
1115GAME( 1998, mtetrisc, aleck64,  a64_e90, mtetrisc, aleck64_state, aleck64, ROT0, "Capcom", "Magical Tetris Challenge (981009 Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
1078GAME( 1998, 11beat,   aleck64,  aleck64, 11beat, aleck64_state,   aleck64, ROT0, "Hudson", "Eleven Beat", GAME_NOT_WORKING|GAME_NO_SOUND ) // crashes at kick off / during attract
1079GAME( 1998, mtetrisc, aleck64,  aleck64, mtetrisc, aleck64_state, aleck64, ROT0, "Capcom", "Magical Tetris Challenge (981009 Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
11161080GAME( 1998, starsldr, aleck64,  aleck64, starsldr, aleck64_state, aleck64, ROT0, "Hudson / Seta", "Star Soldier: Vanishing Earth", GAME_IMPERFECT_GRAPHICS )
11171081GAME( 1998, vivdolls, aleck64,  aleck64, aleck64, aleck64_state,  aleck64, ROT0, "Visco", "Vivid Dolls", GAME_IMPERFECT_GRAPHICS )
11181082GAME( 1999, srmvs,    aleck64,  aleck64, srmvs, aleck64_state,    aleck64, ROT0, "Seta", "Super Real Mahjong VS", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
trunk/src/mame/drivers/chihiro.c
r242944r242945
369369#include "debug/debugcon.h"
370370#include "debug/debugcmd.h"
371371#include "debug/debugcpu.h"
372#include "osdcore.h"
373372#include "includes/chihiro.h"
374373
375374#define LOG_PCI
trunk/src/mame/drivers/peplus.c
r242944r242945
16241624   ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
16251625ROM_END
16261626
1627ROM_START( pepp0038 ) /* Normal board : Standard Draw Poker (PP0038) */
1628/*
1629PayTable   Js+  2PR  3K   STR  FL  FH  4K  SF  RF  (Bonus)
1630----------------------------------------------------------
1631   PE       1    2    3    4    6   9  25  50 300    900
1632  % Range: 95.8-97.8%  Optimum: 99.8%  Hit Frequency: 45.4%
1633     Programs Available: PP0038, X002121P
1634*/
1635   ROM_REGION( 0x10000, "maincpu", 0 )
1636   ROM_LOAD( "pp0038_a45-a74.u68",   0x00000, 0x10000, CRC(85fe387e) SHA1(a0aa4cb422c04066d61d665943eced30b2eaf5b2) ) /* Game Version: A45, Library Version: A74 */
1637
1638   ROM_REGION( 0x020000, "gfx1", 0 )
1639   ROM_LOAD( "mro-cg821.u72",   0x00000, 0x8000, CRC(e91f1192) SHA1(1a00027b681fad6b350366b2dff7411445a07f05) )
1640   ROM_LOAD( "mgo-cg821.u73",   0x08000, 0x8000, CRC(fa417bbc) SHA1(8c59d9156fb52099bf76b0a7e0da3a27518d6f19) )
1641   ROM_LOAD( "mbo-cg821.u74",   0x10000, 0x8000, CRC(4229457a) SHA1(aa1f26792279a834ed2025d6be58fa7ea38329fd) )
1642   ROM_LOAD( "mxo-cg821.u75",   0x18000, 0x8000, CRC(2da9729a) SHA1(3a5cf4c794e0057bdb705e0c7da541c3c8b48591) )
1643
1644   ROM_REGION( 0x100, "proms", 0 )
1645   ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
1646ROM_END
1647
16481627ROM_START( pepp0040 ) /* Normal board : Standard Draw Poker (PP0040) */
16491628/*
16501629PayTable   Js+  2PR  3K   STR  FL  FH  4K  SF  RF  (Bonus)
r242944r242945
22862265   ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
22872266ROM_END
22882267
2289ROM_START( pepp0116a ) /* Normal board : Standard Draw Poker (PP0116) */
2290/*
2291PayTable   Js+  2PR  3K   STR  FL  FH  4K  SF  RF  (Bonus)
2292----------------------------------------------------------
2293   BA       1    2    3    4    5   8  25  50 250    800
2294  % Range: 93.8-95.8%  Optimum: 97.8%  Hit Frequency: 45.3%
2295     Programs Available: PP0116
2296*/
2297   ROM_REGION( 0x10000, "maincpu", 0 )
2298   ROM_LOAD( "pp0116_554-544.u68",   0x00000, 0x8000, CRC(27aba06b) SHA1(7976a2b2577c28e332091cbbcb4c7d53ffbea827) ) /* Game Version: 554, Library Version: 544, Video Lib Ver: 544 */
2299   ROM_RELOAD(                       0x08000, 0x8000) /* 32K version built using earlier gaming libraries */
2300
2301   ROM_REGION( 0x020000, "gfx1", 0 )
2302   ROM_LOAD( "mro-cg864.u72",   0x00000, 0x8000, CRC(f4ac28b9) SHA1(35c8a603120f35bd92905e0491e9ae5cd201e13f) ) /*  09/13/89   @ IGT  L89-1706  */
2303   ROM_LOAD( "mgo-cg864.u73",   0x08000, 0x8000, CRC(da8efcb9) SHA1(942c6b613074c52f6ed1c2fce78d46ef0f221c48) ) /* Custom Mirage casino card backs */
2304   ROM_LOAD( "mbo-cg864.u74",   0x10000, 0x8000, CRC(d48ac9cd) SHA1(a62d6c1daf199856aa1777d1d99fe81399215e36) )
2305   ROM_LOAD( "mxo-cg864.u75",   0x18000, 0x8000, CRC(04f81245) SHA1(055271c6c502fad3be5f2d694a94f96bf3176404) )
2306
2307   ROM_REGION( 0x100, "proms", 0 )
2308   ROM_LOAD( "cap864.u50", 0x0000, 0x0100, CRC(c80e5743) SHA1(edf4e5a68905cc566077613d856bc90b8136a227) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
2309ROM_END
2310
23112268ROM_START( pepp0118 ) /* Normal board : Standard Draw Poker (PP0118) */
23122269/*
23132270PayTable   Js+  2PR  3K  STR  FL  FH  4K  SF  RF  (Bonus)
r242944r242945
90759032GAMEL(1987, pepp0014,  pepp0002, peplus,  peplus_poker, peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0014) Standard Draw Poker (International)", 0, layout_pe_poker )
90769033GAMEL(1987, pepp0014a, pepp0002, peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0014) Standard Draw Poker",           0, layout_pe_poker )
90779034GAMEL(1987, pepp0023,  pepp0002, peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0023) 10's or Better",                0, layout_pe_poker )
9078GAMEL(1987, pepp0038,  pepp0002, peplus,  peplus_poker, peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0038) Standard Draw Poker",           0, layout_pe_poker )
90799035GAMEL(1987, pepp0040,  pepp0002, peplus,  peplus_poker, peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker",           0, layout_pe_poker )
90809036GAMEL(1987, pepp0040a, pepp0002, peplus,  peplus_poker, peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker (International)", 0, layout_pe_poker )
90819037GAMEL(1987, pepp0041,  pepp0002, peplus,  peplus_poker, peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0041) Standard Draw Poker",           0, layout_pe_poker )
r242944r242945
91059061GAMEL(1987, pepp0083,  pepp0002, peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0083) 10's or Better",                0, layout_pe_poker )
91069062GAMEL(1987, pepp0103,  pepp0055, peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0103) Deuces Wild Poker",             0, layout_pe_poker )
91079063GAMEL(1987, pepp0116,  pepp0002, peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0116) Standard Draw Poker",           0, layout_pe_poker )
9108GAMEL(1987, pepp0116a, pepp0002, peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0116) Standard Draw Poker (Mirage)",  0, layout_pe_poker )
91099064GAMEL(1987, pepp0118,  pepp0002, peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0118) Standard Draw Poker",           0, layout_pe_poker )
91109065GAMEL(1987, pepp0120,  0,        peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0120) Wild Sevens Poker",             0, layout_pe_poker )
91119066GAMEL(1987, pepp0125,  pepp0055, peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PP0125) Deuces Wild Poker",             0, layout_pe_poker )
trunk/src/mame/drivers/stfight.c
r242944r242945
247247#include "cpu/z80/z80.h"
248248#include "cpu/m6805/m6805.h"
249249#include "sound/2203intf.h"
250#include "sound/msm5205.h"
250251#include "includes/stfight.h"
251252
252253static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, stfight_state )
r242944r242945
10361037ROM_END
10371038
10381039// Note: Marked GAME_IMPERFECT_SOUND due to YM2203 clock issue
1039GAME( 1986, empcity,  0,       stfight, stfight, stfight_state, empcity, ROT0,   "Seibu Kaihatsu",                           "Empire City: 1931 (bootleg?)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1040GAME( 1986, empcityu, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Taito / Romstar license)", "Empire City: 1931 (US)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // different title logo
1041GAME( 1986, empcityj, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Taito license)",           "Empire City: 1931 (Japan)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1042GAME( 1986, empcityi, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Eurobed license)",         "Empire City: 1931 (Italy)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1043GAME( 1986, stfight,  empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Tuning license)",          "Street Fight (Germany)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1044GAME( 1986, stfighta, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu",                           "Street Fight (bootleg?)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1040GAME( 1986, empcity,  0,       stfight, stfight, stfight_state, empcity, ROT0,   "Seibu Kaihatsu",                           "Empire City: 1931 (bootleg?)", GAME_IMPERFECT_SOUND )
1041GAME( 1986, empcityu, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Taito / Romstar license)", "Empire City: 1931 (US)", GAME_IMPERFECT_SOUND ) // different title logo
1042GAME( 1986, empcityj, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Taito license)",           "Empire City: 1931 (Japan)", GAME_IMPERFECT_SOUND )
1043GAME( 1986, empcityi, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Eurobed license)",         "Empire City: 1931 (Italy)", GAME_IMPERFECT_SOUND )
1044GAME( 1986, stfight,  empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Tuning license)",          "Street Fight (Germany)", GAME_IMPERFECT_SOUND )
1045GAME( 1986, stfighta, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu",                           "Street Fight (bootleg?)", GAME_IMPERFECT_SOUND )
10451046/* Cross Shooter runs on a slightly modified PCB, with a different text tilemap and gfx blobs (see also cshooter.c) */
1046GAME( 1987, cshooter,  0,      cshooter,cshooter, stfight_state, cshooter,ROT270,"Seibu Kaihatsu (Taito license)",           "Cross Shooter (not encrypted)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1047GAME( 1987, cshooter,  0,      cshooter,cshooter, stfight_state, cshooter,ROT270,"Seibu Kaihatsu (Taito license)",           "Cross Shooter (not encrypted)", GAME_NOT_WORKING )
trunk/src/mame/drivers/stlforce.c
r242944r242945
370370}
371371
372372
373GAME( 1994, stlforce, 0,        stlforce, stlforce, stlforce_state, stlforce, ROT0, "Electronic Devices Italy / Ecogames S.L. Spain", "Steel Force", GAME_SUPPORTS_SAVE )
374GAME( 1995, twinbrat, 0,        twinbrat, stlforce, stlforce_state, twinbrat, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 1)", GAME_SUPPORTS_SAVE )
375GAME( 1995, twinbrata,twinbrat, twinbrat, stlforce, stlforce_state, twinbrat, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 2)", GAME_SUPPORTS_SAVE )
373GAME( 1994, stlforce, 0,        stlforce, stlforce, stlforce_state, stlforce, ROT0, "Electronic Devices Italy / Ecogames S.L. Spain", "Steel Force", 0 )
374GAME( 1995, twinbrat, 0,        twinbrat, stlforce, stlforce_state, twinbrat, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 1)", 0 )
375GAME( 1995, twinbrata,twinbrat, twinbrat, stlforce, stlforce_state, twinbrat, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 2)", 0 )
trunk/src/mame/drivers/strnskil.c
r242944r242945
2222#include "sound/sn76496.h"
2323#include "includes/strnskil.h"
2424
25
26
27void strnskil_state::machine_start()
28{
29   save_item(NAME(m_scrl_ctrl));
30   save_item(NAME(m_irq_source));
31}
32
3325/****************************************************************************/
3426
3527READ8_MEMBER(strnskil_state::strnskil_d800_r)
r242944r242945
541533   m_maincpu->space(AS_PROGRAM).install_write_handler(0xd80d, 0xd80d, write8_delegate(FUNC(strnskil_state::protection_w),this));
542534}
543535
544GAME( 1984, strnskil, 0,        strnskil, strnskil, driver_device, 0,       ROT0, "Sun Electronics", "Strength & Skill", GAME_SUPPORTS_SAVE )
545GAME( 1984, guiness,  strnskil, strnskil, strnskil, driver_device, 0,       ROT0, "Sun Electronics", "The Guiness (Japan)", GAME_SUPPORTS_SAVE )
546GAME( 1984, banbam,   0,        banbam,   banbam, strnskil_state,   banbam,  ROT0, "Sun Electronics", "BanBam", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
547GAME( 1984, pettanp,  banbam,   strnskil, banbam, strnskil_state,   pettanp, ROT0, "Sun Electronics", "Pettan Pyuu (Japan)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
536GAME( 1984, strnskil, 0,        strnskil, strnskil, driver_device, 0,       ROT0, "Sun Electronics", "Strength & Skill", 0 )
537GAME( 1984, guiness,  strnskil, strnskil, strnskil, driver_device, 0,       ROT0, "Sun Electronics", "The Guiness (Japan)", 0 )
538GAME( 1984, banbam,   0,        banbam,   banbam, strnskil_state,   banbam,  ROT0, "Sun Electronics", "BanBam", GAME_UNEMULATED_PROTECTION )
539GAME( 1984, pettanp,  banbam,   strnskil, banbam, strnskil_state,   pettanp, ROT0, "Sun Electronics", "Pettan Pyuu (Japan)", GAME_UNEMULATED_PROTECTION )
trunk/src/mame/drivers/tourtabl.c
r242944r242945
2020      : driver_device(mconfig, type, tag),
2121      m_maincpu(*this, "maincpu") { }
2222
23   required_device<cpu_device> m_maincpu;
24   
2523   DECLARE_WRITE8_MEMBER(tourtabl_led_w);
2624   DECLARE_READ16_MEMBER(tourtabl_read_input_port);
2725   DECLARE_READ8_MEMBER(tourtabl_get_databus_contents);
2826   DECLARE_WRITE8_MEMBER(watchdog_w);
27   required_device<cpu_device> m_maincpu;
2928};
3029
3130
r242944r242945
202201ROM_END
203202
204203
205GAME( 1978, tourtabl, 0,        tourtabl, tourtabl, driver_device, 0, ROT0, "Atari", "Tournament Table (set 1)", GAME_SUPPORTS_SAVE )
206GAME( 1978, tourtab2, tourtabl, tourtabl, tourtabl, driver_device, 0, ROT0, "Atari", "Tournament Table (set 2)", GAME_SUPPORTS_SAVE )
204GAME( 1978, tourtabl, 0,        tourtabl, tourtabl, driver_device, 0, ROT0, "Atari", "Tournament Table (set 1)", 0 )
205GAME( 1978, tourtab2, tourtabl, tourtabl, tourtabl, driver_device, 0, ROT0, "Atari", "Tournament Table (set 2)", 0 )
trunk/src/mame/includes/stfight.h
r242944r242945
1010
1111   stfight_state(const machine_config &mconfig, device_type type, const char *tag)
1212      : driver_device(mconfig, type, tag),
13      m_text_char_ram(*this, "text_char_ram"),
14      m_text_attr_ram(*this, "text_attr_ram"),
15      m_tx_vram(*this, "tx_vram"),
16      m_vh_latch_ram(*this, "vh_latch_ram"),
17      m_sprite_ram(*this, "sprite_ram"),
1318      m_maincpu(*this, "maincpu"),
1419      m_audiocpu(*this, "audiocpu"),
1520      m_mcu(*this, "mcu"),
1621      m_msm(*this, "msm"),
1722      m_gfxdecode(*this, "gfxdecode"),
18      m_palette(*this, "palette"),
19      m_text_char_ram(*this, "text_char_ram"),
20      m_text_attr_ram(*this, "text_attr_ram"),
21      m_tx_vram(*this, "tx_vram"),
22      m_vh_latch_ram(*this, "vh_latch_ram"),
23      m_sprite_ram(*this, "sprite_ram") { }
23      m_palette(*this, "palette") { }
2424
25   optional_shared_ptr<UINT8> m_text_char_ram;
26   optional_shared_ptr<UINT8> m_text_attr_ram;
27   optional_shared_ptr<UINT8> m_tx_vram;
28   required_shared_ptr<UINT8> m_vh_latch_ram;
29   required_shared_ptr<UINT8> m_sprite_ram;
2530   required_device<cpu_device> m_maincpu;
2631   required_device<cpu_device> m_audiocpu;
2732   required_device<cpu_device> m_mcu;
2833   required_device<msm5205_device> m_msm;
2934   required_device<gfxdecode_device> m_gfxdecode;
3035   required_device<palette_device> m_palette;
31   
32   optional_shared_ptr<UINT8> m_text_char_ram;
33   optional_shared_ptr<UINT8> m_text_attr_ram;
34   optional_shared_ptr<UINT8> m_tx_vram;
35   required_shared_ptr<UINT8> m_vh_latch_ram;
36   required_shared_ptr<UINT8> m_sprite_ram;
3736
3837   UINT8 *m_decrypt;
3938   UINT8 m_fm_data;
r242944r242945
8079
8180   DECLARE_VIDEO_START(stfight);
8281   DECLARE_VIDEO_START(cshooter);
83   virtual void machine_start();
8482   virtual void machine_reset();
8583   DECLARE_PALETTE_INIT(stfight);
8684   UINT32 screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
r242944r242945
108106   UINT8 m_portB_out, m_portB_in;
109107   UINT8 m_portC_out, m_portC_in;
110108   UINT8 m_ddrA, m_ddrB, m_ddrC;
109   UINT8 m_from_main, m_main_sent;
111110
112111protected:
113112   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mame/includes/stlforce.h
r242944r242945
66public:
77   stlforce_state(const machine_config &mconfig, device_type type, const char *tag)
88      : driver_device(mconfig, type, tag),
9      m_maincpu(*this, "maincpu"),
10      m_oki(*this, "oki"),
11      m_eeprom(*this, "eeprom"),
12      m_gfxdecode(*this, "gfxdecode"),
13      m_palette(*this, "palette"),
149      m_bg_videoram(*this, "bg_videoram"),
1510      m_mlow_videoram(*this, "mlow_videoram"),
1611      m_mhigh_videoram(*this, "mhigh_videoram"),
r242944r242945
1914      m_mlow_scrollram(*this, "mlow_scrollram"),
2015      m_mhigh_scrollram(*this, "mhigh_scrollram"),
2116      m_vidattrram(*this, "vidattrram"),
22      m_spriteram(*this, "spriteram") { }
17      m_spriteram(*this, "spriteram"),
18      m_maincpu(*this, "maincpu"),
19      m_oki(*this, "oki"),
20      m_eeprom(*this, "eeprom"),
21      m_gfxdecode(*this, "gfxdecode"),
22      m_palette(*this, "palette") { }
2323
24   required_device<cpu_device> m_maincpu;
25   required_device<okim6295_device> m_oki;
26   required_device<eeprom_serial_93cxx_device> m_eeprom;
27   required_device<gfxdecode_device> m_gfxdecode;
28   required_device<palette_device> m_palette;
24   tilemap_t *m_bg_tilemap;
25   tilemap_t *m_mlow_tilemap;
26   tilemap_t *m_mhigh_tilemap;
27   tilemap_t *m_tx_tilemap;
2928
3029   required_shared_ptr<UINT16> m_bg_videoram;
3130   required_shared_ptr<UINT16> m_mlow_videoram;
r242944r242945
3534   required_shared_ptr<UINT16> m_mlow_scrollram;
3635   required_shared_ptr<UINT16> m_mhigh_scrollram;
3736   required_shared_ptr<UINT16> m_vidattrram;
37
3838   required_shared_ptr<UINT16> m_spriteram;
39   
40   tilemap_t *m_bg_tilemap;
41   tilemap_t *m_mlow_tilemap;
42   tilemap_t *m_mhigh_tilemap;
43   tilemap_t *m_tx_tilemap;
4439
4540   int m_sprxoffs;
46   
4741   DECLARE_WRITE16_MEMBER(stlforce_bg_videoram_w);
4842   DECLARE_WRITE16_MEMBER(stlforce_mlow_videoram_w);
4943   DECLARE_WRITE16_MEMBER(stlforce_mhigh_videoram_w);
5044   DECLARE_WRITE16_MEMBER(stlforce_tx_videoram_w);
5145   DECLARE_WRITE16_MEMBER(eeprom_w);
5246   DECLARE_WRITE16_MEMBER(oki_bank_w);
53   
5447   DECLARE_DRIVER_INIT(twinbrat);
5548   DECLARE_DRIVER_INIT(stlforce);
56   
5749   TILE_GET_INFO_MEMBER(get_stlforce_bg_tile_info);
5850   TILE_GET_INFO_MEMBER(get_stlforce_mlow_tile_info);
5951   TILE_GET_INFO_MEMBER(get_stlforce_mhigh_tile_info);
6052   TILE_GET_INFO_MEMBER(get_stlforce_tx_tile_info);
61   
6253   virtual void video_start();
6354   UINT32 screen_update_stlforce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6455   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
56   required_device<cpu_device> m_maincpu;
57   required_device<okim6295_device> m_oki;
58   required_device<eeprom_serial_93cxx_device> m_eeprom;
59   required_device<gfxdecode_device> m_gfxdecode;
60   required_device<palette_device> m_palette;
6561};
trunk/src/mame/includes/strnskil.h
r242944r242945
55      : driver_device(mconfig, type, tag),
66      m_maincpu(*this,"maincpu"),
77      m_subcpu(*this,"sub"),
8      m_gfxdecode(*this, "gfxdecode"),
9      m_palette(*this, "palette"),
108      m_videoram(*this, "videoram"),
119      m_xscroll(*this, "xscroll"),
12      m_spriteram(*this, "spriteram") { }
10      m_spriteram(*this, "spriteram"),
11      m_gfxdecode(*this, "gfxdecode"),
12      m_palette(*this, "palette") { }
1313
1414   required_device<cpu_device> m_maincpu;
1515   required_device<cpu_device> m_subcpu;
16   required_device<gfxdecode_device> m_gfxdecode;
17   required_device<palette_device> m_palette;
18   
1916   required_shared_ptr<UINT8> m_videoram;
2017   required_shared_ptr<UINT8> m_xscroll;
2118   required_shared_ptr<UINT8> m_spriteram;
19   required_device<gfxdecode_device> m_gfxdecode;
20   required_device<palette_device> m_palette;
2221
2322   UINT8 m_scrl_ctrl;
2423   tilemap_t *m_bg_tilemap;
2524   UINT8 m_irq_source;
26   
27   TIMER_DEVICE_CALLBACK_MEMBER(strnskil_irq);
2825
2926   DECLARE_READ8_MEMBER(strnskil_d800_r);
3027   DECLARE_READ8_MEMBER(pettanp_protection_r);
r242944r242945
3229   DECLARE_WRITE8_MEMBER(protection_w);
3330   DECLARE_WRITE8_MEMBER(strnskil_videoram_w);
3431   DECLARE_WRITE8_MEMBER(strnskil_scrl_ctrl_w);
35   
3632   DECLARE_DRIVER_INIT(banbam);
3733   DECLARE_DRIVER_INIT(pettanp);
38   
3934   TILE_GET_INFO_MEMBER(get_bg_tile_info);
40   
41   virtual void machine_start();   
4235   virtual void video_start();
4336   DECLARE_PALETTE_INIT(strnskil);
4437   UINT32 screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
38   TIMER_DEVICE_CALLBACK_MEMBER(strnskil_irq);
4539   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
4640};
trunk/src/mame/machine/stfight.c
r242944r242945
11/***************************************************************************
22
3  stfight.c
3  machine.c
44
55  Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
66  I/O ports)
r242944r242945
6363            ( ( ( src ^ A ) >> 1 ) & 0x08 ) |
6464            ( ~( ( src >> 6 ) ^ A ) & 0x01 );
6565   }
66   
6766}
6867
6968DRIVER_INIT_MEMBER(stfight_state,stfight)
r242944r242945
7574{
7675}
7776
78void stfight_state::machine_start()
79{
80   save_item(NAME(m_fm_data));
81   save_item(NAME(m_cpu_to_mcu_data));
82   save_item(NAME(m_cpu_to_mcu_empty));
83   save_item(NAME(m_adpcm_data_offs));
84   save_item(NAME(m_adpcm_nibble));
85   save_item(NAME(m_adpcm_reset));
86   save_item(NAME(m_coin_state));
87   save_item(NAME(m_sprite_base));
88   save_item(NAME(m_portA_out));
89   save_item(NAME(m_portA_in));
90   save_item(NAME(m_portB_out));
91   save_item(NAME(m_portB_in));
92   save_item(NAME(m_portC_out));
93   save_item(NAME(m_portC_in));
94   save_item(NAME(m_ddrA));
95   save_item(NAME(m_ddrB));
96   save_item(NAME(m_ddrC));
97}
98
9977void stfight_state::machine_reset()
10078{
10179   m_fm_data = 0;
trunk/src/mame/mame.lst
r242944r242945
1105411054pepp0014        // (c) 1987 IGT - International Game Technology
1105511055pepp0014a       // (c) 1987 IGT - International Game Technology
1105611056pepp0023        // (c) 1987 IGT - International Game Technology
11057pepp0038        // (c) 1987 IGT - International Game Technology
1105811057pepp0040        // (c) 1987 IGT - International Game Technology
1105911058pepp0040a       // (c) 1987 IGT - International Game Technology
1106011059pepp0041        // (c) 1987 IGT - International Game Technology
r242944r242945
1108411083pepp0083        // (c) 1987 IGT - International Game Technology
1108511084pepp0103        // (c) 1987 IGT - International Game Technology
1108611085pepp0116        // (c) 1987 IGT - International Game Technology
11087pepp0116a       // (c) 1987 IGT - International Game Technology
1108811086pepp0118        // (c) 1987 IGT - International Game Technology
1108911087pepp0120        // (c) 1987 IGT - International Game Technology
1109011088pepp0125        // (c) 1987 IGT - International Game Technology
trunk/src/mame/video/strnskil.c
r242944r242945
4141
4242WRITE8_MEMBER(strnskil_state::strnskil_videoram_w)
4343{
44   m_videoram[offset] = data;
44   UINT8 *videoram = m_videoram;
45   videoram[offset] = data;
4546   m_bg_tilemap->mark_tile_dirty(offset / 2);
4647}
4748
r242944r242945
5859
5960TILE_GET_INFO_MEMBER(strnskil_state::get_bg_tile_info)
6061{
61   int attr = m_videoram[tile_index * 2];
62   int code = m_videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3);
62   UINT8 *videoram = m_videoram;
63   int attr = videoram[tile_index * 2];
64   int code = videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3);
6365   int color = (attr & 0x1f) | ((attr & 0x80) >> 2);
6466
6567   SET_TILE_INFO_MEMBER(0, code, color, 0);
r242944r242945
7577
7678void strnskil_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
7779{
80   UINT8 *spriteram = m_spriteram;
7881   int offs;
7982
8083   for (offs = 0x60; offs < 0x100; offs += 4)
8184   {
82      int code = m_spriteram[offs + 1];
83      int color = m_spriteram[offs + 2] & 0x3f;
85      int code = spriteram[offs + 1];
86      int color = spriteram[offs + 2] & 0x3f;
8487      int flipx = flip_screen_x();
8588      int flipy = flip_screen_y();
8689
87      int sx = m_spriteram[offs + 3];
88      int sy = m_spriteram[offs];
90      int sx = spriteram[offs + 3];
91      int sy = spriteram[offs];
8992      int px, py;
9093
9194      if (flip_screen())
r242944r242945
115118
116119UINT32 strnskil_state::screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
117120{
121   int row;
118122   const UINT8 *usr1 = memregion("user1")->base();
119123
120   for (int row = 0; row < 32; row++)
124   for (row = 0; row < 32; row++)
121125   {
122126      if (m_scrl_ctrl != 0x07)
123127      {
trunk/src/mame/video/tia.c
r242944r242945
430430   helper[0] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT);
431431   helper[1] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT);
432432   helper[2] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT);
433   
434   register_save_state();
435433}
436434
437435
r242944r242945
667665
668666int tia_video_device::current_x()
669667{
670   return 3 * ((machine().device<cpu_device>("maincpu")->total_cycles() - frame_cycles) % 76) - 68;
668   return 3 * ((machine().firstcpu->total_cycles() - frame_cycles) % 76) - 68;
671669}
672670
673671
674672int tia_video_device::current_y()
675673{
676   return (machine().device<cpu_device>("maincpu")->total_cycles() - frame_cycles) / 76;
674   return (machine().firstcpu->total_cycles() - frame_cycles) / 76;
677675}
678676
679677
r242944r242945
10121010
10131011WRITE8_MEMBER( tia_video_device::WSYNC_w )
10141012{
1015   int cycles = machine().device<cpu_device>("maincpu")->total_cycles() - frame_cycles;
1013   int cycles = machine().firstcpu->total_cycles() - frame_cycles;
10161014
10171015   if (cycles % 76)
10181016   {
r242944r242945
10531051{
10541052   if (data & 0x80)
10551053   {
1056      paddle_start = machine().device<cpu_device>("maincpu")->total_cycles();
1054      paddle_start = machine().firstcpu->total_cycles();
10571055   }
10581056   if ( ! ( VBLANK & 0x40 ) ) {
10591057      INPT4 = 0x80;
r242944r242945
18061804
18071805READ8_MEMBER( tia_video_device::INPT_r )
18081806{
1809   UINT64 elapsed = machine().device<cpu_device>("maincpu")->total_cycles() - paddle_start;
1807   UINT64 elapsed = machine().firstcpu->total_cycles() - paddle_start;
18101808   UINT16 input = TIA_INPUT_PORT_ALWAYS_ON;
18111809   if ( !m_read_input_port_cb.isnull() )
18121810   {
r242944r242945
21792177   COLUBK = 0;
21802178   COLUPF = 0;
21812179}
2182
2183
2184void tia_video_device::register_save_state()
2185{
2186   save_item(NAME(p0gfx.start_pixel));
2187   save_item(NAME(p0gfx.start_drawing));
2188   save_item(NAME(p0gfx.size));
2189   save_item(NAME(p0gfx.skipclip));
2190   save_item(NAME(p1gfx.start_pixel));
2191   save_item(NAME(p1gfx.start_drawing));
2192   save_item(NAME(p1gfx.size));
2193   save_item(NAME(p1gfx.skipclip));
2194   save_item(NAME(frame_cycles));
2195   save_item(NAME(paddle_start));
2196   save_item(NAME(horzP0));
2197   save_item(NAME(horzP1));
2198   save_item(NAME(horzM0));
2199   save_item(NAME(horzM1));
2200   save_item(NAME(horzBL));
2201   save_item(NAME(motclkP0));
2202   save_item(NAME(motclkP1));
2203   save_item(NAME(motclkM0));
2204   save_item(NAME(motclkM1));
2205   save_item(NAME(motclkBL));
2206   save_item(NAME(startP0));
2207   save_item(NAME(startP1));
2208   save_item(NAME(startM0));
2209   save_item(NAME(startM1));
2210   save_item(NAME(skipclipP0));
2211   save_item(NAME(skipclipP1));
2212   save_item(NAME(skipM0delay));
2213   save_item(NAME(skipM1delay));
2214   save_item(NAME(current_bitmap));
2215   save_item(NAME(prev_x));
2216   save_item(NAME(prev_y));
2217   save_item(NAME(VSYNC));
2218   save_item(NAME(VBLANK));
2219   save_item(NAME(COLUP0));
2220   save_item(NAME(COLUP1));
2221   save_item(NAME(COLUBK));
2222   save_item(NAME(COLUPF));
2223   save_item(NAME(CTRLPF));
2224   save_item(NAME(GRP0));
2225   save_item(NAME(GRP1));
2226   save_item(NAME(REFP0));
2227   save_item(NAME(REFP1));
2228   save_item(NAME(HMP0));
2229   save_item(NAME(HMP1));
2230   save_item(NAME(HMM0));
2231   save_item(NAME(HMM1));
2232   save_item(NAME(HMBL));
2233   save_item(NAME(VDELP0));
2234   save_item(NAME(VDELP1));
2235   save_item(NAME(VDELBL));
2236   save_item(NAME(NUSIZ0));
2237   save_item(NAME(NUSIZ1));
2238   save_item(NAME(ENAM0));
2239   save_item(NAME(ENAM1));
2240   save_item(NAME(ENABL));
2241   save_item(NAME(CXM0P));
2242   save_item(NAME(CXM1P));
2243   save_item(NAME(CXP0FB));
2244   save_item(NAME(CXP1FB));
2245   save_item(NAME(CXM0FB));
2246   save_item(NAME(CXM1FB));
2247   save_item(NAME(CXBLPF));
2248   save_item(NAME(CXPPMM));
2249   save_item(NAME(RESMP0));
2250   save_item(NAME(RESMP1));
2251   save_item(NAME(PF0));
2252   save_item(NAME(PF1));
2253   save_item(NAME(PF2));
2254   save_item(NAME(INPT4));
2255   save_item(NAME(INPT5));
2256   save_item(NAME(prevGRP0));
2257   save_item(NAME(prevGRP1));
2258   save_item(NAME(prevENABL));
2259   save_item(NAME(HMOVE_started));
2260   save_item(NAME(HMOVE_started_previous));
2261   save_item(NAME(HMP0_latch));
2262   save_item(NAME(HMP1_latch));
2263   save_item(NAME(HMM0_latch));
2264   save_item(NAME(HMM1_latch));
2265   save_item(NAME(HMBL_latch));
2266   save_item(NAME(REFLECT));
2267   save_item(NAME(NUSIZx_changed));
2268}
trunk/src/mame/video/tia.h
r242944r242945
199199   bitmap_ind16 *helper[3];
200200
201201   UINT16 screen_height;
202   
203   void register_save_state();
204202};
205203
206204class tia_pal_video_device : public tia_video_device
trunk/src/mess/drivers/a2600.c
r242944r242945
209209         if ( supported_screen_heights[i] != m_current_screen_height )
210210         {
211211            m_current_screen_height = supported_screen_heights[i];
212//              m_screen->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_NTSC ) * 228 * m_current_screen_height );
212//              machine.first_screen()->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_NTSC ) * 228 * m_current_screen_height );
213213         }
214214      }
215215   }
r242944r242945
226226         if ( supported_screen_heights[i] != m_current_screen_height )
227227         {
228228            m_current_screen_height = supported_screen_heights[i];
229//              m_screen->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_PAL ) * 228 * m_current_screen_height );
229//              machine.first_screen()->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_PAL ) * 228 * m_current_screen_height );
230230         }
231231      }
232232   }
r242944r242945
316316
317317   /* Banks may have changed, reset the cpu so it uses the correct reset vector */
318318   m_maincpu->reset();
319   
320   save_item(NAME(m_current_screen_height));
321319}
322320
323321
r242944r242945
543541#define rom_a2600p rom_a2600
544542
545543/*    YEAR  NAME    PARENT  COMPAT  MACHINE INPUT   INIT    COMPANY     FULLNAME */
546CONS( 1977, a2600,  0,      0,      a2600,  a2600, driver_device,   0,      "Atari",    "Atari 2600 (NTSC)" , GAME_SUPPORTS_SAVE )
547CONS( 1978, a2600p, a2600,  0,      a2600p, a2600, driver_device,   0,      "Atari",    "Atari 2600 (PAL)",   GAME_SUPPORTS_SAVE )
544CONS( 1977, a2600,  0,      0,      a2600,  a2600, driver_device,   0,      "Atari",    "Atari 2600 (NTSC)" , 0)
545CONS( 1978, a2600p, a2600,  0,      a2600p, a2600, driver_device,   0,      "Atari",    "Atari 2600 (PAL)",   0)
trunk/src/mess/drivers/apple3.c
r242944r242945
102102   MCFG_FLOPPY_DRIVE_ADD("2", a3_floppies, "525", apple3_state::floppy_formats)
103103   MCFG_FLOPPY_DRIVE_ADD("3", a3_floppies, "525", apple3_state::floppy_formats)
104104
105   /* softlist for fdc */
106   MCFG_SOFTWARE_LIST_ADD("flop525_list","apple3")
107
108105   /* acia */
109106   MCFG_DEVICE_ADD("acia", MOS6551, 0)
110107   MCFG_MOS6551_XTAL(XTAL_1_8432MHz) // HACK: The schematic shows an external clock generator but using a XTAL is faster to emulate.
trunk/src/mess/drivers/comp4.c
r242944r242945
141141static INPUT_PORTS_START( comp4 )
142142   PORT_START("IN.0") // O1
143143   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("R")
144   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1")
145   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4")
144   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1")
145   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4")
146146   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7")
147147
148148   PORT_START("IN.1") // O2
149149   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0")
150   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2")
151   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5")
150   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2")
151   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5")
152152   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8")
153153
154154   PORT_START("IN.2") // O3
155155   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("E")
156   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3")
157   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6")
156   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3")
157   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6")
158158   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9")
159159INPUT_PORTS_END
160160
trunk/src/mess/drivers/elecdet.c
r242944r242945
77  hardware (and concept) is very similar to Parker Bros Stop Thief
88
99  This is an electronic board game. It requires game cards with suspect info,
10  and good old pen and paper to record game progress. To start the game, enter
11  difficulty(1-3), then number of players(1-4), then [ENTER]. Refer to the
12  manual for more information.
10  and good old pen and paper to record game progress. Refer to the manual
11  on how to play it.
1312
1413
1514  TODO:
r242944r242945
297296
298297ROM_START( elecdet )
299298   ROM_REGION( 0x1000, "maincpu", 0 )
300   ROM_LOAD( "tms0980nll_mp6100a", 0x0000, 0x1000, CRC(8160a081) SHA1(14cbfc0529ad83a58e0dc15fe8ba594947e49f08) )
299   ROM_LOAD( "tms0980nll_mp6100a", 0x0000, 0x1000, CRC(f33f02ae) SHA1(a978d9cc1ba7897f6e8997715da265eb8c4a0c34) )
301300
302301   ROM_REGION( 1246, "maincpu:ipla", 0 )
303302   ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) )
trunk/src/mess/drivers/fmtowns.c
r242944r242945
1515            1024 sprites (16x16), rendered direct to VRAM
1616            16 colour text mode, rendered direct to VRAM
1717
18    Later models add an unknown single channel 16-bit PCM/ADPCM (FreshTV, SJ, MX), and CL-GD543x Windows accelerator chipsets (SJ)
1918
20
2119    Fujitsu FM-Towns Marty
2220
2321    Japanese console, based on the FM-Towns computer, using an AMD 80386SX CPU,
trunk/src/mess/drivers/ngen.c
r242944r242945
8383      m_dmac(*this,"dmac"),
8484      m_pic(*this,"pic"),
8585      m_pit(*this,"pit"),
86      m_disk_rom(*this,"disk"),
8786      m_vram(*this,"vram"),
8887      m_fontram(*this,"fontram"),
8988      m_fdc(*this,"fdc"),
90      m_fd0(*this,"fdc:0"),
91      m_fdc_timer(*this,"fdc_timer"),
92      m_hdc_timer(*this,"hdc_timer")
89      m_fd0(*this,"fdc:0")
9390   {}
9491
9592   DECLARE_WRITE_LINE_MEMBER(pit_out0_w);
r242944r242945
10097   DECLARE_WRITE16_MEMBER(cpu_peripheral_cb);
10198   DECLARE_WRITE16_MEMBER(peripheral_w);
10299   DECLARE_READ16_MEMBER(peripheral_r);
103   DECLARE_WRITE16_MEMBER(xbus_w);
104   DECLARE_READ16_MEMBER(xbus_r);
100   DECLARE_WRITE16_MEMBER(port00_w);
101   DECLARE_READ16_MEMBER(port00_r);
105102   DECLARE_WRITE_LINE_MEMBER(dma_hrq_changed);
106103   DECLARE_WRITE_LINE_MEMBER(dma_eop_changed);
107104   DECLARE_WRITE_LINE_MEMBER(dack0_w);
r242944r242945
115112   DECLARE_READ8_MEMBER( dma_0_dack_r ) { UINT16 ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; }
116113   DECLARE_READ8_MEMBER( dma_1_dack_r ) { UINT16 ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; }
117114   DECLARE_READ8_MEMBER( dma_2_dack_r ) { UINT16 ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; }
118   DECLARE_READ8_MEMBER( dma_3_dack_r );
119   DECLARE_WRITE8_MEMBER( dma_0_dack_w ){ popmessage("IOW0: data %02x",data); }
115   DECLARE_READ8_MEMBER( dma_3_dack_r ) { UINT16 ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; }
116   DECLARE_WRITE8_MEMBER( dma_0_dack_w ){ popmessage("IOW: data %02x",data); }
120117   DECLARE_WRITE8_MEMBER( dma_1_dack_w ){  }
121118   DECLARE_WRITE8_MEMBER( dma_2_dack_w ){  }
122   DECLARE_WRITE8_MEMBER( dma_3_dack_w ){ popmessage("IOW3: data %02x",data); }
123
124   DECLARE_WRITE16_MEMBER(hfd_w);
125   DECLARE_READ16_MEMBER(fhd_r);
119   DECLARE_WRITE8_MEMBER( dma_3_dack_w ){  }
126120   DECLARE_WRITE_LINE_MEMBER(fdc_irq_w);
127121   DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
128122   DECLARE_WRITE8_MEMBER(fdc_control_w);
129123   DECLARE_READ8_MEMBER(irq_cb);
130   DECLARE_WRITE8_MEMBER(hdc_control_w);
131   DECLARE_WRITE8_MEMBER(disk_addr_ext);
132124
133125protected:
134126   virtual void machine_reset();
r242944r242945
141133   required_device<am9517a_device> m_dmac;
142134   required_device<pic8259_device> m_pic;
143135   required_device<pit8254_device> m_pit;
144   optional_memory_region m_disk_rom;
145136   optional_shared_ptr<UINT16> m_vram;
146137   optional_shared_ptr<UINT16> m_fontram;
147138   optional_device<wd2797_t> m_fdc;
148139   optional_device<floppy_connector> m_fd0;
149   optional_device<pit8253_device> m_fdc_timer;
150   optional_device<pit8253_device> m_hdc_timer;
151140
152141   void set_dma_channel(int channel, int state);
153142
154   UINT8 m_xbus_current;  // currently selected X-Bus module
155143   UINT16 m_peripheral;
156144   UINT16 m_upper;
157145   UINT16 m_middle;
r242944r242945
161149   INT8 m_dma_channel;
162150   UINT16 m_dma_high_byte;
163151   UINT16 m_control;
164   UINT16 m_disk_rom_ptr;
165   UINT8 m_hdc_control;
166   UINT8 m_disk_page;
167152};
168153
169154class ngen386_state : public driver_device
r242944r242945
264249   case 0x0f:
265250      if(mem_mask & 0x00ff)
266251         m_dmac->write(space,offset,data & 0xff);
267      logerror("(PC=%06x) DMA write offset %04x data %04x mask %04x\n",m_maincpu->device_t::safe_pc(),offset,data,mem_mask);
252      //logerror("(PC=%06x) DMA write offset %04x data %04x mask %04x\n",m_maincpu->device_t::safe_pc(),offset,data,mem_mask);
268253      break;
269254   case 0x80: // DMA page offset?
270255   case 0x81:
r242944r242945
273258      if(mem_mask & 0x00ff)
274259         m_dma_offset[offset-0x80] = data & 0xff;
275260      break;
276   case 0xc0:  // X-Bus modules reset
277      m_xbus_current = 0;
278      break;
279261   case 0x10c:
280262      if(mem_mask & 0x00ff)
281263         m_pic->write(space,0,data & 0xff);
r242944r242945
397379
398380// X-bus module select
399381// The bootstrap ROM creates a table at 0:FC9h, with a count, followed by the module IDs of each
400// expansion module.  The base I/O address for the currently selected module is set by writing to
401// this register (bits 0-7 are ignored)
402// TODO: make expansion modules slot devices
403WRITE16_MEMBER(ngen_state::xbus_w)
382// expansion module.  The base I/O address for each module is 0x100*module number.
383// Module 0 is the main processor module, module 1 is the next module attached, and so on.
384WRITE16_MEMBER(ngen_state::port00_w)
404385{
405   UINT16 addr = (data & 0x00ff) << 8;
406   address_space& io = m_maincpu->device_t::memory().space(AS_IO);
407   switch(m_xbus_current)
408   {
409      case 0x00:  // Floppy/Hard disk module
410         io.install_readwrite_handler(addr,addr+0xff,0,0,read16_delegate(FUNC(ngen_state::fhd_r),this),write16_delegate(FUNC(ngen_state::hfd_w),this));
411         break;
412      default:
413         m_maincpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE);  // reached end of the modules
414         break;
415   }
416   if(addr != 0)
417      logerror("SYS: X-Bus module %i address set %04x\n",m_xbus_current+1,addr);
418   m_xbus_current++;
386   m_port00 = data;
387   logerror("SYS: X-Bus module select %04x\n",data);
419388}
420389
421// returns X-bus module ID and info in the low byte (can indicate if the device is bootable, has a boot ROM (needs to be written to RAM via DMA), or if it supports a non-80186 CPU)
422// bit 6, I think, indicates a bootable device
423// Known module IDs:
424//  0x1070 - Floppy/Hard disk module
425//  0x3141 - QIC Tape module
426READ16_MEMBER(ngen_state::xbus_r)
390// returns X-bus module ID (what is the low byte for?)
391// For now, we'll hard code a floppy disk module (or try to)
392READ16_MEMBER(ngen_state::port00_r)
427393{
428   UINT16 ret = 0xffff;
429   
430   switch(m_xbus_current)
431   {
432      case 0x00:
433         ret = 0x1070;  // Floppy/Hard disk module
434         break;
435      default:
436         m_maincpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE);  // reached the end of the modules
437         ret = 0x0080;
438         break;
439   }
440   return ret;
394   if(m_port00 > 0)
395      m_maincpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE);
396   if(m_port00 == 0)
397      return 0x0040;  // module ID of 0x40 = dual floppy disk module (need hardware manual to find other module IDs)
398   else
399      return 0x0080;  // invalid device?
441400}
442401
443
444// Floppy/Hard disk module
445WRITE16_MEMBER(ngen_state::hfd_w)
446{
447   switch(offset)
448   {
449      case 0x00:
450      case 0x01:
451      case 0x02:
452      case 0x03:
453         if(mem_mask & 0x00ff)
454            m_fdc->write(space,offset,data & 0xff);
455         break;
456      case 0x04:
457         if(mem_mask & 0x00ff)
458            fdc_control_w(space,offset,data & 0xff);
459         break;
460      case 0x05:
461         if(mem_mask & 0x00ff)
462            hdc_control_w(space,offset,data & 0xff);
463         break;
464      case 0x07:
465         if(mem_mask & 0x00ff)
466            disk_addr_ext(space,offset,data & 0xff);
467         break;
468      case 0x08:
469      case 0x09:
470      case 0x0a:
471      case 0x0b:
472         if(mem_mask & 0x00ff)
473            m_fdc_timer->write(space,offset,data & 0xff);
474         break;
475      case 0x10:
476      case 0x11:
477      case 0x12:
478      case 0x13:
479      case 0x14:
480      case 0x15:
481      case 0x16:
482      case 0x17:
483         logerror("WD1010 register %i write %02x mask %04x\n",offset-0x10,data & 0xff,mem_mask);
484         break;
485      case 0x18:
486      case 0x19:
487      case 0x1a:
488      case 0x1b:
489         if(mem_mask & 0x00ff)
490            m_hdc_timer->write(space,offset,data & 0xff);
491         break;
492   }
493}
494
495READ16_MEMBER(ngen_state::fhd_r)
496{
497   UINT16 ret = 0xffff;
498
499   switch(offset)
500   {
501      case 0x00:
502      case 0x01:
503      case 0x02:
504      case 0x03:
505         if(mem_mask & 0x00ff)
506            ret = m_fdc->read(space,offset);
507         break;
508      case 0x08:
509      case 0x09:
510      case 0x0a:
511      case 0x0b:
512         if(mem_mask & 0x00ff)
513            ret = m_fdc_timer->read(space,offset);
514         break;
515      case 0x10:
516      case 0x11:
517      case 0x12:
518      case 0x13:
519      case 0x14:
520      case 0x15:
521      case 0x16:
522      case 0x17:
523         logerror("WD1010 register %i read, mask %04x\n",offset-0x10,mem_mask);
524         break;
525      case 0x18:
526      case 0x19:
527      case 0x1a:
528      case 0x1b:
529         if(mem_mask & 0x00ff)
530            ret = m_hdc_timer->read(space,offset);
531         break;
532   }
533
534   return ret;
535}
536
537402WRITE_LINE_MEMBER(ngen_state::fdc_irq_w)
538403{
539404   m_pic->ir7_w(state);
r242944r242945
544409   m_dmac->dreq3_w(state);
545410}
546411
547// Floppy disk control register
548// Bit 0 - enable drive and LED
549// Bit 2 - floppy motor
550// Bit 5 - side select
551// Bit 6 - 1 = 2Mhz for seek, 0 = 1MHz for read/write
552// Bit 7 - FDC reset
553412WRITE8_MEMBER(ngen_state::fdc_control_w)
554413{
555414   m_fdc->set_floppy(m_fd0->get_device());
556   m_fd0->get_device()->mon_w(~data & 0x04);
557   m_fd0->get_device()->ss_w(data & 0x20);
558   if(~data & 0x80)
559      m_fdc->soft_reset();
415   m_fd0->get_device()->mon_w((~data) & 0x80);
416   m_fdc->dden_w(~data & 0x04);
560417}
561418
562// Hard disk control register
563// bit 0 - Drive select 0 - selects module hard disk
564// bit 1 - Drive select 1 - selects expansion module hard disk (if available)
565// bit 2 - enable DMA transfer of module ROM contents to X-Bus master memory
566// bits 3-5 - select head / expansion module head
567// bit 6 - write enable, must be set to write to a hard disk
568// bit 7 - HDC reset
569WRITE8_MEMBER(ngen_state::hdc_control_w)
570{
571   m_hdc_control = data;
572   if(m_hdc_control & 0x04)
573   {
574      m_disk_rom_ptr = 0;
575      popmessage("HDD: DMA ROM transfer start\n");
576      m_dmac->dreq3_w(1);
577      //m_dmac->dreq3_w(0);
578   }
579}
580
581// page of system RAM to access
582// bit 7 = disables read/write signals to the WD1010
583WRITE8_MEMBER(ngen_state::disk_addr_ext)
584{
585   m_disk_page = data & 0x7f;
586}
587
588419WRITE_LINE_MEMBER( ngen_state::dma_hrq_changed )
589420{
590421   m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
r242944r242945
599430      else
600431         m_control &= ~0x02;
601432   }
602   if(m_dma_channel == 3)
603   {
604      if(state)
605      {
606         if(m_hdc_control & 0x04) // ROM transfer?
607            m_hdc_control &= ~0x04;  // switch it off when done
608      }
609   }
610433}
611434
612435void ngen_state::set_dma_channel(int channel, int state)
r242944r242945
622445WRITE_LINE_MEMBER( ngen_state::dack2_w ) { set_dma_channel(2, state); }
623446WRITE_LINE_MEMBER( ngen_state::dack3_w ) { set_dma_channel(3, state); }
624447
625READ8_MEMBER(ngen_state::dma_3_dack_r)
626{
627   UINT16 ret = 0xffff;
628   
629   if((m_hdc_control & 0x04) && m_disk_rom)
630   {
631      ret = m_disk_rom->base()[m_disk_rom_ptr++] << 8;
632      printf("DMA3 DACK: returning %02x\n",ret);
633      if(m_disk_rom_ptr < 0x1000)
634      {
635         m_dmac->dreq3_w(1);
636         //m_dmac->dreq3_w(0);
637      }
638   }
639   m_dma_high_byte = ret & 0xff00;
640   return ret;
641}
642
643448READ8_MEMBER(ngen_state::dma_read_word)
644449{
645450   address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space
r242944r242945
693498{
694499   m_port00 = 0;
695500   m_control = 0;
696   m_xbus_current = 0;
697501   m_viduart->write_dsr(0);
698502   m_viduart->write_cts(0);
699503   m_fd0->get_device()->set_rpm(300);
r242944r242945
708512ADDRESS_MAP_END
709513
710514static ADDRESS_MAP_START( ngen_io, AS_IO, 16, ngen_state )
711   AM_RANGE(0x0000, 0x0001) AM_READWRITE(xbus_r,xbus_w)
712   
713   // Floppy/Hard disk module
714//   AM_RANGE(0x0100, 0x0107) AM_DEVREADWRITE8("fdc",wd2797_t,read,write,0x00ff)  // a guess for now
715//   AM_RANGE(0x0108, 0x0109) AM_WRITE8(fdc_control_w,0x00ff)
716//   AM_RANGE(0x010a, 0x010b) AM_WRITE8(hdc_control_w,0x00ff)
717//   AM_RANGE(0x010e, 0x010f) AM_WRITE8(disk_addr_ext,0x00ff)  // X-Bus extended address register
718//   AM_RANGE(0x0110, 0x0117) AM_DEVREADWRITE8("fdc_timer",pit8253_device,read,write,0x00ff)
719   // 0x0120-0x012f - WD1010 Winchester disk controller (unemulated)
720//   AM_RANGE(0x0130, 0x0137) AM_DEVREADWRITE8("hdc_timer",pit8253_device,read,write,0x00ff)
721   
515   AM_RANGE(0x0000, 0x0001) AM_READWRITE(port00_r,port00_w)
516   AM_RANGE(0x0100, 0x0107) AM_DEVREADWRITE8("fdc",wd2797_t,read,write,0x00ff)  // a guess for now
517   AM_RANGE(0x0108, 0x0109) AM_WRITE8(fdc_control_w,0x00ff)
518   AM_RANGE(0x0110, 0x0117) AM_DEVREADWRITE8("fdc_timer",pit8253_device,read,write,0x00ff)
722519ADDRESS_MAP_END
723520
724521static ADDRESS_MAP_START( ngen386_mem, AS_PROGRAM, 32, ngen_state )
r242944r242945
823620
824621   // keyboard UART (patent says i8251 is used for keyboard communications, it is located on the video board)
825622   MCFG_DEVICE_ADD("videouart", I8251, 0)  // main clock unknown, Rx/Tx clocks are 19.53kHz
826//   MCFG_I8251_TXEMPTY_HANDLER(DEVWRITELINE("pic",pic8259_device,ir4_w))
623   MCFG_I8251_TXEMPTY_HANDLER(DEVWRITELINE("pic",pic8259_device,ir4_w))
827624   MCFG_I8251_TXD_HANDLER(DEVWRITELINE("keyboard", rs232_port_device, write_txd))
828625   MCFG_RS232_PORT_ADD("keyboard", keyboard, "ngen")
829626   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("videouart", i8251_device, write_rxd))
r242944r242945
838635   MCFG_WD_FDC_FORCE_READY
839636   MCFG_DEVICE_ADD("fdc_timer", PIT8253, 0)
840637   MCFG_PIT8253_CLK0(XTAL_20MHz / 20)
841   MCFG_PIT8253_OUT0_HANDLER(DEVWRITELINE("pic",pic8259_device,ir7_w))
638   MCFG_PIT8253_OUT0_HANDLER(DEVWRITELINE("pic",pic8259_device,ir4_w))
842639   MCFG_PIT8253_CLK1(XTAL_20MHz / 20)
843   MCFG_PIT8253_OUT1_HANDLER(DEVWRITELINE("pic",pic8259_device,ir7_w))
640   MCFG_PIT8253_OUT1_HANDLER(DEVWRITELINE("pic",pic8259_device,ir4_w))
844641   MCFG_PIT8253_CLK2(XTAL_20MHz / 20)
845   MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("pic",pic8259_device,ir7_w))
642   MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("pic",pic8259_device,ir4_w))
846643   // TODO: WD1010 HDC (not implemented)
847644   MCFG_DEVICE_ADD("hdc_timer", PIT8253, 0)
848645   MCFG_FLOPPY_DRIVE_ADD("fdc:0", ngen_floppies, "525qd", floppy_image_device::default_floppy_formats)
trunk/src/mess/machine/ngen_kb.c
r242944r242945
1212void ngen_keyboard_device::write(UINT8 data)
1313{
1414   // To be figured out
15   // Code 0x92 is sent on startup, perhaps resets the keyboard MCU
16   // Codes 0xAx and 0xBx appear to control the keyboard LEDs, lower nibbles controlling the state of the LEDs
17   // When setting an error code via the LEDs, 0xB0 then 0xAE is sent (presumably for error code 0xE0),
18   // so that means that 0xAx controls the Overtype, Lock, F1 and F2 LEDs, and 0xBx controls the F3, F8, F9 and F10 LEDs.
1915   logerror("KB: received character %02x\n",data);
2016}
2117
trunk/src/osd/osdmini/minimain.c
r242944r242945
5555
5656
5757//============================================================
58//  mini_osd_options
59//============================================================
60
61mini_osd_options::mini_osd_options()
62: osd_options()
63{
64   //add_entries(s_option_entries);
65}
66
67//============================================================
6858//  main
6959//============================================================
7060
r242944r242945
7262{
7363   // cli_frontend does the heavy lifting; if we have osd-specific options, we
7464   // create a derivative of cli_options and add our own
75   mini_osd_options options;
76   mini_osd_interface osd(options);
77   osd.register_options();
65   cli_options options;
66   mini_osd_interface osd;
67   osd.register_options(options);
7868   cli_frontend frontend(options, osd);
7969   return frontend.execute(argc, argv);
8070}
r242944r242945
8474//  constructor
8575//============================================================
8676
87mini_osd_interface::mini_osd_interface(mini_osd_options &options)
88: osd_common_t(options)
77mini_osd_interface::mini_osd_interface()
8978{
9079}
9180
r242944r242945
10695void mini_osd_interface::init(running_machine &machine)
10796{
10897   // call our parent
109   osd_common_t::init(machine);
98   osd_interface::init(machine);
11099
111100   // initialize the video system by allocating a rendering target
112101   our_target = machine.render().target_alloc();
trunk/src/osd/osdmini/osdmini.h
r242944r242945
88
99#include "options.h"
1010#include "osdepend.h"
11#include "modules/lib/osdobj_common.h"
1211
1312
14class mini_osd_options : public osd_options
15{
16public:
17   // construction/destruction
18   mini_osd_options();
19
20};
21
2213//============================================================
2314//  TYPE DEFINITIONS
2415//============================================================
2516
26class mini_osd_interface : public osd_common_t
17class mini_osd_interface : public osd_interface
2718{
2819public:
2920   // construction/destruction
30   mini_osd_interface(mini_osd_options &options);
21   mini_osd_interface();
3122   virtual ~mini_osd_interface();
3223
3324   // general overridables
trunk/src/osd/osdmini/osdmini.mak
r242944r242945
5050OSDSRC = $(SRC)/osd
5151OSDOBJ = $(OBJ)/osd
5252
53OBJDIRS += $(MINIOBJ) \
54   $(OSDOBJ)/modules/sync \
55   $(OSDOBJ)/modules/lib \
56   $(OSDOBJ)/modules/midi
53OBJDIRS += $(MINIOBJ) $(OSDOBJ)/modules/sync
5754
55
56
5857#-------------------------------------------------
5958# OSD core library
6059#-------------------------------------------------
r242944r242945
6564   $(MINIOBJ)/minimisc.o \
6665   $(MINIOBJ)/minisync.o \
6766   $(MINIOBJ)/minitime.o \
67   $(OSDOBJ)/modules/sync/work_mini.o \
6868
6969#-------------------------------------------------
7070# OSD mini library
7171#-------------------------------------------------
7272
7373OSDOBJS = \
74   $(MINIOBJ)/minimain.o \
75   $(OSDOBJ)/modules/sync/work_mini.o \
76   $(OSDOBJ)/modules/lib/osdobj_common.o  \
77   $(OSDOBJ)/modules/midi/none.o \
74   $(MINIOBJ)/minimain.o
7875
7976ifeq ($(OS),Windows_NT)
8077LIBS += -lwinmm -lwsock32
trunk/src/tools/chdman.c
r242944r242945
8787#define OPTION_VERBOSE "verbose"
8888#define OPTION_FIX "fix"
8989#define OPTION_NUMPROCESSORS "numprocessors"
90#define OPTION_SIZE "size"
9190
9291
9392//**************************************************************************
r242944r242945
529528   { OPTION_NO_CHECKSUM,           "nocs", false, ": do not include this metadata information in the overall SHA-1" },
530529   { OPTION_FIX,                   "f",    false, ": fix the SHA-1 if it is incorrect" },
531530   { OPTION_VERBOSE,               "v",    false, ": output additional information" },
532   { OPTION_SIZE,                  "s",    true, ": <bytes>: size of the output file" },
533531};
534532
535533
r242944r242945
581579         OPTION_COMPRESSION,
582580         OPTION_IDENT,
583581         OPTION_CHS,
584         OPTION_SIZE,
585582         OPTION_SECTOR_SIZE,
586583         OPTION_NUMPROCESSORS
587584      }
r242944r242945
904901   if (filesize == 0)
905902      report_error(1, "Can't guess CHS values because there is no input file");
906903
904   // validate the size
905   if (filesize % sectorsize != 0)
906      report_error(1, "Can't guess CHS values because data size is not divisible by %d", sectorsize);
907   ;
908
907909   // now find a valid value
908910   for (UINT32 totalsectors = filesize / sectorsize; ; totalsectors++)
909911      for (UINT32 cursectors = 63; cursectors > 1; cursectors--)
r242944r242945
16851687   parse_hunk_size(params, sector_size, hunk_size);
16861688
16871689   // process input start/end (needs to know hunk_size)
1688   UINT64 filesize = 0;
16891690   UINT64 input_start = 0;
16901691   UINT64 input_end = 0;
16911692   if (input_file != NULL)
1692   {
16931693      parse_input_start_end(params, core_fsize(input_file), hunk_size, hunk_size, input_start, input_end);
1694      filesize = input_end - input_start;
1695   }
1696   else
1697   {
1698      astring *size_str = params.find(OPTION_SIZE);
1699      if (size_str != NULL)
1700      {
1701         if (sscanf(*size_str, "%"I64FMT"d", &filesize) != 1)
1702            report_error(1, "Invalid size string");
1703      }
1704   }
1705   
1694
17061695   // process compression
17071696   chd_codec_type compression[4];
17081697   memcpy(compression, s_default_hd_compression, sizeof(compression));
r242944r242945
17571746      if (sscanf(metadata, HARD_DISK_METADATA_FORMAT, &cylinders, &heads, &sectors, &sector_size) != 4)
17581747         report_error(1, "Error parsing hard disk metadata in parent CHD");
17591748   }
1760     
1761   // validate the size
1762   if (filesize % sector_size != 0)
1763      report_error(1, "Data size is not divisible by sector size %d", sector_size);
17641749
17651750   // if no CHS values, try to guess them
17661751   if (cylinders == 0)
17671752   {
1768      if (input_file == NULL && filesize == 0)
1753      if (input_file == NULL && input_end - input_start == 0)
17691754         report_error(1, "Blank hard drives must specify either a length or a set of CHS values");
1770      guess_chs(input_file_str, filesize, sector_size, cylinders, heads, sectors, sector_size);
1755      guess_chs(input_file_str, input_end - input_start, sector_size, cylinders, heads, sectors, sector_size);
17711756   }
17721757   UINT32 totalsectors = cylinders * heads * sectors;
17731758
r242944r242945
17821767      if (input_start != 0 || input_end != core_fsize(input_file))
17831768      {
17841769         printf("Input start:  %s\n", big_int_string(tempstr, input_start));
1785         printf("Input length: %s\n", big_int_string(tempstr, filesize));
1770         printf("Input length: %s\n", big_int_string(tempstr, input_end - input_start));
17861771      }
17871772   }
17881773   printf("Compression:  %s\n", compression_string(tempstr, compression));
r242944r242945
29232908            (*s_commands[cmdnum].handler)(parameters);
29242909            return 0;
29252910         }
2926         catch (chd_error &err)
2927         {
2928            fprintf(stderr, "CHD error occured (main): %s\n", chd_file::error_string(err));
2929            return 1;
2930         }
29312911         catch (fatal_error &err)
29322912         {
2933            fprintf(stderr, "Fatal error occured: %d\n", err.error());
29342913            return err.error();
29352914         }
29362915         catch (std::exception& ex)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team