[Scummvm-cvs-logs] SF.net SVN: scummvm:[46799] scummvm/trunk/backends/platform/n64
Hkz at users.sourceforge.net
Hkz at users.sourceforge.net
Thu Dec 31 13:47:42 CET 2009
Revision: 46799
http://scummvm.svn.sourceforge.net/scummvm/?rev=46799&view=rev
Author: Hkz
Date: 2009-12-31 12:47:42 +0000 (Thu, 31 Dec 2009)
Log Message:
-----------
N64: some cleanup in osystem
Modified Paths:
--------------
scummvm/trunk/backends/platform/n64/osys_n64.h
scummvm/trunk/backends/platform/n64/osys_n64_base.cpp
Modified: scummvm/trunk/backends/platform/n64/osys_n64.h
===================================================================
--- scummvm/trunk/backends/platform/n64/osys_n64.h 2009-12-31 12:38:17 UTC (rev 46798)
+++ scummvm/trunk/backends/platform/n64/osys_n64.h 2009-12-31 12:47:42 UTC (rev 46799)
@@ -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
Modified: scummvm/trunk/backends/platform/n64/osys_n64_base.cpp
===================================================================
--- scummvm/trunk/backends/platform/n64/osys_n64_base.cpp 2009-12-31 12:38:17 UTC (rev 46798)
+++ scummvm/trunk/backends/platform/n64/osys_n64_base.cpp 2009-12-31 12:47:42 UTC (rev 46799)
@@ -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 @@
// 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 @@
}
// 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 @@
_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 @@
_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 @@
_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 @@
_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 @@
_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 @@
_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 @@
_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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list