Previous 199869 Revisions Next

r34720 Wednesday 28th January, 2015 at 07:58:54 UTC by Couriersud
Merge branch 'master' of https://github.com/mamedev/mame.git
[/trunk]makefile
[src/build]flags_clang.mak
[src/emu/bus/nes_ctrl]miracle.c miracle.h
[src/mame]mame.lst
[src/mame/drivers]gumbo.c peplus.c psikyosh.c
[src/mame/machine]315-5838_317-0229_comp.c 315-5838_317-0229_comp.h
[src/mess/drivers]bw12.c vt100.c
[src/osd/modules/sound]js_sound.c
[src/osd/sdl]video.c

trunk/makefile
r243231r243232
607607# warnings only applicable to C++ compiles
608608CPPONLYFLAGS += \
609609   -Woverloaded-virtual
610   
611include $(SRC)/build/cc_detection.mak
612610
613611ifdef SANITIZE
614612CCOMFLAGS += -fsanitize=$(SANITIZE)
613
615614ifneq (,$(findstring thread,$(SANITIZE)))
616615CCOMFLAGS += -fPIE
617616endif
618ifneq (,$(findstring memory,$(SANITIZE)))
619ifneq (,$(findstring clang,$(CC)))
620CCOMFLAGS += -fsanitize-memory-track-origins -fPIE
621617endif
622endif
623ifneq (,$(findstring undefined,$(SANITIZE)))
624ifneq (,$(findstring clang,$(CC)))
625# TODO: check if linker is clang++
626# produces a lot of messages - disable it for now
627CCOMFLAGS += -fno-sanitize=alignment
628# these are false positives because of the way our delegates work
629CCOMFLAGS += -fno-sanitize=function
630# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled
631CCOMFLAGS += -fno-sanitize=shift
632# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/hd6309.c when this isn't disabled
633CCOMFLAGS += -fno-sanitize=object-size
634# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/konami.c, src/emu/cpu/m6809/hd6309.c, src/emu/video/psx.c when this isn't disabled
635CCOMFLAGS += -fno-sanitize=vptr
636# clang takes forever to compile src/emu/video/psx.c when this isn't disabled
637CCOMFLAGS += -fno-sanitize=null
638# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled
639CCOMFLAGS += -fno-sanitize=signed-integer-overflow
640endif
641endif
642endif
643618
619include $(SRC)/build/cc_detection.mak
620
644621#-------------------------------------------------
645622# include paths
646623#-------------------------------------------------
trunk/src/build/flags_clang.mak
r243231r243232
99# caused by src/mame/video/jagblit.inc on older clang versions
1010CCOMFLAGS += -Wno-constant-logical-operand
1111
12ifneq (,$(findstring undefined,$(SANITIZE)))
13# TODO: check if linker is clang++
14# produces a lot of messages - disable it for now
15CCOMFLAGS += -fno-sanitize=alignment
16# these are false positives because of the way our delegates work
17CCOMFLAGS += -fno-sanitize=function
18endif
19
20ifneq (,$(findstring memory,$(SANITIZE)))
21CCOMFLAGS += -fsanitize-memory-track-origins -fPIE
22endif
23
1224# TODO: needs to use $(CC)
1325TEST_CLANG := $(shell clang --version)
1426
r243231r243232
2941CCOMFLAGS += -Wno-unknown-warning-option
3042# XCode 6.0.1 gives this when using SDL2 in /Library/Frameworks/SDL2.framework/Headers/SDL_syswm.h:150 included from src/osd/sdl/sdlinc.h
3143CCOMFLAGS += -Wno-extern-c-compat
44
45ifneq (,$(findstring undefined,$(SANITIZE)))
46# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled
47CCOMFLAGS += -fno-sanitize=shift
48# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/hd6309.c when this isn't disabled
49CCOMFLAGS += -fno-sanitize=object-size
50# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/konami.c, src/emu/cpu/m6809/hd6309.c, src/emu/video/psx.c when this isn't disabled
51CCOMFLAGS += -fno-sanitize=vptr
52# clang takes forever to compile src/emu/video/psx.c when this isn't disabled
53CCOMFLAGS += -fno-sanitize=null
54# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled
55CCOMFLAGS += -fno-sanitize=signed-integer-overflow
3256endif
57endif
3358
3459ifeq ($(TARGETOS),emscripten)
3560CCOMFLAGS += -Qunused-arguments
trunk/src/emu/bus/nes_ctrl/miracle.c
r243231r243232
1111**********************************************************************/
1212
1313#include "miracle.h"
14#include "bus/midi/midi.h"
1514
1615#define MIRACLE_MIDI_WAITING 0
17#define MIRACLE_MIDI_RECEIVE 1
18#define MIRACLE_MIDI_SEND 2
16#define MIRACLE_MIDI_RECEIVE 1      // receive byte from piano
17#define MIRACLE_MIDI_SEND 2         // send byte to piano
1918
2019//**************************************************************************
2120//  DEVICE DEFINITIONS
r243231r243232
2524
2625
2726MACHINE_CONFIG_FRAGMENT( nes_miracle )
28//   MCFG_CPU_ADD("piano_cpu", I8051, XTAL_11_0592MHz)   // xtal to be verified
29
3027   MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin")
3128   MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout")
3229MACHINE_CONFIG_END
r243231r243232
5855//-------------------------------------------------
5956
6057nes_miracle_device::nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
61               device_t(mconfig, NES_MIRACLE, "Miracle Piano Controller", tag, owner, clock, "nes_miracle", __FILE__)
62               , device_nes_control_port_interface(mconfig, *this)
63//               , m_cpu(*this, "piano_cpu")
58               device_t(mconfig, NES_MIRACLE, "Miracle Piano Controller", tag, owner, clock, "nes_miracle", __FILE__),
59               device_serial_interface(mconfig, *this),
60               device_nes_control_port_interface(mconfig, *this),
61               m_midiin(*this, "mdin"),
62               m_midiout(*this, "mdout")
6463{
6564}
6665
r243231r243232
9089   m_sent_bits = 0;
9190   m_strobe_clock = 0;
9291   m_midi_mode = MIRACLE_MIDI_WAITING;
92
93   // set standard MIDI parameters
94   set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1);
95   set_rcv_rate(31250);
96   set_tra_rate(31250);
97
98   m_xmit_read = m_xmit_write = 0;
99   m_tx_busy = false;
93100}
94101
95102
r243231r243232
102109UINT8 nes_miracle_device::read_bit0()
103110{
104111   UINT8 ret = 0;
105   if (m_strobe_clock >= 66)
106   {
107      // more than 66 clocks since strobe on write means send mode
108      m_midi_mode = MIRACLE_MIDI_SEND;
109      strobe_timer->reset();
110      m_strobe_on = 0;
111      m_strobe_clock = 0;
112//      printf("send start\n");
113   }
114112
115   if (m_midi_mode == MIRACLE_MIDI_SEND)
113   if (m_midi_mode == MIRACLE_MIDI_RECEIVE)
116114   {
117115      //NES reads from Miracle Piano!
118116      // ret |= ...
r243231r243232
126124//-------------------------------------------------
127125
128126// TODO: here, writes to serial midi in bit0, when in MIDI_RECEIVE mode
127// c4fc = start of recv routine
128// c53a = start of send routine
129129
130130void nes_miracle_device::write(UINT8 data)
131131{
132//   printf("write: %d (%d %02x %d)\n", data & 1, m_sent_bits, m_data_sent, m_midi_mode);
133
134   if (m_midi_mode == MIRACLE_MIDI_SEND)
135   {
136      //NES writes (data & 1) to Miracle Piano!
137      // 1st write is data present flag (1=data present)
138      // next 8 writes are actual data bits (with ^1)
139      m_sent_bits++;
140      m_data_sent <<= 1;
141      m_data_sent |= (data & 1);
142      // then we go back to waiting
143      if (m_sent_bits == 8)
144      {
145//         printf("xmit MIDI byte %02x\n", m_data_sent);
146         xmit_char(m_data_sent);
147         m_midi_mode = MIRACLE_MIDI_WAITING;
148         m_sent_bits = 0;
149      }
150
151      return;
152   }
153
132154   if (data == 1 && !m_strobe_on)
133155   {
134156      strobe_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1));
r243231r243232
141163      // was timer running?
142164      if (m_strobe_clock > 0)
143165      {
166//         printf("got strobe at %d clocks\n", m_strobe_clock);
167
144168         if (m_strobe_clock < 66 && data == 0)
145169         {
146            // less than 66 clocks before new write means receive mode
170            // short delay is recieve mode
147171            m_midi_mode = MIRACLE_MIDI_RECEIVE;
148//            printf("receive start\n");
149172            strobe_timer->reset();
150173            m_strobe_on = 0;
151174            m_strobe_clock = 0;
152175            return;
153176         }
177         else if (m_strobe_clock >= 66)
178         {
179            // more than 66 clocks since strobe on write means send mode
180            m_midi_mode = MIRACLE_MIDI_SEND;
181            strobe_timer->reset();
182            m_strobe_on = 0;
183            m_strobe_clock = 0;
184            m_sent_bits = 1;
185            m_data_sent <<= 1;
186            m_data_sent |= (data & 1);
187            return;
188         }
154189      }
155190
156191      if (m_midi_mode == MIRACLE_MIDI_SEND &&  data == 0)
157192      {
158193         // strobe off after the end of a byte
159194         m_midi_mode = MIRACLE_MIDI_WAITING;
160//         printf("send end\n");
161195      }
162196   }
197}
163198
164   if (m_midi_mode == MIRACLE_MIDI_RECEIVE)
199void nes_miracle_device::rcv_complete()    // Rx completed receiving byte
200{
201   receive_register_extract();
202//   UINT8 rcv = get_received_char();
203}
204
205void nes_miracle_device::tra_complete()    // Tx completed sending byte
206{
207//  printf("Tx complete\n");
208   // is there more waiting to send?
209   if (m_xmit_read != m_xmit_write)
165210   {
166      //NES writes (data & 1) to Miracle Piano!
167      // 1st write is data present flag (1=data present)
168      // next 8 writes are actual data bits (with ^1)
169      m_sent_bits++;
170      // then we go back to waiting
171      if (m_sent_bits == 9)
211      transmit_register_setup(m_xmitring[m_xmit_read++]);
212      if (m_xmit_read >= XMIT_RING_SIZE)
172213      {
173//         printf("receive end\n");
174         m_midi_mode = MIRACLE_MIDI_WAITING;
175         m_sent_bits = 0;
214         m_xmit_read = 0;
176215      }
177216   }
217   else
218   {
219      m_tx_busy = false;
220   }
178221}
222
223void nes_miracle_device::tra_callback()    // Tx send bit
224{
225   // send this to midi out
226   m_midiout->write_txd(transmit_register_get_data_bit());
227}
228
229void nes_miracle_device::xmit_char(UINT8 data)
230{
231//  printf("xmit %02x\n", data);
232
233   // if tx is busy it'll pick this up automatically when it completes
234   // if not, send now!
235   if (!m_tx_busy)
236   {
237      m_tx_busy = true;
238      transmit_register_setup(data);
239   }
240   else
241   {
242      // tx is busy, it'll pick this up next time
243      m_xmitring[m_xmit_write++] = data;
244      if (m_xmit_write >= XMIT_RING_SIZE)
245      {
246         m_xmit_write = 0;
247      }
248   }
249}
250
trunk/src/emu/bus/nes_ctrl/miracle.h
r243231r243232
1515
1616#include "emu.h"
1717#include "ctrl.h"
18//#include "cpu/mcs51/mcs51.h"
18#include "bus/midi/midi.h"
1919
2020//**************************************************************************
2121//  TYPE DEFINITIONS
r243231r243232
2424// ======================> nes_miracle_device
2525
2626class nes_miracle_device : public device_t,
27                     public device_serial_interface,
2728                     public device_nes_control_port_interface
2829{
2930public:
31   static const int XMIT_RING_SIZE = 16;
32
3033   // construction/destruction
3134   nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3235
3336   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
3437   virtual machine_config_constructor device_mconfig_additions() const;
3538
39   // serial overrides
40   virtual void rcv_complete();    // Rx completed receiving byte
41   virtual void tra_complete();    // Tx completed sending byte
42   virtual void tra_callback();    // Tx send bit
43
44   void xmit_char(UINT8 data);
45
46   required_device<midi_port_device> m_midiin, m_midiout;
47
3648protected:
3749   // device-level overrides
3850   virtual void device_start();
r243231r243232
4456   static const device_timer_id TIMER_STROBE_ON = 0;
4557   emu_timer *strobe_timer;
4658
47   //required_device<i8051_device> m_cpu;
4859   int m_strobe_on, m_midi_mode, m_sent_bits;
4960   UINT32 m_strobe_clock;
61   UINT8 m_data_sent;
62   UINT8 m_xmitring[XMIT_RING_SIZE];
63   int m_xmit_read, m_xmit_write;
64   bool m_tx_busy;
5065};
5166
5267// device type definition
trunk/src/mame/drivers/gumbo.c
r243231r243232
229229
230230static MACHINE_CONFIG_START( gumbo, gumbo_state )
231231
232   MCFG_CPU_ADD("maincpu", M68000, 14318180 /2)     // or 10mhz? ?
232   MCFG_CPU_ADD("maincpu", M68000, XTAL_14_31818MHz/2)
233233   MCFG_CPU_PROGRAM_MAP(gumbo_map)
234234   MCFG_CPU_VBLANK_INT_DRIVER("screen", gumbo_state,  irq1_line_hold) // all the same
235235
r243231r243232
248248
249249   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
250250
251   MCFG_OKIM6295_ADD("oki", 1122000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
251   MCFG_OKIM6295_ADD("oki", XTAL_14_31818MHz/16, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
252252   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.47)
253253   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.47)
254254MACHINE_CONFIG_END
trunk/src/mame/drivers/peplus.c
r243231r243232
51125112   ROM_LOAD( "cap960.u50", 0x0000, 0x0100, CRC(00dd8d0a) SHA1(542763b12aeb0aec2b410f7c075c52907f45d171) )
51135113ROM_END
51145114
5115ROM_START( peps0366 ) /* Normal board : Double Diamonds Deluxe Slots (PS0366) - Payout 94.99% */
5116   ROM_REGION( 0x10000, "maincpu", 0 )
5117   ROM_LOAD( "ps0366_569-a2c.u68",   0x00000, 0x10000, CRC(32fd35c5) SHA1(8562608bc45328559b7c04ef4026384862bf2d51) ) /* 2 Coins Max / 1 Line */
5118
5119   ROM_REGION( 0x020000, "gfx1", 0 )
5120   ROM_LOAD( "mro-cg1303.u72",  0x00000, 0x8000, CRC(f5bcc47f) SHA1(b132960a095996d1790df4dcedf14a29169fe667) )
5121   ROM_LOAD( "mgo-cg1303.u73",  0x08000, 0x8000, CRC(e16cc01b) SHA1(086f2ac533d868dbaa3852516b6fef344dddff13) )
5122   ROM_LOAD( "mbo-cg1303.u74",  0x10000, 0x8000, CRC(2c1ffea2) SHA1(efc16869f994415a03663205ca2396e4c26e25a3) )
5123   ROM_LOAD( "mxo-cg1303.u75",  0x18000, 0x8000, CRC(7c4578e0) SHA1(70b6cf02225a4804592f44c90365f370fb83281a) )
5124
5125   ROM_REGION( 0x100, "proms", 0 )
5126   ROM_LOAD( "cap1303.u50", 0x0000, 0x0100, CRC(5341ea30) SHA1(63c8f7fa94dcb772c308b307f755a188b9b5e7eb) )
5127ROM_END
5128
5129ROM_START( peps0372 ) /* Normal board : Double Diamonds Deluxe Slots (PS0372) - Payout 90.10% */
5130   ROM_REGION( 0x10000, "maincpu", 0 )
5131   ROM_LOAD( "ps0372_569-a2c.u68",   0x00000, 0x10000, CRC(45573591) SHA1(0a15313af506817528eb7319a0994b6993412965) ) /* 3 Coins Max / 1 Line */
5132
5133   ROM_REGION( 0x020000, "gfx1", 0 )
5134   ROM_LOAD( "mro-cg1303.u72",  0x00000, 0x8000, CRC(f5bcc47f) SHA1(b132960a095996d1790df4dcedf14a29169fe667) )
5135   ROM_LOAD( "mgo-cg1303.u73",  0x08000, 0x8000, CRC(e16cc01b) SHA1(086f2ac533d868dbaa3852516b6fef344dddff13) )
5136   ROM_LOAD( "mbo-cg1303.u74",  0x10000, 0x8000, CRC(2c1ffea2) SHA1(efc16869f994415a03663205ca2396e4c26e25a3) )
5137   ROM_LOAD( "mxo-cg1303.u75",  0x18000, 0x8000, CRC(7c4578e0) SHA1(70b6cf02225a4804592f44c90365f370fb83281a) )
5138
5139   ROM_REGION( 0x100, "proms", 0 )
5140   ROM_LOAD( "cap1303.u50", 0x0000, 0x0100, CRC(5341ea30) SHA1(63c8f7fa94dcb772c308b307f755a188b9b5e7eb) )
5141ROM_END
5142
5143ROM_START( peps0373 ) /* Normal board : Double Diamonds Deluxe Slots (PS0373) - Payout 87.56% */
5144   ROM_REGION( 0x10000, "maincpu", 0 )
5145   ROM_LOAD( "ps0373_583-a6c.u68",   0x00000, 0x10000, CRC(085bed76) SHA1(8775f7c9654f92eab616cdda4505cbde30154889) ) /* 3 Coins Max / 1 Line */
5146
5147   ROM_REGION( 0x020000, "gfx1", 0 )
5148   ROM_LOAD( "mro-cg1303.u72",  0x00000, 0x8000, CRC(f5bcc47f) SHA1(b132960a095996d1790df4dcedf14a29169fe667) )
5149   ROM_LOAD( "mgo-cg1303.u73",  0x08000, 0x8000, CRC(e16cc01b) SHA1(086f2ac533d868dbaa3852516b6fef344dddff13) )
5150   ROM_LOAD( "mbo-cg1303.u74",  0x10000, 0x8000, CRC(2c1ffea2) SHA1(efc16869f994415a03663205ca2396e4c26e25a3) )
5151   ROM_LOAD( "mxo-cg1303.u75",  0x18000, 0x8000, CRC(7c4578e0) SHA1(70b6cf02225a4804592f44c90365f370fb83281a) )
5152
5153   ROM_REGION( 0x100, "proms", 0 )
5154   ROM_LOAD( "cap1303.u50", 0x0000, 0x0100, CRC(5341ea30) SHA1(63c8f7fa94dcb772c308b307f755a188b9b5e7eb) )
5155ROM_END
5156
51155157ROM_START( peps0426 ) /* Normal board : Sizzling Sevens Slots (PS0268) - Payout 90.35% */
51165158   ROM_REGION( 0x10000, "maincpu", 0 )
51175159   ROM_LOAD( "ps0426_571-a3h.u68",   0x00000, 0x10000, CRC(b53771c1) SHA1(23fccd5facb98fc83b8903946435be4f15199ff8) ) /* 3 Coins Max / 1 Lines */
r243231r243232
92489290GAMEL(1996, peps0298, peps0042, peplus, peplus_slots,   peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PS0298) Double Diamond Slots",          0, layout_pe_slots )
92499291GAMEL(1996, peps0308, 0,        peplus, peplus_slots,   peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PS0308) Double Jackpot Slots",          0, layout_pe_slots )
92509292GAMEL(1996, peps0364, peps0021, peplus, peplus_slots,   peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PS0364) Red White & Blue Slots",        0, layout_pe_slots )
9293GAMEL(1996, peps0366, 0,        peplus, peplus_slots,   peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PS0366) Double Diamond Deluxe Slots",   0, layout_pe_slots )
9294GAMEL(1996, peps0372, peps0366, peplus, peplus_slots,   peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PS0372) Double Diamond Deluxe Slots",   0, layout_pe_slots )
9295GAMEL(1996, peps0373, peps0366, peplus, peplus_slots,   peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PS0373) Double Diamond Deluxe Slots",   0, layout_pe_slots )
92519296GAMEL(1996, peps0426, 0,        peplus, peplus_slots,   peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PS0426) Sizzling Sevens Slots",         0, layout_pe_slots )
92529297GAMEL(1996, peps0581, peps0021, peplus, peplus_slots,   peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PS0581) Red White & Blue Slots",        0, layout_pe_slots )
92539298GAMEL(1996, peps0615, 0,        peplus, peplus_slots,   peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (PS0615) Chaos Slots",                   0, layout_pe_slots )
trunk/src/mame/drivers/psikyosh.c
r243231r243232
778778
779779   MCFG_SCREEN_ADD("screen", RASTER)
780780   MCFG_SCREEN_REFRESH_RATE(60)
781   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
782781   MCFG_SCREEN_SIZE(64*8, 32*8)
783782   MCFG_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 28*8-1)
784783   MCFG_SCREEN_UPDATE_DRIVER(psikyosh_state, screen_update_psikyosh)
r243231r243232
813812   MCFG_CPU_MODIFY("maincpu")
814813   MCFG_CPU_PROGRAM_MAP(ps5_map)
815814
815   /* Measured Hsync 16.165 KHz, Vsync 61.68 Hz */
816816   /* Ideally this would be driven off the video register. However, it doesn't changeat runtime and MAME will pick a better screen resolution if it knows upfront */
817817   MCFG_SCREEN_MODIFY("screen")
818   MCFG_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 30*8-1)
818   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/8, 443, 0, 40*8, 262, 0, 30*8)
819819MACHINE_CONFIG_END
820820
821821
trunk/src/mame/machine/315-5838_317-0229_comp.c
r243231r243232
1010   dumb security check, decompressing a single string.
1111
1212   Each channel appears to be connected to a different set of ROMs, however there is
13   defintiely only 315-5838 single chip.
13   defintiely only a single 315-5838 chip. (could the different channels actually just
14   be mirror addresses, with part of the address determining the ROMs to use?)
1415
1516   Dead of Alive only uses a single channel, and has the source data in RAM, not ROM.
1617   This is similar to how some 5881 games were set up, with the ST-V versions decrypting
r243231r243232
1819
1920   Looking at the values read I don't think there is any address based encryption, for
2021   example many blocks where you'd expect a zero fill start with repeating patterns
21   of 8f708f70 (different lengths) which would appear to relate to compressed 0x00 data
22   of 8f708f70 (different lengths) channel would appear to relate to compressed 0x00 data
2223
2324   read addr 0071253c, blah_r 8f708f70 - read count count 00000004
2425   read addr 00712540, blah_r 8f708f70 - read count count 00000008
r243231r243232
4647
4748void sega_315_5838_comp_device::device_start()
4849{
49   m_decathlt_lastcount = 0;
50   m_decathlt_prot_uploadmode = 0;
51   m_decathlt_prot_uploadoffset = 0;
50   for (int i = 0; i < 2; i++)
51   {
52      m_channel[i].m_decathlt_lastcount = 0;
53      m_channel[i].m_decathlt_prot_uploadmode = 0;
54      m_channel[i].m_decathlt_prot_uploadoffset = 0;
55      m_channel[i].m_read_ch.bind_relative_to(*owner());
5256
53   m_read_ch1.bind_relative_to(*owner());
54   m_read_ch2.bind_relative_to(*owner());
57   }
5558}
5659
5760void sega_315_5838_comp_device::device_reset()
5861{
59   memset(m_decathlt_protregs, 0, sizeof(m_decathlt_protregs));
60   m_decathlt_lastcount = 0;
61   m_decathlt_prot_uploadmode = 0;
62   m_decathlt_prot_uploadoffset = 0;
63   m_decathlt_part = 1;
62   for (int i = 0; i < 2; i++)
63   {
64      m_channel[i].m_srcoffset = 0;
65      m_channel[i].m_decathlt_lastcount = 0;
66      m_channel[i].m_decathlt_prot_uploadmode = 0;
67      m_channel[i].m_decathlt_prot_uploadoffset = 0;
68   }
6469
6570   m_protstate = 0;
6671}
r243231r243232
7782#endif
7883
7984
80READ32_MEMBER(sega_315_5838_comp_device::decathlt_prot_r)
85READ32_MEMBER(sega_315_5838_comp_device::decathlt_prot1_r)
8186{
82   return genericdecathlt_prot_r(offset, mem_mask, 0);
87   return genericdecathlt_prot_r(mem_mask, 0);
8388}
8489
85READ32_MEMBER(sega_315_5838_comp_device::decathlt_prot_ch2_r)
90READ32_MEMBER(sega_315_5838_comp_device::decathlt_prot2_r)
8691{
87   return genericdecathlt_prot_r(offset, mem_mask, 1);
92   return genericdecathlt_prot_r(mem_mask, 1);
8893}
8994
9095
91UINT32 sega_315_5838_comp_device::genericdecathlt_prot_r(UINT32 offset, UINT32 mem_mask, int which)
96UINT32 sega_315_5838_comp_device::genericdecathlt_prot_r(UINT32 mem_mask, int channel)
9297{
93
9498//   UINT32 *fake0 = (UINT32*)memregion( ":fake0" )->base();
99//   UINT32 retvalue = 0xffff;
95100
96   if (offset==2)
101   switch (m_channel[channel].m_srcoffset)
97102   {
98//      UINT32 retvalue = 0xffff;
103      default:
99104
100      switch (m_decathlt_protregs[0])
101      {
102         default:
105      m_channel[channel].m_decathlt_lastcount++;
103106
104         m_decathlt_lastcount++;
107      UINT32 tempdata = 0;
108      tempdata |= m_channel[channel].m_read_ch(m_channel[channel].m_srcoffset) << 0;
109      m_channel[channel].m_srcoffset++;
110      tempdata |= m_channel[channel].m_read_ch(m_channel[channel].m_srcoffset) << 16;
111      m_channel[channel].m_srcoffset++;
105112
106         UINT32 tempdata = 0;
107113
108         if (which == 0)
109         {
110            tempdata |= m_read_ch1(m_decathlt_protregs[0]) << 16;
111            m_decathlt_protregs[0]++;
112            tempdata |= m_read_ch1(m_decathlt_protregs[0]) << 0;
113            m_decathlt_protregs[0]++;
114         }
115         else
116         {
117            tempdata |= m_read_ch2(m_decathlt_protregs[0]) << 16;
118            m_decathlt_protregs[0]++;
119            tempdata |= m_read_ch2(m_decathlt_protregs[0]) << 0;
120            m_decathlt_protregs[0]++;
121         }
114      #ifdef DEBUG_DATA_DUMP
115      //printf("read addr %08x, blah_r %08x - read count count %08x\n", m_channel[channel].m_srcoffset*2, tempdata,  m_channel[channel].m_decathlt_lastcount*4);
116      fwrite(&tempdata, 1, 4, tempfile);
117      #else
118      logerror("read addr %08x, blah_r %08x - read count count %08x\n", m_channel[channel].m_srcoffset*2, tempdata,  m_channel[channel].m_decathlt_lastcount*4);
119      #endif
122120
123         #ifdef DEBUG_DATA_DUMP
124         //printf("read addr %08x, blah_r %08x - read count count %08x\n", m_decathlt_protregs[0]*2, tempdata,  m_decathlt_lastcount*4);
125         fwrite(&tempdata, 1, 4, tempfile);
126         #else
127         logerror("read addr %08x, blah_r %08x - read count count %08x\n", m_decathlt_protregs[0]*2, tempdata,  m_decathlt_lastcount*4);
128         #endif
129
130         return tempdata;
121      return tempdata;
131122#if 0
132         case 0x03228e4:
133            if (fake0) retvalue = fake0[(((0x20080/4)+m_decathlt_lastcount))];
134            m_decathlt_lastcount++;
135            return retvalue;
123      case 0x03228e4:
124         if (fake0) retvalue = fake0[(((0x20080/4)+m_channel[channel].m_decathlt_lastcount))];
125         m_channel[channel].m_decathlt_lastcount++;
126         return retvalue;
136127
137         case 0x00a9f3a:
138            if (fake0) retvalue = fake0[(((0x00000/4)+m_decathlt_lastcount))];
139            m_decathlt_lastcount++;
140            return retvalue;
128      case 0x00a9f3a:
129         if (fake0) retvalue = fake0[(((0x00000/4)+m_channel[channel].m_decathlt_lastcount))];
130         m_channel[channel].m_decathlt_lastcount++;
131         return retvalue;
141132
142         case 0x0213ab4:
143            if (fake0) retvalue = fake0[(((0x40000/4)+m_decathlt_lastcount))];
144            m_decathlt_lastcount++;
145            return retvalue;
133      case 0x0213ab4:
134         if (fake0) retvalue = fake0[(((0x40000/4)+m_channel[channel].m_decathlt_lastcount))];
135         m_channel[channel].m_decathlt_lastcount++;
136         return retvalue;
146137
147         case 0x01efaf0:
148            if (fake0) retvalue = fake0[(((0x60000/4)+m_decathlt_lastcount))];
149            m_decathlt_lastcount++;
150            return retvalue;
138      case 0x01efaf0:
139         if (fake0) retvalue = fake0[(((0x60000/4)+m_channel[channel].m_decathlt_lastcount))];
140         m_channel[channel].m_decathlt_lastcount++;
141         return retvalue;
151142
152         case 0x033f16c:
153         case 0x038929c:
143      case 0x033f16c:
144      case 0x038929c:
154145
155146
156147
157         case 0x00de05a:
158         case 0x0334258:
159         case 0x019fb82:
160         case 0x033dbf6:
161         case 0x0011ac6:
162         case 0x00060dc:
163         case 0x0000002:
164         case 0x0008c90:
165         case 0x035cdc8:
166         case 0x0327960:
167         case 0x0329b8c:
168         case 0x00d6e92:
169         case 0x000081e:
170         case 0x00035d6:
171         case 0x00089a6:
172         case 0x03315f4:
173         case 0x0023fe0:
174         case 0x001e290:
175         case 0x0026e86:
176         case 0x0012494:
177         case 0x001b35a:
178         case 0x0018424:
148      case 0x00de05a:
149      case 0x0334258:
150      case 0x019fb82:
151      case 0x033dbf6:
152      case 0x0011ac6:
153      case 0x00060dc:
154      case 0x0000002:
155      case 0x0008c90:
156      case 0x035cdc8:
157      case 0x0327960:
158      case 0x0329b8c:
159      case 0x00d6e92:
160      case 0x000081e:
161      case 0x00035d6:
162      case 0x00089a6:
163      case 0x03315f4:
164      case 0x0023fe0:
165      case 0x001e290:
166      case 0x0026e86:
167      case 0x0012494:
168      case 0x001b35a:
169      case 0x0018424:
179170
180            return retvalue;
171         return retvalue;
181172#endif
182      }
183
184
185173   }
186   else
187   {
188      logerror("%06x Decathlete prot R offset %04x mask %08x regs %08x, %08x, %08x, %08x\n", safe_pc(), offset, mem_mask, m_decathlt_protregs[0], m_decathlt_protregs[1], m_decathlt_protregs[2], m_decathlt_protregs[3]);
189   }
190174
191   return m_decathlt_protregs[offset];
175   return 0xffffffff;
192176}
193177
194
195void sega_315_5838_comp_device::write_prot_data(UINT32 data, UINT32 mem_mask, int offset, int which)
178void sega_315_5838_comp_device::set_prot_addr(UINT32 data, UINT32 mem_mask, int channel)
196179{
180//   printf("set_prot_addr\n");
181   COMBINE_DATA(&m_channel[channel].m_srcoffset);
197182
198   printf("write_prot_data %08x %08x %08x\n", offset, data, mem_mask);
183   //if (m_decathlt_part==0) logerror("%d, last read count was %06x\n",channel, m_channel[channel].m_decathlt_lastcount*4);
184   m_channel[channel].m_decathlt_lastcount = 0;
199185
200   m_decathlt_protregs[offset] = (data&mem_mask)|(m_decathlt_protregs[offset]&~mem_mask);
201//  m_decathlt_protregs[0] = 0x0c00000/4;
202
203   if (offset==0) // seems to set a source address
186   if (mem_mask == 0x0000ffff)
204187   {
205      m_decathlt_part ^=1;
188      printf("set source address to %08x (channel %d)\n", m_channel[channel].m_srcoffset, channel);
189   }
206190
207      //if (m_decathlt_part==0) logerror("%d, last read count was %06x\n",which, m_decathlt_lastcount*4);
208      m_decathlt_lastcount = 0;
209      if (m_decathlt_part==1) logerror("%d Decathlete prot W offset %04x data %08x, %08x, >>> regs %08x <<<<, %08x, %08x, %08x\n",which, offset, data, m_decathlt_protregs[0], m_decathlt_protregs[0]*4, m_decathlt_protregs[1], m_decathlt_protregs[2], m_decathlt_protregs[3]);
210191
211192#ifdef DEBUG_DATA_DUMP
212      if (mem_mask == 0x0000ffff)
193   if (mem_mask == 0x0000ffff)
194   {
195      if (tempfile)
196         fclose(tempfile);
197
198      char filename[256];
199      sprintf(filename, "%d_compressed_%08x", channel, m_channel[channel].m_srcoffset * 2);
200      tempfile = fopen(filename, "w+b");
201
202      // the table and dictionary are uploaded repeatedly, usually before groups of data transfers but
203      // it's always the same tables (one pair for each channel)
213204      {
214         if (tempfile)
215            fclose(tempfile);
205         FILE* fp;
206         sprintf(filename, "%d_compressed_table1", channel);
207         fp = fopen(filename, "w+b");
208         fwrite(&m_channel[channel].m_decathlt_prottable1, 24, 2, fp);
209         fclose(fp);
210      }
216211
217         char filename[256];
218         sprintf(filename, "%d_compressed_%08x", which, m_decathlt_protregs[0] );
219         tempfile = fopen(filename, "w+b");
212      {
213         FILE* fp;
214         sprintf(filename, "%d_compressed_dictionary", channel);
215         fp = fopen(filename, "w+b");
216         fwrite(&m_channel[channel].m_decathlt_dictionary, 128, 2, fp);
217         fclose(fp);
220218      }
219   }
221220#endif
222221
222}
223
224void sega_315_5838_comp_device::set_upload_mode(UINT16 data, int channel)
225{
226   if ((data == 0x8000) || (data == 0x0000))
227   {
228   //  logerror("changed to upload mode 1\n");
229      m_channel[channel].m_decathlt_prot_uploadmode = 1;
230      m_channel[channel].m_decathlt_prot_uploadoffset = 0;
223231   }
232   else if ((data == 0x8080) || (data == 0x0080))
233   {
234      m_channel[channel].m_decathlt_prot_uploadmode = 2;
235      m_channel[channel].m_decathlt_prot_uploadoffset = 0;
236   }
237   else
238   {
239      fatalerror("unknown upload mode\n");
240   }
241}
224242
225   if (offset==1) // uploads 2 tables...
243void sega_315_5838_comp_device::upload_table_data(UINT16 data, int channel)
244{
245   if (m_channel[channel].m_decathlt_prot_uploadmode == 1)
226246   {
227      if (mem_mask==0xffff0000)
247      if (m_channel[channel].m_decathlt_prot_uploadoffset >= 24)
228248      {
229         if (data == 0x80000000)
230         {
231         //  logerror("changed to upload mode 1\n");
232            m_decathlt_prot_uploadmode = 1;
233            m_decathlt_prot_uploadoffset = 0;
234         }
235         else if (data == 0x80800000)
236         {
237         //  logerror("changed to upload mode 2\n");
238            m_decathlt_prot_uploadmode = 2;
239            m_decathlt_prot_uploadoffset = 0;
240         }
241         else
242         {
243         //  logerror("unknown upload mode\n");
244            m_decathlt_prot_uploadmode = 2;
245            m_decathlt_prot_uploadoffset = 0;
246         }
247
248//          logerror("ARGH! %08x %08x\n",mem_mask,data);
249         fatalerror("upload mode 1 error, too big\n");
250         return;
249251      }
250      else if (mem_mask==0x0000ffff)
251      {
252         if (m_decathlt_prot_uploadmode==1)
253         {
254            if (m_decathlt_prot_uploadoffset>=24)
255            {
256            //  logerror("upload mode 1 error, too big\n");
257               return;
258            }
259252
260            //logerror("uploading table 1 %04x %04x\n",m_decathlt_prot_uploadoffset, data&0xffff);
261            m_decathlt_prottable1[m_decathlt_prot_uploadoffset]=data&0xffff;
262            m_decathlt_prot_uploadoffset++;
263
264            printf("table 1 %04x\n", data & 0xffff);
265
266            {
267               /* 0x18 (24) values in this table, rom data is 0x1800000 long, maybe it has
268                  something to do with that? or 24-address b    its?
269
270                  uploaded values appear to be 12-bit, some are repeated
271               */
272
273               {
274                  FILE* fp;
275                  if (which==1) fp = fopen("table1x","wb");
276                  else fp = fopen("table1","wb");
277
278                  {
279                     fwrite(&m_decathlt_prottable1,24,2,fp);
280                  }
281                  fclose(fp);
282               }
283            }
284
285         }
286         else if (m_decathlt_prot_uploadmode==2)
287         {
288            if (m_decathlt_prot_uploadoffset>=128)
289            {
290               //logerror("upload mode 2 error, too big\n");
291               return;
292            }
293
294            //logerror("uploading table 2 %04x %04x\n",m_decathlt_prot_uploadoffset, data&0xffff);
295            m_decathlt_prottable2[m_decathlt_prot_uploadoffset]=data&0xffff;
296            m_decathlt_prot_uploadoffset++;
297
298            printf("dictionary %04x\n", data & 0xffff);
299
300
301            {
302               /* the table uploaded here is a 256 byte table with 256 unique values, remaps something? */
303
304               {
305                  FILE* fp;
306                  if (which==1) fp = fopen("table2x","wb");
307                  else fp = fopen("table2","wb");
308
309                  {
310                     fwrite(&m_decathlt_prottable2,128,2,fp);
311                  }
312                  fclose(fp);
313               }
314            }
315         }
316         else
317         {
318         //  logerror("unknown upload mode!\n");
319         }
253      //logerror("uploading table 1 %04x %04x\n",m_channel[channel].m_decathlt_prot_uploadoffset, data&0xffff);
254      m_channel[channel].m_decathlt_prottable1[m_channel[channel].m_decathlt_prot_uploadoffset] = data & 0xffff;
255      m_channel[channel].m_decathlt_prot_uploadoffset++;
256      printf("unk table 1 %04x (channel %d)\n", data & 0xffff, channel);
257   }
258   else if (m_channel[channel].m_decathlt_prot_uploadmode == 2)
259   {
260      if (m_channel[channel].m_decathlt_prot_uploadoffset >= 128)
261      {
262         fatalerror("upload mode 2 error, too big\n");
263         return;
320264      }
265
266      //logerror("uploading table 2 %04x %04x\n",m_channel[channel].m_decathlt_prot_uploadoffset, data&0xffff);
267      m_channel[channel].m_decathlt_dictionary[m_channel[channel].m_decathlt_prot_uploadoffset] = data & 0xffff;
268      m_channel[channel].m_decathlt_prot_uploadoffset++;
269      printf("dictionary %04x (channel %d)\n", data & 0xffff, channel);
321270   }
271}
322272
323   if (offset>1)
273void sega_315_5838_comp_device::write_prot_data(UINT32 data, UINT32 mem_mask, int channel, int rev_words)
274{
275   if (mem_mask==0xffff0000)
324276   {
325   //  logerror("higher offset write\n");
277      if (rev_words==0) set_upload_mode(data >> 16, channel);
278      else upload_table_data(data >>16, channel);
326279   }
327
280   else if (mem_mask == 0x0000ffff)
281   {
282      if (rev_words==0) upload_table_data(data & 0xffff, channel);
283      else set_upload_mode(data & 0xffff, channel);
284   }
285   else
286   {
287      fatalerror("write_prot_data invalid mem_mask\b");
288   }
328289}
329290
330WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot1_w )
331{
332   write_prot_data(data,mem_mask, offset, 0);
333291
334}
335292
336WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot2_w )
337{
338   write_prot_data(data,mem_mask, offset, 1);
293WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot1_w_doa )  { write_prot_data(data, mem_mask, 0, 1); }
294WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot1_w)  { write_prot_data(data, mem_mask, 0, 0); }
295WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot2_w)  { write_prot_data(data, mem_mask, 1, 0); }
339296
297WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot1_srcaddr_w ) { set_prot_addr(data, mem_mask, 0); }
298WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot2_srcaddr_w)  { set_prot_addr(data, mem_mask, 1); }
340299
341}
342300
343301void sega_315_5838_comp_device::install_decathlt_protection()
344302{
345   /* It uploads 2 tables here, then performs what looks like a number of transfers, setting
346      a source address of some kind (scrambled?) and then making many reads from a single address */
347
348303   //todo, install these in the driver, they differ between games
349304   cpu_device* cpu = (cpu_device*)machine().device(":maincpu");
350305
306   cpu->space(AS_PROGRAM).install_write_handler(0x37FFFF0, 0x37FFFF3, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_srcaddr_w), this)); // set compressed data source address
307   cpu->space(AS_PROGRAM).install_write_handler(0x37FFFF4, 0x37FFFF7, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_w), this)); // upload tables
308   cpu->space(AS_PROGRAM).install_read_handler(0x37FFFF8, 0x37FFFFb, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_r), this)); // read decompressed data
351309
352   cpu->space(AS_PROGRAM).install_readwrite_handler(0x37FFFF0, 0x37FFFFF, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot_r), this), write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_w), this));
353   /* It accesses the device at this address too, with different tables, for the game textures, should it just act like a mirror, or a secondary device? */
354   cpu->space(AS_PROGRAM).install_readwrite_handler(0x27FFFF0, 0x27FFFFF, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot_ch2_r), this), write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot2_w), this));
310   // the device is addressed here too, uploading a different set of tables and accessing a different part of ROM
311   cpu->space(AS_PROGRAM).install_write_handler(0x27FFFF0, 0x27FFFF3, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot2_srcaddr_w), this)); // set compressed data source address
312   cpu->space(AS_PROGRAM).install_write_handler(0x27FFFF4, 0x27FFFF7, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot2_w), this)); // upload tables
313   cpu->space(AS_PROGRAM).install_read_handler(0x27FFFF8, 0x27FFFFb, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot2_r), this)); // read decompressed data
355314}
356315
357316
r243231r243232
387346{
388347   printf("doa_prot_w %08x %08x %08x\n", offset*4, data, mem_mask);
389348
390   if (offset == 0x7ff2 / 4)
391   {
392      if (data == 0)
393      {
394         m_protstate = 0;
395         strcpy((char *)m_protram, "  TECMO LTD.  DEAD OR ALIVE  1996.10.22  VER. 1.00"); // this is the single decompressed string DOA needs
396      }
397   }
398   else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc());
349   m_protstate = 0;
399350}
400351
401352
r243231r243232
403354{
404355   //todo, install these in the driver, they differ between games
405356   cpu_device* cpu = (cpu_device*)machine().device(":maincpu");
357
358   m_protstate = 0;
359   strcpy((char *)m_protram, "  TECMO LTD.  DEAD OR ALIVE  1996.10.22  VER. 1.00"); // this is the single decompressed string DOA needs, note, 2 spaces at start, might indicate a dummy read like with 5881 on Model 2
360
406361   cpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_r), this), write32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_w), this));
362   cpu->space(AS_PROGRAM).install_write_handler(0x01d87ff0, 0x01d87ff3, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_srcaddr_w), this)); // set compressed data source address (always set 0, data is in RAM)
363   cpu->space(AS_PROGRAM).install_write_handler(0x01d87ff4, 0x01d87ff7, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_w_doa), this)); // upload tab
364//   cpu->space(AS_PROGRAM).install_read_handler(0x01d87ff8, 0x01d87ffb, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_r), this)); // read decompressed data
365
407366}
No newline at end of file
trunk/src/mame/machine/315-5838_317-0229_comp.h
r243231r243232
44#ifndef __SEGA315_5838_COMP__
55#define __SEGA315_5838_COMP__
66
7#define CHANNELS 2
8
79typedef device_delegate<UINT16 (UINT32)> sega_dec_read_delegate;
810
911extern const device_type SEGA315_5838_COMP;
r243231r243232
2022   // construction/destruction
2123   sega_315_5838_comp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2224
23   sega_dec_read_delegate m_read_ch1;
2425   sega_dec_read_delegate m_read_ch2;
2526
2627   static void set_read_cb_ch1(device_t &device,sega_dec_read_delegate readcb)
2728   {
2829      sega_315_5838_comp_device &dev = downcast<sega_315_5838_comp_device &>(device);
29      dev.m_read_ch1 = readcb;
30      dev.m_channel[0].m_read_ch = readcb;
3031   }
3132
3233   static void set_read_cb_ch2(device_t &device,sega_dec_read_delegate readcb)
3334   {
3435      sega_315_5838_comp_device &dev = downcast<sega_315_5838_comp_device &>(device);
35      dev.m_read_ch2 = readcb;
36      dev.m_channel[1].m_read_ch = readcb;
3637   }
3738
38   DECLARE_READ32_MEMBER(decathlt_prot_r);
39   DECLARE_READ32_MEMBER(decathlt_prot_ch2_r);;
40   UINT32 genericdecathlt_prot_r(UINT32 offset, UINT32 mem_mask, int which);
39   DECLARE_READ32_MEMBER(decathlt_prot1_r);
40   DECLARE_READ32_MEMBER(decathlt_prot2_r);;
41   UINT32 genericdecathlt_prot_r(UINT32 mem_mask, int channel);
4142
42   void write_prot_data(UINT32 data, UINT32 mem_mask, int offset, int which);
43   void write_prot_data(UINT32 data, UINT32 mem_mask, int channel, int rev_words);
44
45   void upload_table_data(UINT16 data, int channel);
46   void set_upload_mode(UINT16 data, int channel);
47   void set_prot_addr(UINT32 data, UINT32 mem_mask, int channel);
48
49   DECLARE_WRITE32_MEMBER(decathlt_prot1_w_doa);
4350   DECLARE_WRITE32_MEMBER(decathlt_prot1_w);
4451   DECLARE_WRITE32_MEMBER(decathlt_prot2_w);
52   DECLARE_WRITE32_MEMBER(decathlt_prot1_srcaddr_w);
53   DECLARE_WRITE32_MEMBER(decathlt_prot2_srcaddr_w);
54
4555   void install_decathlt_protection();
4656   void install_doa_protection();
4757
r243231r243232
5565private:
5666
5767   // Decathlete specific variables and functions (see machine/decathlt.c)
58   UINT32 m_decathlt_protregs[4];
59   UINT32 m_decathlt_lastcount;
60   UINT32 m_decathlt_part;
61   UINT32 m_decathlt_prot_uploadmode;
62   UINT32 m_decathlt_prot_uploadoffset;
63   UINT16 m_decathlt_prottable1[24];
64   UINT16 m_decathlt_prottable2[128];
68   struct channel_type
69   {
70      UINT32 m_srcoffset;
71      UINT16 m_decathlt_prottable1[24];
72      UINT16 m_decathlt_dictionary[128];
6573
74      UINT32 m_decathlt_lastcount;
75      UINT32 m_decathlt_prot_uploadmode;
76      UINT32 m_decathlt_prot_uploadoffset;
77      sega_dec_read_delegate m_read_ch;
78
79   };
80
81   channel_type m_channel[2];
82
83
84
6685   // Doa
6786   int m_protstate;
6887   int m_prot_a;
trunk/src/mame/mame.lst
r243231r243232
1121711217peps0298        // (c) 1996 IGT - International Game Technology
1121811218peps0308        // (c) 1996 IGT - International Game Technology
1121911219peps0364        // (c) 1996 IGT - International Game Technology
11220peps0366        // (c) 1996 IGT - International Game Technology
11221peps0372        // (c) 1996 IGT - International Game Technology
11222peps0373        // (c) 1996 IGT - International Game Technology
1122011223peps0426        // (c) 1996 IGT - International Game Technology
1122111224peps0581        // (c) 1996 IGT - International Game Technology
1122211225peps0615        // (c) 1996 IGT - International Game Technology
trunk/src/mess/drivers/bw12.c
r243231r243232
484484   save_item(NAME(m_motor_on));
485485   save_item(NAME(m_motor0));
486486   save_item(NAME(m_motor1));
487   save_item(NAME(m_centronics_busy));
488   save_item(NAME(m_centronics_fault));
489   save_item(NAME(m_centronics_perror));
490   machine().save().register_postload(save_prepost_delegate(FUNC(bw12_state::bankswitch), this));
487491}
488492
489493void bw12_state::machine_reset()
trunk/src/mess/drivers/vt100.c
r243231r243232
758758// does not have integrated STP or AVO populated
759759// 8085 based instead of I8080
760760   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
761   ROM_LOAD( "23-???e4-00.e71", 0x0000, 0x2000, NO_DUMP) // rom is unique to vt101
761   ROM_LOAD( "23-028e4-00.e71", 0x0000, 0x2000, NO_DUMP) // rom is unique to vt101; "CN55004N 8232 // DEC TP03 // 23-028E4-00" 24-pin mask rom (mc68764 pinout)
762762   //e69 socket is empty/unpopulated on vt101?
763763   //e67 socket is empty/unpopulated on vt101?
764764
trunk/src/osd/modules/sound/js_sound.c
r243231r243232
1313
1414#if (defined(SDLMAME_EMSCRIPTEN))
1515
16#include "js_sound.h"
1716#include "emscripten.h"
1817
1918class sound_js : public osd_module, public sound_module
trunk/src/osd/sdl/video.c
r243231r243232
227227         SDL_VideoDriverName(monitor->monitor_device, sizeof(monitor->monitor_device)-1);
228228         if (first_call==0)
229229         {
230            char *dimstr = osd_getenv(SDLENV_DESKTOPDIM);
230            const char *dimstr = osd_getenv(SDLENV_DESKTOPDIM);
231231            const SDL_VideoInfo *sdl_vi;
232232
233233            sdl_vi = SDL_GetVideoInfo();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team