コード例 #1
0
void MM_ShowMemory (void)
{
	mmblocktype id0_far *scan;
	id0_unsigned_t color,temp;
	id0_long_t	end;

	VW_SetLineWidth(40);
	temp = bufferofs;
	bufferofs = 0;
	VW_SetScreen_EGA (0,0); // REFKEEN - We're in an EGA-only function anyway...

	scan = mmhead;

	end = -1;

	while (scan)
	{
		if (scan->attributes & PURGEBITS)
			color = 5;		// dark purple = purgable
		else
			color = 9;		// medium blue = non purgable
		if (scan->attributes & LOCKBIT)
			color = 12;		// red = locked
		if (scan->start<=end)
			Quit ("MM_ShowMemory: Memory block order currupted!");
		end = scan->start+scan->length-1;
		// REFKEEN - Again we're in an EGA-only function
		VW_Hlin_EGA(scan->start,(id0_unsigned_t)end,0,color);
		VW_Plot_EGA(scan->start,0,15);
		if (scan->next->start > end+1)
			VW_Hlin_EGA(end+1,scan->next->start,0,0);	// black = free
		scan = scan->next;
	}

	IN_Ack();
	VW_SetLineWidth(64);
	bufferofs = temp;
}
コード例 #2
0
ファイル: kd_demo.c プロジェクト: NY00123/refkeen
void
DemoLoop_New (void)
{
	//id0_char_t		*s;
	//id0_word_t		move;
	//id0_longword_t	lasttime;
	// REFKEEN - Add FakeCGA shape for 2015 port
	const id0_char_t *FileName0;
	struct Shape FileShape0;
	const id0_char_t *FileName1;
	struct Shape FileShape1;
	// REFKEEN - CREDITS is now a variable, set based on version
//#if CREDITS
	const id0_char_t *FileName2;
	struct Shape FileShape2;
	// REFKEEN - Add second credits shape for 2015 port
	const id0_char_t *FileName3;
	struct Shape FileShape3;
//#endif
	//struct ffblk ffblk;
	//WindowRec	mywin;
	id0_int_t bufsave	= bufferofs;
	id0_int_t dissave	= displayofs;


#if FRILLS
//
// check for launch from ted
//
	if (tedlevel)
	{
		NewGame();
		gamestate.mapon = tedlevelnum;
		GameLoop();
		TEDDeath();
	}
#endif

//
// demo loop
//
	// REFKEEN - Alternative controllers support
	BE_ST_AltControlScheme_Push();
	BE_ST_AltControlScheme_PrepareControllerMapping(&g_ingame_altcontrol_mapping_demoloop);

	US_SetLoadSaveHooks(LoadGame,SaveGame,ResetGame);
	restartgame = gd_Continue;

	BE_FILE_T handle = BE_Cross_open_readonly_for_reading("KDREAMS.CMP");
	//int handle = open("KDREAMS.CMP" ,O_BINARY | O_RDONLY);
	if (!BE_Cross_IsFileValid(handle))
	//if (handle == -1)
		Quit("Couldn't find KDREAMS.CMP");
	BE_Cross_close(handle);
#if 0
	if (findfirst("KDREAMS.CMP", &ffblk, 0) == -1)
		Quit("Couldn't find KDREAMS.CMP");
#endif

	while (true)
	{

		loadedgame = false;

		if (refkeen_current_gamever == BE_GAMEVER_KDREAMS2015)
		{
			FileName0 = "TITLECGA.LBM";
			if (LoadLIBShape("KDREAMS.CMP", FileName0, &FileShape0))
				Quit("Can't load TITLE SCREEN");
		}
		FileName1 = "TITLESCR.LBM";
		if (LoadLIBShape("KDREAMS.CMP", FileName1, &FileShape1))
			Quit("Can't load TITLE SCREEN");
		if (CREDITS)
		{
			// REFKEEN - Instead of loading just "CREDITS.LBM"
			// (which never happened with the original EXEs in practice),
			// load "CREDITS1.LBM" and "CREDITS2.LBM", as available
			// in the 2015 release
			FileName2 = "CREDITS1.LBM";
			if (LoadLIBShape("KDREAMS.CMP", FileName2, &FileShape2))
				Quit("Can't load CREDITS SCREEN 1");
			if (refkeen_current_gamever == BE_GAMEVER_KDREAMS2015)
			FileName3 = "CREDITS2.LBM";
			if (LoadLIBShape("KDREAMS.CMP", FileName3, &FileShape3))
				Quit("Can't load CREDITS SCREEN 3");
		}

		while (!restartgame && !loadedgame)
		{

			VW_InitDoubleBuffer();
			IN_ClearKeysDown();

			while (true)
			{

				// REFKEEN - We're in an EGA-only function anyway,
				// so use EGA versions of VW functions...
				VW_SetScreen_EGA(0, 0);
				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(fakecgamode ? &FileShape0 : &FileShape1, 0, 0);
				VW_ScreenToScreen_EGA (64*200,0,40,200);

				if (IN_UserInput(CREDITS ? (TickBase * 8) : (TickBase * 4), false))
					break;

		// REFKEEN - Patch for 2015 port
		if (!fakecgamode)
		{
			if (CREDITS)
			{
				// REFKEEN - Show two credits screens
				// as present in the 2015 release
				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(&FileShape2, 0, 0);
				VW_ScreenToScreen_EGA (64*200,0,40,200);

				if (IN_UserInput(TickBase * 7, false))
					break;

				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(&FileShape3, 0, 0);
				VW_ScreenToScreen_EGA (64*200,0,40,200);

				if (IN_UserInput(TickBase * 7, false))
					break;
			}
			else
			{
				MoveGfxDst(0, 200);
				UnpackEGAShapeToScreen(&FileShape1, 0, 0);
				VW_ScreenToScreen_EGA (64*200,0,40,200);

				if (IN_UserInput(TickBase * 3, false))
					break;
			}
		}

				displayofs = 0;
				VWB_Bar(0,0,320,200,FIRSTCOLOR);
				US_DisplayHighScores(-1);

				if (IN_UserInput(TickBase * 6, false))
					break;

			}

			bufferofs = bufsave;
			displayofs = dissave;

			VW_FixRefreshBuffer();
			US_ControlPanel ();
		}

		if (!loadedgame)
			NewGame();

		if (refkeen_current_gamever == BE_GAMEVER_KDREAMS2015)
			FreeShape(&FileShape0);
		FreeShape(&FileShape1);
		if (CREDITS)
		{
			// REFKEEN - Free two credits screens as present in the 2015 release
			FreeShape(&FileShape2);
			FreeShape(&FileShape3);
		}
		GameLoop();
	}
	// REFKEEN - Alternative controllers support
	BE_ST_AltControlScheme_Pop();
}
コード例 #3
0
ファイル: id_vw.c プロジェクト: BSzili/refkeen
void VW_InitDoubleBuffer (void)
{
	if (GRMODE == EGAGR)
		VW_SetScreen_EGA (displayofs+panadjust,0);			// no pel pan
}