void rmFlush(void) {
	rmDispatch();

	// release all the uploaded textures
	gsKit_vram_clear(gsGlobal);

	while (uploadedTextures) {
		// free clut and txt if those are filled in
		if (uploadedTextures->txt) {
			uploadedTextures->txt->Vram = 0;
			uploadedTextures->txt->VramClut = 0;
		}

		if (uploadedTextures->clut)
			uploadedTextures->clut->VramClut = 0;

		struct rm_texture_list_t *entry = uploadedTextures;
		uploadedTextures = uploadedTextures->next;
		free(entry);
	}
}
Exemple #2
0
void init_custom_screen()
{
    if (Settings.display == 0) {
        gsGlobal->Mode = GS_MODE_NTSC;
        gsGlobal->Interlace = GS_INTERLACED;
        gsGlobal->Field = GS_FIELD;
        gsGlobal->Width = 640;
        gsGlobal->Height = 448;
        VCK = 4;
    }
    else if (Settings.display == 1) {
        gsGlobal->Mode = GS_MODE_PAL;
        gsGlobal->Interlace = GS_INTERLACED;
        gsGlobal->Field = GS_FIELD;
        gsGlobal->Width = 640;
        gsGlobal->Height = 512;
        VCK = 4;
    }
    else if (Settings.display == 2) {
        gsGlobal->Mode = GS_MODE_DTV_480P;
        gsGlobal->Interlace = GS_NONINTERLACED;
        gsGlobal->Field = GS_FRAME;
        gsGlobal->Width = 640;
        gsGlobal->Height = 480;
        VCK = 2;
    }

    if (Settings.display == 0 || Settings.display == 1) {
        if (!Settings.interlace) {
            gsGlobal->Interlace = GS_NONINTERLACED;
            gsGlobal->Height = gsGlobal->Height / 2;
            VCK = 2;
        }
    }

    gsKit_vram_clear(gsGlobal);
    gsKit_init_screen(gsGlobal); /* Apply settings. */
    gsKit_set_display_offset(gsGlobal, Settings.offset_x * VCK, Settings.offset_y);
    gsKit_mode_switch(gsGlobal, GS_ONESHOT);
}