Exemplo n.º 1
0
// seg000:024F
void __pascal far init_game_main() {
	doorlink1_ad = /*&*/level.doorlinks1;
	doorlink2_ad = /*&*/level.doorlinks2;
	prandom(1);
	if (graphics_mode == gmMcgaVga) {
		// Guard palettes
		guard_palettes = (byte*) load_from_opendats_alloc(10, "bin", NULL, NULL);
		// (blood, hurt flash) #E00030 = red
		set_pal(12, 0x38, 0x00, 0x0C, 1);
		// (palace wall pattern) #C09850 = light brown
		set_pal( 6, 0x30, 0x26, 0x14, 0);

		// Level color variations (1.3)
		level_var_palettes = load_from_opendats_alloc(20, "bin", NULL, NULL);
	}
	// PRINCE.DAT: sword
	chtab_addrs[id_chtab_0_sword] = load_sprites_from_file(700, 1<<2, 1);
	// PRINCE.DAT: flame, sword on floor, potion
	chtab_addrs[id_chtab_1_flameswordpotion] = load_sprites_from_file(150, 1<<3, 1);
	close_dat(dathandle);
	load_sounds(0, 43);
	load_opt_sounds(43, 56); //added
	hof_read();
	show_use_fixes_and_enhancements_prompt(); // added
	start_game();
}
Exemplo n.º 2
0
// seg000:22C8
void __pascal far load_title_images(int bgcolor) {
	dat_type* dathandle;
	dathandle = open_dat("TITLE.DAT", 0);
	chtab_title40 = load_sprites_from_file(40, 1<<11, 1);
	chtab_title50 = load_sprites_from_file(50, 1<<12, 1);
	close_dat(dathandle);
	if (graphics_mode == gmMcgaVga) {
		// background of text frame
		SDL_Color color;
		if (bgcolor) {
			// RGB(4,0,18h) = #100060 = dark blue
			set_pal((find_first_pal_row(1<<11) << 4) + 14, 0x04, 0x00, 0x18, 1);
			color.r = 0x10;
			color.g = 0x00;
			color.b = 0x60;
			color.a = 0xFF;
		} else {
			// RGB(20h,0,0) = #800000 = dark red
			set_pal((find_first_pal_row(1<<11) << 4) + 14, 0x20, 0x00, 0x00, 1);
			color.r = 0x80;
			color.g = 0x00;
			color.b = 0x00;
			color.a = 0xFF;
		}
		if (NULL != chtab_title40) {
			SDL_SetPaletteColors(chtab_title40->images[0]->format->palette, &color, 14, 1);
		}
	} else if (graphics_mode == gmEga || graphics_mode == gmTga) {
		// ...
	}
}
Exemplo n.º 3
0
static void do_rom_specific_overrides() {
    static MD5_CTX md5_ctx;
    static unsigned char md5[16];

    MD5_Init(&md5_ctx);
    MD5_Update(&md5_ctx, (void*)prg_base, 16*1024*prg_16k_banks);
    MD5_Final(md5, &md5_ctx);

#if 0
    for (unsigned i = 0; i < 16; ++i)
        printf("%02X", md5[i]);
    putchar('\n');
#endif

    if (MEM_EQ(md5, "\xAC\x5F\x53\x53\x59\x87\x58\x45\xBC\xBD\x1B\x6F\x31\x30\x7D\xEC"))
        // Cybernoid
        enable_bus_conflicts();
    else if (MEM_EQ(md5, "\x60\xC6\x21\xF5\xB5\x09\xD4\x14\xBB\x4A\xFB\x9B\x56\x95\xC0\x73"))
        // High hopes
        set_pal();
    else if (MEM_EQ(md5, "\x44\x6F\xCD\x30\x75\x61\x00\xA9\x94\x35\x9A\xD4\xC5\xF8\x76\x67"))
        // Rad Racer 2
        correct_mirroring(FOUR_SCREEN);
}
Exemplo n.º 4
0
static void do_opt_menu(void)
{
    bool done=false;
    int selected=0;
    int result;

    static const struct opt_items onoff[2] = {
        { "Off", -1 },
        { "On" , -1 },
    };

    static const struct opt_items frameskip[]= {
        { "0 Max", -1 },
        { "1 Max", -1 },
        { "2 Max", -1 },
        { "3 Max", -1 },
        { "4 Max", -1 },
        { "5 Max", -1 },
        { "6 Max", -1 },
    };
    
#ifdef HAVE_LCD_COLOR
    static const struct opt_items rotate[] = {
        { "No rotation", -1 },
        { "Rotate Right" , -1 },
        { "Rotate Left" , -1 },
    };

    static const struct opt_items scaling[]= {
        { "Scaled", -1 },
        { "Scaled - Maintain Ratio", -1 },
#if (LCD_WIDTH>=160) && (LCD_HEIGHT>=144)
        { "Unscaled", -1 },
#endif
    };

    static const struct opt_items palette[]= {
        { "Brown (Default)", -1 },
        { "Gray", -1 },
        { "Light Gray", -1 },
        { "Multi-Color 1", -1 },
        { "Multi-Color 2", -1 },
        { "Adventure Island", -1 },
        { "Adventure Island 2", -1 },
        { "Balloon Kid", -1 },
        { "Batman", -1 },
        { "Batman: Return of Joker", -1 },
        { "Bionic Commando", -1 },
        { "Castlvania Adventure", -1 },
        { "Donkey Kong Land", -1 },
        { "Dr. Mario", -1 },
        { "Kirby", -1 },
        { "Metroid", -1 },
        { "Zelda", -1 },
    };
#endif

    MENUITEM_STRINGLIST(menu, "Options", NULL,
                        "Max Frameskip", "Sound", "Stats", "Set Keys (Buggy)",
#ifdef HAVE_LCD_COLOR
                        "Screen Size", "Screen Rotate", "Set Palette",
#endif
                        );

    options.dirty=1; /* Assume that the settings have been changed */

    while(!done)
    {
        result = rb->do_menu(&menu, &selected, NULL, false);

        switch (result)
        {
            case 0: /* Frameskip */
                rb->set_option("Max Frameskip", &options.maxskip, INT, frameskip, 
                    sizeof(frameskip)/sizeof(*frameskip), NULL );
                break;
            case 1: /* Sound */
                if(options.sound>1) options.sound=1;
                rb->set_option("Sound", &options.sound, INT, onoff, 2, NULL );
                if(options.sound) sound_dirty();
                break;
            case 2: /* Stats */
                rb->set_option("Stats", &options.showstats, INT, onoff, 2, NULL );
                break;
            case 3: /* Keys */
                setupkeys();
                break;
#ifdef HAVE_LCD_COLOR
            case 4: /* Screen Size */
                rb->set_option("Screen Size", &options.scaling, INT, scaling,
                    sizeof(scaling)/sizeof(*scaling), NULL );
                setvidmode();
                break;
            case 5: /* Screen rotate */
                rb->set_option("Screen Rotate", &options.rotate, INT, rotate,
                    sizeof(rotate)/sizeof(*rotate), NULL );
                setvidmode();
                break;
            case 6: /* Palette */
                rb->set_option("Set Palette", &options.pal, INT, palette, 17, NULL );
                set_pal();
                break;
#endif
            default:
                done=true;
                break;
        }
    }
}