diff options
author | Fabio Battaglia | 2009-12-31 12:47:42 +0000 |
---|---|---|
committer | Fabio Battaglia | 2009-12-31 12:47:42 +0000 |
commit | 2e0482efa7103a71ba8729de7d8d34895eca380f (patch) | |
tree | a2e6e12aabe668b053ad6ad369ae965d84ebe501 /backends/platform | |
parent | 3b1d4ace4097fb213e5a55b3417465318e083319 (diff) | |
download | scummvm-rg350-2e0482efa7103a71ba8729de7d8d34895eca380f.tar.gz scummvm-rg350-2e0482efa7103a71ba8729de7d8d34895eca380f.tar.bz2 scummvm-rg350-2e0482efa7103a71ba8729de7d8d34895eca380f.zip |
N64: some cleanup in osystem
svn-id: r46799
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/n64/osys_n64.h | 5 | ||||
-rw-r--r-- | backends/platform/n64/osys_n64_base.cpp | 64 |
2 files changed, 31 insertions, 38 deletions
diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index dd9b4751ea..8b58ddc571 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -45,11 +45,6 @@ #define DEFAULT_SOUND_SAMPLE_RATE 8000 // 8 kHz //#define DEFAULT_SOUND_SAMPLE_RATE 11025 // 11 kHz -// Limit the N64 resolution to 320x240, because framebuffer -// at higher resolutions would be too slow and memory hogging -#define DEFAULT_SCREEN_WIDTH 320 -#define DEFAULT_SCREEN_HEIGHT 240 - #define N64_PAL_FPS 25 #define N64_NTSC_FPS 30 diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index 558a8642e6..b39fcb3295 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -28,9 +28,6 @@ #include "pakfs_save_manager.h" #include "backends/fs/n64/n64-fs-factory.h" -#define DEFAULT_FRAMEBUFFER_WIDTH 340 // a horizontal resolution of 340 takes into account overscan -#define DEFAULT_PIX_SKIP 15 - extern uint8 _romfs; // Defined by linker (used to calculate position of romfs image) inline uint16 colBGR888toRGB555(byte r, byte g, byte b); @@ -61,7 +58,7 @@ OSystem_N64::OSystem_N64() { // Init Controller Pak initPakFs(); - // Use the first save pak found + // Use the first controller pak found uint8 ctrl_num; for (ctrl_num = 0; ctrl_num < 4; ctrl_num++) { int8 pak_type = identifyPak(ctrl_num); @@ -72,26 +69,27 @@ OSystem_N64::OSystem_N64() { } // Screen size - _screenWidth = DEFAULT_SCREEN_WIDTH; - _screenHeight = DEFAULT_SCREEN_HEIGHT; + _screenWidth = 320; + _screenHeight = 240; // Game screen size - _gameHeight = DEFAULT_SCREEN_WIDTH; - _gameWidth = DEFAULT_SCREEN_HEIGHT; + _gameHeight = 320; + _gameWidth = 240; // Overlay size - _overlayWidth = DEFAULT_SCREEN_WIDTH; - _overlayHeight = DEFAULT_SCREEN_HEIGHT; + _overlayWidth = 320; + _overlayHeight = 240; // Framebuffer width - _frameBufferWidth = DEFAULT_FRAMEBUFFER_WIDTH; + _frameBufferWidth = 340; // Pixels to skip - _offscrPixels = DEFAULT_PIX_SKIP; + _offscrPixels = 15; // Video clock _viClockRate = VI_NTSC_CLOCK; + // Max FPS _maxFps = N64_NTSC_FPS; _overlayVisible = false; @@ -99,9 +97,9 @@ OSystem_N64::OSystem_N64() { _shakeOffset = 0; // Allocate memory for offscreen buffers - _offscreen_hic = (uint16*)memalign(8, DEFAULT_SCREEN_WIDTH * DEFAULT_SCREEN_HEIGHT * 2); - _offscreen_pal = (uint8*)memalign(8, DEFAULT_SCREEN_WIDTH * DEFAULT_SCREEN_HEIGHT); - _overlayBuffer = (uint16*)memalign(8, DEFAULT_SCREEN_WIDTH * DEFAULT_SCREEN_HEIGHT * sizeof(OverlayColor)); + _offscreen_hic = (uint16*)memalign(8, _screenWidth * _screenHeight * 2); + _offscreen_pal = (uint8*)memalign(8, _screenWidth * _screenHeight); + _overlayBuffer = (uint16*)memalign(8, _overlayWidth * _overlayHeight * sizeof(OverlayColor)); _cursor_pal = NULL; @@ -233,8 +231,8 @@ void OSystem_N64::switchGraphicModeId(int mode) { _maxFps = N64_PAL_FPS; initDisplay(PAL_320X240_16BIT); _frameBufferWidth = 320; - _screenWidth = DEFAULT_SCREEN_WIDTH; - _screenHeight = DEFAULT_SCREEN_HEIGHT; + _screenWidth = 320; + _screenHeight = 240; _offscrPixels = 0; _graphicMode = NORM_PAL_320X240; enableAudioPlayback(); @@ -245,10 +243,10 @@ void OSystem_N64::switchGraphicModeId(int mode) { _viClockRate = VI_PAL_CLOCK; _maxFps = N64_PAL_FPS; initDisplay(PAL_340X240_16BIT); - _frameBufferWidth = DEFAULT_FRAMEBUFFER_WIDTH; - _screenWidth = DEFAULT_SCREEN_WIDTH; - _screenHeight = DEFAULT_SCREEN_HEIGHT; - _offscrPixels = DEFAULT_PIX_SKIP; + _frameBufferWidth = 340; + _screenWidth = 320; + _screenHeight = 240; + _offscrPixels = 15; _graphicMode = OVERS_PAL_340X240; enableAudioPlayback(); break; @@ -259,8 +257,8 @@ void OSystem_N64::switchGraphicModeId(int mode) { _maxFps = N64_NTSC_FPS; initDisplay(MPAL_320X240_16BIT); _frameBufferWidth = 320; - _screenWidth = DEFAULT_SCREEN_WIDTH; - _screenHeight = DEFAULT_SCREEN_HEIGHT; + _screenWidth = 320; + _screenHeight = 240; _offscrPixels = 0; _graphicMode = NORM_MPAL_320X240; enableAudioPlayback(); @@ -271,10 +269,10 @@ void OSystem_N64::switchGraphicModeId(int mode) { _viClockRate = VI_MPAL_CLOCK; _maxFps = N64_NTSC_FPS; initDisplay(MPAL_340X240_16BIT); - _frameBufferWidth = DEFAULT_FRAMEBUFFER_WIDTH; - _screenWidth = DEFAULT_SCREEN_WIDTH; - _screenHeight = DEFAULT_SCREEN_HEIGHT; - _offscrPixels = DEFAULT_PIX_SKIP; + _frameBufferWidth = 340; + _screenWidth = 320; + _screenHeight = 240; + _offscrPixels = 15; _graphicMode = OVERS_MPAL_340X240; enableAudioPlayback(); break; @@ -285,8 +283,8 @@ void OSystem_N64::switchGraphicModeId(int mode) { _maxFps = N64_NTSC_FPS; initDisplay(NTSC_320X240_16BIT); _frameBufferWidth = 320; - _screenWidth = DEFAULT_SCREEN_WIDTH; - _screenHeight = DEFAULT_SCREEN_HEIGHT; + _screenWidth = 320; + _screenHeight = 240; _offscrPixels = 0; _graphicMode = NORM_NTSC_320X240; enableAudioPlayback(); @@ -298,10 +296,10 @@ void OSystem_N64::switchGraphicModeId(int mode) { _viClockRate = VI_NTSC_CLOCK; _maxFps = N64_NTSC_FPS; initDisplay(NTSC_340X240_16BIT); - _frameBufferWidth = DEFAULT_FRAMEBUFFER_WIDTH; - _screenWidth = DEFAULT_SCREEN_WIDTH; - _screenHeight = DEFAULT_SCREEN_HEIGHT; - _offscrPixels = DEFAULT_PIX_SKIP; + _frameBufferWidth = 340; + _screenWidth = 320; + _screenHeight = 240; + _offscrPixels = 15; _graphicMode = OVERS_NTSC_340X240; enableAudioPlayback(); break; |