forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[PS2] Fix for debug library for proper video mode selection

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> Patch Submissions
View previous topic :: View next topic  
Author Message
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Mon Feb 15, 2010 3:49 am    Post subject: [PS2] Fix for debug library for proper video mode selection Reply with quote

This fixes debug lib for proper PAL/NTSC screen mode initialization. It's just what gsKit currently uses that works equally well at PS2 fat and slim models.

Code:
Index: src/scr_printf.c
===================================================================
--- src/scr_printf.c   (revision 1664)
+++ src/scr_printf.c   (working copy)
@@ -66,6 +66,19 @@
 /* charmap must be 16 byte aligned.  */
 static u32   charmap[64] __attribute__ (( aligned (16) ));
 
+// from gsKit
+static int debug_detect_signal()
+{
+   char romname[14];
+   GetRomName((char *)romname);
+   if (romname[4] == 'E') {
+      return 1;
+   }
+   else {
+      return 0;
+   }
+}
+
 static void Init_GS( int a, int b, int c)
 {
    u64   *mem = (u64 *)0x12001000;
@@ -187,9 +200,15 @@
    X = Y = 0;
    EI();
    DmaReset();
-/// EEUG: note that access to 0x1FC7FF52 causes
-///       crash on SCPH-77004. Probably this code must be revised
-   Init_GS( 0, ((*((char*)0x1FC7FF52))=='E')+2, 1);
+///// EEUG: note that access to 0x1FC7FF52 causes
+/////       crash on SCPH-77004. Probably this code must be revised
+//   Init_GS( 0, ((*((char*)0x1FC7FF52))=='E')+2, 1);
+     
+   if (debug_detect_signal() == 1)
+       Init_GS( 0, 3, 1);
+   else
+       Init_GS( 0, 2, 1);
+
    SetVideoMode();
    Dma02Wait();
    progdma( &setupscr, 15);
Back to top
View user's profile Send private message Visit poster's website
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Fri Mar 12, 2010 10:02 am    Post subject: Reply with quote

Committed in rev 1665, thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> Patch Submissions All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group