Przeglądaj źródła

* Updated libndsfpc to ver.1.5.6 and devkitARM to r38

git-svn-id: trunk@21032 -
Legolas 13 lat temu
rodzic
commit
6bf0bc70a1

+ 23 - 0
packages/libndsfpc/src/nds/arm9/background.inc

@@ -266,6 +266,11 @@ procedure bgSetCenterf(id: cint; x, y: cint32); inline;
 procedure bgSetCenter(id, x, y: cint); inline;
 procedure bgSetAffineMatrixScroll(id, hdx, vdx, hdy, vdy, scrollx, scrolly: cint); inline;
 
+procedure bgExtPaletteEnable(); inline; 
+procedure bgExtPaletteEnableSub(); inline; 
+procedure bgExtPaletteDisable(); inline; 
+procedure bgExtPaletteDisableSub(); inline; 
+
 {$endif NDS_INTERFACE}
 
 {$ifdef NDS_IMPLEMENTATION}
@@ -585,6 +590,24 @@ begin
   bgState[id].dirty := false;
 end;
 
+procedure bgExtPaletteEnable(); inline; 
+begin 
+  REG_DISPCNT^ := REG_DISPCNT^ or DISPLAY_BG_EXT_PALETTE; 
+end;
+
+procedure bgExtPaletteEnableSub(); inline; 
+begin 
+  REG_DISPCNT_SUB^ := REG_DISPCNT_SUB^ or DISPLAY_BG_EXT_PALETTE; 
+end;
 
+procedure bgExtPaletteDisable(); inline; 
+begin 
+  REG_DISPCNT^ := REG_DISPCNT^ and not DISPLAY_BG_EXT_PALETTE; 
+end;
+
+procedure bgExtPaletteDisableSub(); inline; 
+begin 
+  REG_DISPCNT_SUB^ := REG_DISPCNT_SUB^ and not DISPLAY_BG_EXT_PALETTE; 
+end;
 
 {$endif NDS_IMPLEMENTATION}

+ 2 - 2
packages/libndsfpc/src/nds/arm9/video.inc

@@ -414,8 +414,8 @@ const
   DCAP_SIZE_256x192     = 3;
   DCAP_BANK_VRAM_A      = 0;
   DCAP_BANK_VRAM_B      = 1;
-  DCAP_BANK_VRAM_C      = 1;
-  DCAP_BANK_VRAM_D      = 2;
+  DCAP_BANK_VRAM_C      = 2;
+  DCAP_BANK_VRAM_D      = 3;
 
 const
   GFX_CONTROL           : pcuint16 = pointer($04000060);

+ 6 - 6
packages/libndsfpc/src/nds/arm9/videoGL.inc

@@ -54,7 +54,7 @@ function inttov16(n: cint): cint{v16}; inline;
 function f32tov16(n: cint32): v16; inline; 
 function v16toint(n: v16): cint; inline;
 function floattov16(n: cfloat): v16; inline;
-function VERTEX_PACK(x,y: cint): cint; inline;
+function VERTEX_PACK(x,y: cint): cuint32; inline;
 
 type
   v10 = cint16;
@@ -63,7 +63,7 @@ function inttov10(n: cint): cint; inline;
 function f32tov10(n: cint32): cint; inline;
 function v10toint(n: v10): cint; inline;
 function floattov10(n: cfloat): v10; inline;
-function NORMAL_PACK(x,y,z: cint): cint; inline;
+function NORMAL_PACK(x,y,z: cint): cuint32; inline;
 
 type
   rgb = cushort;
@@ -531,9 +531,9 @@ begin
   floattov16 := v16(trunc(n * (1 shl 12)));
 end;
 
-function VERTEX_PACK(x,y: cint): cint; inline;
+function VERTEX_PACK(x,y: cint): cuint32; inline;
 begin
-  VERTEX_PACK := (x and $FFFF) or (y shl 16);
+  VERTEX_PACK := cuint32((x and $FFFF) or (y shl 16));
 end;
 
 function inttov10(n: cint): cint; inline;
@@ -559,9 +559,9 @@ begin
 	  floattov10 := trunc(n * (1 shl 9));
 end;
 
-function NORMAL_PACK(x,y,z: cint): cint; inline;
+function NORMAL_PACK(x,y,z: cint): cuint32; inline;
 begin
-  NORMAL_PACK := ((x and $3FF) or ((y and $3FF) shl 10) or (z shl 20));
+  NORMAL_PACK := cuint32((x and $3FF) or ((y and $3FF) shl 10) or (z shl 20));
 end;
 
 //---------------------------------------------------------------------------------

+ 2 - 0
packages/libndsfpc/src/nds/fifocommon.inc

@@ -44,6 +44,8 @@ const
   SYS_REQ_KEYS       : FifoSystemCommands = 1;
   SYS_REQ_TIME       : FifoSystemCommands = 2;
   SYS_SET_TIME       : FifoSystemCommands = 3;
+  SDMMC_INSERT       : FifoSystemCommands = 4;
+  SDMMC_REMOVE       : FifoSystemCommands = 5;  
   
 type
  FifoSdmmcCommands = integer;

+ 4 - 1
packages/libndsfpc/src/nds/system.inc

@@ -51,7 +51,7 @@ procedure powerOn(bits: cint); cdecl; external;
 procedure powerOff(bits: cint); cdecl; external;
 
 procedure systemMsgHandler(bytes: cint; user_data: pointer); cdecl; external;
-procedure powerValueHandler(value: cuint32; data: pointer); cdecl; external;
+procedure systemValueHandler(value: cuint32; data: pointer); cdecl; external;
 
 procedure lcdSwap(); inline; 
 procedure lcdMainOnTop(); inline; 
@@ -78,6 +78,9 @@ type
 var
   SystemVectors: sysVectors; cvar; external;
 
+//void setSDcallback(void(*callback)(int));
+procedure setSDcallback(callback: pointer); cdecl; external; // ??
+
 // Helper functions for heap size
 //! returns current start of heap space
 function getHeapStart(): pcuint8; cdecl; external;