Previous 199869 Revisions Next

r34451 Sunday 18th January, 2015 at 02:23:22 UTC by David Haywood
new WORKING game
Come Back Toto [system11, David Haywood]
[src/emu]clifront.c clifront.h emu.mak emuopts.h ioport.c machine.c machine.h mame.c mame.h render.h rendfont.c rendfont.h rendutil.h video.c webengine.c
[src/emu/bus/vcs]dpc.c
[src/emu/cpu/tms0980]tms0980.c tms0980.h
[src/emu/machine]atahle.c idehd.c
[src/emu/netlist]netlist.mak nl_base.c nl_base.h nl_config.h nl_dice_compat.h nl_factory.c nl_factory.h nl_lists.h nl_setup.c nl_setup.h plists.h pstate.c pstate.h pstring.c
[src/emu/netlist/analog]nld_bjt.c nld_ms_direct.h nld_solver.c nld_solver.h
[src/emu/netlist/devices]net_lib.c net_lib.h nld_4020.c nld_74107.c nld_74123.c nld_74153.c nld_7448.c nld_7474.c nld_7483.c nld_7490.c nld_7493.c nld_74ls629.c nld_9316.c nld_ne555.c nld_signal.h nld_system.h nld_truthtable.h
[src/emu/sound]tiaintf.c tiasound.c tiasound.h
[src/emu/ui]devopt.c devopt.h filemngr.c filemngr.h miscmenu.c slotopt.c
[src/lib]lib.mak
[src/lib/util]chd.c corefile.h options.h
[src/mame]mame.lst
[src/mame/audio]mario.c
[src/mame/drivers]aleck64.c chihiro.c naomi.c peplus.c snowbros.c stfight.c stlforce.c strnskil.c tourtabl.c
[src/mame/includes]mario.h snowbros.h stfight.h stlforce.h strnskil.h
[src/mame/machine]stfight.c
[src/mame/video]strnskil.c tia.c tia.h
[src/mess]mess.lst mess.mak
[src/mess/drivers]a2600.c comp4.c elecdet.c ngen.c splitsec.c
[src/mess/includes]msx.h
[src/mess/layout]splitsec.lay
[src/osd]osdcore.c osdepend.h
[src/osd/modules/lib]osdobj_common.c osdobj_common.h
[src/osd/osdmini]minimain.c osdmini.h osdmini.mak
[src/osd/sdl]draw13.c osdsdl.h sdlmain.c
[src/osd/windows]winmain.c winmain.h
[src/tools]chdman.c

