cosmito
Joined: 04 Mar 2007 Posts: 314 Location: Portugal
|
Posted: Mon Feb 15, 2010 3:49 am Post subject: [PS2] Fix for debug library for proper video mode selection |
|
|
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);
|
|
|