Previous 199869 Revisions Next

r32377 Thursday 25th September, 2014 at 16:00:30 UTC by Fabio Priuli
(MESS) fixed a small bug in the decryption of multi-ROM pegasus programs.
many thanks amilo3438 for testing! nw.
[src/mess/drivers]pegasus.c

trunk/src/mess/drivers/pegasus.c
r32376r32377
9494   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9595   DECLARE_DRIVER_INIT(pegasus);
9696   TIMER_DEVICE_CALLBACK_MEMBER(pegasus_firq);
97   void pegasus_decrypt_rom(UINT8 *ROM);
97   void pegasus_decrypt_rom(UINT8 *ROM, bool force_decrypt);
9898   
9999   int load_cart(device_image_interface &image, generic_slot_device *slot, const char *reg_tag);
100100   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp00_load) { return load_cart(image, m_exp_00, "0000"); }
r32376r32377
389389
390390/* An encrypted single rom starts with 02, decrypted with 20. Not sure what
391391    multipart roms will have. */
392void pegasus_state::pegasus_decrypt_rom(UINT8 *ROM)
392void pegasus_state::pegasus_decrypt_rom(UINT8 *ROM, bool force_decrypt)
393393{
394394   UINT8 b;
395395   UINT16 j;
396396   dynamic_buffer temp_copy;
397397   temp_copy.resize(0x1000);
398398
399   if (ROM[0] == 0x02)
399   if (ROM[0] == 0x02 || force_decrypt)
400400   {
401401      for (int i = 0; i < 0x1000; i++)
402402      {
r32376r32377
424424   {
425425      // we might be loading a cart compatible with all sockets!
426426      // so try to get region "rom"
427      printf("universal\n");     
428427      size = slot->common_get_size("rom");
429428      any_socket = true;
430429
r32376r32377
440439   slot->rom_alloc(0x1000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);   // we alloc 0x1000 also for smaller roms!
441440   slot->common_load_rom(slot->get_rom_base(), size, any_socket ? "rom" : reg_tag);
442441   
443   // raw images have to be decrypted
444   pegasus_decrypt_rom(slot->get_rom_base());
442   // raw images have to be decrypted (in particular the ones from softlist)
443   pegasus_decrypt_rom(slot->get_rom_base(), image.software_entry() != NULL);
445444   
446445   return IMAGE_INIT_PASS;
447446}
r32376r32377
473472{
474473   // decrypt monitor
475474   UINT8 *base = memregion("maincpu")->base() + 0xf000;
476   pegasus_decrypt_rom(base);
475   pegasus_decrypt_rom(base, FALSE);
477476}
478477
479478static MACHINE_CONFIG_START( pegasus, pegasus_state )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team