aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/n64/osys_n64_base.cpp
diff options
context:
space:
mode:
authorFabio Battaglia2010-01-07 16:07:22 +0000
committerFabio Battaglia2010-01-07 16:07:22 +0000
commit8c03fffbf0c246b77b5d60604405aa898c58e6ea (patch)
tree3c868d5a102d8b6645cd136b4860103777630a0a /backends/platform/n64/osys_n64_base.cpp
parent9577a45cdd70ca7b9e471434478f9eba8e60374e (diff)
downloadscummvm-rg350-8c03fffbf0c246b77b5d60604405aa898c58e6ea.tar.gz
scummvm-rg350-8c03fffbf0c246b77b5d60604405aa898c58e6ea.tar.bz2
scummvm-rg350-8c03fffbf0c246b77b5d60604405aa898c58e6ea.zip
Nintendo64: Add FlashRAM support for saving if a compatible cart is available.
svn-id: r47126
Diffstat (limited to 'backends/platform/n64/osys_n64_base.cpp')
-rw-r--r--backends/platform/n64/osys_n64_base.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index b39fcb3295..c5fa1a5d58 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -26,6 +26,7 @@
#include "osys_n64.h"
#include "pakfs_save_manager.h"
+#include "framfs_save_manager.h"
#include "backends/fs/n64/n64-fs-factory.h"
extern uint8 _romfs; // Defined by linker (used to calculate position of romfs image)
@@ -55,19 +56,6 @@ OSystem_N64::OSystem_N64() {
// Init PI interface
PI_Init();
- // Init Controller Pak
- initPakFs();
-
- // Use the first controller pak found
- uint8 ctrl_num;
- for (ctrl_num = 0; ctrl_num < 4; ctrl_num++) {
- int8 pak_type = identifyPak(ctrl_num);
- if (pak_type == 1) {
- loadPakData(ctrl_num);
- break;
- }
- }
-
// Screen size
_screenWidth = 320;
_screenHeight = 240;
@@ -164,7 +152,27 @@ void OSystem_N64::initBackend() {
ConfMan.setBool("FM_medium_quality", true);
ConfMan.set("gui_theme", "modern"); // In case of modern theme being present, use it.
- _savefile = new PAKSaveManager();
+ FRAM_Init();
+
+ if (FRAM_Detect()) { // Use FlashRAM
+ initFramFS();
+ _savefile = new FRAMSaveManager();
+ } else { // Use PakFS
+ // Init Controller Pak
+ initPakFs();
+
+ // Use the first controller pak found
+ uint8 ctrl_num;
+ for (ctrl_num = 0; ctrl_num < 4; ctrl_num++) {
+ int8 pak_type = identifyPak(ctrl_num);
+ if (pak_type == 1) {
+ loadPakData(ctrl_num);
+ break;
+ }
+ }
+
+ _savefile = new PAKSaveManager();
+ }
_mixer = new Audio::MixerImpl(this);
_mixer->setReady(false);