Skip to content

Instantly share code, notes, and snippets.

@takeutch-kemeco
Last active December 20, 2015 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takeutch-kemeco/6078703 to your computer and use it in GitHub Desktop.
Save takeutch-kemeco/6078703 to your computer and use it in GitHub Desktop.
osecpu072d で追加された新しいキー入力に対応
更新:2013.08.23
00-osecpu072d
osecpu072d.cのそれを、これに置き換えてビルドすれば動く。
・とりあえず絵は出る。
・アニメーションも動く。
・新しいキー入力に対応。( editor.ose、othello.ose で動作確認)
・c_blike_01f_linux の最新版 (commit: 83868bb8067f4209f4409e5b2d268b164b7a653e 以降)が別途必須。
https://github.com/takeutch-kemeco/blike
Ubuntu13.04 (i686版(32bit環境))で動作確認済み。64bit環境では動作しない。
gcc -D__linux__ osecpu.c `pkg-config blike --cflags --libs` -o osecpu
#if (DRV_OSNUM == 0x0003)
// by takeutch-kemeco, 2013.07.25-
// gcc -D__linux__ osecpu.c `pkg-config blike --cflags --libs` -o osecpu
void __bl_openWin_attach_vram(int, int, int*);
void *__bld_mallocRWE(unsigned int);
void bld_flshWin(int, int, int, int);
void bl_wait(int);
void __bld_set_callback_key_press(void (*f)(void*, const int));
void __bld_set_callback_key_release(void (*f)(void*, const int));
extern int bl_argc;
extern const UCHAR** bl_argv;
static void __drv_bld_callback_key_press(void* a, const int keyval) { if (keyval != -1) putKeybuf(keyval); }
static void __drv_bld_callback_key_release(void* a, const int keyval) { /* putKeybuf(0x0fff); */ }
void *mallocRWE(int bytes) { return __bld_mallocRWE(bytes); }
void drv_openWin(int sx, int sy, UCHAR *buf, char *winClosed) { __bl_openWin_attach_vram(sx, sy, (int*) buf); }
void drv_flshWin(int sx, int sy, int x0, int y0) { bld_flshWin(sx, sy, x0, y0); }
void drv_sleep(int msec) { bl_wait(msec); }
blMain()
{
__bld_set_callback_key_press(__drv_bld_callback_key_press);
__bld_set_callback_key_release(__drv_bld_callback_key_release);
OsecpuMain(bl_argc, bl_argv);
}
#endif /* (DRV_OSNUM == 0x0003) */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment