⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mingw32.c

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 C
字号:
/* * MinGW32 system file * based on nix.c and dos.c * req's SDL * -Dave Kiddell */#include <stdlib.h>#include <stdio.h>#include <string.h>#include <SDL/SDL.h>void *sys_timer(){	Uint32 *tv;		tv = malloc(sizeof *tv);	*tv = SDL_GetTicks() * 1000;	return tv;}int sys_elapsed(Uint32 *cl){	Uint32 now;	Uint32 usecs;	now = SDL_GetTicks() * 1000;	usecs = now - *cl;	*cl = now;	return usecs;}void sys_sleep(int us){	/* dbk: for some reason 2000 works..	   maybe its just compensation for the time it takes for SDL_Delay to	   execute, or maybe sys_timer is too slow */	SDL_Delay(us/1000);}void sys_sanitize(char *s){	int i;	for (i = 0; s[i]; i++)		if (s[i] == '\\') s[i] = '/';}void sys_initpath(char *exe){	char *buf, *home, *p;	home = strdup(exe);	sys_sanitize(home);	p = strrchr(home, '/');	if (p) *p = 0;	else	{		/* FIXME dbk: this isnt working */		/*rc_setvar("rcpath",1, ".");		rc_setvar("savedir",1, ".");		return;*/	}	buf = malloc(strlen(home) + 8);	sprintf(buf, ".:%s/", home);	rc_setvar("rcpath", 1, &buf);	sprintf(buf, ".", home);	rc_setvar("savedir", 1, &buf);	free(buf);}void sys_checkdir(char *path, int wr){}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -