All pastes #1014119 Raw Edit

patches.patch

public text v1 · immutable
#1014119 ·published 2008-05-10 21:55 UTC
rendered paste body
Index: arm9/source/Prefs.cpp
===================================================================
--- arm9/source/Prefs.cpp	(revision 149)
+++ arm9/source/Prefs.cpp	(working copy)
@@ -31,7 +31,7 @@
 	FILE* fp = fopen(PREFSPATH,"w");
 	if(!fp) return false;
 	
-	fprintf(fp, "<dslibris>\n");
+	fprintf(fp, "<dslibris paraspacing=\"%d\">\n", app->paraspacing);
 	fprintf(fp, "\t<screen brightness=\"%d\" invert=\"%d\" />\n",
 		app->brightness, app->ts->GetInvert());
 	//	fprintf(fp,	"\t<margin top=\"%d\" left=\"%d\" bottom=\"%d\" right=\"%d\" />\n",	app->margintop, app->marginleft, app->marginbottom, app->marginright);
Index: arm9/source/App.cpp
===================================================================
--- arm9/source/App.cpp	(revision 149)
+++ arm9/source/App.cpp	(working copy)
@@ -115,7 +115,7 @@
 		swiWaitForVBlank();
 		exit(-3);
 	}
-
+    
 	char filename[64];
 	while (bookcount < MAXBOOKS)
 	{
@@ -755,14 +755,14 @@
 
 	// page number
 
-	char msg[8];
+	char msg[15]; // Allow for a maximum of 4-character-length pagecounts
 	strcpy(msg,"");
 	if(pagecurrent == 0) 
-		sprintf((char*)msg,"[ %d >",pagecurrent+1);
+		sprintf((char*)msg,"[ %d / %d >",pagecurrent+1, pagecount+1);
 	else if(pagecurrent == pagecount)
-		sprintf((char*)msg,"< %d ]",pagecurrent+1);
+		sprintf((char*)msg,"< %d / %d ]",pagecurrent+1, pagecount+1);
 	else
-		sprintf((char*)msg,"< %d >",pagecurrent+1);
+		sprintf((char*)msg,"< %d / %d >",pagecurrent+1, pagecount+1);
 	ts->SetScreen(screen1);
 	u8 offset = (u8)((PAGE_WIDTH-marginleft-marginright-(ts->GetAdvance(40)*7))
 		* (pagecurrent / (float)pagecount));
Index: arm9/source/main.cpp
===================================================================
--- arm9/source/main.cpp	(revision 149)
+++ arm9/source/main.cpp	(working copy)
@@ -52,7 +52,18 @@
 
 	app->Log("prog : element %s\n", name);
  
-	if (!stricmp(name,"screen"))
+    if (!stricmp(name,"dslibris"))
+    {
+        for (i=0;attr[i];i+=2)
+        {
+            if (!stricmp(attr[i],"paraspacing"))
+            {
+                app->paraspacing = atoi(attr[i+1]);
+            }
+        }
+
+    }
+    else if (!stricmp(name,"screen"))
 	{
 		for(i=0;attr[i];i+=2)
 		{