[Scummvm-cvs-logs] SF.net SVN: scummvm: [25237] scummvm/branches/branch-0-9-0/backends/ds/arm9 /source

agent-q at users.sourceforge.net agent-q at users.sourceforge.net
Sun Jan 28 00:54:16 CET 2007


Revision: 25237
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25237&view=rev
Author:   agent-q
Date:     2007-01-27 15:54:15 -0800 (Sat, 27 Jan 2007)

Log Message:
-----------
Changes made for 0.9.1a beta2 release

Modified Paths:
--------------
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/cdaudio.cpp
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/ds-fs.h
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/dsmain.cpp
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/disc_io.c
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/disc_io.h
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_m3sd.c
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_njsd.c
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_scsd.c
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_scsd.h
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/osystem_ds.cpp
    scummvm/branches/branch-0-9-0/backends/ds/arm9/source/portdefs.h

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/cdaudio.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/cdaudio.cpp	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/cdaudio.cpp	2007-01-27 23:54:15 UTC (rev 25237)
@@ -114,7 +114,7 @@
 }
 
 void setActive(bool active) {
-	active = active;
+	DS::CD::active = active;
 }
 
 bool getActive() {
@@ -232,7 +232,7 @@
 	
 	//decompressBlock();
 	playNextBlock();
-	numLoops = numLoops;
+	DS::CD::numLoops = numLoops;
 }
 
 void update() {

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/ds-fs.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/ds-fs.h	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/ds-fs.h	2007-01-27 23:54:15 UTC (rev 25237)
@@ -20,6 +20,7 @@
 #ifndef _DS_FS_H
 #define _DS_FS_H
 
+#define USE_ASSERTS
 
 #include "stdafx.h"
 #include "common/array.h"
@@ -176,7 +177,18 @@
 #define getcwd(dir, dunno)					DS::std_getcwd(dir, dunno)
 #define ferror(handle)						DS::std_ferror(handle)
 
+#ifdef assert
+#undef assert
+#endif
 
+
+#ifdef USE_ASSERTS
+#define assert(s) if (!(s)) consolePrintf("Assertion failed: '##s##' at file %s, line %d\n", __FILE__, __LINE__)
+#else
+#define assert(s)
+#endif
+
+
 }
 
 #endif

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/dsmain.cpp	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/dsmain.cpp	2007-01-27 23:54:15 UTC (rev 25237)
@@ -34,6 +34,14 @@
 // - Delete files
 // - Fatlib conversion
 
+// - Software scalar
+// - Delete files
+// - Unified menu?
+// - Drivers for EZ Flash IV and DS Xtreme?
+// - Stereo audio
+
+//#define USE_BUILT_IN_DRIVER_SELECTION
+
 #include <nds.h>
 
 #include <ARM9/console.h> //basic print funcionality
@@ -468,7 +476,7 @@
 	BG0_Y0 = 0;
 	
 	// Restore palette entry used by text in the front-end	
-	PALETTE_SUB[255] = savedPalEntry255;
+//	PALETTE_SUB[255] = savedPalEntry255;
 	
 	consoleInitDefault((u16*)SCREEN_BASE_BLOCK(0), (u16*)CHAR_BASE_BLOCK(1), 16);
 	consolePrintSet(0, 23);
@@ -1875,16 +1883,18 @@
 
 bool GBAMPAvail = false;
 
-void initGBAMP(int mode) {	
+bool initGBAMP(int mode) {	
 	if (FAT_InitFiles()) {
 		if (mode == 2)	{
 			disc_IsInserted();
 		}
 		GBAMPAvail = true;
-		consolePrintf("Found flash card reader!\n");
+//		consolePrintf("Found flash card reader!\n");
+		return true;
 	} else {
 		GBAMPAvail = false;
-		consolePrintf("Flash card reader not found!\n");
+//		consolePrintf("Flash card reader not found!\n");
+		return false;
 	}
 }
 	 
@@ -2022,41 +2032,43 @@
 	
 
 	
-	consolePrintf("---------------------------\n");
+	consolePrintf("-------------------------------\n");
 	consolePrintf("ScummVM DS\n");
 	consolePrintf("Ported by Neil Millstone\n");
-	consolePrintf("Version 0.9.1");
+	consolePrintf("Version 0.9.1a beta2 ");
 #if defined(DS_BUILD_A)
 	consolePrintf("build A\n");
 	consolePrintf("Supports: Lucasarts SCUMM\n");
-	consolePrintf("---------------------------\n");
+	consolePrintf("-------------------------------\n");
 #elif defined(DS_BUILD_B)
 	consolePrintf("build B\n");
 	consolePrintf("Supports: BASS, QUEEN\n");
-	consolePrintf("---------------------------\n");
+	consolePrintf("-------------------------------\n");
 #elif defined(DS_BUILD_C)
 	consolePrintf("build C\n");
-	consolePrintf("---------------------------\n");
 	consolePrintf("Supports: SIMON, KYRA, GOB\n");
+	consolePrintf("-------------------------------\n");
 #endif
-	consolePrintf("L/R + D-pad/pen: Scroll view\n");
-	consolePrintf("D-pad left:  Left mouse button\n");
+	consolePrintf("L/R + D-pad/pen:    Scroll view\n");
+	consolePrintf("D-pad left:   Left mouse button\n");
 	consolePrintf("D-pad right: Right mouse button\n");
-	consolePrintf("D-pad up:    Hover mouse\n");
-	consolePrintf("B button:    Skip cutscenes\n");
-	consolePrintf("Select:		DS Options menu\n");
-	consolePrintf("Start:       Game menu\n");
-	consolePrintf("Y (in game): Toggle console\n");
-	consolePrintf("X:           Toggle keyboard\n");
-	consolePrintf("A:			Swap screens\n");
-	consolePrintf("L+R (on start): Clear SRAM\n");
+	consolePrintf("D-pad up:           Hover mouse\n");
+	consolePrintf("B button:        Skip cutscenes\n");
+	consolePrintf("Select:		   DS Options menu\n");
+	consolePrintf("Start:   Game menu (some games)\n");
+	consolePrintf("Y (in game):     Toggle console\n");
+	consolePrintf("X:              Toggle keyboard\n");
+	consolePrintf("A:                 Swap screens\n");
+	consolePrintf("L+R (on start):      Clear SRAM\n");
 
 #if defined(DS_BUILD_A)
 	consolePrintf("For a complete key list see the\n");
-	consolePrintf("help screen.\n\n");
+	consolePrintf("help screen.\n");
 #endif
 
-	
+	consolePrintf("\n");
+
+#ifdef USE_BUILT_IN_DRIVER_SELECTION
 	// Do M3 detection selectioon
 	int extraData = DSSaveFileManager::getExtraData();
 	bool present = DSSaveFileManager::isExtraDataPresent();
@@ -2093,7 +2105,11 @@
 
 	disc_setEnable(mode);
 	DSSaveFileManager::setExtraData(mode);
+#else
+	
+	int mode = 0;
 
+#endif
 
 /*
 	if ((present) && (extraData & 0x00000001)) {
@@ -2123,7 +2139,13 @@
 	DSFileSystemNode* node = new DSFileSystemNode();
 	if (!node->getZip() || (!node->getZip()->isReady())) {
 		// If not found, init CF/SD driver
-		initGBAMP(mode);
+		if (!initGBAMP(mode)) {
+			consolePrintf("\nNo file system was found.\n");
+			consolePrintf("View the README_DLDI.TXT file\n");
+			consolePrintf("for more information.\n");
+
+			while (1);
+		}
 	}
 	delete node;
 
@@ -2161,7 +2183,7 @@
 	}
 #else
 	while (1) {
-		scummvm_main(1, (char **) &argv);
+		scummvm_main(2, (char **) &argv);
 		powerOff();
 	}
 #endif

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/disc_io.c
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/disc_io.c	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/disc_io.c	2007-01-27 23:54:15 UTC (rev 25237)
@@ -77,6 +77,8 @@
  #include "io_mmcf.h"
 #endif
 
+#include "io_dldi.h"
+
 // Keep a pointer to the active interface
 LPIO_INTERFACE active_interface = 0;
 
@@ -90,6 +92,8 @@
 */
 int discDetect = 0;
 
+int dldiFound = FALSE;
+
 #ifdef DISC_CACHE
 
 #include <string.h>
@@ -104,6 +108,8 @@
 	u32 count;
 } cache[ DISC_CACHE_COUNT ];
 
+FATDevice currentDevice;
+
 static u32 disc_CacheFind(u32 sector) {
 	u32 i;
 	
@@ -245,6 +251,7 @@
 		if (active_interface->fn_StartUp())
 		{
 			// set M3 SD as default IO
+			currentDevice = DEVICE_M3SD;
 			return true ;
 		} ;
 	}
@@ -259,6 +266,7 @@
 	if (active_interface->fn_StartUp())
 	{
 		// set MMCF as default IO
+		currentDevice = DEVICE_MMCF;
 		return true ;
 	} ;
 #endif
@@ -271,6 +279,7 @@
 	if (active_interface->fn_StartUp())
 	{
 		// set M3 CF as default IO
+		currentDevice = DEVICE_M3CF;
 		return true ;
 	} ;
 #endif
@@ -282,6 +291,7 @@
 	if (active_interface->fn_StartUp())
 	{
 		// set GBAMP as default IO
+		currentDevice = DEVICE_MPCF;
 		return true ;
 	} ;
 #endif
@@ -293,6 +303,7 @@
 	if (active_interface->fn_StartUp())
 	{
 		// set SC CF as default IO
+		currentDevice = DEVICE_SCCF;
 		return true ;
 	} ;
 #endif
@@ -325,6 +336,11 @@
 	return false;
 }
 
+
+FATDevice disc_getDeviceId() {
+	return currentDevice;
+}
+
 #ifdef NDS
 // Check the DS card slot for a valid memory card interface
 // If an interface is found, it is set as the default interace
@@ -339,6 +355,27 @@
 	WAIT_CR |= (1<<11);
 #endif
 
+	active_interface = DLDI_GetInterface();
+
+	if (stricmp(&_dldi_driver_name, "Default (No interface)")) {
+		char name[48];
+		memcpy(name, &_dldi_driver_name, 48);
+		name[47] = '\0';
+		consolePrintf("DLDI Device:\n'%s'\n", name);
+		dldiFound = TRUE;
+	} else {
+		consolePrintf("DLDI Driver not patched!\n");
+		dldiFound = FALSE;
+	}
+
+	if (active_interface->fn_StartUp()) {
+		consolePrintf("DLDI Driver Initialised OK!\n");
+		currentDevice = DEVICE_DLDI;
+		return true;
+	} else {
+		consolePrintf("DLDI Initialise failed.\n");
+	}
+
 #ifdef SUPPORT_SCSD
 	// check if we have a SuperCard SD plugged in
 	if (discDetect == 2) {
@@ -347,6 +384,7 @@
 		if (active_interface->fn_StartUp())
 		{
 			// set SC SD as default IO
+			currentDevice = DEVICE_SCSD;
 			return true ;
 		} ;
 	}
@@ -358,6 +396,7 @@
 	if (active_interface->fn_StartUp())
 	{
 		// set NJSD as default IO
+		currentDevice = DEVICE_NJSD;
 		return true ;
 	} ;
 #endif
@@ -368,6 +407,7 @@
 	if (active_interface->fn_StartUp())
 	{
 		// set Neoflash MK2 / MK3 as default IO
+		currentDevice = DEVICE_NMMC;
 		return true ;
 	} ;
 #endif

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/disc_io.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/disc_io.h	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/disc_io.h	2007-01-27 23:54:15 UTC (rev 25237)
@@ -15,17 +15,19 @@
 
 // Device support options, added by www.neoflash.com
 
-#define SUPPORT_NMMC		// comment out this line to remove Neoflash MK2 MMC Card support
-#define SUPPORT_MPCF		// comment out this line to remove GBA Movie Player support
-#define SUPPORT_M3CF		// comment out this line to remove M3 Perfect CF support
-#define SUPPORT_M3SD		// comment out this line to remove M3 Perfect SD support
-#define SUPPORT_SCCF		// comment out this line to remove Supercard CF support
-#define SUPPORT_SCSD		// comment out this line to remove Supercard SD support
+//#define SUPPORT_MPCF		// comment out this line to remove GBA Movie Player support
+//#define SUPPORT_M3CF		// comment out this line to remove M3 Perfect CF support
+//#define SUPPORT_M3SD		// comment out this line to remove M3 Perfect SD support
+//#define SUPPORT_SCCF		// comment out this line to remove Supercard CF support
+//#define SUPPORT_SCSD		// comment out this line to remove Supercard SD support
+//#define SUPPORT_NJSD
+//#define SUPPORT_MMCF
+
 //#define SUPPORT_EFA2		// comment out this line to remove EFA2 linker support
-#define SUPPORT_FCSR		// comment out this line to remove GBA Flash Cart support
-#define SUPPORT_NJSD
-#define SUPPORT_MMCF
+//#define SUPPORT_FCSR		// comment out this line to remove GBA Flash Cart support
+//#define SUPPORT_NMMC		// comment out this line to remove Neoflash MK2 MMC Card support
 
+
 // Disk caching options, added by www.neoflash.com
 // Each additional sector cache uses 512 bytes of memory
 // Disk caching is disabled on GBA to conserve memory
