[Scummvm-cvs-logs] SF.net SVN: scummvm:[50690] scummvm/trunk/backends/platform/ds/arm9/source

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Jul 5 18:11:34 CEST 2010


Revision: 50690
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50690&view=rev
Author:   fingolfin
Date:     2010-07-05 16:11:34 +0000 (Mon, 05 Jul 2010)

Log Message:
-----------
DS: Cleanup NDS portdefs.h a bit

* Don't #include "nds/ndstypes.h" everywhere
* Don't #define ITCM_DATA globally, it is only need in one place
* Fix STREAM_AUDIO_FROM_DISK definition (copy&paste error)
* Fix custom assert() implementation by using the do/while(0) trick
  for macros. Previously, there could be subtle errors caused by
  statements like
     if (COND) assert(...) else ...

Modified Paths:
--------------
    scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/portdefs.h
    scummvm/trunk/backends/platform/ds/arm9/source/ramsave.h
    scummvm/trunk/backends/platform/ds/arm9/source/zipreader.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/zipreader.h

Modified: scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2010-07-05 16:11:11 UTC (rev 50689)
+++ scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2010-07-05 16:11:34 UTC (rev 50690)
@@ -2834,6 +2834,8 @@
 ///////////////////
 
 #define FAST_RAM_SIZE (24000)
+#define ITCM_DATA	__attribute__((section(".itcm")))
+
 u8 *fastRamPointer;
 u8 fastRamData[FAST_RAM_SIZE] ITCM_DATA;
 

Modified: scummvm/trunk/backends/platform/ds/arm9/source/portdefs.h
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/portdefs.h	2010-07-05 16:11:11 UTC (rev 50689)
+++ scummvm/trunk/backends/platform/ds/arm9/source/portdefs.h	2010-07-05 16:11:34 UTC (rev 50690)
@@ -26,24 +26,8 @@
 #ifndef _PORTDEFS_H_
 #define _PORTDEFS_H_
 
-
-
-/*
-typedef unsigned char u8;
-typedef signed char s8;
-
-typedef unsigned short u16;
-typedef signed short s16;
-
-typedef unsigned int u32;
-typedef signed int s32;
-*/
-
-#include "nds/ndstypes.h"
-
-
-// Somebody removed these from scummsys.h, but they're still required, so I'm adding them here
-// in the hope that they'll stay.
+// Somebody removed these from scummsys.h, but they're still required, so I'm
+// adding them here in the hope that they'll stay.
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -53,8 +37,6 @@
 
 #define double float
 
-#define CT_NO_TRANSPARENCY
-
 #ifndef DISABLE_TEXT_CONSOLE
 #define DISABLE_TEXT_CONSOLE
 #endif
@@ -63,15 +45,12 @@
 #define DISABLE_COMMAND_LINE
 #endif
 
-#ifndef DISABLE_COMMAND_LINE
+#ifndef STREAM_AUDIO_FROM_DISK
 #define STREAM_AUDIO_FROM_DISK
 #endif
 
-//#undef assert
-//#define assert(expr) consolePrintf("Asserted!")
 #define NO_DEBUG_MSGS
 
-
 // This is defined in dsmain.cpp
 #ifdef __cplusplus
 extern "C" {
@@ -86,15 +65,17 @@
 #undef assert
 #endif
 
-#define assert(s) if (!(s)) consolePrintf("Assertion failed: '##s##' at file %s, line %d\n", __FILE__, __LINE__)
+#define assert(s) \
+	do { \
+		if (!(s)) \
+			consolePrintf("Assertion failed: '##s##' at file %s, line %d\n", __FILE__, __LINE__); \
+	} while (0)
 
 //#include "ds-fs.h"
 
 //#define debug(fmt, ...) consolePrintf(fmt, ##__VA_ARGS__)
 //#define debug(fmt, ...) debug(0, fmt, ##__VA_ARGS__)
 
-#define ITCM_DATA	__attribute__((section(".itcm")))
-
 // FIXME: Since I can't change the engine at the moment (post lockdown) this define can go here.
 // This define changes the mouse-relative motion which doesn't make sense on a touch screen to
 // a more conventional form of input where the menus can be clicked on.

Modified: scummvm/trunk/backends/platform/ds/arm9/source/ramsave.h
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/ramsave.h	2010-07-05 16:11:11 UTC (rev 50689)
+++ scummvm/trunk/backends/platform/ds/arm9/source/ramsave.h	2010-07-05 16:11:34 UTC (rev 50690)
@@ -26,9 +26,11 @@
 #ifndef _RAMSAVE_H_
 #define _RAMSAVE_H_
 
+#include <nds/ndstypes.h>
 #include "common/system.h"
 #include "common/savefile.h"
 
+
 // SaveFileManager class
 
 #define DS_MAX_SAVE_SIZE 150000

Modified: scummvm/trunk/backends/platform/ds/arm9/source/zipreader.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/zipreader.cpp	2010-07-05 16:11:11 UTC (rev 50689)
+++ scummvm/trunk/backends/platform/ds/arm9/source/zipreader.cpp	2010-07-05 16:11:34 UTC (rev 50690)
@@ -24,6 +24,7 @@
  */
 
 
+#include "common/scummsys.h"
 #include "zipreader.h"
 
 ZipFile::ZipFile() {

Modified: scummvm/trunk/backends/platform/ds/arm9/source/zipreader.h
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/zipreader.h	2010-07-05 16:11:11 UTC (rev 50689)
+++ scummvm/trunk/backends/platform/ds/arm9/source/zipreader.h	2010-07-05 16:11:34 UTC (rev 50690)
@@ -25,7 +25,9 @@
 
 #ifndef _ZIPREADER_H_
 #define _ZIPREADER_H_
-#include "portdefs.h"
+
+#include <nds/ndstypes.h>
+
 #define ZF_SEARCH_START 0x08000000
 #define ZF_SEARCH_END 0x09000000
 #define ZF_SEARCH_STRIDE 16


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