From 69e8bafec135a2c3448b82b2770fe888c4faba47 Mon Sep 17 00:00:00 2001 From: GeoffreyFrogeye Date: Tue, 8 Apr 2014 18:46:29 +0200 Subject: [PATCH] Made SH4 compatible Actually not tested but doesn't break SH3 --- FXSH_Build.bat | 2 +- MonochromeLib.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/FXSH_Build.bat b/FXSH_Build.bat index 8cd9d51..61af57d 100644 --- a/FXSH_Build.bat +++ b/FXSH_Build.bat @@ -1,7 +1,7 @@ @echo off rem Do not edit! This batch file is created by CASIO fx-9860G SDK. - +if exist debug\*.obj del debug\*.obj if exist 2048.G1A del 2048.G1A cd debug diff --git a/MonochromeLib.c b/MonochromeLib.c index 9b753c8..c4b36b1 100644 --- a/MonochromeLib.c +++ b/MonochromeLib.c @@ -1,6 +1,7 @@ /*************************************************************/ /** MonochromeLib - monochrome graphic library for fx-9860G **/ /** MonochromeLib is free software **/ +/** MonochromeLib is now SH4 compatible ! **/ /** **/ /** @author Pierre "PierrotLL" Le Gall **/ /** @contact legallpierre89@gmail.com **/ @@ -116,12 +117,10 @@ #define rnd(x) ((int)(x+0.5)) //Thanks to Simon Lothar for this function -static int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070}; -static int (*SysCall)( int R4, int R5, int R6, int R7, int FNo ) = (void*)&SysCallCode; -char* ML_vram_adress() -{ - return (char*)((*SysCall)(0, 0, 0, 0, 309)); -} +typedef char*(*sc_cpv)(void); +const unsigned int sc0135[] = { 0xD201D002, 0x422B0009, 0x80010070, 0x0135 }; +#define ML_vram_adress (*(sc_cpv)sc0135) + #ifdef ML_CLEAR_VRAM void ML_clear_vram()