@@ -72,6 +74,20 @@
 extern "C" {
 #endif
 
+
+typedef enum {
+	DEVICE_NONE = 0,
+	DEVICE_M3SD,
+	DEVICE_MMCF,
+	DEVICE_M3CF,
+	DEVICE_MPCF,
+	DEVICE_SCCF,
+	DEVICE_NJSD,
+	DEVICE_SCSD,
+	DEVICE_NMMC,
+	DEVICE_DLDI
+} FATDevice;
+
 /*-----------------------------------------------------------------
 disc_Init
 Detects the inserted hardware and initialises it if necessary
@@ -88,6 +104,8 @@
 
 
 extern void disc_setEnable(int en);
+extern FATDevice disc_getDeviceId();
+
 /*-----------------------------------------------------------------
 disc_ReadSectors
 Read 512 byte sector numbered "sector" into "buffer"
@@ -161,6 +179,7 @@
 #define FEATURE_SLOT_GBA			0x00000010
 #define FEATURE_SLOT_NDS			0x00000020
 
+
 typedef bool (* FN_MEDIUM_STARTUP)(void) ;
 typedef bool (* FN_MEDIUM_ISINSERTED)(void) ;
 typedef bool (* FN_MEDIUM_READSECTORS)(u32 sector, u8 numSecs, void* buffer) ;

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_m3sd.c
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_m3sd.c	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_m3sd.c	2007-01-27 23:54:15 UTC (rev 25237)
@@ -1,7 +1,7 @@
 
 #define io_M3SD_c
 #include "io_m3sd.h"
-
+#ifdef SUPPORT_M3SD
 //M3-SD interface SD card.
 
 #define DMA3SAD      *(volatile u32*)0x040000D4
@@ -379,3 +379,5 @@
 {
 	return &io_m3sd ;
 }
+
+#endif

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_njsd.c
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_njsd.c	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_njsd.c	2007-01-27 23:54:15 UTC (rev 25237)
@@ -35,6 +35,7 @@
 
 #include "io_njsd.h"
 
+#ifdef SUPPORT_NJSD
 #ifdef NDS
 
 #include <nds.h>
@@ -677,3 +678,4 @@
 } ;
 
 #endif // defined NDS
+#endif
\ No newline at end of file

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_scsd.c
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_scsd.c	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_scsd.c	2007-01-27 23:54:15 UTC (rev 25237)
@@ -26,6 +26,8 @@
 
 #include "io_scsd.h"
 
+#ifdef SUPPORT_SCSD
+
 /*-----------------------------------------------------------------
 Since all CF addresses and commands are the same for the GBAMP,
 simply use it's functions instead.
@@ -101,3 +103,4 @@
 	return &io_scsd ;
 } ;
 
+#endif
\ No newline at end of file

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_scsd.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_scsd.h	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/fat/io_scsd.h	2007-01-27 23:54:15 UTC (rev 25237)
@@ -26,33 +26,4 @@
 // export interface
 extern LPIO_INTERFACE SCSD_GetInterface(void) ;
 
-#endif	// define IO_SCSD_H
-/*
-	io_scsd.h by SaTa.
-	based on io_sccf.h
-	
-	
-*/
-
-/*
-	io_sccf.h 
-
-	Hardware Routines for reading a compact flash card
-	using the GBA Movie Player
-
-	This software is completely free. No warranty is provided.
-	If you use it, please give me credit and email me about your
-	project at chishm at hotmail.com
-
-	See gba_nds_fat.txt for help and license details.
-*/
-
-#ifndef IO_SCSD_H
-#define IO_SCSD_H
-
-#include "disc_io.h"
-
-// export interface
-extern LPIO_INTERFACE SCSD_GetInterface(void) ;
-
-#endif	// define IO_SCSD_H
+#endif	// define IO_SCSD_H
\ No newline at end of file

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/osystem_ds.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/osystem_ds.cpp	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/osystem_ds.cpp	2007-01-27 23:54:15 UTC (rev 25237)
@@ -466,7 +466,19 @@
 
 bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) {
 	surf->create(DS::getGameWidth(), DS::getGameHeight(), 1);
-	memcpy(surf->pixels, DS::get8BitBackBuffer(), DS::getGameWidth() * DS::getGameHeight());
+
+	// Ensure we copy using 16 bit quantities due to limitation of VRAM addressing
+	// TODO: Change this to work with the software scalar (hint: video ram format is different)
+	u16* image = (u16 *) DS::get8BitBackBuffer();
+	for (int y = 0; y <  DS::getGameHeight(); y++)
+	{
+		DC_FlushRange((image + (y * 512)), DS::getGameWidth());
+		for (int x = 0; x < DS::getGameWidth() >> 1; x++)
+		{
+			*(((u16 *) (surf->pixels)) + y * (DS::getGameWidth() >> 1) + x) = *(image + y * 256 + x);
+		}
+	}
+
 	return true;
 }
 

Modified: scummvm/branches/branch-0-9-0/backends/ds/arm9/source/portdefs.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/ds/arm9/source/portdefs.h	2007-01-27 23:50:09 UTC (rev 25236)
+++ scummvm/branches/branch-0-9-0/backends/ds/arm9/source/portdefs.h	2007-01-27 23:54:15 UTC (rev 25237)
@@ -35,8 +35,6 @@
 
 #define CT_NO_TRANSPARENCY
 
-#undef assert
-#define assert(expr) consolePrintf("Asserted!")
 //#define NO_DEBUG_MSGS
 #include "ds-fs.h"
 


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