Nokia N900 >> Sbox

移植gngeo 0.7


目前N900上的gngeo版本是0.7版,版本雖然比較舊,不過沒有支援全螢幕顯示,等於沒移植成功,因為這代表直接編譯使用,雖然司徒已經移植gngeo 0.8版到N900身上,不過司徒測試後發現,gngeo 0.7版可以玩的遊戲,在gngeo 0.8上不見得版本相容,這導致司徒必須重新下載遊戲,加上目前的gngeo-gui也不相容gngeo 0.8版(0.8版已經有自帶的GUI介面),因此,司徒只好再度移植gngeo 0.7到N900身上,步驟如下說明。

+++ new_gngeo/src/blitter/soft.c
--- old_gngeo/src/blitter/soft.c
+#define SCREEN_WIDTH 800
+static unsigned int nbtable[SCREEN_WIDTH]={0};
 
SDL_bool blitter_soft_init()
{
+ int i=0;
+ for(i=0; i<SCREEN_WIDTH; i++){
+  nbtable[i] = ((unsigned long)i * visible_area.w) / SCREEN_WIDTH;
+ }
+ screen = SDL_SetVideoMode(SCREEN_WIDTH, height, 16, sdl_flags);
- screen = SDL_SetVideoMode(width, height, 16, sdl_flags);
}
 
+#if 0
+#else
+void update_double()
+{
+ Uint16 *src, *dst;
+ Uint16 w, h;
+
+ src = (Uint16*)buffer->pixels + visible_area.x + (buffer->w << 4);
+ dst = (Uint16*)screen->pixels;
+ for(h=0; h<visible_area.h; h++){
+  for(w=0; w<SCREEN_WIDTH; w++){
+   dst[w] = src[nbtable[w]];
+   dst[w + SCREEN_WIDTH] = src[nbtable[w]];
+  }
+  src+= visible_area.w;
+  src+= (visible_area.x << 1);
+  dst+= (SCREEN_WIDTH << 1);
+ }
+}
+#endif

+++ new_gngeo/src/emu.c
--- old_gngeo/src/emu.c
void main_loop(void)
{
+ //screen_resize(event.resize.w, event.resize.h);
- screen_resize(event.resize.w, event.resize.h);
}

+++ new_gngeo/src/conf.c
--- old_gngeo/src/conf.c
void cf_init(void)
{
+ cf_create_int_item("quit_key","Quit emulator",0,1);
}

+++ new_gngeo/src/emu.c
--- old_gngeo/src/emu.c
void main_loop(void)
{
+ int quit_key=CF_VAL(cf_get_item_by_name("quit_key"));

+ if(scancode == quit_key){
+  neo_emu_done = 1;
+  break;
+ }

接著覆蓋編譯後的gngeo以及設定effect成none


原始畫面


移植後的畫面


返回上一頁