Previous 199869 Revisions Next

r34465 Sunday 18th January, 2015 at 17:24:31 UTC by Couriersud
Merge branch 'master' of https://github.com/mamedev/mame.git
[src/emu]emu.mak image.c image.h
[src/emu/ui]filemngr.c filemngr.h imgcntrl.c imginfo.c imginfo.h info.c* info.h* mainmenu.c miscmenu.c miscmenu.h selgame.c ui.c
[src/mame/drivers]naomi.c
[src/mame/machine]315-5881_crypt.c naomicrypt.c

trunk/src/emu/emu.mak
r242976r242977
124124   $(EMUOBJ)/ui/filemngr.o \
125125   $(EMUOBJ)/ui/filesel.o \
126126   $(EMUOBJ)/ui/imgcntrl.o \
127   $(EMUOBJ)/ui/imginfo.o \
127   $(EMUOBJ)/ui/info.o \
128128   $(EMUOBJ)/ui/inputmap.o \
129129   $(EMUOBJ)/ui/selgame.o \
130130   $(EMUOBJ)/ui/slotopt.o \
trunk/src/emu/image.c
r242976r242977
237237         }
238238      }
239239   }
240}
240241
242/*-------------------------------------------------
243 image_mandatory_scan - search for devices which
244 need an image to be loaded
245 -------------------------------------------------*/
246
247astring &image_mandatory_scan(running_machine &machine, astring &mandatory)
248{
249   mandatory.reset();
250   // make sure that any required image has a mounted file
251   image_interface_iterator iter(machine.root_device());
241252   for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
242253   {
243      /* is an image specified for this image */
244      image_name = image->filename();
245
246      if (!((image_name != NULL) && (image_name[0] != '\0')))
247      {
248         /* no image... must this device be loaded? */
249         if (image->must_be_loaded())
250         {
251            fatalerror_exitcode(machine, MAMERR_DEVICE, "Driver requires that device \"%s\" must have an image to load", image->instance_name());
252         }
253      }
254      if (image->filename() == NULL && image->must_be_loaded())
255         mandatory.cat("\"").cat(image->instance_name()).cat("\", ");
254256   }
257   return mandatory;
255258}
256259
257260/*-------------------------------------------------
trunk/src/emu/image.h
r242976r242977
2020
2121void image_init(running_machine &machine);
2222void image_postdevice_init(running_machine &machine);
23astring &image_mandatory_scan(running_machine &machine, astring &mandatory);
2324
2425extern struct io_procs image_ioprocs;
2526
trunk/src/emu/ui/filemngr.c
r242976r242977
2020#include "ui/swlist.h"
2121#include "ui/filemngr.h"
2222#include "ui/filesel.h"
23#include "ui/miscmenu.h"
2324
2425
2526/***************************************************************************
r242976r242977
3031//  ctor
3132//-------------------------------------------------
3233
33ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container) : ui_menu(machine, container)
34ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container, const char *warnings) : ui_menu(machine, container)
3435{
36   // This warning string is used when accessing from the force_file_manager call, i.e.
37   // when the file manager is loaded top front in the case of mandatory image devices
38   if (warnings)
39      m_warnings.cpy(warnings);
40   else
41      m_warnings.reset();
3542}
3643
3744
r242976r242977
101108   bool first_entry = true;
102109   astring prev_owner;
103110
111   if (m_warnings)
112   {
113      item_append(m_warnings, NULL, MENU_FLAG_DISABLE, NULL);
114      item_append("", NULL, MENU_FLAG_DISABLE, NULL);
115   }
116     
104117   // cycle through all devices for this system
105118   device_iterator iter(machine().root_device());
106119   tagmap_t<UINT8> devtags;
r242976r242977
172185      }
173186   }
174187}
188
189// force file manager menu
190void ui_menu_file_manager::force_file_manager(running_machine &machine, render_container *container, const char *warnings)
191{   
192   // reset the menu stack
193   ui_menu::stack_reset(machine);
194   
195   // add the quit entry followed by the game select entry
196   ui_menu *quit = auto_alloc_clear(machine, ui_menu_quit_game(machine, container));
197   quit->set_special_main_menu(true);
198   ui_menu::stack_push(quit);
199   ui_menu::stack_push(auto_alloc_clear(machine, ui_menu_file_manager(machine, container, warnings)));
200   
201   // force the menus on
202   machine.ui().show_menu();
203   
204   // make sure MAME is paused
205   machine.pause();
206}
trunk/src/emu/ui/filemngr.h
r242976r242977
2020   astring current_file;
2121   device_image_interface *selected_device;
2222
23   ui_menu_file_manager(running_machine &machine, render_container *container);
23   static void force_file_manager(running_machine &machine, render_container *container, const char *warnings);
24
25   ui_menu_file_manager(running_machine &machine, render_container *container, const char *warnings);
2426   virtual ~ui_menu_file_manager();
2527   virtual void populate();
2628   virtual void handle();
2729   virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
2830
2931   void fill_image_line(device_image_interface *img, astring &instance, astring &filename);
32
33private:
34   astring m_warnings;
3035};
3136
3237#endif  /* __UI_FILEMNGR_H__ */
trunk/src/emu/ui/imgcntrl.c
r242976r242977
217217      {
218218         swp = swi->first_part();
219219         load_software_part();
220         ui_menu::stack_pop(machine());
221220      }
222221      break;
223222
r242976r242977
225224      switch(submenu_result) {
226225      case ui_menu_software_parts::T_ENTRY: {
227226         load_software_part();
228         ui_menu::stack_pop(machine());
229227         break;
230228      }
231229
trunk/src/emu/ui/imginfo.c
r242976r242977
1/***************************************************************************
2
3    ui/imginfo.c
4
5    Image info screen
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/menu.h"
14#include "ui/imginfo.h"
15
16
17/***************************************************************************
18    IMPLEMENTATION
19***************************************************************************/
20
21//-------------------------------------------------
22//  ctor
23//-------------------------------------------------
24
25ui_menu_image_info::ui_menu_image_info(running_machine &machine, render_container *container) : ui_menu(machine, container)
26{
27}
28
29
30//-------------------------------------------------
31//  dtor
32//-------------------------------------------------
33
34ui_menu_image_info::~ui_menu_image_info()
35{
36}
37
38
39//-------------------------------------------------
40//  populate
41//-------------------------------------------------
42
43void ui_menu_image_info::populate()
44{
45   item_append(machine().system().description, NULL, MENU_FLAG_DISABLE, NULL);
46   item_append("", NULL, MENU_FLAG_DISABLE, NULL);
47
48   image_interface_iterator iter(machine().root_device());
49   for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
50         image_info(image);
51}
52
53
54//-------------------------------------------------
55//  handle
56//-------------------------------------------------
57
58void ui_menu_image_info::handle()
59{
60   // process the menu
61   process(0);
62}
63
64
65//-------------------------------------------------
66//  image_info - display image info for a specific
67//  image interface device
68//-------------------------------------------------
69
70void ui_menu_image_info::image_info(device_image_interface *image)
71{
72   if (image->exists())
73   {
74      // display device type and filename
75      item_append(image->brief_instance_name(), image->basename(), 0, NULL);
76
77      // if image has been loaded through softlist, let's add some more info
78      if (image->software_entry())
79      {
80         astring string;
81
82         // display long filename
83         item_append(image->longname(), "", MENU_FLAG_DISABLE, NULL);
84         
85         // display manufacturer and year
86         string.catprintf("%s, %s", image->manufacturer(), image->year());
87         item_append(string, "", MENU_FLAG_DISABLE, NULL);
88
89         // display supported information, if available
90         switch (image->supported())
91         {
92            case SOFTWARE_SUPPORTED_NO:
93               item_append("Not supported", "", MENU_FLAG_DISABLE, NULL);
94               break;
95            case SOFTWARE_SUPPORTED_PARTIAL:
96               item_append("Partially supported", "", MENU_FLAG_DISABLE, NULL);
97               break;
98            default:
99               break;
100         }
101      }
102   }
103   else
104      item_append(image->brief_instance_name(), "[empty]", 0, NULL);
105   item_append("", NULL, MENU_FLAG_DISABLE, NULL);
106}
trunk/src/emu/ui/imginfo.h
r242976r242977
1/***************************************************************************
2
3    ui/imginfo.h
4
5    Image info screen
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_IMGINFO_H__
15#define __UI_IMGINFO_H__
16
17class ui_menu_image_info : public ui_menu
18{
19public:
20   ui_menu_image_info(running_machine &machine, render_container *container);
21   virtual ~ui_menu_image_info();
22   virtual void populate();
23   virtual void handle();
24
25private:
26   void image_info(device_image_interface *image);
27};
28
29#endif // __UI_IMGINFO_H__
trunk/src/emu/ui/info.c
r0r242977
1/***************************************************************************
2
3    ui/info.c
4
5    System and image info screens
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/menu.h"
14#include "ui/info.h"
15#include "ui/ui.h"
16
17/*-------------------------------------------------
18  menu_game_info - handle the game information
19  menu
20 -------------------------------------------------*/
21
22ui_menu_game_info::ui_menu_game_info(running_machine &machine, render_container *container) : ui_menu(machine, container)
23{
24}
25
26ui_menu_game_info::~ui_menu_game_info()
27{
28}
29
30void ui_menu_game_info::populate()
31{
32   astring tempstring;
33   item_append(machine().ui().game_info_astring(tempstring), NULL, MENU_FLAG_MULTILINE, NULL);
34}
35
36void ui_menu_game_info::handle()
37{
38   // process the menu
39   process(0);
40}
41
42
43/*-------------------------------------------------
44  ui_menu_image_info - handle the image information
45  menu
46 -------------------------------------------------*/
47
48ui_menu_image_info::ui_menu_image_info(running_machine &machine, render_container *container) : ui_menu(machine, container)
49{
50}
51
52ui_menu_image_info::~ui_menu_image_info()
53{
54}
55
56void ui_menu_image_info::populate()
57{
58   item_append(machine().system().description, NULL, MENU_FLAG_DISABLE, NULL);
59   item_append("", NULL, MENU_FLAG_DISABLE, NULL);
60
61   image_interface_iterator iter(machine().root_device());
62   for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
63         image_info(image);
64}
65
66void ui_menu_image_info::handle()
67{
68   // process the menu
69   process(0);
70}
71
72
73/*-------------------------------------------------
74  image_info - display image info for a specific
75  image interface device
76-------------------------------------------------*/
77
78void ui_menu_image_info::image_info(device_image_interface *image)
79{
80   if (image->exists())
81   {
82      // display device type and filename
83      item_append(image->brief_instance_name(), image->basename(), 0, NULL);
84
85      // if image has been loaded through softlist, let's add some more info
86      if (image->software_entry())
87      {
88         astring string;
89
90         // display long filename
91         item_append(image->longname(), "", MENU_FLAG_DISABLE, NULL);
92         
93         // display manufacturer and year
94         string.catprintf("%s, %s", image->manufacturer(), image->year());
95         item_append(string, "", MENU_FLAG_DISABLE, NULL);
96
97         // display supported information, if available
98         switch (image->supported())
99         {
100            case SOFTWARE_SUPPORTED_NO:
101               item_append("Not supported", "", MENU_FLAG_DISABLE, NULL);
102               break;
103            case SOFTWARE_SUPPORTED_PARTIAL:
104               item_append("Partially supported", "", MENU_FLAG_DISABLE, NULL);
105               break;
106            default:
107               break;
108         }
109      }
110   }
111   else
112      item_append(image->brief_instance_name(), "[empty]", 0, NULL);
113   item_append("", NULL, MENU_FLAG_DISABLE, NULL);
114}
trunk/src/emu/ui/info.h
r0r242977
1/***************************************************************************
2
3    ui/info.h
4
5    System and image info screens
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_INFO_H__
15#define __UI_INFO_H__
16
17class ui_menu_game_info : public ui_menu {
18public:
19   ui_menu_game_info(running_machine &machine, render_container *container);
20   virtual ~ui_menu_game_info();
21   virtual void populate();
22   virtual void handle();
23};
24
25
26class ui_menu_image_info : public ui_menu
27{
28public:
29   ui_menu_image_info(running_machine &machine, render_container *container);
30   virtual ~ui_menu_image_info();
31   virtual void populate();
32   virtual void handle();
33
34private:
35   void image_info(device_image_interface *image);
36};
37
38#endif // __UI_INFO_H__
trunk/src/emu/ui/mainmenu.c
r242976r242977
1919#include "ui/filemngr.h"
2020#include "ui/filesel.h"
2121#include "ui/barcode.h"
22#include "ui/imginfo.h"
22#include "ui/info.h"
2323#include "ui/inputmap.h"
2424#include "ui/mainmenu.h"
2525#include "ui/miscmenu.h"
r242976r242977
183183         break;
184184
185185      case IMAGE_MENU_FILE_MANAGER:
186         ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_file_manager(machine(), container)));
186         ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_file_manager(machine(), container, NULL)));
187187         break;
188188
189189      case TAPE_CONTROL:
trunk/src/emu/ui/miscmenu.c
r242976r242977
1919#include "rendutil.h"
2020
2121#include "uiinput.h"
22#include "ui/ui.h"
2322#include "ui/miscmenu.h"
2423#include "ui/filemngr.h"
2524
r242976r242977
305304
306305
307306/*-------------------------------------------------
308    menu_game_info - handle the game information
309    menu
310-------------------------------------------------*/
311
312ui_menu_game_info::ui_menu_game_info(running_machine &machine, render_container *container) : ui_menu(machine, container)
313{
314}
315
316void ui_menu_game_info::populate()
317{
318   astring tempstring;
319   item_append(machine().ui().game_info_astring(tempstring), NULL, MENU_FLAG_MULTILINE, NULL);
320}
321
322void ui_menu_game_info::handle()
323{
324   /* process the menu */
325   process(0);
326}
327
328ui_menu_game_info::~ui_menu_game_info()
329{
330}
331
332/*-------------------------------------------------
333307    menu_cheat - handle the cheat menu
334308-------------------------------------------------*/
335309
trunk/src/emu/ui/miscmenu.h
r242976r242977
4444   attotime prevtime;
4545};
4646
47class ui_menu_game_info : public ui_menu {
48public:
49   ui_menu_game_info(running_machine &machine, render_container *container);
50   virtual ~ui_menu_game_info();
51   virtual void populate();
52   virtual void handle();
53};
54
5547class ui_menu_cheat : public ui_menu {
5648public:
5749   ui_menu_cheat(running_machine &machine, render_container *container);
trunk/src/emu/ui/selgame.c
r242976r242977
157157      media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);
158158
159159      // if everything looks good, schedule the new driver
160      if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE)
160      if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
161161      {
162162         machine().manager().schedule_new_driver(*driver);
163163         machine().schedule_hard_reset();
trunk/src/emu/ui/ui.c
r242976r242977
2020#include "uiinput.h"
2121#include "ui/mainmenu.h"
2222#include "ui/miscmenu.h"
23#include "ui/filemngr.h"
2324#include "ui/viewgfx.h"
2425#include "imagedev/cassette.h"
2526#include <ctype.h>
r242976r242977
306307
307308void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer)
308309{
309   const int maxstate = 3;
310   const int maxstate = 4;
310311   int str = machine().options().seconds_to_run();
311312   bool show_gameinfo = !machine().options().skip_gameinfo();
312313   bool show_warnings = true;
r242976r242977
352353            if (show_gameinfo && game_info_astring(messagebox_text).len() > 0)
353354               set_handler(handler_messagebox_anykey, 0);
354355            break;
356
357         case 3:
358            if (image_mandatory_scan(machine(), messagebox_text).len() > 0)
359            {
360               astring warning;
361               warning.cpy("This driver requires images to be loaded in the following device(s): ").cat(messagebox_text.substr(0, messagebox_text.len() - 2));
362               ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.cstr());
363            }
364            break;
355365      }
356366
357367      // clear the input memory
trunk/src/mame/drivers/naomi.c
r242976r242977
60146014   ROM_LOAD( "wk1ma10.4c",  0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) )
60156015
60166016   ROM_REGION( 4, "rom_key", 0 )
6017   ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(c1e3000b) SHA1(36c2546833effe9452e2b3f7d31335fc5e349f49) )
6017   ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(1708ebb9) SHA1(c1115e4dd675f10d5fb41f57c1eea8e6a4f09fed) )
60186018ROM_END
60196019
60206020ROM_START( wldkicksa )
r242976r242977
60366036   ROM_LOAD( "wk1ma10.4c",  0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) )
60376037
60386038   ROM_REGION( 4, "rom_key", 0 )
6039   ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(c1e3000b) SHA1(36c2546833effe9452e2b3f7d31335fc5e349f49) )
6039   ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(1708ebb9) SHA1(c1115e4dd675f10d5fb41f57c1eea8e6a4f09fed) )
60406040ROM_END
60416041
60426042ROM_START( wldkicksb )
r242976r242977
60586058   ROM_LOAD( "wk1ma10.4c",  0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) )
60596059
60606060   ROM_REGION( 4, "rom_key", 0 )
6061   ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(c1e3000b) SHA1(36c2546833effe9452e2b3f7d31335fc5e349f49) )
6061   ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(1708ebb9) SHA1(c1115e4dd675f10d5fb41f57c1eea8e6a4f09fed) )
60626062ROM_END
60636063
60646064ROM_START( toukon4 )
r242976r242977
60856085   ROM_LOAD( "trf1ma15.6l", 0xf000000, 0x1000000, CRC(42d318c5) SHA1(f9fe82ffbfc51fcb52333f94c55a7092e7124fb4) )
60866086
60876087   ROM_REGION( 4, "rom_key", 0 )
6088   ROM_LOAD( "tr4ae-key.bin", 0x000000, 0x000004, CRC(986a7cee) SHA1(70c3ff80f86de6a0655251658c66a156fb644995) )
6088   ROM_LOAD( "tr4ae-key.bin", 0x000000, 0x000004, CRC(1708ebb9) SHA1(c1115e4dd675f10d5fb41f57c1eea8e6a4f09fed) )
60896089ROM_END
60906090
60916091ROM_START( ninjaslt )
r242976r242977
78057805   ROM_LOAD( "mpr-23662.ic11", 0xa800000, 0x0800000, CRC(d6ef7d68) SHA1(4ee396af6c5caf4c5af6e9ad0e03a7ac2c5039f4) )
78067806
78077807   ROM_REGION( 4, "rom_key", 0 )
7808   ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(049f41b0) SHA1(4ea444878c8e9288ec95b1763d48bc92c634acdd) )
7808   ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(8c9012fe) SHA1(d81e00d6377a3f0eeed01dc523707e36ca1b434d) )
78097809ROM_END
78107810
78117811ROM_START( vstrik3cb )
r242976r242977
78277827   ROM_LOAD( "mpr-23662.ic11", 0xa800000, 0x0800000, CRC(d6ef7d68) SHA1(4ee396af6c5caf4c5af6e9ad0e03a7ac2c5039f4) )
78287828
78297829   ROM_REGION( 4, "rom_key", 0 )
7830   ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(049f41b0) SHA1(4ea444878c8e9288ec95b1763d48bc92c634acdd) )
7830   ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(8c9012fe) SHA1(d81e00d6377a3f0eeed01dc523707e36ca1b434d) )
78317831ROM_END
78327832
78337833ROM_START( wldrider )
r242976r242977
78707870   ROM_LOAD( "mpr-23784.ic11", 0xa800000, 0x1000000, CRC(f74f2fee) SHA1(84b07baa6d116727e66ef27e24ba6484c3393891) )
78717871
78727872   ROM_REGION( 4, "rom_key", 0 )
7873   ROM_LOAD( "vf4cart-key.bin", 0, 4, CRC(22838e16) SHA1(afee674dce3cfdd20360c30da2da5ba69f8d4682) )
7873   ROM_LOAD( "vf4cart-key.bin", 0, 4, CRC(aa8cdd58) SHA1(e282b7d215044a005b50c8553b8056f3d599135c) )
78747874ROM_END
78757875
78767876// There is also a development cart (171-7885A) with 20x 64Mb FlashROMs instead of 10x 128Mb MaskROMs. Content is the same.
trunk/src/mame/machine/315-5881_crypt.c
r242976r242977
121121The encryption is done by a stream cipher operating in counter mode, which use a 16-bits internal block cipher.
122122
123123There are 2 "control bits" at the start of the decrypted stream which control the mode of operation: bit #1 set to 1 means
124that the decrypted stream needs to be decompressed after being decrypted. More on this later.
124that the stream needs to be decompressed after being decrypted. More on this later.
125125
126126The next 16-bits are part of the header (they don't belong to the plaintext), but his meaning is unclear. It has been
127127conjectured that it could stablish when to "reset" the process and start processing a new stream (based on some tests
r242976r242977
134134given plaintext word, and the remaining 2 to the next plaintext word.
135135
136136The underlying block cipher consists of two 4-round Feistel Networks (FN): the first one takes the counter (16 bits),
137the game-key (>=26 bits) and the sequence-key (16 bits) and output a middle result (16 bits) which will act as another key
137the game-key (>=27 bits) and the sequence-key (16 bits) and output a middle result (16 bits) which will act as another key
138138for the second one. The second FN will take the encrypted word (16 bits), the game-key, the sequence-key and the result
139139from the first FN and will output the decrypted word (16 bits).
140140
141Each round of the Feistel Networks use four substitution sboxes, each having 6 inputs and 2 outputs. The input can be the
142XOR of at most two "sources bits", being source bits the bits from the previous round and the bits from the different keys.
141Each round of the Feistel Networks use four substitution sboxes, each having 6 inputs and 2 outputs. The input is the
142XOR of at most one bit from the previous round and at most one bit from the different keys.
143143
144144The underlying block cipher has the same structure than the one used by the CPS-2 (Capcom Play System 2) and,
145145indeed, some of the used sboxes are exactly the same and appear in the same FN/round in both systems (this is not evident,
r242976r242977
151151some (encrypted word-decrypted word) pairs suffice. However, due to the weak key scheduling, it should be noted that some
152152related keys can produce the same output bytes for some (short) input sequences.
153153
154The only difference in the decryption process between M2 and M3 is the initialization of the counter. In M3, the counter is
155always set to 0 at the beginning of the decryption while, in M2, the bits #1-#16 of the ciphertext's address are used
156to initialize the counter.
157
158154Note that this implementation considers that the counter initialization for ram decryption is 0 simply because the ram is
159155mapped to multiples of 128K.
160156
r242976r242977
164160chosen so as to make the key for CAPSNK equal to 0.
165161
166162It can be observed that a couple of sboxes have incomplete tables (a 255 value indicate an unknown value). The recovered keys
167as of december/2010 show small randomness and big correlations, making possible that some unseen bits could make the
163as of january/2015 show small randomness and big correlations, making possible that some unseen bits could make the
168164decryption need those incomplete parts.
169165
170166****************************************************************************************/
r242976r242977
478474   {1,29},  {1,71},  {2,4},   {2,54},  {3,8},   {4,56},  {4,73},  {5,11},
479475   {6,51},  {7,92},  {8,89},  {9,9},   {9,10},  {9,39},  {9,41},  {9,58},
480476   {9,59},  {9,86},  {10,90}, {11,6},  {12,64}, {13,49}, {14,44}, {15,40},
481   {16,69}, {17,15}, {18,23}, {18,43}, {19,82}, {20,81}, {21,32}, {21,61},
482   {22,5},  {23,66}, {24,13}, {24,45}, {25,12}, {25,35}
477    {16,69}, {17,15}, {18,23}, {18,43}, {19,82}, {20,81}, {21,32}, {22,5},
478   {23,66}, {24,13}, {24,45}, {25,12}, {25,35}, {26,61},
483479};
484480
485481const int sega_315_5881_crypt_device::fn2_game_key_scheduling[34][2] = {
486482   {0,0},   {1,3},   {2,11},  {3,20},  {4,22},  {5,23},  {6,29},  {7,38},
487483   {8,39},  {9,47},  {9,55},  {9,86},  {9,87},  {9,90},  {10,50}, {10,53},
488484   {11,57}, {12,59}, {13,61}, {13,64}, {14,63}, {15,67}, {16,72}, {17,83},
489   {18,88}, {19,94}, {20,35}, {21,17}, {21,92}, {22,6},  {22,11}, {23,85},
490   {24,16}, {25,25}
485    {18,88}, {19,94}, {20,35}, {21,17}, {22,6},  {22,11}, {23,85}, {24,16},
486   {25,25}, {26,92}
491487};
492488
493489const int sega_315_5881_crypt_device::fn1_sequence_key_scheduling[20][2] = {
trunk/src/mame/machine/naomicrypt.c
r242976r242977
2828{
2929   // name             key              gameid #         year
3030// M2
31   { "wldkicks",        0x00ae2901 }, // 25209801    2000
32   { "toukon4",         0x012e2901 }, // 25349801    2000
31   { "wldkicks",        0x052e2901 }, // 25209801    2000
32   { "toukon4",         0x052e2901 }, // 25349801    2000
3333   { "ninjaslt",        0x000ca510 }, // 25469801    2000
3434   { "ninjaslt4",       0x000ca510 }, // 25469801    2000
3535   { "gunsur2e",        0x000680d0 }, // 25709801    2001
r242976r242977
6868   { "alienfnt",        0x00174343 }, // 840-0048    2001
6969   { "alienfnta",       0x00174343 }, // 840-0048    2001
7070   { "crackdj2",        0x00428247 }, // 840-0068    2001
71   { "vf4cart",         0x02ef2f96 }, // 840-0080    2002
71   { "vf4cart",         0x06ef2f92 }, // 840-0080    2002
7272   { "pstone",          0x000e69c1 }, // 841-0001    1999
7373   { "suchie3",         0x000368e1 }, // 841-0002    1999
7474   { "doa2",            0x0008ad01 }, // 841-0003    1999


Previous 199869 Revisions Next


© 1997-2024 The MAME Team