trunk/src/emu/bus/vcs/dpc.c
r242962r242963
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/clifront.c
r242962r242963
2424
2525#include "drivenum.h"
2626
27#include "osdepend.h"
28
2927#include <new>
3028#include <ctype.h>
3129
trunk/src/emu/clifront.h
r242962r242963
1515
1616#include "emu.h"
1717#include "cliopts.h"
18#include "osdepend.h"
1819
19// don't include osd_interface in header files
20class osd_interface;
2120
2221//**************************************************************************
2322//  TYPE DEFINITIONS
trunk/src/emu/cpu/tms0980/tms0980.c
r242962r242963
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:
r242962r242963
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
r242962r242963
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
r242962r242963
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{ }
r242962r242963
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
r242962r242963
429380   m_sr = 0;
430381   m_pa = 0;
431382   m_pb = 0;
432   m_ps = 0;
433383   m_a = 0;
434384   m_x = 0;
435385   m_y = 0;
r242962r242963
467417   save_item(NAME(m_sr));
468418   save_item(NAME(m_pa));
469419   save_item(NAME(m_pb));
470   save_item(NAME(m_ps));
471420   save_item(NAME(m_a));
472421   save_item(NAME(m_x));
473422   save_item(NAME(m_y));
r242962r242963
633582   for (int i = 0x3c; i < 0x40; i++) m_fixed_decode[i] = 0;
634583}
635584
636void tms1400_cpu_device::device_reset()
637{
638   tms1100_cpu_device::device_reset();
639585
640   // small differences in 00-3f area
641   m_fixed_decode[0x09] = F_COMX;
642   m_fixed_decode[0x0b] = F_TPC;
643}
644
645
646586void tms0970_cpu_device::device_reset()
647587{
648588   // common reset
r242962r242963
959899//  fixed opcode set
960900//-------------------------------------------------
961901
962// handle branches:
902// TMS1000/common:
963903
964// TMS1000/common
965// note: add(latch) and bl(branch latch) are specific to 0980 series,
966// c(chapter) bits are specific to 1100(and 1400) series
967
968void tms1xxx_cpu_device::op_br()
969{
970   // BR/BL: conditional branch
971   if (m_status)
972   {
973      if (m_clatch == 0)
974         m_pa = m_pb;
975      m_ca = m_cb;
976      m_pc = m_opcode & m_pc_mask;
977   }
978}
979
980void tms1xxx_cpu_device::op_call()
981{
982   // CALL/CALLL: conditional call
983   if (m_status)
984   {
985      UINT8 prev_pa = m_pa;
986
987      if (m_clatch == 0)
988      {
989         m_clatch = 1;
990         m_sr = m_pc;
991         m_pa = m_pb;
992         m_cs = m_ca;
993      }
994      m_ca = m_cb;
995      m_pb = prev_pa;
996      m_pc = m_opcode & m_pc_mask;
997   }
998}
999
1000void tms1xxx_cpu_device::op_retn()
1001{
1002   // RETN: return from subroutine
1003   if (m_clatch == 1)
1004   {
1005      m_clatch = 0;
1006      m_pc = m_sr;
1007      m_ca = m_cs;
1008   }
1009   m_add = 0;
1010   m_bl = 0;
1011   m_pa = m_pb;
1012}
1013
1014
1015// TMS1400-specific
1016
1017void tms1400_cpu_device::op_br()
1018{
1019   // BR/BL: conditional branch
1020   if (m_status)
1021   {
1022      m_pa = m_pb; // don't care about clatch
1023      m_ca = m_cb;
1024      m_pc = m_opcode & m_pc_mask;
1025   }
1026}
1027
1028void tms1400_cpu_device::op_call()
1029{
1030   // CALL/CALLL: conditional call
1031   if (m_status)
1032   {
1033      // 3-level stack, mask clatch 3 bits (no need to mask others)
1034      m_clatch = (m_clatch << 1 | 1) & 7;
1035
1036      m_sr = m_sr << m_pc_bits | m_pc;
1037      m_pc = m_opcode & m_pc_mask;
1038
1039      m_ps = m_ps << 4 | m_pa;
1040      m_pa = m_pb;
1041     
1042      m_cs = m_cs << 2 | m_ca;
1043      m_ca = m_cb;
1044   }
1045   else
1046   {
1047      m_pb = m_pa;
1048      m_cb = m_ca;
1049   }
1050}
1051
1052void tms1400_cpu_device::op_retn()
1053{
1054   // RETN: return from subroutine
1055   if (m_clatch & 1)
1056   {
1057      m_clatch >>= 1;
1058
1059      m_pc = m_sr & m_pc_mask;
1060      m_sr >>= m_pc_bits;
1061     
1062      m_pa = m_pb = m_ps & 0xf;
1063      m_ps >>= 4;
1064     
1065      m_ca = m_cb = m_cs & 3;
1066      m_cs >>= 2;
1067   }
1068}
1069
1070
1071// handle other:
1072
1073// TMS1000/common
1074
1075904void tms1xxx_cpu_device::op_sbit()
1076905{
1077906   // SBIT: set memory bit
r242962r242963
1163992}
1164993
1165994
1166// TMS1400-specific
1167
1168void tms1xxx_cpu_device::op_tpc()
1169{
1170   // TPC: transfer page buffer to chapter buffer
1171   m_cb = m_pb & 3;
1172}
1173
1174
1175995// TMS0970-specific (and possibly child classes)
1176996void tms0970_cpu_device::op_setr()
1177997{
r242962r242963
11901010
11911011
11921012// TMS0980-specific (and possibly child classes)
1193
11941013void tms0980_cpu_device::op_comx()
11951014{
11961015   // COMX: complement X register, but not the MSB
r242962r242963
12361055
12371056
12381057// TMS0270-specific
1239
12401058void tms0270_cpu_device::op_setr()
12411059{
12421060   // same as default, but handle write to output in dynamic_output
r242962r242963
12771095         // fetch: rom address 1/2
12781096
12791097         // execute: br/call 2/2
1280         if (m_fixed & F_BR)    op_br();
1281         if (m_fixed & F_CALL)  op_call();
1282         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;
12831103
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
12841144         // execute: k input valid, read ram, clear alu inputs
12851145         dynamic_output();
12861146         set_cki_bus();
r242962r242963
13561216         if (m_fixed & F_COMX8) op_comx8();
13571217         if (m_fixed & F_LDP)   op_ldp();
13581218         if (m_fixed & F_COMC)  op_comc();
1359         if (m_fixed & F_TPC)   op_tpc();
13601219         if (m_fixed & F_OFF)   op_off();
13611220         if (m_fixed & F_SEAC)  op_seac();
13621221         if (m_fixed & F_REAC)  op_reac();
trunk/src/emu/cpu/tms0980/tms0980.h
r242962r242963
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();
r242962r242963
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();
r242962r242963
139134   optional_device<pla_device> m_spla;
140135
141136   UINT8   m_pc;        // 6 or 7-bit program counter
142   UINT32  m_sr;        // 6 or 7-bit subroutine return register(s)
137   UINT8  m_sr;        // 6 or 7-bit subroutine return register
143138   UINT8   m_pa;        // 4-bit page address register
144139   UINT8   m_pb;        // 4-bit page buffer register
145   UINT16  m_ps;        // 4-bit page subroutine register(s)
146140   UINT8   m_a;         // 4-bit accumulator
147141   UINT8   m_x;         // 2,3,or 4-bit RAM X register
148142   UINT8   m_y;         // 4-bit RAM Y register
149   UINT8   m_ca;        // chapter address register
150   UINT8   m_cb;        // chapter buffer register
151   UINT16  m_cs;        // chapter subroutine register(s)
143   UINT8   m_ca;        // chapter address bit
144   UINT8   m_cb;        // chapter buffer bit
145   UINT8   m_cs;        // chapter subroutine bit
152146   UINT16  m_r;
153147   UINT16  m_o;
154148   UINT8   m_cki_bus;
r242962r242963
161155   UINT8   m_status;
162156   UINT8   m_status_latch;
163157   UINT8   m_eac;       // end around carry bit
164   UINT8   m_clatch;    // call latch bit(s)
158   UINT8   m_clatch;    // call latch bit
165159   UINT8   m_add;       // add latch bit
166160   UINT8   m_bl;        // branch latch bit
167161
r242962r242963
250244   virtual void op_rstr();
251245};
252246
253class tms1170_cpu_device : public tms1100_cpu_device
254{
255public:
256   tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
257};
258
259247class tms1300_cpu_device : public tms1100_cpu_device
260248{
261249public:
262250   tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
263251};
264252
265class tms1370_cpu_device : public tms1100_cpu_device
266{
267public:
268   tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
269};
270253
271
272class tms1400_cpu_device : public tms1100_cpu_device
273{
274public:
275   tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
276   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);
277
278protected:
279   // overrides
280   virtual void device_reset();
281   virtual machine_config_constructor device_mconfig_additions() const;
282
283   virtual void op_br();
284   virtual void op_call();
285   virtual void op_retn();
286
287   virtual void op_setr() { tms1xxx_cpu_device::op_setr(); } // no anomaly with MSB of X register
288   virtual void op_rstr() { tms1xxx_cpu_device::op_rstr(); } // "
289};
290
291class tms1470_cpu_device : public tms1400_cpu_device
292{
293public:
294   tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
295};
296
297
298254class tms0970_cpu_device : public tms1000_cpu_device
299255{
300256public:
r242962r242963
388344extern const device_type TMS1070;
389345extern const device_type TMS1200;
390346extern const device_type TMS1100;
391extern const device_type TMS1170;
392347extern const device_type TMS1300;
393extern const device_type TMS1370;
394extern const device_type TMS1400;
395extern const device_type TMS1470;
396348extern const device_type TMS0970;
397349extern const device_type TMS0980;
398350extern const device_type TMS0270;
trunk/src/emu/emu.mak
r242962r242963
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 \
r242962r242963
148147   $(EMUOBJ)/debug/textbuf.o \
149148   $(EMUOBJ)/profiler.o \
150149   $(EMUOBJ)/webengine.o \
150   $(OSDOBJ)/osdcore.o \
151151   $(OSDOBJ)/osdnet.o \
152152   $(OSDOBJ)/modules/sound/none.o \
153153   $(OSDOBJ)/modules/debugger/none.o \
trunk/src/emu/emuopts.h
r242962r242963
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/ioport.c
r242962r242963
9999#include "uiinput.h"
100100#include "debug/debugcon.h"
101101
102#include "osdepend.h"
103
104102#include <ctype.h>
105103#include <time.h>
106104
trunk/src/emu/machine.c
r242962r242963
106106//  RUNNING MACHINE
107107//**************************************************************************
108108
109osd_interface &running_machine::osd() const
110{
111    return m_manager.osd();
112}
113
114109//-------------------------------------------------
115110//  running_machine - constructor
116111//-------------------------------------------------
trunk/src/emu/machine.h
r242962r242963
1919
2020#include <time.h>
2121
22// forward declaration instead of osdepend.h
23class osd_interface;
2422
23
2524//**************************************************************************
2625//  CONSTANTS
2726//**************************************************************************
r242962r242963
158157   const machine_config &config() const { return m_config; }
159158   device_t &root_device() const { return m_config.root_device(); }
160159   const game_driver &system() const { return m_system; }
161   osd_interface &osd() const;
160   osd_interface &osd() const { return m_manager.osd(); }
162161   machine_manager &manager() const { return m_manager; }
163162   resource_pool &respool() { return m_respool; }
164163   device_scheduler &scheduler() { return m_scheduler; }
trunk/src/emu/machine/atahle.c
r242962r242963
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
r242962r242963
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/mame.c
r242962r242963
9292
9393machine_manager* machine_manager::m_manager = NULL;
9494
95osd_interface &machine_manager::osd() const
96{
97    return m_osd;
98}
99
100
10195machine_manager* machine_manager::instance(emu_options &options,osd_interface &osd)
10296{
10397   if(!m_manager)
trunk/src/emu/mame.h
r242962r242963
2222
2323#include "webengine.h"
2424
25class osd_interface;
2625
2726//**************************************************************************
2827//    CONSTANTS
r242962r242963
8988   static machine_manager *instance();
9089   ~machine_manager();
9190
92   osd_interface &osd() const;
91   osd_interface &osd() const { return m_osd; }
9392   emu_options &options() const { return m_options; }
9493   web_engine *web() { return &m_web; }
9594   lua_engine *lua() { return &m_lua; }
trunk/src/emu/netlist/analog/nld_bjt.c
r242962r242963
7575   connect(m_RB.m_P, m_BC_dummy.m_P);
7676   connect(m_RC.m_P, m_BC_dummy.m_N);
7777
78   save(NLNAME(m_state_on));
78   save(NAME(m_state_on));
7979
8080   m_RB.set(netlist().gmin(), 0.0, 0.0);
8181   m_RC.set(netlist().gmin(), 0.0, 0.0);
trunk/src/emu/netlist/analog/nld_ms_direct.h
r242962r242963
6969   {
7070      //delete[] m_A[k];
7171   }
72    for (int k = 0; k < N(); k++)
73    {
74        nl_free(m_terms[k]);
75        nl_free(m_row_ops[k]);
76    }
77    nl_free(m_row_ops[N()]);
78    //delete[] m_last_RHS;
72   //delete[] m_last_RHS;
7973   //delete[] m_RHS;
80   nl_free_array(m_terms);
81   nl_free_array(m_rails_temp);
74   delete[] m_terms;
75   delete[] m_rails_temp;
8276   //delete[] m_row_ops;
8377
8478}
r242962r242963
458452, m_dim(size)
459453, m_lp_fact(0)
460454{
461   m_terms = nl_alloc_array(terms_t *, N());
462   m_rails_temp = nl_alloc_array(terms_t, N());
455   m_terms = new terms_t *[N()];
456   m_rails_temp = new terms_t[N()];
463457
464458   for (int k = 0; k < N(); k++)
465459   {
466      m_terms[k] = nl_alloc(terms_t);
460      m_terms[k] = new terms_t;
467461      m_row_ops[k] = vector_ops_t::create_ops(k);
468462   }
469463   m_row_ops[N()] = vector_ops_t::create_ops(N());
r242962r242963
475469, m_dim(size)
476470, m_lp_fact(0)
477471{
478    m_terms = nl_alloc_array(terms_t *, N());
479    m_rails_temp = nl_alloc_array(terms_t, N());
472    m_terms = new terms_t *[N()];
473    m_rails_temp = new terms_t[N()];
480474
481475    for (int k = 0; k < N(); k++)
482476    {
483        m_terms[k] = nl_alloc(terms_t);
477        m_terms[k] = new terms_t;
484478        m_row_ops[k] = vector_ops_t::create_ops(k);
485479    }
486480    m_row_ops[N()] = vector_ops_t::create_ops(N());
trunk/src/emu/netlist/analog/nld_solver.c
r242962r242963
4444   switch (size)
4545   {
4646      case 1:
47         return nl_alloc(vector_ops_impl_t<1>);
47         return new vector_ops_impl_t<1>();
4848      case 2:
49         return nl_alloc(vector_ops_impl_t<2>);
49         return new vector_ops_impl_t<2>();
5050      case 3:
51         return nl_alloc(vector_ops_impl_t<3>);
51         return new vector_ops_impl_t<3>();
5252      case 4:
53         return nl_alloc(vector_ops_impl_t<4>);
53         return new vector_ops_impl_t<4>();
5454      case 5:
55         return nl_alloc(vector_ops_impl_t<5>);
55         return new vector_ops_impl_t<5>();
5656      case 6:
57         return nl_alloc(vector_ops_impl_t<6>);
57         return new vector_ops_impl_t<6>();
5858      case 7:
59         return nl_alloc(vector_ops_impl_t<7>);
59         return new vector_ops_impl_t<7>();
6060      case 8:
61         return nl_alloc(vector_ops_impl_t<8>);
61         return new vector_ops_impl_t<8>();
6262      case 9:
63         return nl_alloc(vector_ops_impl_t<9>);
63         return new vector_ops_impl_t<9>();
6464      case 10:
65         return nl_alloc(vector_ops_impl_t<10>);
65         return new vector_ops_impl_t<10>();
6666      case 11:
67         return nl_alloc(vector_ops_impl_t<11>);
67         return new vector_ops_impl_t<11>();
6868      case 12:
69         return nl_alloc(vector_ops_impl_t<12>);
69         return new vector_ops_impl_t<12>();
7070      default:
71         return nl_alloc(vector_ops_impl_t<0>, size);
71         return new vector_ops_impl_t<0>(size);
7272   }
7373}
7474
r242962r242963
9191      m_term[i]->m_Idr1 = &m_Idr[i];
9292      m_other_curanalog[i] = &m_term[i]->m_otherterm->net().as_analog().m_cur_Analog;
9393   }
94
95   m_ops = vector_ops_t::create_ops(m_gt.count());
9496}
9597
9698// ----------------------------------------------------------------------------------------
r242962r242963
110112ATTR_COLD netlist_matrix_solver_t::~netlist_matrix_solver_t()
111113{
112114   for (int i = 0; i < m_inps.count(); i++)
113      global_free(m_inps[i]);
115      delete m_inps[i];
114116}
115117
116118ATTR_COLD void netlist_matrix_solver_t::setup(netlist_analog_net_t::list_t &nets)
r242962r242963
174176
175177                  if (net_proxy_output == NULL)
176178                  {
177                     net_proxy_output = nl_alloc(netlist_analog_output_t);
179                     net_proxy_output = new netlist_analog_output_t();
178180                     net_proxy_output->init_object(*this, this->name() + "." + pstring::sprintf("m%d", m_inps.count()));
179181                     m_inps.add(net_proxy_output);
180182                     net_proxy_output->m_proxied_net = &p->net().as_analog();
r242962r242963
378380   while (e != NULL)
379381   {
380382      netlist_matrix_solver_t * const *en = m_mat_solvers.next(e);
381      global_free(*e);
383      delete *e;
382384      e = en;
383385   }
384386
r242962r242963
433435netlist_matrix_solver_t * NETLIB_NAME(solver)::create_solver(int size, const int gs_threshold, const bool use_specific)
434436{
435437   if (use_specific && m_N == 1)
436      return nl_alloc(netlist_matrix_solver_direct1_t, m_params);
438      return new netlist_matrix_solver_direct1_t(m_params);
437439   else if (use_specific && m_N == 2)
438      return nl_alloc(netlist_matrix_solver_direct2_t, m_params);
440      return new netlist_matrix_solver_direct2_t(m_params);
439441   else
440442   {
441       typedef netlist_matrix_solver_gauss_seidel_t<m_N,_storage_N> solver_N;
442443      if (size >= gs_threshold)
443         return nl_alloc(solver_N, m_params, size);
444         return new netlist_matrix_solver_gauss_seidel_t<m_N,_storage_N>(m_params, size);
444445      else
445         return nl_alloc(solver_N, m_params, size);
446         return new netlist_matrix_solver_direct_t<m_N, _storage_N>(m_params, size);
446447   }
447448}
448449
trunk/src/emu/netlist/analog/nld_solver.h
r242962r242963
8888   vector_ops_impl_t(int size)
8989   : vector_ops_t(size)
9090   {
91      nl_assert(m_N == 0);
91      assert(m_N == 0);
9292   }
9393
9494   virtual ~vector_ops_impl_t() {}
r242962r242963
155155   NETLIST_PREVENT_COPYING(terms_t)
156156
157157   public:
158   ATTR_COLD terms_t() : m_railstart(0)
158   ATTR_COLD terms_t() : m_railstart(0), m_ops(NULL)
159159   {}
160160
161161   ATTR_COLD void clear()
r242962r242963
175175   ATTR_HOT inline double *go() { return m_go; }
176176   ATTR_HOT inline double *Idr() { return m_Idr; }
177177   ATTR_HOT inline double **other_curanalog() { return m_other_curanalog; }
178   ATTR_HOT vector_ops_t *ops() { return m_ops; }
178179
179180   ATTR_COLD void set_pointers();
180181
r242962r242963
187188   plinearlist_t<double> m_gt;
188189   plinearlist_t<double> m_Idr;
189190   plinearlist_t<double *> m_other_curanalog;
191   vector_ops_t * m_ops;
190192};
191193
192194class netlist_matrix_solver_t : public netlist_device_t
trunk/src/emu/netlist/devices/net_lib.c
r242962r242963
4949
5050#include "net_lib.h"
5151#include "nld_system.h"
52#include "../nl_factory.h"
5352
5453NETLIST_START(diode_models)
5554   NET_MODEL(".model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
r242962r242963
6564
6665
6766#define xstr(s) # s
68#define ENTRY1(_nic, _name, _defparam) factory.register_device<_nic>( # _name, xstr(_nic), _defparam );
67#define ENTRY1(_nic, _name, _defparam) register_device<_nic>( # _name, xstr(_nic), _defparam );
6968#define ENTRY(_nic, _name, _defparam) ENTRY1(NETLIB_NAME(_nic), _name, _defparam)
7069
71void nl_initialize_factory(netlist_factory_t &factory)
70netlist_factory_t::netlist_factory_t()
7271{
72}
73
74netlist_factory_t::~netlist_factory_t()
75{
76   for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e))
77   {
78      net_device_t_base_factory *p = *e;
79      delete p;
80   }
81   m_list.clear();
82}
83
84void netlist_factory_t::initialize()
85{
7386   ENTRY(R,                    RES,                    "R")
7487   ENTRY(POT,                  POT,                    "R")
7588   ENTRY(C,                    CAP,                    "C")
r242962r242963
149162   ENTRY(NE555_dip,            NE555_DIP,              "-")
150163}
151164
165netlist_device_t *netlist_factory_t::new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const
166{
167   for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e))
168   {
169      net_device_t_base_factory *p = *e;
170      if (strcmp(p->classname(), classname) == 0)
171      {
172         netlist_device_t *ret = p->Create();
173         return ret;
174      }
175      p++;
176   }
177   setup.netlist().error("Class %s not found!\n", classname.cstr());
178   return NULL; // appease code analysis
179}
180
181netlist_device_t *netlist_factory_t::new_device_by_name(const pstring &name, netlist_setup_t &setup) const
182{
183   net_device_t_base_factory *f = factory_by_name(name, setup);
184   return f->Create();
185}
186
187net_device_t_base_factory * netlist_factory_t::factory_by_name(const pstring &name, netlist_setup_t &setup) const
188{
189   for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e))
190   {
191      net_device_t_base_factory *p = *e;
192      if (strcmp(p->name(), name) == 0)
193      {
194         return p;
195      }
196      p++;
197   }
198   setup.netlist().error("Class %s not found!\n", name.cstr());
199   return NULL; // appease code analysis
200}
trunk/src/emu/netlist/devices/net_lib.h
r242962r242963
9999NETLIST_EXTERNAL(diode_models);
100100NETLIST_EXTERNAL(bjt_models);
101101
102void nl_initialize_factory(netlist_factory_t &factory);
103
104102#endif
trunk/src/emu/netlist/devices/nld_4020.c
r242962r242963
5151   register_output("Q13", m_Q[12]);
5252   register_output("Q14", m_Q[13]);
5353
54   save(NLNAME(m_cnt));
54   save(NAME(m_cnt));
5555}
5656
5757NETLIB_RESET(4020_sub)
trunk/src/emu/netlist/devices/nld_74107.c
r242962r242963
1111   register_output("Q", m_Q);
1212   register_output("QQ", m_QQ);
1313
14   save(NLNAME(m_Q1));
15   save(NLNAME(m_Q2));
16   save(NLNAME(m_F));
14   save(NAME(m_Q1));
15   save(NAME(m_Q2));
16   save(NAME(m_F));
1717}
1818
1919NETLIB_RESET(74107Asub)
trunk/src/emu/netlist/devices/nld_74123.c
r242962r242963
3232   connect(m_RN.m_P, m_RP.m_N);
3333   connect(m_CV, m_RN.m_P);
3434
35   save(NLNAME(m_last_trig));
36   save(NLNAME(m_state));
37   save(NLNAME(m_KP));
35   save(NAME(m_last_trig));
36   save(NAME(m_state));
37   save(NAME(m_KP));
3838
3939   m_KP = 1.0 / (1.0 + exp(m_K.Value()));
4040}
trunk/src/emu/netlist/devices/nld_74153.c
r242962r242963
2222
2323   m_chan = 0;
2424
25   save(NLNAME(m_chan));
25   save(NAME(m_chan));
2626}
2727
2828NETLIB_RESET(74153sub)
trunk/src/emu/netlist/devices/nld_7448.c
r242962r242963
7878   register_output("f", m_f);
7979   register_output("g", m_g);
8080
81   save(NLNAME(m_state));
81   save(NAME(m_state));
8282}
8383
8484NETLIB_RESET(7448_sub)
r242962r242963
9898
9999NETLIB_FUNC_VOID(7448_sub, update_outputs, (UINT8 v))
100100{
101   nl_assert(v<16);
101   assert(v<16);
102102   if (v != m_state)
103103   {
104104      // max transfer time is 100 NS */
trunk/src/emu/netlist/devices/nld_7474.c
r242962r242963
7676   register_output("Q",   m_Q);
7777   register_output("QQ",  m_QQ);
7878
79   save(NLNAME(m_nextD));
79   save(NAME(m_nextD));
8080}
8181
8282NETLIB_RESET(7474sub)
trunk/src/emu/netlist/devices/nld_7483.c
r242962r242963
2323   register_output("S4", m_S4);
2424   register_output("C4", m_C4);
2525
26   save(NLNAME(m_lastr));
26   save(NAME(m_lastr));
2727}
2828
2929NETLIB_RESET(7483)
trunk/src/emu/netlist/devices/nld_7490.c
r242962r242963
1919   register_output("QC", m_Q[2]);
2020   register_output("QD", m_Q[3]);
2121
22   save(NLNAME(m_cnt));
23   save(NLNAME(m_last_A));
24   save(NLNAME(m_last_B));
22   save(NAME(m_cnt));
23   save(NAME(m_last_A));
24   save(NAME(m_last_B));
2525
2626}
2727
trunk/src/emu/netlist/devices/nld_7493.c
r242962r242963
4040   register_input("CLK", m_I);
4141   register_output("Q", m_Q);
4242
43   save(NLNAME(m_reset));
43   save(NAME(m_reset));
4444}
4545
4646NETLIB_RESET(7493ff)
trunk/src/emu/netlist/devices/nld_74ls629.c
r242962r242963
4949
5050   reset();
5151
52   save(NLNAME(m_enableq));
53   save(NLNAME(m_inc));
54   save(NLNAME(m_out));
52   save(NAME(m_enableq));
53   save(NAME(m_inc));
54   save(NAME(m_out));
5555}
5656
5757NETLIB_RESET(SN74LS629clk)
trunk/src/emu/netlist/devices/nld_9316.c
r242962r242963
7373   register_output("QD", m_QD);
7474   register_output("RC", m_RC);
7575
76   save(NLNAME(m_cnt.ref()));
77   save(NLNAME(m_loadq.ref()));
78   save(NLNAME(m_ent.ref()));
76   save(NAME(m_cnt.ref()));
77   save(NAME(m_loadq.ref()));
78   save(NAME(m_ent.ref()));
7979}
8080
8181NETLIB_RESET(9316_sub)
trunk/src/emu/netlist/devices/nld_ne555.c
r242962r242963
4242   connect(m_R2.m_N, m_R3.m_P);
4343   connect(m_RDIS.m_N, m_R3.m_N);
4444
45   save(NLNAME(m_last_out));
45   save(NAME(m_last_out));
4646}
4747
4848NETLIB_RESET(NE555)
trunk/src/emu/netlist/devices/nld_signal.h
r242962r242963
4444      {
4545         register_input(sIN[i], m_i[i]);
4646      }
47      save(NLNAME(m_active));
47      save(NAME(m_active));
4848   }
4949
5050   ATTR_COLD void reset()
r242962r242963
118118      register_input("A", m_i[0]);
119119      register_input("B", m_i[1]);
120120
121      save(NLNAME(m_active));
121      save(NAME(m_active));
122122   }
123123
124124   ATTR_COLD void reset()
trunk/src/emu/netlist/devices/nld_system.h
r242962r242963
198198   ATTR_COLD nld_a_to_d_proxy(netlist_input_t &in_proxied)
199199         : netlist_device_t()
200200   {
201      nl_assert(in_proxied.family() == LOGIC);
201      assert(in_proxied.family() == LOGIC);
202202      m_I.m_logic_family = in_proxied.m_logic_family;
203203   }
204204
r242962r242963
240240   ATTR_COLD nld_base_d_to_a_proxy(netlist_output_t &out_proxied)
241241         : netlist_device_t()
242242   {
243      nl_assert(out_proxied.family() == LOGIC);
243      assert(out_proxied.family() == LOGIC);
244244      m_logic_family = out_proxied.m_logic_family;
245245   }
246246
trunk/src/emu/netlist/devices/nld_truthtable.h
r242962r242963
5050      {
5151         nl_util::pstring_list io = nl_util::split(ttline,"|");
5252         // checks
53         nl_assert(io.count() == 2);
53         assert(io.count() == 2);
5454         nl_util::pstring_list inout = nl_util::split(io[0], ",");
55         nl_assert(inout.count() == m_num_bits);
55         assert(inout.count() == m_num_bits);
5656         nl_util::pstring_list out = nl_util::split(io[1], ",");
57         nl_assert(out.count() == m_NO);
57         assert(out.count() == m_NO);
5858
5959         for (int i=0; i < m_NI; i++)
6060         {
r242962r242963
133133      {
134134         nl_util::pstring_list io = nl_util::split(ttline,"|");
135135         // checks
136         nl_assert(io.count() == 3);
136         assert(io.count() == 3);
137137         nl_util::pstring_list inout = nl_util::split(io[0], ",");
138         nl_assert(inout.count() == m_num_bits);
138         assert(inout.count() == m_num_bits);
139139         nl_util::pstring_list out = nl_util::split(io[1], ",");
140         nl_assert(out.count() == m_NO);
140         assert(out.count() == m_NO);
141141         nl_util::pstring_list times = nl_util::split(io[2], ",");
142         nl_assert(times.count() == m_NO);
142         assert(times.count() == m_NO);
143143
144144         UINT16 val = 0;
145145         UINT8 tindex[m_NO];
trunk/src/emu/netlist/netlist.mak
r242962r242963
2626   $(NETLISTOBJ)/nl_base.o \
2727   $(NETLISTOBJ)/nl_parser.o \
2828   $(NETLISTOBJ)/nl_setup.o \
29   $(NETLISTOBJ)/nl_factory.o \
3029   $(NETLISTOBJ)/pstring.o \
3130   $(NETLISTOBJ)/pstate.o \
3231   $(NETLISTOBJ)/analog/nld_bjt.o \
trunk/src/emu/netlist/nl_base.c
r242962r242963
99#include "pstring.h"
1010#include "nl_util.h"
1111
12#include <stdlib.h> // FIXME: only included for atof
13
1412const netlist_time netlist_time::zero = netlist_time::from_raw(0);
1513
1614netlist_logic_family_desc_t netlist_family_TTL =
r242962r242963
152150   {
153151      if (!m_nets[i]->isRailNet())
154152      {
155         global_free(m_nets[i]);
153         delete m_nets[i];
156154      }
157155   }
158156
r242962r242963
166164ATTR_COLD void netlist_base_t::save_register()
167165{
168166   save(static_cast<pstate_callback_t &>(m_queue), "m_queue");
169   save(NLNAME(m_time));
167   save(NAME(m_time));
170168   netlist_object_t::save_register();
171169}
172170
r242962r242963
531529
532530ATTR_COLD void netlist_net_t::register_railterminal(netlist_output_t &mr)
533531{
534   nl_assert(m_railterminal == NULL);
532   assert(m_railterminal == NULL);
535533   m_railterminal = &mr;
536534}
537535
r242962r242963
547545
548546ATTR_COLD void netlist_net_t::save_register()
549547{
550   save(NLNAME(m_time));
551   save(NLNAME(m_active));
552   save(NLNAME(m_in_queue));
553   save(NLNAME(m_cur_Analog));
554   save(NLNAME(m_cur_Q));
555   save(NLNAME(m_new_Q));
548   save(NAME(m_time));
549   save(NAME(m_active));
550   save(NAME(m_in_queue));
551   save(NAME(m_cur_Analog));
552   save(NAME(m_cur_Q));
553   save(NAME(m_new_Q));
556554   netlist_object_t::save_register();
557555}
558556
r242962r242963
571569ATTR_HOT ATTR_ALIGN inline void netlist_net_t::update_devs()
572570{
573571   //assert(m_num_cons != 0);
574   nl_assert(this->isRailNet());
572   assert(this->isRailNet());
575573
576574   const UINT32 masks[4] = { 1, 5, 3, 1 };
577575   const UINT32 mask = masks[ (m_cur_Q  << 1) | m_new_Q ];
r242962r242963
709707
710708ATTR_COLD void netlist_analog_net_t::save_register()
711709{
712   save(NLNAME(m_DD_n_m_1));
713   save(NLNAME(m_h_n_m_1));
710   save(NAME(m_DD_n_m_1));
711   save(NAME(m_h_n_m_1));
714712   netlist_net_t::save_register();
715713}
716714
r242962r242963
805803
806804ATTR_COLD void netlist_terminal_t::save_register()
807805{
808   save(NLNAME(m_Idr1));
809   save(NLNAME(m_go1));
810   save(NLNAME(m_gt1));
806   save(NAME(m_Idr1));
807   save(NAME(m_go1));
808   save(NAME(m_gt1));
811809   netlist_core_terminal_t::save_register();
812810}
813811
trunk/src/emu/netlist/nl_base.h
r242962r242963
444444   ATTR_HOT inline const state_e state() const { return m_state; }
445445   ATTR_HOT inline void set_state(const state_e astate)
446446   {
447      nl_assert(astate != STATE_NONEX);
447      assert(astate != STATE_NONEX);
448448      m_state = astate;
449449   }
450450
r242962r242963
453453protected:
454454   ATTR_COLD virtual void save_register()
455455   {
456      save(NLNAME(m_state));
456      save(NAME(m_state));
457457      netlist_owned_object_t::save_register();
458458   }
459459
r242962r242963
710710    */
711711   ATTR_COLD inline netlist_sig_t &Q_state_ptr()
712712   {
713      nl_assert(family() == LOGIC);
713      assert(family() == LOGIC);
714714      return m_cur_Q;
715715   }
716716
r242962r242963
738738
739739   ATTR_HOT inline const double Q_Analog() const
740740   {
741      //nl_assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
742      nl_assert(family() == ANALOG);
741      //assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
742      assert(family() == ANALOG);
743743      return m_cur_Analog;
744744   }
745745
746746   ATTR_COLD inline double &Q_Analog_state_ptr()
747747   {
748      //nl_assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
749      nl_assert(family() == ANALOG);
748      //assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
749      assert(family() == ANALOG);
750750      return m_cur_Analog;
751751   }
752752
r242962r242963
883883protected:
884884   ATTR_COLD virtual void save_register()
885885   {
886      save(NLNAME(m_param));
886      save(NAME(m_param));
887887      netlist_param_t::save_register();
888888   }
889889
r242962r242963
905905protected:
906906   ATTR_COLD virtual void save_register()
907907   {
908      save(NLNAME(m_param));
908      save(NAME(m_param));
909909      netlist_param_t::save_register();
910910   }
911911
r242962r242963
988988
989989   ATTR_HOT inline const netlist_sig_t INPLOGIC(const netlist_logic_input_t &inp) const
990990   {
991      nl_assert(inp.state() != netlist_input_t::STATE_INP_PASSIVE);
991      assert(inp.state() != netlist_input_t::STATE_INP_PASSIVE);
992992      return inp.Q();
993993   }
994994
r242962r242963
12621262
12631263ATTR_HOT inline netlist_logic_net_t & RESTRICT netlist_net_t::as_logic()
12641264{
1265   nl_assert(family() == LOGIC);
1265   assert(family() == LOGIC);
12661266   return static_cast<netlist_logic_net_t &>(*this);
12671267}
12681268
12691269ATTR_HOT inline const netlist_logic_net_t & RESTRICT netlist_net_t::as_logic() const
12701270{
1271    nl_assert(family() == LOGIC);
1271   assert(family() == LOGIC);
12721272   return static_cast<const netlist_logic_net_t &>(*this);
12731273}
12741274
12751275ATTR_HOT inline netlist_analog_net_t & RESTRICT netlist_net_t::as_analog()
12761276{
1277    nl_assert(family() == ANALOG);
1277   assert(family() == ANALOG);
12781278   return static_cast<netlist_analog_net_t &>(*this);
12791279}
12801280
12811281ATTR_HOT inline const netlist_analog_net_t & RESTRICT netlist_net_t::as_analog() const
12821282{
1283   nl_assert(family() == ANALOG);
1283   assert(family() == ANALOG);
12841284   return static_cast<const netlist_analog_net_t &>(*this);
12851285}
12861286
r242962r242963
13701370   }
13711371}
13721372
1373
1374// -----------------------------------------------------------------------------
1375// net_dev class factory
1376// -----------------------------------------------------------------------------
1377
1378class net_device_t_base_factory
1379{
1380   NETLIST_PREVENT_COPYING(net_device_t_base_factory)
1381public:
1382   ATTR_COLD net_device_t_base_factory(const pstring &name, const pstring &classname,
1383         const pstring &def_param)
1384   : m_name(name), m_classname(classname), m_def_param(def_param)
1385   {}
1386
1387   ATTR_COLD virtual ~net_device_t_base_factory() {}
1388
1389   ATTR_COLD virtual netlist_device_t *Create() const = 0;
1390
1391   ATTR_COLD const pstring &name() const { return m_name; }
1392   ATTR_COLD const pstring &classname() const { return m_classname; }
1393   ATTR_COLD const pstring &param_desc() const { return m_def_param; }
1394   ATTR_COLD const nl_util::pstring_list term_param_list();
1395   ATTR_COLD const nl_util::pstring_list def_params();
1396
1397protected:
1398   pstring m_name;                             /* device name */
1399   pstring m_classname;                        /* device class name */
1400   pstring m_def_param;                        /* default parameter */
1401};
1402
1403template <class C>
1404class net_device_t_factory : public net_device_t_base_factory
1405{
1406   NETLIST_PREVENT_COPYING(net_device_t_factory)
1407public:
1408   ATTR_COLD net_device_t_factory(const pstring &name, const pstring &classname,
1409         const pstring &def_param)
1410   : net_device_t_base_factory(name, classname, def_param) { }
1411
1412   ATTR_COLD netlist_device_t *Create() const
1413   {
1414      netlist_device_t *r = new C();
1415      //r->init(setup, name);
1416      return r;
1417   }
1418};
1419
1420class netlist_factory_t
1421{
1422public:
1423   typedef plinearlist_t<net_device_t_base_factory *> list_t;
1424
1425   ATTR_COLD netlist_factory_t();
1426   ATTR_COLD ~netlist_factory_t();
1427
1428   ATTR_COLD void initialize();
1429
1430   template<class _C>
1431   ATTR_COLD void register_device(const pstring &name, const pstring &classname,
1432         const pstring &def_param)
1433   {
1434      m_list.add(new net_device_t_factory< _C >(name, classname, def_param) );
1435   }
1436
1437   ATTR_COLD netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
1438   ATTR_COLD netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const;
1439   ATTR_COLD net_device_t_base_factory * factory_by_name(const pstring &name, netlist_setup_t &setup) const;
1440
1441   const list_t &list() { return m_list; }
1442
1443private:
1444   list_t m_list;
1445
1446};
1447
1448
13731449#endif /* NLBASE_H_ */
trunk/src/emu/netlist/nl_config.h
r242962r242963
1010
1111/* FIXME: at some time, make it compile on it's own */
1212
13#include "osdcore.h"
14#include "corealloc.h"
15#include <math.h>
16#include <exception>
17#include <typeinfo>
13#include "emu.h"
1814
1915//============================================================
2016//  SETUP
r242962r242963
106102#define end_timing(v)           do { } while (0)
107103#endif
108104
109// this macro passes an item followed by a string version of itself as two consecutive parameters
110#define NLNAME(x) x, #x
111105
112106//============================================================
113//  Exceptions
114//============================================================
115
116// emu_fatalerror is a generic fatal exception that provides an error string
117class nl_fatalerror : public std::exception
118{
119public:
120    nl_fatalerror(const char *format, ...) ATTR_PRINTF(2,3)
121    {
122        char text[1024];
123        va_list ap;
124        va_start(ap, format);
125        vsprintf(text, format, ap);
126        va_end(ap);
127        osd_printf_error("%s\n", text);
128    }
129    nl_fatalerror(const char *format, va_list ap)
130    {
131        char text[1024];
132        vsprintf(text, format, ap);
133        osd_printf_error("%s\n", text);
134    }
135};
136
137//============================================================
138//  Memory allocation
139//============================================================
140
141#define nl_alloc(T, ...)        global_alloc(T(__VA_ARGS__))
142#define nl_alloc_array(T, N)    global_alloc_array(T, N)
143
144#define nl_free(_ptr)           global_free(_ptr)
145#define nl_free_array(_ptr)     global_free_array(_ptr)
146
147
148//============================================================
149//  Asserts
150//============================================================
151
152#ifdef MAME_DEBUG
153#define nl_assert(x)               do { if (!(x)) throw nl_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
154#define nl_assert_always(x, msg)   do { if (!(x)) throw nl_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
155#else
156#define nl_assert(x)               do { } while (0)
157//#define assert_always(x, msg)   do { if (!(x)) throw emu_fatalerror("Fatal error: %s (%s:%d)", msg, __FILE__, __LINE__); } while (0)
158#define nl_assert_always(x, msg)   do { } while (0)
159#endif
160
161//============================================================
162107//  Compiling standalone
163108//============================================================
164109
165110// Compiling without mame ?
166111
167112#ifndef ATTR_HOT
168#warning ATTR_HOT not defined
113//#warning ATTR_HOT not defined
169114
170115// standard C includes
171116#include <math.h>
r242962r242963
187132#define UNEXPECTED
188133#define ATTR_UNUSED             __attribute__((__unused__))
189134
135// this macro passes an item followed by a string version of itself as two consecutive parameters
136#define NAME(x) x, #x
137
190138/* 8-bit values */
191139typedef unsigned char                       UINT8;
192140typedef signed char                         INT8;
r242962r242963
212160#endif
213161#endif
214162
163#ifdef MAME_DEBUG
164#define assert(x)               do { if (!(x)) throw emu_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
165#define assert_always(x, msg)   do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
166#else
167#define assert(x)               do { } while (0)
168//#define assert_always(x, msg)   do { if (!(x)) throw emu_fatalerror("Fatal error: %s (%s:%d)", msg, __FILE__, __LINE__); } while (0)
169#define assert_always(x, msg)   do { } while (0)
170#endif
171
215172/* U64 and S64 are used to wrap long integer constants. */
216173#if defined(__GNUC__) || defined(_MSC_VER)
217174#define U64(val) val##ULL
trunk/src/emu/netlist/nl_dice_compat.h
r242962r242963
1313 * -------------------------------------------------------------------- */
1414
1515//#define CHIP(_n, _t) netlist.register_dev(NET_NEW(_t ## _dip), _n);
16#define CHIP(_n, _t) setup.register_dev( nL_alloc(nld_ ## _t ## _dip()), _n);
16#define CHIP(_n, _t) setup.register_dev( new nld_ ## _t ## _dip(), _n);
1717
1818#define CONNECTION( ... ) CONNECTIONY( CONNECTIONX( __VA_ARGS__ ) )
1919#define CONNECTIONY(_a) _a
trunk/src/emu/netlist/nl_factory.c
r242962r242963
1// license:GPL-2.0+
2// copyright-holders:Couriersud
3/***************************************************************************
4
5    nl_factory.c
6
7    Discrete netlist implementation.
8
9****************************************************************************
10
11    Couriersud reserves the right to license the code under a less restrictive
12    license going forward.
13
14    Copyright Nicola Salmoria and the MAME team
15    All rights reserved.
16
17    Redistribution and use of this code or any derivative works are permitted
18    provided that the following conditions are met:
19
20    * Redistributions may not be sold, nor may they be used in a commercial
21    product or activity.
22
23    * Redistributions that are modified from the original source must include the
24    complete source code, including the source code for all components used by a
25    binary built from the modified sources. However, as a special exception, the
26    source code distributed need not include anything that is normally distributed
27    (in either source or binary form) with the major components (compiler, kernel,
28    and so on) of the operating system on which the executable runs, unless that
29    component itself accompanies the executable.
30
31    * Redistributions must reproduce the above copyright notice, this list of
32    conditions and the following disclaimer in the documentation and/or other
33    materials provided with the distribution.
34
35    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
36    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
38    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
39    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
40    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
41    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
42    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
43    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
44    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
45    POSSIBILITY OF SUCH DAMAGE.
46
47
48****************************************************************************/
49
50#include "nl_factory.h"
51#include "nl_setup.h"
52
53netlist_factory_t::netlist_factory_t()
54{
55}
56
57netlist_factory_t::~netlist_factory_t()
58{
59   for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e))
60   {
61      net_device_t_base_factory *p = *e;
62      global_free(p);
63   }
64   m_list.clear();
65}
66
67netlist_device_t *netlist_factory_t::new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const
68{
69   for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e))
70   {
71      net_device_t_base_factory *p = *e;
72      if (strcmp(p->classname(), classname) == 0)
73      {
74         netlist_device_t *ret = p->Create();
75         return ret;
76      }
77      p++;
78   }
79   setup.netlist().error("Class %s not found!\n", classname.cstr());
80   return NULL; // appease code analysis
81}
82
83netlist_device_t *netlist_factory_t::new_device_by_name(const pstring &name, netlist_setup_t &setup) const
84{
85   net_device_t_base_factory *f = factory_by_name(name, setup);
86   return f->Create();
87}
88
89net_device_t_base_factory * netlist_factory_t::factory_by_name(const pstring &name, netlist_setup_t &setup) const
90{
91   for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e))
92   {
93      net_device_t_base_factory *p = *e;
94      if (strcmp(p->name(), name) == 0)
95      {
96         return p;
97      }
98      p++;
99   }
100   setup.netlist().error("Class %s not found!\n", name.cstr());
101   return NULL; // appease code analysis
102}
trunk/src/emu/netlist/nl_factory.h
r242962r242963
1// license:GPL-2.0+
2// copyright-holders:Couriersud
3/*
4 * nl_factory.h
5 *
6 *
7 */
8
9#ifndef NLFACTORY_H_
10#define NLFACTORY_H_
11
12#include "nl_config.h"
13#include "plists.h"
14#include "nl_base.h"
15#if 0
16#include "nl_time.h"
17#include "nl_util.h"
18#include "pstate.h"
19#endif
20#include "pstring.h"
21
22// -----------------------------------------------------------------------------
23// net_dev class factory
24// -----------------------------------------------------------------------------
25
26class net_device_t_base_factory
27{
28   NETLIST_PREVENT_COPYING(net_device_t_base_factory)
29public:
30   ATTR_COLD net_device_t_base_factory(const pstring &name, const pstring &classname,
31         const pstring &def_param)
32   : m_name(name), m_classname(classname), m_def_param(def_param)
33   {}
34
35   ATTR_COLD virtual ~net_device_t_base_factory() {}
36
37   ATTR_COLD virtual netlist_device_t *Create() const = 0;
38
39   ATTR_COLD const pstring &name() const { return m_name; }
40   ATTR_COLD const pstring &classname() const { return m_classname; }
41   ATTR_COLD const pstring &param_desc() const { return m_def_param; }
42   ATTR_COLD const nl_util::pstring_list term_param_list();
43   ATTR_COLD const nl_util::pstring_list def_params();
44
45protected:
46   pstring m_name;                             /* device name */
47   pstring m_classname;                        /* device class name */
48   pstring m_def_param;                        /* default parameter */
49};
50
51template <class C>
52class net_device_t_factory : public net_device_t_base_factory
53{
54   NETLIST_PREVENT_COPYING(net_device_t_factory)
55public:
56   ATTR_COLD net_device_t_factory(const pstring &name, const pstring &classname,
57         const pstring &def_param)
58   : net_device_t_base_factory(name, classname, def_param) { }
59
60   ATTR_COLD netlist_device_t *Create() const
61   {
62      netlist_device_t *r = nl_alloc(C);
63      //r->init(setup, name);
64      return r;
65   }
66};
67
68class netlist_factory_t
69{
70public:
71   typedef plinearlist_t<net_device_t_base_factory *> list_t;
72
73   ATTR_COLD netlist_factory_t();
74   ATTR_COLD ~netlist_factory_t();
75
76   template<class _C>
77   ATTR_COLD void register_device(const pstring &name, const pstring &classname,
78         const pstring &def_param)
79   {
80      m_list.add(nl_alloc(net_device_t_factory< _C >, name, classname, def_param));
81   }
82
83   ATTR_COLD netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
84   ATTR_COLD netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const;
85   ATTR_COLD net_device_t_base_factory * factory_by_name(const pstring &name, netlist_setup_t &setup) const;
86
87   const list_t &list() { return m_list; }
88
89private:
90   list_t m_list;
91
92};
93
94
95#endif /* NLFACTORY_H_ */
trunk/src/emu/netlist/nl_lists.h
r242962r242963
5959      }
6060      *i = e;
6161      inc_stat(m_prof_sort);
62      nl_assert(m_end - m_list < _Size);
62      assert(m_end - m_list < _Size);
6363   }
6464
6565   ATTR_HOT inline const entry_t *pop()
trunk/src/emu/netlist/nl_setup.c
r242962r242963
1414#include "analog/nld_solver.h"
1515#include "analog/nld_twoterm.h"
1616
17//FIXME: we need a nl_getenv
18#include <stdlib.h>
19
2017static NETLIST_START(base)
2118   TTL_INPUT(ttlhigh, 1)
2219   TTL_INPUT(ttllow, 0)
r242962r242963
4138
4239void netlist_setup_t::init()
4340{
44   nl_initialize_factory(factory());
41   m_factory.initialize();
4542   NETLIST_NAME(base)(*this);
4643}
4744
r242962r242963
381378
382379nld_base_d_to_a_proxy *netlist_setup_t::get_d_a_proxy(netlist_output_t &out)
383380{
384   nl_assert(out.isFamily(netlist_terminal_t::LOGIC));
381   assert(out.isFamily(netlist_terminal_t::LOGIC));
385382
386383   //printf("proxy for %s\n", out.name().cstr());;
387384   netlist_logic_output_t &out_cast = dynamic_cast<netlist_logic_output_t &>(out);
r242962r242963
390387   if (proxy == NULL)
391388   {
392389      // create a new one ...
393      proxy = nl_alloc(nld_d_to_a_proxy ,out);
390      proxy = new nld_d_to_a_proxy(out);
394391      pstring x = pstring::sprintf("proxy_da_%s_%d", out.name().cstr(), m_proxy_cnt);
395392      m_proxy_cnt++;
396393
r242962r242963
419416{
420417   if (out.isFamily(netlist_terminal_t::ANALOG) && in.isFamily(netlist_terminal_t::LOGIC))
421418   {
422      nld_a_to_d_proxy *proxy = nl_alloc(nld_a_to_d_proxy, in);
419      nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(in);
423420      pstring x = pstring::sprintf("proxy_ad_%s_%d", in.name().cstr(), m_proxy_cnt);
424421      m_proxy_cnt++;
425422
r242962r242963
455452   else if (inp.isFamily(netlist_terminal_t::LOGIC))
456453   {
457454      NL_VERBOSE_OUT(("connect_terminal_input: connecting proxy\n"));
458      nld_a_to_d_proxy *proxy = nl_alloc(nld_a_to_d_proxy, inp);
455      nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(inp);
459456      pstring x = pstring::sprintf("proxy_ad_%s_%d", inp.name().cstr(), m_proxy_cnt);
460457      m_proxy_cnt++;
461458
r242962r242963
502499
503500void netlist_setup_t::connect_terminals(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2)
504501{
505   //nl_assert(in.isType(netlist_terminal_t::TERMINAL));
506   //nl_assert(out.isType(netlist_terminal_t::TERMINAL));
502   //assert(in.isType(netlist_terminal_t::TERMINAL));
503   //assert(out.isType(netlist_terminal_t::TERMINAL));
507504
508505   if (t1.has_net() && t2.has_net())
509506   {
r242962r242963
523520   else
524521   {
525522      NL_VERBOSE_OUT(("adding net ...\n"));
526      netlist_analog_net_t *anet =  nl_alloc(netlist_analog_net_t);
523      netlist_analog_net_t *anet =  new netlist_analog_net_t();
527524      t1.set_net(*anet);
528525      //m_netlist.solver()->m_nets.add(anet);
529526      // FIXME: Nets should have a unique name
r242962r242963
686683
687684void netlist_setup_t::start_devices()
688685{
689    //FIXME: we need a nl_getenv
690686   if (getenv("NL_LOGS"))
691687   {
692688      NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
trunk/src/emu/netlist/nl_setup.h
r242962r242963
1111#define NLSETUP_H_
1212
1313#include "nl_base.h"
14#include "nl_factory.h"
1514
1615//============================================================
1716//  MACROS / inline netlist definitions
trunk/src/emu/netlist/plists.h
r242962r242963
2828      if (m_num_elements == 0)
2929         m_list = NULL;
3030      else
31         m_list = nl_alloc_array(_ListClass, m_num_elements);
31         m_list = new _ListClass[m_num_elements];
3232      m_count = 0;
3333   }
3434
r242962r242963
3838      if (m_num_elements == 0)
3939         m_list = NULL;
4040      else
41         m_list = nl_alloc_array(_ListClass, m_num_elements);
41         m_list = new _ListClass[m_num_elements];
4242      m_count = 0;
4343      for (int i=0; i<rhs.count(); i++)
4444      {
r242962r242963
6060   ATTR_COLD ~plinearlist_t()
6161   {
6262      if (m_list != NULL)
63          nl_free_array(m_list);
63         delete[] m_list;
6464      m_list = NULL;
6565   }
6666
r242962r242963
108108
109109   ATTR_HOT inline void remove_at(const int pos)
110110   {
111      nl_assert((pos>=0) && (pos<m_count));
111      assert((pos>=0) && (pos<m_count));
112112      m_count--;
113113      for (int i = pos; i < m_count; i++)
114114      {
r242962r242963
118118
119119   ATTR_HOT inline void swap(const int pos1, const int pos2)
120120   {
121      nl_assert((pos1>=0) && (pos1<m_count));
122      nl_assert((pos2>=0) && (pos2<m_count));
121      assert((pos1>=0) && (pos1<m_count));
122      assert((pos2>=0) && (pos2<m_count));
123123      _ListClass tmp = m_list[pos1];
124124      m_list[pos1] = m_list[pos2];
125125      m_list[pos2] =tmp;
r242962r242963
157157   {
158158      for (_ListClass *i = m_list; i < m_list + m_count; i++)
159159      {
160         nl_free(*i);
160         delete *i;
161161      }
162162      clear();
163163   }
164164
165165private:
166   ATTR_COLD void resize(const int new_size)
166   ATTR_HOT inline void resize(const int new_size)
167167   {
168168      int cnt = count();
169169      if (new_size > 0)
170170      {
171         _ListClass *m_new = nl_alloc_array(_ListClass, new_size);
171         _ListClass *m_new = new _ListClass[new_size];
172172         _ListClass *pd = m_new;
173173
174174         if (cnt > new_size)
r242962r242963
176176         for (_ListClass *ps = m_list; ps < m_list + cnt; ps++, pd++)
177177            *pd = *ps;
178178         if (m_list != NULL)
179            nl_free_array(m_list);
179            delete[] m_list;
180180         m_list = m_new;
181181         m_count = cnt;
182182      }
183183      else
184184      {
185185         if (m_list != NULL)
186             nl_free_array(m_list);
186            delete[] m_list;
187187         m_list = NULL;
188188         m_count = 0;
189189      }
r242962r242963
331331            }
332332            p = p->m_next;
333333         }
334         nl_assert_always(false, "element not found");
334         assert_always(false, "element not found");
335335      }
336336   }
337337
r242962r242963
357357      _ListClass **p = &m_head;
358358      while (*p != &elem)
359359      {
360         nl_assert(*p != NULL);
360         assert(*p != NULL);
361361         p = &((*p)->m_next);
362362      }
363363      (*p) = elem.m_next;
trunk/src/emu/netlist/pstate.c
r242962r242963
2727   };
2828
2929   NL_VERBOSE_OUT(("SAVE: <%s> %s(%d) %p\n", fullname.cstr(), ts[dt].cstr(), size, ptr));
30   pstate_entry_t *p = nl_alloc(pstate_entry_t, stname, dt, owner, size, count, ptr, is_ptr);
30   pstate_entry_t *p = new pstate_entry_t(stname, dt, owner, size, count, ptr, is_ptr);
3131   m_save.add(p);
3232}
3333
r242962r242963
6060      if (m_save[i]->m_dt == DT_CUSTOM)
6161         m_save[i]->m_callback->on_post_load();
6262}
63
64template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state, const void *owner, const pstring &stname)
65{
66    //save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
67    pstate_entry_t *p = nl_alloc(pstate_entry_t, stname, owner, &state);
68    m_save.add(p);
69    state.register_state(*this, stname);
70}
trunk/src/emu/netlist/pstate.h
r242962r242963
145145   pstate_entry_t::list_t m_save;
146146};
147147
148template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state, const void *owner, const pstring &stname);
148template<> ATTR_COLD inline void pstate_manager_t::save_item(pstate_callback_t &state, const void *owner, const pstring &stname)
149{
150   //save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
151   pstate_entry_t *p = new pstate_entry_t(stname, owner, &state);
152   m_save.add(p);
153   state.register_state(*this, stname);
154}
149155
150156template<> ATTR_COLD inline void pstate_manager_t::save_item(netlist_time &nlt, const void *owner, const pstring &stname)
151157{
trunk/src/emu/netlist/pstring.c
r242962r242963
55
66#include "pstring.h"
77#include <cstdio>
8#include <stdlib.h>
98
109
1110// The following will work on linux, however not on Windows ....
r242962r242963
1413//pstring::str_t *pstring::m_zero = new(pstring::m_pool, 0) pstring::str_t(0);
1514
1615pblockpool pstring::m_pool;
16
1717pstring::str_t pstring::m_zero;
1818
1919/*
trunk/src/emu/render.h
r242962r242963
4646#ifndef __RENDER_H__
4747#define __RENDER_H__
4848
49//#include "osdepend.h"
49#include "osdepend.h"
5050
5151#include <math.h>
5252
trunk/src/emu/rendfont.c
r242962r242963
1414#include "emuopts.h"
1515#include <zlib.h>
1616
17#include "osdepend.h"
1817#include "uismall.fh"
1918
2019
trunk/src/emu/rendfont.h
r242962r242963
1313
1414#include "render.h"
1515
16// forward instead of include
17class osd_font;
1816
1917//**************************************************************************
2018//  TYPE DEFINITIONS
r242962r242963
9391   dynamic_array<glyph> m_glyphs[256];     // array of glyph subtables
9492   dynamic_array<char> m_rawdata;          // pointer to the raw data for the font
9593   UINT64              m_rawsize;          // size of the raw font data
96   osd_font            *m_osdfont;          // handle to the OSD font
94   osd_font            m_osdfont;          // handle to the OSD font
9795
9896   // constants
9997   static const int CACHED_CHAR_SIZE       = 12;
trunk/src/emu/rendutil.h
r242962r242963
1212#ifndef __RENDUTIL_H__
1313#define __RENDUTIL_H__
1414
15#include "osdepend.h"
1516#include "render.h"
1617
1718#include <math.h>
trunk/src/emu/sound/tiaintf.c
r242962r242963
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
r242962r242963
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                  */
r242962r242963
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;
r242962r242963
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
r242962r242963
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
r242962r242963
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
r242962r242963
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
r242962r242963
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
r242962r242963
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/miscmenu.c
r242962r242963
2323#include "ui/miscmenu.h"
2424#include "ui/filemngr.h"
2525
26#include "osdepend.h"
2726
2827/*-------------------------------------------------
2928    ui_slider_ui_handler - pushes the slider
trunk/src/emu/ui/slotopt.c
r242962r242963
1313
1414#include "ui/ui.h"
1515#include "ui/slotopt.h"
16#include "ui/devopt.h"
1716
1817
1918/*-------------------------------------------------
r242962r242963
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;
r242962r242963
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/emu/video.c
r242962r242963
2020
2121#include "snap.lh"
2222
23#include "osdepend.h"
2423
24
2525//**************************************************************************
2626//  DEBUGGING
2727//**************************************************************************
trunk/src/emu/webengine.c
r242962r242963
1616#include "webengine.h"
1717#include "lua.hpp"
1818
19#include "osdepend.h"
2019
20
2121//**************************************************************************
2222//  WEB ENGINE
2323//**************************************************************************
trunk/src/lib/lib.mak
r242962r242963
3939#-------------------------------------------------
4040
4141UTILOBJS = \
42   $(OSDOBJ)/osdcore.o \
4342   $(LIBOBJ)/util/astring.o \
4443   $(LIBOBJ)/util/avhuff.o \
4544   $(LIBOBJ)/util/aviio.o \
trunk/src/lib/util/chd.c
r242962r242963
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/lib/util/corefile.h
r242962r242963
1414#define __COREFILE_H__
1515
1616#include <stdarg.h>
17#include "osdcore.h"
1718#include "astring.h"
1819#include "coretmpl.h"
1920
trunk/src/lib/util/options.h
r242962r242963
1111#ifndef __OPTIONS_H__
1212#define __OPTIONS_H__
1313
14#include "osdcore.h"
1415#include "corefile.h"
1516#include "tagmap.h"
1617
trunk/src/mame/audio/mario.c
r242962r242963
22#include "cpu/z80/z80.h"
33#include "cpu/mcs48/mcs48.h"
44#include "sound/ay8910.h"
5#include "sound/discrete.h"
56
67#include "includes/mario.h"
78
r242962r242963
3839#define I8035_P1_W_AH(M,B,D) I8035_P1_W(M,ACTIVEHIGH_PORT_BIT(I8035_P1_R(M),B,(D)))
3940#define I8035_P2_W_AH(M,B,D) I8035_P2_W(M,ACTIVEHIGH_PORT_BIT(I8035_P2_R(M),B,(D)))
4041
41
42#if !OLD_SOUND
43
44/* ---------------------------------------------------------------------- */
45/* mario sound                                                            */
46/* ---------------------------------------------------------------------- */
47static NETLIST_START(nl_mario_snd0)
48
49    RES(R17, RES_K(27))               /* 20 according to parts list           */
50                                      /* 27 verified, 30K in schematics       */
51    CAP(C14, CAP_U(4.7))              /* verified                             */
52
53    TTL_74123(2H_A)
54    NET_C(2H_A.VCC, V5)
55    NET_C(2H_A.GND, GND)
56    NET_C(SOUND0.Q, 2H_A.B)
57    NET_C(GND, 2H_A.A)
58    NET_C(2H_A.CLRQ, ttlhigh)         /* NOT IN SCHEMATICS                    */
59    DIODE(D1, "1N4148")               /* FIXME: try to identify */
60    TTL_7404_INVERT(1H_A, 2H_A.QQ)
61    NET_C(R17.1, V5)
62    NET_C(R17.2, D1.A, C14.1)
63    NET_C(D1.K, 2H_A.RC)
64    NET_C(C14.2, 2H_A.C)
65
66    RES(R6, RES_K(4.7))               /* verified                             */
67    CAP(C3, CAP_U(10))                /* verified                             */
68
69    NET_C(1H_A.Q, R6.1)
70    NET_C(R6.2, C3.1, 1J_A.FC)
71    NET_C(R6.2, 2J_A.FC)
72    NET_C(C3.2, GND)
73
74    //#define MR_C6       CAP_N(3.9)        /* verified                           */
75
76    SN74LS629(1J_A, CAP_N(3.9))
77    NET_C(1J_A.RNG, V5)
78    NET_C(1J_A.ENQ, ttllow)
79    NET_C(GND, 1J_A.GND)
80
81    //#define MR_C17      CAP_N(22)        /* verified                            */
82
83    SN74LS629(2J_A, CAP_N(22))
84    NET_C(2J_A.RNG, V5)
85    NET_C(2J_A.ENQ, ttllow)
86    NET_C(GND, 2J_A.GND)
87
88    TTL_7486_XOR(1K_A, 1J_A.Y, 2J_A.Y)
89    TTL_7408_AND(2K_A, 2H_A.Q, 1K_A)
90NETLIST_END()
91
92/* ---------------------------------------------------------------------- */
93/* skid sound                                                            */
94/* ---------------------------------------------------------------------- */
95
96// FIXME: Diodes are 1S953
97static NETLIST_START(nl_mario_snd7)
98
99    RES(R61, RES_K(47))
100    CAP(C41, CAP_U(4.7))              /* verified                             */
101
102    TTL_74123(4L_A)
103    NET_C(4L_A.VCC, V5)
104    NET_C(4L_A.GND, GND)
105    NET_C(SOUND7.Q, 4L_A.B)
106    NET_C(GND, 4L_A.A)
107    NET_C(4L_A.CLRQ, ttlhigh)         /* NOT IN SCHEMATICS                    */
108    DIODE(D10, "1N4148")               /* FIXME: try to identify */
109    TTL_7404_INVERT(4J_A, 4L_A.Q)
110    NET_C(R61.1, V5)
111    NET_C(R61.2, D10.A, C41.1)
112    NET_C(D10.K, 4L_A.RC)
113    NET_C(C41.2, 4L_A.C)
114
115    RES(R65, RES_K(10))
116    CAP(C44, CAP_U(3.3))              /* verified                             */
117
118    SN74LS629(4K_A, CAP_U(0.022))
119    NET_C(4K_A.RNG, V5)
120    NET_C(4K_A.ENQ, ttllow)
121    NET_C(GND, 4K_A.GND)
122    NET_C(R65.1, 4J_A.Q)
123    NET_C(R65.2, 4K_A.FC, C44.1)
124    NET_C(C44.2, GND)
125
126    CD_4020(3H, 4K_B.Y, ttllow, V5, GND)
127    TTL_7404_INVERT(4J_B, 3H.Q12)
128
129    RES(R64, RES_K(20))
130    CAP(C43, CAP_U(3.3))              /* verified                             */
131
132    SN74LS629(4K_B, CAP_U(0.0047))
133    NET_C(4K_B.RNG, V5)
134    NET_C(4K_B.ENQ, ttllow)
135    NET_C(GND, 4K_B.GND)
136    NET_C(R64.1, 4J_B.Q)
137    NET_C(R64.2, 4K_B.FC, C43.1)
138    NET_C(C43.2, GND)
139
140    TTL_7486_XOR(1K_C, 3H.Q4, 4K_A.Y)
141    TTL_7408_AND(2K_C, 4L_A.Q, 1K_C)
142
143NETLIST_END()
144
145/* ---------------------------------------------------------------------- */
146/* DAC sound                                                            */
147/* ---------------------------------------------------------------------- */
148static NETLIST_START(nl_mario_dac)
149    RES(R34, RES_M(2))
150    RES(R35, RES_M(1))
151    RES(R36, RES_M(1.8))
152    LM3900(3M_1)
153    NET_C(3M_1.VM, GND)
154    NET_C(3M_1.VP, V5)
155
156    NET_C(DAC.VOUT, R34.1)
157    NET_C(3M_1.MINUS, R34.2, R35.2)
158    NET_C(3M_1.OUT, R35.1)
159    NET_C(3M_1.PLUS, R36.1)
160    NET_C(R36.2, GND)
161
162    RES(R21, RES_M(1.8))
163    RES(R23, RES_K(10))
164    RES(R25, RES_K(10))
165    RES(R37, RES_K(750))
166    RES(R38, RES_K(360))
167    RES(R39, RES_K(750))
168
169    CAP(C18, CAP_P(100))
170    CAP(C19, CAP_U(10))
171    CAP(C20, CAP_U(1))
172    CAP(C30, CAP_P(100))
173
174    LM3900(3M_2)
175    NET_C(3M_2.VM, GND)
176    NET_C(3M_2.VP, V5)
177
178    NET_C(R35.1, C20.1)
179    NET_C(C20.2, R37.1)
180    NET_C(R37.2, R38.2, C18.1, R39.2)
181
182    NET_C(C18.2, GND)
183    NET_C(R38.1, C30.2, 3M_2.MINUS)
184    NET_C(3M_2.OUT, R39.1, C30.1)
185
186    NET_C(R21.1, 3M_2.PLUS)
187    NET_C(R21.2, C19.1, R25.2, R23.1)
188    NET_C(C19.2, R23.2, GND)
189    NET_C(R25.1, V5)
190NETLIST_END()
191
192static NETLIST_START(nl_mario)
193
194    /* Standard stuff */
195
196    SOLVER(Solver, 48000)
197    PARAM(Solver.ACCURACY, 1e-8)
198    PARAM(Solver.SOR_FACTOR, 1.0)
199    PARAM(Solver.GS_THRESHOLD, 5)
200    PARAM(Solver.GS_LOOPS, 4)
201    //PARAM(Solver.LTE,     5e-2) // Default is not enough for paddle control
202    PARAM(Solver.DYNAMIC_TS,  0)
203    ANALOG_INPUT(V5, 5)
204
205    TTL_INPUT(SOUND0, 1)
206    INCLUDE(nl_mario_snd0)
207
208    TTL_INPUT(SOUND7, 1)
209    INCLUDE(nl_mario_snd7)
210
211    R2R_DAC(DAC, 3.4, 10000.0, 8)
212    NET_C(DAC.VGND, GND)
213
214    INCLUDE(nl_mario_dac)
215
216    /* ---------------------------------------------------------------------- */
217    /* mixing                                                                 */
218    /* ---------------------------------------------------------------------- */
219
220    RES(R20, RES_K(22))               /* verified                             */
221    RES(R19, RES_K(22))               /* verified                             */
222    RES(R40, RES_K(22))               /* verified                             */
223    RES(R41, RES_K(100))              /* verified                             */
224    CAP(C31, CAP_U(0.022))            /*                             */
225
226    NET_C(2K_A.Q, R20.1)
227    NET_C(GND, R19.1) //FIXME
228    NET_C(2K_C.Q, R41.1)
229
230#if 1
231    RES(DUM, RES_K(22))
232    NET_C(R39.1, DUM.1)
233    NET_C(DUM.2, GND)
234    FRONTIER(front1, R39.1, R40.1)
235#else
236    NET_C(R39.1, R40.1)
237#endif
238
239    NET_C(R20.2, R19.2, R40.2, R41.2, C31.1)
240    NET_C(C31.2, GND)
241
242    CAP(C32, CAP_U(1))                /* verified                             */
243    RES(R42, RES_K(43))               /* verified                             */
244    RES(R43, RES_K(100))              /* verified                             */
245
246    NET_C(C31.1, C32.1)
247    NET_C(C32.2, R42.1, R43.2, Q10.B)
248    //NET_C(C32.2, R42.1, R43.2)
249    NET_C(R43.1, V5)
250    NET_C(R42.2, GND)
251#if 1
252    RES(R63, RES_K(1))                /*                                      */
253    RES(R62, 150)                     /*                                      */
254
255    QBJT_EB(Q10, "2SC1815")
256
257    NET_C(R62.2, GND)
258    NET_C(R62.1, Q10.E)
259
260    NET_C(R63.1, V5)
261    NET_C(R63.2, Q10.C)
262
263    CAP(C42, CAP_U(0.1))
264    CAP(C47, CAP_U(4.7))
265    RES(VR1, RES_K(10))
266
267    NET_C(C42.1, C47.1, R62.1)
268    NET_C(C42.2, GND)
269    NET_C(C47.2, VR1.1)
270    NET_C(VR1.2, GND)
271#endif
272    /* ---------------------------------------------------------------------- */
273    /* Output                                                                 */
274    /* ---------------------------------------------------------------------- */
275
276    RES(ROUT, 1000000)
277
278    //NET_C(Q10.C, ROUT.1)
279    //NET_C(R43.2, ROUT.1)
280    NET_C(VR1.1, ROUT.1)
281
282    NET_C(GND, ROUT.2)
283
284NETLIST_END()
285
286#else
28742/****************************************************************
28843 *
28944 * Discrete Sound defines
r242962r242963
635390   DISCRETE_TASK_END()
636391
637392DISCRETE_SOUND_END
638#endif
393
639394/****************************************************************
640395 *
641396 * EA / Banking
r242962r242963
743498
744499WRITE8_MEMBER(mario_state::mario_sh_sound_w)
745500{
746#if OLD_SOUND
747501   m_discrete->write(space, DS_DAC, data);
748#else
749   m_audio_dac->write(data);
750#endif
751502}
752503
753504WRITE8_MEMBER(mario_state::mario_sh_p1_w)
r242962r242963
787538/* Mario running sample */
788539WRITE8_MEMBER(mario_state::mario_sh1_w)
789540{
790#if OLD_SOUND
791541   m_discrete->write(space, DS_SOUND0_INP, 0);
792#else
793    m_audio_snd0->write(data);
794#endif
795542}
796543
797544/* Luigi running sample */
798545WRITE8_MEMBER(mario_state::mario_sh2_w)
799546{
800#if OLD_SOUND
801547   m_discrete->write(space, DS_SOUND1_INP, 0);
802#endif
803548}
804549
805550/* Misc samples */
r242962r242963
832577         I8035_P1_W_AH(space, 3, data & 1);
833578         break;
834579      case 7: /* skid */
835#if OLD_SOUND
836580         machine().device<discrete_device>("discrete")->write(space, DS_SOUND7_INP, data & 1);
837#else
838          m_audio_snd7->write((data & 1) ^ 1);
839#endif
840581         break;
841582   }
842583}
r242962r242963
885626   MCFG_CPU_IO_MAP(mario_sound_io_map)
886627
887628   MCFG_SPEAKER_STANDARD_MONO("mono")
888
889#if OLD_SOUND
890629   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
891630   MCFG_DISCRETE_INTF(mario)
892631   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
893#else
894    MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000)
895    MCFG_NETLIST_SETUP(nl_mario)
896    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
897632
898    MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd0", "SOUND0.IN", 0, 1)
899    MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd7", "SOUND7.IN", 0, 1)
900    MCFG_NETLIST_LOGIC_INPUT("snd_nl", "dac", "DAC.VAL", 0, 255)
901
902    MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "ROUT.1")
903    MCFG_NETLIST_ANALOG_MULT_OFFSET(150000.0, 0.0)
904#endif
905
906633MACHINE_CONFIG_END
907634
908635MACHINE_CONFIG_FRAGMENT( masao_audio )
trunk/src/mame/drivers/aleck64.c
r242962r242963
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
r242962r242963
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};
r242962r242963
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 // x/y offsets
353   AM_RANGE(0xd0010000, 0xd0010fff) AM_RAM // RGB555 palette
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 )
r242962r242963
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
r242962r242963
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")
r242962r242963
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
461   PORT_MODIFY("P1_ANALOG_Y")
462   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(1)
463
464   PORT_MODIFY("P2_ANALOG_Y")
465   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(2)
466
492467INPUT_PORTS_END
493468
494469static INPUT_PORTS_START( mtetrisc )
r242962r242963
873848   MCFG_N64_PERIPHS_ADD("rcp");
874849MACHINE_CONFIG_END
875850
876static MACHINE_CONFIG_DERIVED( a64_e90, aleck64 )
877   MCFG_CPU_MODIFY("maincpu")
878   MCFG_CPU_PROGRAM_MAP(e90_map)
879MACHINE_CONFIG_END
880
881851DRIVER_INIT_MEMBER(aleck64_state,aleck64)
882852{
883853   UINT8 *rom = memregion("user2")->base();
r242962r242963
11121082
11131083// games
11141084GAME( 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 )
1085GAME( 1998, mtetrisc, aleck64,  aleck64, mtetrisc, aleck64_state, aleck64, ROT0, "Capcom", "Magical Tetris Challenge (981009 Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
11161086GAME( 1998, starsldr, aleck64,  aleck64, starsldr, aleck64_state, aleck64, ROT0, "Hudson / Seta", "Star Soldier: Vanishing Earth", GAME_IMPERFECT_GRAPHICS )
11171087GAME( 1998, vivdolls, aleck64,  aleck64, aleck64, aleck64_state,  aleck64, ROT0, "Visco", "Vivid Dolls", GAME_IMPERFECT_GRAPHICS )
11181088GAME( 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
r242962r242963
369369#include "debug/debugcon.h"
370370#include "debug/debugcmd.h"
371371#include "debug/debugcpu.h"
372#include "osdcore.h"
372373#include "includes/chihiro.h"
373374
374375#define LOG_PCI
trunk/src/mame/drivers/naomi.c
r242962r242963
521521Star Horse (satellite)                          840-0056C  23627    6 (128Mb)* 315-6319   315-6213  not present   * +1 (64Mb), requires 837-13785 ARCNET&IO BD
522522Star Horse Progress (satellite) (Rev A)         840-0123C  24122A   7 (128Mb)  315-6319A  315-6213  not present   requires 837-13785 ARCNET&IO BD
523523The King of Route 66 (Rev A)                    840-0087C  23819A  10 (128Mb)  315-6319A  315-6213  not present
524Virtua Striker 3                                840-0061C  23663   11 (128Mb)  315-6319A  315-6213  317-0310-COM
525524Virtua Striker 3 (Rev B)                        840-0061C  23663B  11 (128Mb)  315-6319A  315-6213  317-0310-COM
525Virtua Striker 3 (Rev C)                        840-0061C  23663C  11 (128Mb)  315-6319A  315-6213  317-0310-COM
526526Wave Runner GP                                  840-0064C  24059    6 (128Mb)  315-6319A  315-6213  not present
527527Wild Riders                                     840-0046C  23622   10 (128Mb)  315-6319A  315-6213  317-0301-COM
528528WWF Royal Rumble                                840-0040C  22261    8 (128Mb)  315-6319   315-6213  317-0285-COM
r242962r242963
77907790   NAOMI_DEFAULT_EEPROM
77917791
77927792   ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF)
7793   // rom was handmade from 2 damaged dumps, needs to be verified
7794   ROM_LOAD( "epr-23663.ic22", 0x0000000, 0x0400000, BAD_DUMP CRC(6910a008) SHA1(865affff1cf31321725ef727a17be384555e3aae) )
7793   ROM_LOAD( "epr-23663c.ic22",0x0000000, 0x0400000, CRC(7007fec7) SHA1(523168f0b218d0bd5c815d65bf0caba2c8468c9d) )
77957794   ROM_LOAD( "mpr-23652.ic1",  0x0800000, 0x1000000, CRC(992758a2) SHA1(5e2a25c520c1795128e5026fc00d355c24852ded) )
77967795   ROM_LOAD( "mpr-23653.ic2",  0x1800000, 0x1000000, CRC(e210e932) SHA1(2f6f0a31c3e98b21f1ff3af1680e50b3535b130f) )
77977796   ROM_LOAD( "mpr-23654.ic3",  0x2800000, 0x1000000, CRC(91335971) SHA1(fc7599b836fb7995dd7da940e64b08b3c09cb180) )
r242962r242963
90359034
90369035/* 840-xxxxx (Sega Naomi 2 cart games) */
90379036/* 0046 */ GAME( 2001, wldrider, naomi2,  naomi2m2, naomi, naomi_state, naomi2,   ROT0, "Sega", "Wild Riders (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS )
9038/* 0061 */ GAME( 2001, vstrik3c, naomi2,  naomi2m2, naomi, naomi_state, naomi2,   ROT0, "Sega", "Virtua Striker 3 (USA, EXP, KOR, AUS) (Cart)", GAME_FLAGS )
9037/* 0061 */ GAME( 2001, vstrik3c, naomi2,  naomi2m2, naomi, naomi_state, naomi2,   ROT0, "Sega", "Virtua Striker 3 (USA, EXP, KOR, AUS) (Cart, Rev C)", GAME_FLAGS )
90399038/* 0061 */ GAME( 2001, vstrik3cb,vstrik3c,naomi2m2, naomi, naomi_state, naomi2,   ROT0, "Sega", "Virtua Striker 3 (USA, EXP, KOR, AUS) (Cart, Rev B)", GAME_FLAGS )
90409039/* 0062 */ GAME( 2001, clubkrte, naomi2,  naomi2m2, naomi, naomi_state, naomi2,   ROT0, "Sega", "Club Kart: European Session", GAME_FLAGS )
90419040/* 0062 */ GAME( 2001, clubkrtd, clubkrte,naomi2m2, naomi, naomi_state, naomi2,   ROT0, "Sega", "Club Kart: European Session (Rev D)", GAME_FLAGS )
trunk/src/mame/drivers/peplus.c
r242962r242963
36873687   ROM_REGION( 0x020000, "gfx1", 0 )
36883688   ROM_LOAD( "mro-cg2153.u72",   0x00000, 0x8000, CRC(004c9c8e) SHA1(ec3fa9d2c658de59e722d9979513d6b0c71d5742) ) /*  05/01/95   @ IGT  L95-1123  */
36893689   ROM_LOAD( "mgo-cg2153.u73",   0x08000, 0x8000, CRC(e6843b35) SHA1(2d5219a3cb054ce8b470797c0496c7e24e94ed81) )
3690   ROM_LOAD( "mbo-cg2153.u74",   0x10000, 0x8000, CRC(e3e28611) SHA1(d040f1df6203dc0bd6a79a391fb90fb930f8dd1a) ) /* Custom Arizona Charlie's Casino card backs */
3690   ROM_LOAD( "mbo-cg2153.u74",   0x10000, 0x8000, CRC(e3e28611) SHA1(d040f1df6203dc0bd6a79a391fb90fb930f8dd1a) ) /* Custom Arizona Charlie's Casino graphics */
36913691   ROM_LOAD( "mxo-cg2153.u75",   0x18000, 0x8000, CRC(3ae44f7e) SHA1(00d625b60bffef6ce622cb50a3aa93b92131f578) )
36923692
36933693   ROM_REGION( 0x100, "proms", 0 )
r242962r242963
47724772  Four of a Kind Bonus Poker
47734773  Deuces Wild Poker
47744774
4775Also uses a Dallas (Maxim) DS1216 SmartWatch RAM for RTC (Real Time Clock) functions
4776
47774775Came out of an IGT machine with belly glass calling it Montana Choice
47784776*/
47794777   ROM_REGION( 0x10000, "maincpu", 0 )
r242962r242963
53935391   ROM_LOAD( "x000055p.u66",   0x00000, 0x10000, CRC(e06819df) SHA1(36590c4588b8036908e63714fbb3e77d23e60eae) ) /* Deuces Wild Poker */
53945392
53955393   ROM_REGION( 0x020000, "gfx1", 0 )
5396   ROM_LOAD( "mro-cg2291.u77",  0x00000, 0x8000, CRC(db4e491c) SHA1(e371e7b236962a0f30640c683d3a0a302c51aee9) ) /* Custom The Orleans card backs */
5394   ROM_LOAD( "mro-cg2291.u77",  0x00000, 0x8000, CRC(db4e491c) SHA1(e371e7b236962a0f30640c683d3a0a302c51aee9) ) /* Custom The Orleans graphics */
53975395   ROM_LOAD( "mgo-cg2291.u78",  0x08000, 0x8000, CRC(17bb35f8) SHA1(ba9e8aa3ff42b17c7be6ee46c70db22d8e60e52c) ) /* Compatible with most "standard" game sets */
53985396   ROM_LOAD( "mbo-cg2291.u79",  0x10000, 0x8000, CRC(de1036e4) SHA1(774bbcda301754dc4a606974248847a2264c3827) )
53995397   ROM_LOAD( "mxo-cg2291.u80",  0x18000, 0x8000, CRC(7049403c) SHA1(3a29a00fb8dfdb30dba757c1536151827ea09068) )
r242962r242963
54185416   ROM_LOAD( "x000055p.u66",   0x00000, 0x10000, CRC(e06819df) SHA1(36590c4588b8036908e63714fbb3e77d23e60eae) ) /* Deuces Wild Poker */
54195417
54205418   ROM_REGION( 0x020000, "gfx1", 0 )
5421   ROM_LOAD( "mro-cg2399.u72",  0x00000, 0x8000, CRC(0424f4ba) SHA1(c8b192a6f63c8c9937cb3923d27b9ba2c39823cd) ) /* Custom The Fun Ships card backs */
5419   ROM_LOAD( "mro-cg2399.u72",  0x00000, 0x8000, CRC(0424f4ba) SHA1(c8b192a6f63c8c9937cb3923d27b9ba2c39823cd) ) /* Custom The Fun Ships graphics */
54225420   ROM_LOAD( "mgo-cg2399.u73",  0x08000, 0x8000, CRC(5848a2fa) SHA1(4173a473016b7a776d2b59bf3ded0be35bd43721) )
54235421   ROM_LOAD( "mbo-cg2399.u74",  0x10000, 0x8000, CRC(5c3e16f6) SHA1(a4aa457f239527bffa6472e0d6f9d836f796b326) )
54245422   ROM_LOAD( "mxo-cg2399.u75",  0x18000, 0x8000, CRC(bd7669d5) SHA1(4343a9764fd563e2e1cdd8558f2f53f77006b159) )
r242962r242963
54435441   ROM_LOAD( "x000055p.u66",   0x00000, 0x10000, CRC(e06819df) SHA1(36590c4588b8036908e63714fbb3e77d23e60eae) ) /* Deuces Wild Poker */
54445442
54455443   ROM_REGION( 0x020000, "gfx1", 0 )
5446   ROM_LOAD( "mro-cg2374.u72",  0x00000, 0x8000, CRC(ceeb714d) SHA1(6de908d04bcaa243195943affa9ad0d725de5c81) ) /* Custom Horseshoe Casino card backs */
5447   ROM_LOAD( "mgo-cg2374.u73",  0x08000, 0x8000, CRC(d0fabad5) SHA1(438ebe074fa3eaa3073ef042f481449f416d0665) )
5448   ROM_LOAD( "mbo-cg2374.u74",  0x10000, 0x8000, CRC(9a0fbc8d) SHA1(aa39f47cbeaf8218fd2d753c9a350e9eab5df5d3) )
5449   ROM_LOAD( "mxo-cg2374.u75",  0x18000, 0x8000, CRC(99814562) SHA1(2d8e132f4cc4edd06332c0327927219513b22832) )
5444   ROM_LOAD( "mro-cg2185.u77",  0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /*  07/10/95   @ IGT  L95-1506  */
5445   ROM_LOAD( "mgo-cg2185.u78",  0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) )
5446   ROM_LOAD( "mbo-cg2185.u79",  0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) )
5447   ROM_LOAD( "mxo-cg2185.u80",  0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) )
54505448
54515449   ROM_REGION( 0x200, "proms", 0 )
5452   ROM_LOAD( "capx2374.u43", 0x0000, 0x0200, CRC(f922e1b8) SHA1(4aa5291c59431c022dc0561a6e3b38209f60286a) )
5450   ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
54535451ROM_END
54545452
54555453ROM_START( pex0055pd ) /* Superboard : Deuces Wild Poker (X000055P+XP000035) */
r242962r242963
79407938   ROM_LOAD( "x002374p.u66",   0x00000, 0x10000, CRC(fc4b6c8d) SHA1(b101f9042bd54dbfdeed4c7a3acf3798096f6857) ) /* Super Aces Poker */
79417939
79427940   ROM_REGION( 0x020000, "gfx1", 0 )
7943   ROM_LOAD( "mro-cg2324.u77",  0x00000, 0x8000, CRC(6eceef42) SHA1(a2ddd2a3290c41e510f483c6b633fe0002694d0b) )
7944   ROM_LOAD( "mgo-cg2324.u78",  0x08000, 0x8000, CRC(26d0acbe) SHA1(09a9127deb88185cd5b748bac657461eadb2f48f) )
7945   ROM_LOAD( "mbo-cg2324.u79",  0x10000, 0x8000, CRC(47baee32) SHA1(d8af09022ccb5fc06aa3aa4c200a734b66cbee00) )
7946   ROM_LOAD( "mxo-cg2324.u80",  0x18000, 0x8000, CRC(60449fc0) SHA1(251d1e04786b70c1d2bc7b02f3b69cd58ac76398) )
7941   ROM_LOAD( "mro-cg2374.u72",  0x00000, 0x8000, CRC(ceeb714d) SHA1(6de908d04bcaa243195943affa9ad0d725de5c81) ) /* Custom Horseshoe Casino card backs */
7942   ROM_LOAD( "mgo-cg2374.u73",  0x08000, 0x8000, CRC(d0fabad5) SHA1(438ebe074fa3eaa3073ef042f481449f416d0665) )
7943   ROM_LOAD( "mbo-cg2374.u74",  0x10000, 0x8000, CRC(9a0fbc8d) SHA1(aa39f47cbeaf8218fd2d753c9a350e9eab5df5d3) )
7944   ROM_LOAD( "mxo-cg2374.u75",  0x18000, 0x8000, CRC(99814562) SHA1(2d8e132f4cc4edd06332c0327927219513b22832) )
79477945
79487946   ROM_REGION( 0x200, "proms", 0 )
7949   ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
7947   ROM_LOAD( "cap2374.u43", 0x0000, 0x0200, CRC(f922e1b8) SHA1(4aa5291c59431c022dc0561a6e3b38209f60286a) )
79507948ROM_END
79517949
79527950ROM_START( pex2377p ) /* Superboard : Super Double Bonus Poker (X002377P+XP000112) */
r242962r242963
92659263GAMEL(1995, pex0055p,  0,         peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000019) Deuces Wild Poker",   0, layout_pe_poker )
92669264GAMEL(1995, pex0055pa, pex0055p,  peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000022) Deuces Wild Poker (The Orleans)", 0, layout_pe_poker )
92679265GAMEL(1995, pex0055pb, pex0055p,  peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000023) Deuces Wild Poker (The Fun Ships)", 0, layout_pe_poker )
9268GAMEL(1995, pex0055pc, pex0055p,  peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000028) Deuces Wild Poker (Horseshoe)", 0, layout_pe_poker )
9266GAMEL(1995, pex0055pc, pex0055p,  peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000028) Deuces Wild Poker",  0, layout_pe_poker )
92699267GAMEL(1995, pex0055pd, pex0055p,  peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000035) Deuces Wild Poker",   0, layout_pe_poker )
92709268GAMEL(1995, pex0055pe, pex0055p,  peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000038) Deuces Wild Poker",   0, layout_pe_poker )
92719269GAMEL(1995, pex0055pf, pex0055p,  peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000040) Deuces Wild Poker",   0, layout_pe_poker )
r242962r242963
93639361GAMEL(1995, pex2308p,  0,         peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X002308P+XP000112) Triple Double Bonus Poker", 0, layout_pe_poker )
93649362GAMEL(1995, pex2310p,  0,         peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X002310P+XP000112) Triple Double Bonus Poker", 0, layout_pe_poker )
93659363GAMEL(1995, pex2314p,  0,         peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X002314P+XP000112) Triple Bonus Poker Plus", 0, layout_pe_poker )
9366GAMEL(1995, pex2374p,  0,         peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X002374P+XP000112) Super Aces Poker",    0, layout_pe_poker )
9364GAMEL(1995, pex2374p,  0,         peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X002374P+XP000112) Super Aces Poker (Horseshoe)", 0, layout_pe_poker )
93679365GAMEL(1995, pex2377p,  0,         peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X002377P+XP000112) Super Double Bonus Poker", 0, layout_pe_poker )
93689366GAMEL(1995, pex2419p,  0,         peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X002419P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker )
93699367GAMEL(1995, pex2420p,  0,         peplus,  peplus_poker, peplus_state, peplussb, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (X002420P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker )
trunk/src/mame/drivers/snowbros.c
r242962r242963
185185   if (ACCESSING_BITS_0_7) soundlatch_byte_w(space,0,data & 0xff);
186186}
187187
188READ16_MEMBER(snowbros_state::toto_read)
189{
190   int pc = space.device().safe_pc();
191   if ((pc!= 0x3f010) && (pc!= 0x38008)) printf("toto prot %08x %04x\n", pc, mem_mask);
192   return 0x0700;
193}
194
188195/* Snow Bros Memory Map */
189196
190197static ADDRESS_MAP_START( snowbros_map, AS_PROGRAM, 16, snowbros_state )
r242962r242963
19551962   ROM_LOAD16_BYTE( "wb09.bin",     0x60001, 0x10000, CRC(9be718ca) SHA1(5c195e4f13efbdb229201d2408d018861bf389cc) )
19561963ROM_END
19571964
1965ROM_START( toto )
1966   ROM_REGION( 0x40000, "maincpu", 0 )
1967   ROM_LOAD16_BYTE( "u60.5j",  0x00000, 0x20000, CRC(39203792) SHA1(4c8d560be02a514cbf91774c7a0b4a95cf573356) )
1968   ROM_LOAD16_BYTE( "u51.4j",  0x00001, 0x20000, CRC(7b846cd4) SHA1(04aa0bbaab4303fb08dff52d5515f7e764f1be6d))
1969
1970   ROM_REGION( 0x10000, "soundcpu", 0 )    /* 64k for z80 sound code */
1971   ROM_LOAD( "u46.4c",   0x0000, 0x8000, CRC(77b1ef42) SHA1(75e3c8c2b687669cc56f972dd7375dab5185859c) )
1972
1973   ROM_REGION( 0x80000, "gfx1", 0 )
1974   ROM_LOAD( "u107.8k",          0x00000, 0x20000, CRC(4486153b) SHA1(a6dc0c17bf2328ab725bce4aaa0a413a42129fb0) )
1975   ROM_LOAD( "u108.8l",          0x20000, 0x20000, CRC(3286cf5f) SHA1(133366b0e10ab86111247cbedf329e8e3a7f2148) )
1976   ROM_LOAD( "u109.8m",          0x40000, 0x20000, CRC(464d7251) SHA1(f03ee54e9301ea87de4171cecdbad4a5e17929c4) )
1977   ROM_LOAD( "u110.8n",          0x60000, 0x20000, CRC(7dea56df) SHA1(7e7b9238837c6f4221cff416a2de21723d2c9272) )
1978ROM_END
1979
19581980/* Barko */
19591981
19601982ROM_START( honeydol )
r242962r242963
28662888
28672889
28682890
2891DRIVER_INIT_MEMBER(snowbros_state,toto)
2892{
2893   // every single rom has bits 0x10 and 0x08 swapped
2894   UINT8 *src = memregion("maincpu")->base();
2895   int len = memregion("maincpu")->bytes();
2896
2897   for (int i = 0; i < len; i++)
2898   {
2899      src[i] = BITSWAP8(src[i], 7, 6, 5, 3, 4, 2, 1, 0);
2900   }
2901
2902   src = memregion("gfx1")->base();
2903   len = memregion("gfx1")->bytes();
2904
2905   for (int i = 0; i < len; i++)
2906   {
2907      src[i] = BITSWAP8(src[i], 7, 6, 5, 3, 4, 2, 1, 0);
2908   }
2909
2910   src = memregion("soundcpu")->base();
2911   len = memregion("soundcpu")->bytes();
2912
2913   for (int i = 0; i < len; i++)
2914   {
2915      src[i] = BITSWAP8(src[i], 7, 6, 5, 3, 4, 2, 1, 0);
2916   }
2917
2918   // protection? (just return 0x07)
2919   m_maincpu->space(AS_PROGRAM).install_read_handler(0x500006, 0x500007, read16_delegate(FUNC(snowbros_state::toto_read),this));
2920}
2921
2922
2923
28692924GAME( 1990, snowbros,  0,        snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 1)", 0 )
28702925GAME( 1990, snowbrosa, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 2)", 0 )
28712926GAME( 1990, snowbrosb, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 3)", 0 )
r242962r242963
28752930GAME( 1990, wintbob,   snowbros, wintbob,  snowbros, driver_device, 0, ROT0, "bootleg (Sakowa Project Korea)", "The Winter Bobble (bootleg of Snow Bros.)", 0 )
28762931GAME( 1990, snowbroswb,snowbros, wintbob,  snowbros, driver_device, 0, ROT0, "bootleg",                        "Snow Bros. - Nick & Tom (The Winter Bobble hardware bootleg)", 0 ) // this was probably unhacked back from the more common Winter Bobble to make it look more original
28772932
2933GAME( 1996, toto,      0,        snowbros, snowbros, snowbros_state, toto, ROT0, "SoftClub",                    "Come Back Toto", 0 ) // modified from 'snowbros' code
2934
28782935// none of the games below are on genuine SnowBros hardware, but they clone the functionality of it.
28792936
28802937// SemiCom / Jeil titles are protected, a dumb MCU copies code into RAM at startup, some also check for a specific return value from an address on startup.
trunk/src/mame/drivers/stfight.c
r242962r242963
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 )
r242962r242963
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
r242962r242963
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
r242962r242963
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)
r242962r242963
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
r242962r242963
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
r242962r242963
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/mario.h
r242962r242963
11#ifndef MARIO_H_
22#define MARIO_H_
33
4#include "sound/discrete.h"
45#include "machine/z80dma.h"
56
6#define OLD_SOUND   (1)
7
8#if !OLD_SOUND
9#include "machine/netlist.h"
10#include "netlist/devices/net_lib.h"
11#else
12#include "sound/discrete.h"
13#endif
14
157/*
168 * From the schematics:
179 *
r242962r242963
5042      m_gfxdecode(*this, "gfxdecode"),
5143      m_palette(*this, "palette"),
5244      m_z80dma(*this, "z80dma"),
53#if OLD_SOUND
5445      m_discrete(*this, "discrete"),
55#else
56      m_audio_snd0(*this, "snd_nl:snd0"),
57        m_audio_snd7(*this, "snd_nl:snd7"),
58        m_audio_dac(*this, "snd_nl:dac"),
59#endif
6046      m_spriteram(*this, "spriteram"),
6147      m_videoram(*this, "videoram"),
6248      m_monitor(0) { }
r242962r242963
6753   required_device<gfxdecode_device> m_gfxdecode;
6854   required_device<palette_device> m_palette;
6955   optional_device<z80dma_device> m_z80dma;
70#if OLD_SOUND
7156   optional_device<discrete_device> m_discrete;
72#else
73   optional_device<netlist_mame_logic_input_t> m_audio_snd0;
74    optional_device<netlist_mame_logic_input_t> m_audio_snd7;
75    optional_device<netlist_mame_logic_input_t> m_audio_dac;
76#endif
7757
7858   /* memory pointers */
7959   required_shared_ptr<UINT8> m_spriteram;
trunk/src/mame/includes/snowbros.h
r242962r242963
5555   DECLARE_DRIVER_INIT(4in1boot);
5656   DECLARE_DRIVER_INIT(3in1semi);
5757   DECLARE_DRIVER_INIT(cookbib2);
58   DECLARE_DRIVER_INIT(toto);
59   DECLARE_READ16_MEMBER(toto_read);
5860   DECLARE_MACHINE_RESET(semiprot);
5961   DECLARE_MACHINE_RESET(finalttr);
6062   UINT32 screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
trunk/src/mame/includes/stfight.h
r242962r242963
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;
r242962r242963
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);
r242962r242963
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
r242962r242963
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"),
r242962r242963
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;
r242962r242963
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
r242962r242963
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);
r242962r242963
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
r242962r242963
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)
r242962r242963
6363            ( ( ( src ^ A ) >> 1 ) & 0x08 ) |
6464            ( ~( ( src >> 6 ) ^ A ) & 0x01 );
6565   }
66   
6766}
6867
6968DRIVER_INIT_MEMBER(stfight_state,stfight)
r242962r242963
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
r242962r242963
26782678snowbrosd       // MIN16-02 (c) 1990 Toaplan + Dooyong license
26792679wintbob         // bootleg
26802680snowbroswb      //
2681toto         //
26812682// modified snowbros 'clone' hardware
26822683honeydol        // (c) 1995 Barko Corp
26832684twinadv         // (c) 1995 Barko Corp
r242962r242963
54465447starhrsp        // 2003.12.01 Star Horse Progress (satellite) (Rev A)
54475448puyofevp        // 2003.?? Puyo Puyo Fever (prototype)
54485449            // 2003.?? Dragon Treasure
5450            // 2003.?? Rabbit 2
54495451cfield          // 2004.06 Chaos Field
54505452tetkiwam        // 2004.06 Tetris Kiwamemichi (Arcade TV Game List - P.88, Right, 11 from bottom)
54515453trizeal         // 2004.09 Trizeal
r242962r242963
55125514
55135515// NAOMI 2
55145516naomi2          // 2001.?? Naomi 2 BIOS
5515vstrik3c        // 2001.04 Virtua Striker 3 (cartridge)
5517vstrik3        // 2001.04.06 Virtua Striker 3 Ver. 2002
55165518vstrik3cb       // 2001.04 Virtua Striker 3 (Rev B) (cartridge)
5517vstrik3        // 2001.04.06 Virtua Striker 3 Ver. 2002
5519vstrik3c        // 2001.04 Virtua Striker 3 (Rev C) (cartridge)
55185520wldrider        // 2001.05 Wild Riders
55195521clubkrte        // 2001.06 Club Kart: European Session
5522clubkrtd        // 2001.06 Club Kart: European Session (Rev D)
55205523clubkrtc        // 2001.?? Club Kart: European Session (Rev C)
5521clubkrtd        // 2001.06 Club Kart: European Session (Rev D)
55225524beachspi        // 2001.07 Beach Spikers
55235525vf4cart         // 2001.08.02 Virtua Fighter 4 (cartridge)
55245526vf4             // 2001.08.02 Virtua Fighter 4 (GD-ROM)
trunk/src/mame/video/strnskil.c
r242962r242963
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
r242962r242963
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);
r242962r242963
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())
r242962r242963
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
r242962r242963
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
r242962r242963
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
r242962r242963
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   {
r242962r242963
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;
r242962r242963
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   {
r242962r242963
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
r242962r242963
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
r242962r242963
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   }
r242962r242963
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   }
r242962r242963
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
r242962r242963
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/comp4.c
r242962r242963
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
r242962r242963
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:
r242962r242963
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/ngen.c
r242962r242963
8787      m_vram(*this,"vram"),
8888      m_fontram(*this,"fontram"),
8989      m_fdc(*this,"fdc"),
90      m_fd0(*this,"fdc:0"),
91      m_fdc_timer(*this,"fdc_timer"),
92      m_hdc_timer(*this,"hdc_timer")
90      m_fd0(*this,"fdc:0")
9391   {}
9492
9593   DECLARE_WRITE_LINE_MEMBER(pit_out0_w);
r242962r242963
10098   DECLARE_WRITE16_MEMBER(cpu_peripheral_cb);
10199   DECLARE_WRITE16_MEMBER(peripheral_w);
102100   DECLARE_READ16_MEMBER(peripheral_r);
103   DECLARE_WRITE16_MEMBER(xbus_w);
104   DECLARE_READ16_MEMBER(xbus_r);
101   DECLARE_WRITE16_MEMBER(port00_w);
102   DECLARE_READ16_MEMBER(port00_r);
105103   DECLARE_WRITE_LINE_MEMBER(dma_hrq_changed);
106104   DECLARE_WRITE_LINE_MEMBER(dma_eop_changed);
107105   DECLARE_WRITE_LINE_MEMBER(dack0_w);
r242962r242963
120118   DECLARE_WRITE8_MEMBER( dma_1_dack_w ){  }
121119   DECLARE_WRITE8_MEMBER( dma_2_dack_w ){  }
122120   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);
126121   DECLARE_WRITE_LINE_MEMBER(fdc_irq_w);
127122   DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
128123   DECLARE_WRITE8_MEMBER(fdc_control_w);
r242962r242963
146141   optional_shared_ptr<UINT16> m_fontram;
147142   optional_device<wd2797_t> m_fdc;
148143   optional_device<floppy_connector> m_fd0;
149   optional_device<pit8253_device> m_fdc_timer;
150   optional_device<pit8253_device> m_hdc_timer;
151144
152145   void set_dma_channel(int channel, int state);
153146
154   UINT8 m_xbus_current;  // currently selected X-Bus module
155147   UINT16 m_peripheral;
156148   UINT16 m_upper;
157149   UINT16 m_middle;
r242962r242963
273265      if(mem_mask & 0x00ff)
274266         m_dma_offset[offset-0x80] = data & 0xff;
275267      break;
276   case 0xc0:  // X-Bus modules reset
277      m_xbus_current = 0;
278      break;
279268   case 0x10c:
280269      if(mem_mask & 0x00ff)
281270         m_pic->write(space,0,data & 0xff);
r242962r242963
397386
398387// X-bus module select
399388// 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)
389// expansion module.  The base I/O address for each module is 0x100*module number.
390// Module 0 is the main processor module, module 1 is the next module attached, and so on.
391WRITE16_MEMBER(ngen_state::port00_w)
404392{
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++;
393   m_port00 = data;
394   logerror("SYS: X-Bus module select %04x\n",data);
419395}
420396
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)
397// returns X-bus module ID (what is the low byte for?)
398READ16_MEMBER(ngen_state::port00_r)
427399{
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;
400   if(m_port00 > 0)
401      m_maincpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE);
402   if(m_port00 == 0)
403      return 0x1070;  // module ID of 0x1070, according to the floppy/hard disk tech manual
404   else
405      return 0x0080;  // invalid device?
441406}
442407
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
537408WRITE_LINE_MEMBER(ngen_state::fdc_irq_w)
538409{
539410   m_pic->ir7_w(state);
r242962r242963
693564{
694565   m_port00 = 0;
695566   m_control = 0;
696   m_xbus_current = 0;
697567   m_viduart->write_dsr(0);
698568   m_viduart->write_cts(0);
699569   m_fd0->get_device()->set_rpm(300);
r242962r242963
708578ADDRESS_MAP_END
709579
710580static ADDRESS_MAP_START( ngen_io, AS_IO, 16, ngen_state )
711   AM_RANGE(0x0000, 0x0001) AM_READWRITE(xbus_r,xbus_w)
581   AM_RANGE(0x0000, 0x0001) AM_READWRITE(port00_r,port00_w)
712582   
583   // TODO: allow for expansion modules to be allocated where asked to
713584   // 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)
585   AM_RANGE(0x0100, 0x0107) AM_DEVREADWRITE8("fdc",wd2797_t,read,write,0x00ff)  // a guess for now
586   AM_RANGE(0x0108, 0x0109) AM_WRITE8(fdc_control_w,0x00ff)
587   AM_RANGE(0x010a, 0x010b) AM_WRITE8(hdc_control_w,0x00ff)
588   AM_RANGE(0x010e, 0x010f) AM_WRITE8(disk_addr_ext,0x00ff)  // X-Bus extended address register
589   AM_RANGE(0x0110, 0x0117) AM_DEVREADWRITE8("fdc_timer",pit8253_device,read,write,0x00ff)
719590   // 0x0120-0x012f - WD1010 Winchester disk controller (unemulated)
720//   AM_RANGE(0x0130, 0x0137) AM_DEVREADWRITE8("hdc_timer",pit8253_device,read,write,0x00ff)
591   AM_RANGE(0x0130, 0x0137) AM_DEVREADWRITE8("hdc_timer",pit8253_device,read,write,0x00ff)
721592   
722593ADDRESS_MAP_END
723594
trunk/src/mess/drivers/splitsec.c
r242962r242963
1// license:BSD-3-Clause
2// copyright-holders:hap
3/***************************************************************************
4
5  Parker Brothers Split Second
6  * TMS1400NLL MP7314-N2 (die labeled MP7314)
7
8
9***************************************************************************/
10
11#include "emu.h"
12#include "cpu/tms0980/tms0980.h"
13#include "sound/speaker.h"
14
15#include "splitsec.lh"
16
17// master clock is a single stage RC oscillator: R=24K, C=100pf,
18// according to the TMS 1000 series data manual this is around 375kHz
19#define MASTER_CLOCK (375000)
20
21
22class splitsec_state : public driver_device
23{
24public:
25   splitsec_state(const machine_config &mconfig, device_type type, const char *tag)
26      : driver_device(mconfig, type, tag),
27      m_maincpu(*this, "maincpu"),
28      m_button_matrix(*this, "IN"),
29      m_speaker(*this, "speaker")
30   { }
31
32   required_device<cpu_device> m_maincpu;
33   required_ioport_array<2> m_button_matrix;
34   required_device<speaker_sound_device> m_speaker;
35
36   UINT16 m_r;
37   UINT16 m_o;
38
39   UINT16 m_leds_state[0x10];
40   UINT16 m_leds_cache[0x10];
41   UINT8 m_leds_decay[0x100];
42
43   DECLARE_READ8_MEMBER(read_k);
44   DECLARE_WRITE16_MEMBER(write_o);
45   DECLARE_WRITE16_MEMBER(write_r);
46
47   TIMER_DEVICE_CALLBACK_MEMBER(leds_decay_tick);
48   void leds_update();
49
50   virtual void machine_start();
51};
52
53
54
55/***************************************************************************
56
57  LEDs
58
59***************************************************************************/
60
61// The device strobes the outputs very fast, it is unnoticeable to the user.
62// To prevent flickering here, we need to simulate a decay.
63
64// decay time, in steps of 10ms
65#define LEDS_DECAY_TIME 4
66
67void splitsec_state::leds_update()
68{
69   UINT16 active_state[0x10];
70
71   for (int i = 0; i < 0x10; i++)
72   {
73      // update current state
74      if (m_r >> i & 1)
75         m_leds_state[i] = m_o;
76
77      active_state[i] = 0;
78
79      for (int j = 0; j < 0x10; j++)
80      {
81         int di = j << 4 | i;
82
83         // turn on powered leds
84         if (m_leds_state[i] >> j & 1)
85            m_leds_decay[di] = LEDS_DECAY_TIME;
86
87         // determine active state
88         int ds = (m_leds_decay[di] != 0) ? 1 : 0;
89         active_state[i] |= (ds << j);
90      }
91   }
92
93   // on difference, send to output
94   for (int i = 0; i < 0x10; i++)
95      if (m_leds_cache[i] != active_state[i])
96      {
97         for (int j = 0; j < 8; j++)
98            output_set_lamp_value(i*10 + j, active_state[i] >> j & 1);
99      }
100
101   memcpy(m_leds_cache, active_state, sizeof(m_leds_cache));
102}
103
104TIMER_DEVICE_CALLBACK_MEMBER(splitsec_state::leds_decay_tick)
105{
106   // slowly turn off unpowered leds
107   for (int i = 0; i < 0x100; i++)
108      if (!(m_leds_state[i & 0xf] >> (i>>4) & 1) && m_leds_decay[i])
109         m_leds_decay[i]--;
110
111   leds_update();
112}
113
114
115
116/***************************************************************************
117
118  I/O
119
120***************************************************************************/
121
122READ8_MEMBER(splitsec_state::read_k)
123{
124   UINT8 k = 0;
125
126   // read selected button rows
127   for (int i = 0; i < 2; i++)
128      if (m_r >> (i+9) & 1)
129         k |= m_button_matrix[i]->read();
130
131   return k;
132}
133
134WRITE16_MEMBER(splitsec_state::write_r)
135{
136   // R8: speaker out
137   m_speaker->level_w(data >> 8 & 1);
138   
139   // R9,R10: input mux
140   // R0-R7: led columns
141   m_r = data;
142   leds_update();
143}
144
145WRITE16_MEMBER(splitsec_state::write_o)
146{
147   // O0-O6: led rows
148   // O7: N/C
149   m_o = data;
150   leds_update();
151}
152
153
154
155/***************************************************************************
156
157  Inputs
158
159***************************************************************************/
160
161static INPUT_PORTS_START( splitsec )
162   PORT_START("IN.0") // R9
163   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
164   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
165   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
166   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
167
168   PORT_START("IN.1") // R10
169   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
170   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Select")
171   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start")
172   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
173INPUT_PORTS_END
174
175
176
177/***************************************************************************
178
179  Machine Config
180
181***************************************************************************/
182
183void splitsec_state::machine_start()
184{
185   // zerofill
186   memset(m_leds_state, 0, sizeof(m_leds_state));
187   memset(m_leds_cache, 0, sizeof(m_leds_cache));
188   memset(m_leds_decay, 0, sizeof(m_leds_decay));
189
190   m_r = 0;
191   m_o = 0;
192
193   // register for savestates
194   save_item(NAME(m_leds_state));
195   save_item(NAME(m_leds_cache));
196   save_item(NAME(m_leds_decay));
197
198   save_item(NAME(m_r));
199   save_item(NAME(m_o));
200}
201
202
203static MACHINE_CONFIG_START( splitsec, splitsec_state )
204
205   /* basic machine hardware */
206   MCFG_CPU_ADD("maincpu", TMS1400, MASTER_CLOCK)
207   MCFG_TMS1XXX_READ_K_CB(READ8(splitsec_state, read_k))
208   MCFG_TMS1XXX_WRITE_O_CB(WRITE16(splitsec_state, write_o))
209   MCFG_TMS1XXX_WRITE_R_CB(WRITE16(splitsec_state, write_r))
210
211   MCFG_TIMER_DRIVER_ADD_PERIODIC("leds_decay", splitsec_state, leds_decay_tick, attotime::from_msec(10))
212
213   MCFG_DEFAULT_LAYOUT(layout_splitsec)
214
215   /* no video! */
216
217   /* sound hardware */
218   MCFG_SPEAKER_STANDARD_MONO("mono")
219   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
220   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
221MACHINE_CONFIG_END
222
223
224
225/***************************************************************************
226
227  Game driver(s)
228
229***************************************************************************/
230
231ROM_START( splitsec )
232   ROM_REGION( 0x1000, "maincpu", 0 )
233   ROM_LOAD( "tms1400nll_mp7314", 0x0000, 0x1000, CRC(0cccdf59) SHA1(06a533134a433aaf856b80f0ca239d0498b98d5f) )
234
235   ROM_REGION( 867, "maincpu:mpla", 0 )
236   ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) )
237   ROM_REGION( 557, "maincpu:opla", 0 )
238   ROM_LOAD( "tms1400_splitsec_opla.pla", 0, 557, CRC(7539283b) SHA1(f791fa98259fc10c393ff1961d4c93040f1a2932) )
239ROM_END
240
241
242CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
trunk/src/mess/includes/msx.h
r242962r242963
2424#include "formats/basicdsk.h"
2525#include "formats/fmsx_cas.h"
2626#include "formats/msx_dsk.h"
27//#include "osdepend.h"
2728#include "hashfile.h"
2829#include "machine/wd_fdc.h"
2930#include "imagedev/floppy.h"
trunk/src/mess/layout/splitsec.lay
r242962r242963
1<?xml version="1.0"?>
2<mamelayout version="2">
3
4<!-- define elements -->
5
6   <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
7
8   <element name="lamp_disk" defstate="0">
9      <disk state="1"><color red="1.0" green="0.24" blue="0.26" /></disk>
10      <disk state="0"><color red="0.15" green="0.043" blue="0.047" /></disk>
11   </element>
12   <element name="lamp_rect" defstate="0">
13      <rect state="1"><color red="1.0" green="0.24" blue="0.26" /></rect>
14      <rect state="0"><color red="0.15" green="0.043" blue="0.047" /></rect>
15   </element>
16
17
18<!-- build screen -->
19
20   <view name="Internal Layout">
21      <bounds left="0" right="18" top="0" bottom="28" />
22      <bezel element="static_black">
23         <bounds left="0" right="18" top="0" bottom="28" />
24      </bezel>
25
26   <!-- maze of lamps -->
27
28      <bezel name="lamp6" element="lamp_rect"><bounds x="2" y="1" width="4" height="1" /></bezel>
29      <bezel name="lamp4" element="lamp_rect"><bounds x="7" y="1" width="4" height="1" /></bezel>
30      <bezel name="lamp2" element="lamp_rect"><bounds x="12" y="1" width="4" height="1" /></bezel>
31
32      <bezel name="lamp16" element="lamp_rect"><bounds x="1" y="2" width="1" height="4" /></bezel>
33      <bezel name="lamp5" element="lamp_disk"><bounds x="3" y="3" width="2" height="2" /></bezel>
34      <bezel name="lamp14" element="lamp_rect"><bounds x="6" y="2" width="1" height="4" /></bezel>
35      <bezel name="lamp3" element="lamp_disk"><bounds x="8" y="3" width="2" height="2" /></bezel>
36      <bezel name="lamp12" element="lamp_rect"><bounds x="11" y="2" width="1" height="4" /></bezel>
37      <bezel name="lamp1" element="lamp_disk"><bounds x="13" y="3" width="2" height="2" /></bezel>
38      <bezel name="lamp10" element="lamp_rect"><bounds x="16" y="2" width="1" height="4" /></bezel>
39
40      <bezel name="lamp15" element="lamp_rect"><bounds x="2" y="6" width="4" height="1" /></bezel>
41      <bezel name="lamp13" element="lamp_rect"><bounds x="7" y="6" width="4" height="1" /></bezel>
42      <bezel name="lamp11" element="lamp_rect"><bounds x="12" y="6" width="4" height="1" /></bezel>
43
44      <bezel name="lamp26" element="lamp_rect"><bounds x="1" y="7" width="1" height="4" /></bezel>
45      <bezel name="lamp25" element="lamp_disk"><bounds x="3" y="8" width="2" height="2" /></bezel>
46      <bezel name="lamp24" element="lamp_rect"><bounds x="6" y="7" width="1" height="4" /></bezel>
47      <bezel name="lamp23" element="lamp_disk"><bounds x="8" y="8" width="2" height="2" /></bezel>
48      <bezel name="lamp22" element="lamp_rect"><bounds x="11" y="7" width="1" height="4" /></bezel>
49      <bezel name="lamp21" element="lamp_disk"><bounds x="13" y="8" width="2" height="2" /></bezel>
50      <bezel name="lamp20" element="lamp_rect"><bounds x="16" y="7" width="1" height="4" /></bezel>
51
52      <bezel name="lamp35" element="lamp_rect"><bounds x="2" y="11" width="4" height="1" /></bezel>
53      <bezel name="lamp33" element="lamp_rect"><bounds x="7" y="11" width="4" height="1" /></bezel>
54      <bezel name="lamp31" element="lamp_rect"><bounds x="12" y="11" width="4" height="1" /></bezel>
55
56      <bezel name="lamp36" element="lamp_rect"><bounds x="1" y="12" width="1" height="4" /></bezel>
57      <bezel name="lamp45" element="lamp_disk"><bounds x="3" y="13" width="2" height="2" /></bezel>
58      <bezel name="lamp34" element="lamp_rect"><bounds x="6" y="12" width="1" height="4" /></bezel>
59      <bezel name="lamp43" element="lamp_disk"><bounds x="8" y="13" width="2" height="2" /></bezel>
60      <bezel name="lamp32" element="lamp_rect"><bounds x="11" y="12" width="1" height="4" /></bezel>
61      <bezel name="lamp41" element="lamp_disk"><bounds x="13" y="13" width="2" height="2" /></bezel>
62      <bezel name="lamp30" element="lamp_rect"><bounds x="16" y="12" width="1" height="4" /></bezel>
63
64      <bezel name="lamp55" element="lamp_rect"><bounds x="2" y="16" width="4" height="1" /></bezel>
65      <bezel name="lamp53" element="lamp_rect"><bounds x="7" y="16" width="4" height="1" /></bezel>
66      <bezel name="lamp51" element="lamp_rect"><bounds x="12" y="16" width="4" height="1" /></bezel>
67
68      <bezel name="lamp46" element="lamp_rect"><bounds x="1" y="17" width="1" height="4" /></bezel>
69      <bezel name="lamp65" element="lamp_disk"><bounds x="3" y="18" width="2" height="2" /></bezel>
70      <bezel name="lamp44" element="lamp_rect"><bounds x="6" y="17" width="1" height="4" /></bezel>
71      <bezel name="lamp63" element="lamp_disk"><bounds x="8" y="18" width="2" height="2" /></bezel>
72      <bezel name="lamp42" element="lamp_rect"><bounds x="11" y="17" width="1" height="4" /></bezel>
73      <bezel name="lamp61" element="lamp_disk"><bounds x="13" y="18" width="2" height="2" /></bezel>
74      <bezel name="lamp40" element="lamp_rect"><bounds x="16" y="17" width="1" height="4" /></bezel>
75
76      <bezel name="lamp75" element="lamp_rect"><bounds x="2" y="21" width="4" height="1" /></bezel>
77      <bezel name="lamp73" element="lamp_rect"><bounds x="7" y="21" width="4" height="1" /></bezel>
78      <bezel name="lamp71" element="lamp_rect"><bounds x="12" y="21" width="4" height="1" /></bezel>
79
80      <bezel name="lamp56" element="lamp_rect"><bounds x="1" y="22" width="1" height="4" /></bezel>
81      <bezel name="lamp66" element="lamp_disk"><bounds x="3" y="23" width="2" height="2" /></bezel>
82      <bezel name="lamp54" element="lamp_rect"><bounds x="6" y="22" width="1" height="4" /></bezel>
83      <bezel name="lamp64" element="lamp_disk"><bounds x="8" y="23" width="2" height="2" /></bezel>
84      <bezel name="lamp52" element="lamp_rect"><bounds x="11" y="22" width="1" height="4" /></bezel>
85      <bezel name="lamp62" element="lamp_disk"><bounds x="13" y="23" width="2" height="2" /></bezel>
86      <bezel name="lamp50" element="lamp_rect"><bounds x="16" y="22" width="1" height="4" /></bezel>
87
88      <bezel name="lamp76" element="lamp_rect"><bounds x="2" y="26" width="4" height="1" /></bezel>
89      <bezel name="lamp74" element="lamp_rect"><bounds x="7" y="26" width="4" height="1" /></bezel>
90      <bezel name="lamp72" element="lamp_rect"><bounds x="12" y="26" width="4" height="1" /></bezel>
91
92   </view>
93</mamelayout>
trunk/src/mess/mess.lst
r242962r242963
22692269starwbcp
22702270stopthie
22712271stopthiep
2272splitsec
22732272amico2k
22742273jtc
22752274jtces88
trunk/src/mess/mess.mak
r242962r242963
14901490$(MESSOBJ)/parker.a:            \
14911491   $(MESS_DRIVERS)/cnsector.o  \
14921492   $(MESS_DRIVERS)/merlin.o    \
1493   $(MESS_DRIVERS)/splitsec.o  \
14941493   $(MESS_DRIVERS)/stopthie.o  \
14951494
14961495$(MESSOBJ)/pitronic.a:          \
r242962r242963
21722171$(MESS_DRIVERS)/sitcom.o:   $(MESS_LAYOUT)/sitcom.lh
21732172$(MESS_DRIVERS)/slc1.o:     $(MESS_LAYOUT)/slc1.lh
21742173$(MESS_DRIVERS)/sms.o:      $(MESS_LAYOUT)/sms1.lh
2175$(MESS_DRIVERS)/splitsec.o: $(MESS_LAYOUT)/splitsec.lh
21762174$(MESS_DRIVERS)/starwbc.o:  $(MESS_LAYOUT)/starwbc.lh
21772175$(MESS_DRIVERS)/stopthie.o: $(MESS_LAYOUT)/stopthie.lh
21782176$(MESS_DRIVERS)/super80.o:  $(MESS_LAYOUT)/super80.lh
trunk/src/osd/modules/lib/osdobj_common.c
r242962r242963
346346//  font with the given name
347347//-------------------------------------------------
348348
349osd_font *osd_common_t::font_open(const char *name, int &height)
349osd_font osd_common_t::font_open(const char *name, int &height)
350350{
351351   return NULL;
352352}
r242962r242963
357357//  a given OSD font
358358//-------------------------------------------------
359359
360void osd_common_t::font_close(osd_font *font)
360void osd_common_t::font_close(osd_font font)
361361{
362362}
363363
r242962r242963
370370//  pixel of a black & white font
371371//-------------------------------------------------
372372
373bool osd_common_t::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
373bool osd_common_t::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
374374{
375375   return false;
376376}
trunk/src/osd/modules/lib/osdobj_common.h
r242962r242963
153153   virtual void customize_input_type_list(simple_list<input_type_entry> &typelist);
154154
155155   // font overridables
156   virtual osd_font *font_open(const char *name, int &height);
157   virtual void font_close(osd_font *font);
158   virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
156   virtual osd_font font_open(const char *name, int &height);
157   virtual void font_close(osd_font font);
158   virtual bool font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
159159
160160   // video overridables
161161   virtual void *get_slider_list();
trunk/src/osd/osdcore.c
r242962r242963
5353
5454output_delegate osd_set_output_channel(output_channel channel, output_delegate callback)
5555{
56   if (!(channel < OSD_OUTPUT_CHANNEL_COUNT) || callback.isnull())
57    {
58       throw std::exception();
59    }
56   assert(channel < OSD_OUTPUT_CHANNEL_COUNT);
57   assert(!callback.isnull());
6058
6159   /* return the originals if requested */
6260   output_delegate prevcb = output_cb[channel];
trunk/src/osd/osdepend.h
r242962r242963
2727//============================================================
2828
2929// FIXME: We can do better than this
30class osd_font;
30typedef void *osd_font;
3131
3232// ======================> osd_interface
3333
r242962r242963
5353   virtual void customize_input_type_list(simple_list<input_type_entry> &typelist) = 0;
5454
5555   // font overridables
56   virtual osd_font *font_open(const char *name, int &height) = 0;
57   virtual void font_close(osd_font *font) = 0;
58   virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) = 0;
56   virtual osd_font font_open(const char *name, int &height) = 0;
57   virtual void font_close(osd_font font) = 0;
58   virtual bool font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) = 0;
5959
6060   // video overridables
6161   virtual void *get_slider_list() = 0; // FIXME: returns slider_state *
trunk/src/osd/osdmini/minimain.c
r242962r242963
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
r242962r242963
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}
r242962r242963
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
r242962r242963
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
r242962r242963
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
r242962r242963
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#-------------------------------------------------
r242962r242963
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/osd/sdl/draw13.c
r242962r242963
134134    const HashT hash() const { return m_hash; }
135135    const UINT32 flags() const { return m_flags; }
136136    const bool is_pixels_owned() const { // do we own / allocated it ?
137        return false && ((m_sdl_access == SDL_TEXTUREACCESS_STATIC)
138                && (m_copyinfo->func != NULL)) ;
137        return m_sdl_access == SDL_TEXTUREACCESS_STATIC
138                && m_copyinfo->func != NULL ;
139139    }
140140
141141private:
142    Uint32              m_sdl_access;
143142    SDL_Renderer *      m_renderer;
144143    render_texinfo      m_texinfo;            // copy of the texture info
145144    HashT               m_hash;               // hash value for the texture (must be >= pointer size)
r242962r242963
150149
151150    int                 m_format;             // texture format
152151    SDL_BlendMode       m_sdl_blendmode;
152    Uint32              m_sdl_access;
153153
154154    texture_info *      m_next;               // next texture in the list
155155};
r242962r242963
490490   }
491491}
492492
493// FIXME: machine only used to access options.
494493int drawsdl2_init(running_machine &machine, sdl_draw_info *callbacks)
495494{
496495   const char *stemp;
r242962r242963
10081007
10091008texture_info::~texture_info()
10101009{
1011    if ( is_pixels_owned() && (m_pixels != NULL) )
1012        free(m_pixels);
10131010    SDL_DestroyTexture(m_texture_id);
1011    if ( is_pixels_owned() && m_pixels != NULL )
1012        free(m_pixels);
10141013}
10151014
10161015//============================================================
trunk/src/osd/sdl/osdsdl.h
r242962r242963
115115//  TYPE DEFINITIONS
116116//============================================================
117117
118typedef void *osd_font;
119
120//============================================================
121//  TYPE DEFINITIONS
122//============================================================
123
118124class sdl_options : public osd_options
119125{
120126public:
r242962r242963
187193   virtual void customize_input_type_list(simple_list<input_type_entry> &typelist);
188194
189195   // font overridables
190   virtual osd_font *font_open(const char *name, int &height);
191   virtual void font_close(osd_font *font);
192   virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
196   virtual osd_font font_open(const char *name, int &height);
197   virtual void font_close(osd_font font);
198   virtual bool font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
193199
194200   virtual void video_register();
195201   virtual void sound_register();
trunk/src/osd/sdl/sdlmain.c
r242962r242963
717717//  font with the given name
718718//-------------------------------------------------
719719
720class osd_font
720osd_font sdl_osd_interface::font_open(const char *_name, int &height)
721721{
722public:
723    CTFontRef m_font;
724};
725
726osd_font *sdl_osd_interface::font_open(const char *_name, int &height)
727{
728722   CFStringRef font_name = NULL;
729723   CTFontRef ct_font = NULL;
730724   CTFontDescriptorRef font_descriptor;
r242962r242963
776770   line_height += CTFontGetLeading(ct_font);
777771   height = ceilf(line_height * EXTRA_HEIGHT);
778772
779   osd_font *ret = global_alloc(osd_font);
780   ret->m_font = ct_font;
781   return ret;
773   return (osd_font)ct_font;
782774}
783775
784776//-------------------------------------------------
r242962r242963
786778//  a given OSD font
787779//-------------------------------------------------
788780
789void sdl_osd_interface::font_close(osd_font *font)
781void sdl_osd_interface::font_close(osd_font font)
790782{
791   CTFontRef ct_font = font->m_font;
783   CTFontRef ct_font = (CTFontRef)font;
792784
793785   if( ct_font != NULL )
794786   {
795787      CFRelease( ct_font );
796788   }
797   global_free(font);
798789}
799790
800791//-------------------------------------------------
r242962r242963
805796//  pixel of a black & white font
806797//-------------------------------------------------
807798
808bool sdl_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
799bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
809800{
810801   UniChar uni_char;
811802   CGGlyph glyph;
812   CTFontRef ct_font = font->m_font;
803   CTFontRef ct_font = (CTFontRef)font;
813804   const CFIndex count = 1;
814805   CGRect bounding_rect, success_rect;
815806   CGContextRef context_ref;
r242962r242963
10181009//  font with the given name
10191010//-------------------------------------------------
10201011
1021class osd_font
1012osd_font sdl_osd_interface::font_open(const char *_name, int &height)
10221013{
1023public:
1024    TTF_Font *m_font;
1025};
1026
1027osd_font *sdl_osd_interface::font_open(const char *_name, int &height)
1028{
10291014   TTF_Font *font = (TTF_Font *)NULL;
10301015   bool bakedstyles = false;
10311016   int style = 0;
r242962r242963
10961081
10971082   height = TTF_FontLineSkip(font);
10981083
1099   osd_font *ret = global_alloc(osd_font);
1100   ret->m_font = font;
1101   return ret;
1084   return (osd_font)font;
11021085}
11031086
11041087//-------------------------------------------------
r242962r242963
11061089//  a given OSD font
11071090//-------------------------------------------------
11081091
1109void sdl_osd_interface::font_close(osd_font *font)
1092void sdl_osd_interface::font_close(osd_font font)
11101093{
1111   TTF_CloseFont(font->m_font);
1112   global_free(font);
1094   TTF_Font *ttffont;
1095
1096   ttffont = (TTF_Font *)font;
1097
1098   TTF_CloseFont(ttffont);
11131099}
11141100
11151101//-------------------------------------------------
r242962r242963
11201106//  pixel of a black & white font
11211107//-------------------------------------------------
11221108
1123bool sdl_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
1109bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
11241110{
11251111   TTF_Font *ttffont;
11261112   SDL_Surface *drawsurf;
11271113   SDL_Color fcol = { 0xff, 0xff, 0xff };
11281114   UINT16 ustr[16];
11291115
1130   ttffont = font->m_font;
1116   ttffont = (TTF_Font *)font;
11311117
11321118   memset(ustr,0,sizeof(ustr));
11331119   ustr[0] = (UINT16)chnum;
trunk/src/osd/windows/winmain.c
r242962r242963
719719//  font with the given name
720720//-------------------------------------------------
721721
722osd_font *windows_osd_interface::font_open(const char *_name, int &height)
722osd_font windows_osd_interface::font_open(const char *_name, int &height)
723723{
724724   // accept qualifiers from the name
725725   astring name(_name);
r242962r242963
751751
752752   // create the font
753753   height = logfont.lfHeight;
754   osd_font *font = reinterpret_cast<osd_font *>(CreateFontIndirect(&logfont));
754   osd_font font = reinterpret_cast<osd_font>(CreateFontIndirect(&logfont));
755755   if (font == NULL)
756756      return NULL;
757757
r242962r242963
783783//  a given OSD font
784784//-------------------------------------------------
785785
786void windows_osd_interface::font_close(osd_font *font)
786void windows_osd_interface::font_close(osd_font font)
787787{
788788   // delete the font ojbect
789789   if (font != NULL)
r242962r242963
799799//  pixel of a black & white font
800800//-------------------------------------------------
801801
802bool windows_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
802bool windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
803803{
804804   // create a dummy DC to work with
805805   HDC dummyDC = CreateCompatibleDC(NULL);
trunk/src/osd/windows/winmain.h
r242962r242963
253253   virtual void customize_input_type_list(simple_list<input_type_entry> &typelist);
254254
255255   // font overridables
256   virtual osd_font *font_open(const char *name, int &height);
257   virtual void font_close(osd_font *font);
258   virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
256   virtual osd_font font_open(const char *name, int &height);
257   virtual void font_close(osd_font font);
258   virtual bool font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
259259
260260   virtual void video_register();
261261   virtual void sound_register();
trunk/src/tools/chdman.c
r242962r242963
29232923            (*s_commands[cmdnum].handler)(parameters);
29242924            return 0;
29252925         }
2926         catch (chd_error &err)
2927         {
2928            fprintf(stderr, "CHD error occured (main): %s\n", chd_file::error_string(err));
2929            return 1;
2930         }
29312926         catch (fatal_error &err)
29322927         {
2933            fprintf(stderr, "Fatal error occured: %d\n", err.error());
29342928            return err.error();
29352929         }
29362930         catch (std::exception& ex)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team