Skip to content

Commit

Permalink
GSM 0.38 Core readded (now fully PS2RD compatible)*
Browse files Browse the repository at this point in the history
It is based on 0.38 standalone version and also still rellocatable and per-game based.
The DTV576P** and DTV1080P*** vmodes are powered by a replacement code for SetGsCrt.
The Skip FMVs (Full Motion Videos) toggle has came back, it is based on NachBrenner's method #1****.
*Thanks Vedita BR for asking and testing it.
**Without this, only PSTwos (BIOS >= 220) have native support.
***None PS2 natively support it; it has been made possible by SP193 (research & development) and reprep (research).
****TODO: Implement other NachBrenner's methods, maybe merging with per-game OPL's appy_patches.
PS: VGA vmodes higher than 60Hz can reduce eye strain, depending on your monitor.
  • Loading branch information
doctorxyz committed Jan 5, 2016
1 parent 7bf1487 commit a3dcd16
Show file tree
Hide file tree
Showing 7 changed files with 756 additions and 139 deletions.
4 changes: 2 additions & 2 deletions DETAILED_CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

Open PS2 Loader detailed ChangeLog:

rev876 - Restorations and additions
rev875 - About Menu: Credits added
rev876 - Restorations and addtions - Wed Dec 23 13:00:14 2015 +0100
rev875 - About Menu: Credits added - Wed Nov 04 18:48:54 2015 -0500
rev874 - Updated changelog - Wed Nov 04 02:16:05 2015 +0100
rev873 - lang_Turkish.lng deleted - Wed Nov 04 00:38:44 2015 +0000
rev872 - lang_TChinese.lng deleted - Wed Nov 04 00:38:17 2015 +0000
Expand Down
2 changes: 1 addition & 1 deletion ee_core/include/gsm_api.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
void UpdateGSMParams(u32 interlace, u32 mode, u32 ffmd, u64 display, u64 syncv, u64 smode2, int dx_offset, int dy_offset);
void UpdateGSMParams(u32 interlace, u32 mode, u32 ffmd, u64 display, u64 syncv, u64 smode2, u32 dx_offset, u32 dy_offset, u8 skip_videos);
void EnableGSM(void);
void DisableGSM(void);
40 changes: 24 additions & 16 deletions ee_core/src/gsm_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,33 @@ struct VModeSettings{

struct GSRegisterValues{
u64 smode2;
u64 display;
u64 display1;
u64 display2;
u64 syncv;
};

struct GSRegisterFixValues{
u8 automatic_adaptation;
u8 auto_adaptation;
u8 smode2;
u8 display;
u8 syncv;
u32 X_offset;
u32 Y_offset;
u32 dx_offset;
u32 dy_offset;
};

struct GSRegisterAdaptationValues{
u64 display;
struct GSAdaptationValues{
u64 display1;
u64 display2;
u8 double_height;
u8 smode2;
u8 skip_videos;
};

extern struct VModeSettings Source_VModeSettings;
extern struct VModeSettings Target_VModeSettings;
extern struct GSRegisterValues Target_GSRegisterValues;
extern struct GSRegisterFixValues GSRegisterFixValues;
extern struct GSAdaptationValues GSAdaptationValues;

extern void Hook_SetGsCrt();
extern void GSHandler();
Expand All @@ -58,23 +62,27 @@ static unsigned int KSEG_backup[2]; //Copies of the original words at 0x80000100
/* Update GSM params */
/*-------------------*/
// Update parameters to be enforced by Hook_SetGsCrt syscall hook and GSHandler service routine functions
void UpdateGSMParams(u32 interlace, u32 mode, u32 ffmd, u64 display, u64 syncv, u64 smode2, int dx_offset, int dy_offset)
void UpdateGSMParams(u32 interlace, u32 mode, u32 ffmd, u64 display, u64 syncv, u64 smode2, u32 dx_offset, u32 dy_offset, u8 skip_videos)
{
Target_VModeSettings.interlace = (u32) interlace;
Target_VModeSettings.mode = (u32) mode;
Target_VModeSettings.ffmd = (u32) ffmd;
Target_VModeSettings.interlace = (u32) interlace;
Target_VModeSettings.mode = (u32) mode;
Target_VModeSettings.ffmd = (u32) ffmd;

Target_GSRegisterValues.smode2 = (u8) smode2;
Target_GSRegisterValues.display = (u64) display;
Target_GSRegisterValues.syncv = (u64) syncv;
Target_GSRegisterValues.smode2 = (u8) smode2;
Target_GSRegisterValues.display1 = (u64) display;
Target_GSRegisterValues.display2 = (u64) display;
Target_GSRegisterValues.syncv = (u64) syncv;

GSRegisterFixValues.automatic_adaptation = 0; // Automatic Adaptation -> 0 = On, 1 = Off ; Default = 0 = On
GSRegisterFixValues.auto_adaptation = 0; // Automatic Adaptation -> 0 = On, 1 = Off ; Default = 0 = On
GSRegisterFixValues.display = 0; // DISPLAYx Fix ---------> 0 = On, 1 = Off ; Default = 0 = On
GSRegisterFixValues.smode2 = 0; // SMODE2 Fix -----------> 0 = On, 1 = Off ; Default = 0 = On
GSRegisterFixValues.syncv = 0; // SYNCV Fix ------------> 0 = On, 1 = Off ; Default = 0 = On

GSRegisterFixValues.X_offset = dx_offset; // X-axis offset -> Use it only when automatic adaptations formulas don't suffice
GSRegisterFixValues.Y_offset = dy_offset; // Y-axis offset -> Use it only when automatic adaptations formulas don't suffice
GSRegisterFixValues.dx_offset = (u32) dx_offset; // X-axis offset -> Use it only when automatic adaptations formulas don't suffice
GSRegisterFixValues.dy_offset = (u32) dy_offset; // Y-axis offset -> Use it only when automatic adaptations formulas don't suffice

GSAdaptationValues.skip_videos = (u8) (skip_videos ^ 1); // Skip Videos Fix ------------> 0 = On, 1 = Off ; Default = 0 = On

}

/*------------------------------------------------------------------*/
Expand Down

0 comments on commit a3dcd16

Please sign in to comment.