X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fgpu_neon%2Fpsx_gpu%2Fpsx_gpu_main.c;h=435c51a2eeea3512f7d958ba061fc59fdaae4d09;hb=1cec47197eaa7f82bd4503015761cbc7416fff41;hp=6c17b0ababd0518bdeb0077ef755a7cd3ff9dd3b;hpb=87c45ad1e2a265cedb7970cc1b7777591d0050b7;p=pcsx_rearmed.git diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_main.c b/plugins/gpu_neon/psx_gpu/psx_gpu_main.c index 6c17b0ab..435c51a2 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_main.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_main.c @@ -127,7 +127,7 @@ void update_screen(psx_gpu_struct *psx_gpu, SDL_Surface *screen) int main(int argc, char *argv[]) { psx_gpu_struct *psx_gpu = &_psx_gpu; - SDL_Surface *screen; + SDL_Surface *screen = NULL; SDL_Event event; u32 *list; @@ -135,6 +135,8 @@ int main(int argc, char *argv[]) FILE *state_file; FILE *list_file; u32 no_display = 0; + s32 dummy0 = 0; + u32 dummy1 = 0; if((argc != 3) && (argc != 4)) { @@ -164,14 +166,35 @@ int main(int argc, char *argv[]) { SDL_Init(SDL_INIT_EVERYTHING); screen = SDL_SetVideoMode(1024, 512, 32, 0); + if (screen == 0) + { + printf("can't set video mode: %s\n", SDL_GetError()); + return 1; + } } #ifdef NEON_BUILD + u16 *vram_ptr; +#if 0 system("ofbset -fb /dev/fb1 -mem 6291456 -en 0"); u32 fbdev_handle = open("/dev/fb1", O_RDWR); - u16 *vram_ptr = vram_ptr = (mmap((void *)0x50000000, 1024 * 1024 * 2, PROT_READ | PROT_WRITE, MAP_SHARED | 0xA0000000, fbdev_handle, 0)); +#elif 1 + #ifndef MAP_HUGETLB + #define MAP_HUGETLB 0x40000 /* arch specific */ + #endif + vram_ptr = (mmap((void *)0x50000000, 1024 * 1024 * 2, PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE | MAP_HUGETLB, -1, 0)); +#else + vram_ptr = (mmap((void *)0x50000000, 1024 * 1024 * 2, PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)); +#endif + if (vram_ptr == MAP_FAILED) + { + perror("mmap"); + return 1; + } vram_ptr += 64; initialize_psx_gpu(psx_gpu, vram_ptr); @@ -192,7 +215,7 @@ int main(int argc, char *argv[]) init_counter(); #endif - gpu_parse(psx_gpu, list, size); + gpu_parse(psx_gpu, list, size, &dummy0, &dummy1); flush_render_block_buffer(psx_gpu); clear_stats(); @@ -201,7 +224,7 @@ int main(int argc, char *argv[]) u32 cycles = get_counter(); #endif - gpu_parse(psx_gpu, list, size); + gpu_parse(psx_gpu, list, size, &dummy0, &dummy1); flush_render_block_buffer(psx_gpu); #ifdef NEON_BUILD