Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Feb 4, 2015
1 parent deb6357 commit 1b85d78
Show file tree
Hide file tree
Showing 18 changed files with 179 additions and 163 deletions.
5 changes: 2 additions & 3 deletions Makefile.menu2_wii
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ CC =powerpc-eabi-gcc
CXX =powerpc-eabi-g++
AS =powerpc-eabi-as

CFLAGS = -g -Ofast -Wall $(MACHDEP) $(INCLUDE) \
CFLAGS = -g -Ofast -mrvl -Wall $(INCLUDE) \
-fno-exceptions -Wno-unused-parameter -pipe \
-DUSE_GUI -DWII -DGLN64_GX -DUSE_EXPANSION \
-DUSE_RECOMP_CACHE -DPPC_DYNAREC -DFASTMEM -DMENU_V2\
-DRELEASE #-DSHOW_DEBUG #-DPRINTGECKO #-DPROFILE #-DDEBUGON #-DUSE_TLB_CACHE \
#-DNO_BT -DUSE_ROM_CACHE_L1 -DPRINTGECKO -DGLN64_SDLOG -DEMBEDDED_FONTS -DUSE_EXPANSION -DSHOW_STATS

MACHDEP = -DGEKKO -mrvl -msdata
LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map -Wl,--cref
LDFLAGS = -mrvl -Wl,-Map,$(notdir $@).map -Wl,--cref

INCLUDE = -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libfat/libogc/include
LIBPATHS = -L$(DEVKITPRO)/libogc/lib/wii -L$(DEVKITPRO)/libfat/libogc/lib/wii
Expand Down
43 changes: 25 additions & 18 deletions fileBrowser/fileBrowser-DVD.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@
/* DVD Globals */
int dvd_init = 0;

/* Worked out manually from my original Disc */
#define ZELDA_BONUS_ID "D43U01"
#define ZELDA_CLCTR_ID "PZLP01"
#define ZELDA_BONUS_OOT 0x54FBEEF4ULL
#define ZELDA_BONUS_MQ 0x52CCC5FCULL
#define ZELDA_CLCTR_OOT 0x3B9D1FC0ULL
#define ZELDA_CLCTR_MM 0x0C4E1FC0ULL
#define ZELDA_SIZE 0x2000000
#define ZELDA_OOT_NAME "Zelda - Ocarina of Time"
#define ZELDA_MQ_NAME "Zelda - Ocarina of Time Master Quest"
#define ZELDA_MM_NAME "Zelda - Majoras Mask"
Expand All @@ -67,33 +59,48 @@ int fileBrowser_DVD_readDir(fileBrowser_file* ffile, fileBrowser_file** dir){
dvd_init = 1;
}

if (!memcmp((void*)0x80000000, ZELDA_BONUS_ID, 6)) { //OoT+MQ bonus disc support.
if (!memcmp((void*)0x80000000, "D43U01", 6)) { //OoT+MQ bonus disc support.
num_entries = 2;
*dir = malloc( num_entries * sizeof(fileBrowser_file) );
strcpy( (*dir)[0].name, ZELDA_OOT_NAME);
(*dir)[0].discoffset = ZELDA_BONUS_OOT;
(*dir)[0].discoffset = 0x54FBEEF4ULL;
(*dir)[0].offset = 0;
(*dir)[0].size = ZELDA_SIZE;
(*dir)[0].size = 0x2000000;
(*dir)[0].attr = 0;
strcpy( (*dir)[1].name, ZELDA_MQ_NAME);
(*dir)[1].discoffset = ZELDA_BONUS_MQ;
(*dir)[1].discoffset = 0x52CCC5FCULL;
(*dir)[1].offset = 0;
(*dir)[1].size = ZELDA_SIZE;
(*dir)[1].size = 0x2000000;
(*dir)[1].attr = 0;
return num_entries;
}
else if (!memcmp((void*)0x80000000, ZELDA_CLCTR_ID, 6)) { //Zelda Collectors disc support.
else if (!memcmp((void*)0x80000000, "D43E01", 6)) {
num_entries = 2;
*dir = malloc( num_entries * sizeof(fileBrowser_file) );
strcpy( (*dir)[0].name, ZELDA_OOT_NAME);
(*dir)[0].discoffset = ZELDA_CLCTR_OOT;
(*dir)[0].discoffset = 0x550569D8ULL;
(*dir)[0].offset = 0;
(*dir)[0].size = ZELDA_SIZE;
(*dir)[0].size = 0x2000000;
(*dir)[0].attr = 0;
strcpy( (*dir)[1].name, ZELDA_MQ_NAME);
(*dir)[1].discoffset = 0x52FBC1E0ULL;
(*dir)[1].offset = 0;
(*dir)[1].size = 0x2000000;
(*dir)[1].attr = 0;
return num_entries;
}
else if (!memcmp((void*)0x80000000, "PZLP01", 6)) { //Zelda Collectors disc support.
num_entries = 2;
*dir = malloc( num_entries * sizeof(fileBrowser_file) );
strcpy( (*dir)[0].name, ZELDA_OOT_NAME);
(*dir)[0].discoffset = 0x3B9D1FC0ULL;
(*dir)[0].offset = 0;
(*dir)[0].size = 0x2000000;
(*dir)[0].attr = 0;
strcpy( (*dir)[1].name, ZELDA_MM_NAME);
(*dir)[1].discoffset = ZELDA_CLCTR_MM;
(*dir)[1].discoffset = 0x0C4E1FC0ULL;
(*dir)[1].offset = 0;
(*dir)[1].size = ZELDA_SIZE;
(*dir)[1].size = 0x2000000;
(*dir)[1].attr = 0;
return num_entries;
}
Expand Down
8 changes: 6 additions & 2 deletions gc_audio/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static unsigned int freq;
static AESNDPB *voice;

char audioEnabled;
char scalePitch;

static void aesnd_callback(AESNDPB *pb, uint32_t state)
{
Expand Down Expand Up @@ -100,7 +101,9 @@ EXPORT void CALL AiLenChanged(void)
length -= len;
} while (length > 0);

AESND_SetVoiceFrequency(voice, freq * (Timers.vis / VILimit));
if (scalePitch)
AESND_SetVoiceFrequency(voice, freq * (Timers.vis / VILimit));

IRQ_Restore(level);
}
}
Expand All @@ -120,6 +123,7 @@ EXPORT BOOL CALL InitiateAudio(AUDIO_INFO Audio_Info)

AESND_SetVoiceFormat(voice, VOICE_STEREO16);
AESND_SetVoiceStream(voice, true);
AESND_SetVoiceLoop(voice, true);

return TRUE;
}
Expand Down Expand Up @@ -148,5 +152,5 @@ void pauseAudio(void) {

void resumeAudio(void) {
AESND_SetVoiceFrequency(voice, freq);
AESND_Pause(false);
AESND_Pause(!audioEnabled);
}
4 changes: 2 additions & 2 deletions gc_memory/MEM2.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define KB (1024)

// MEM2 begins at MEM2_LO, the Starlet's Dedicated Memory begins at MEM2_HI
#define MEM2_LO ((char*)0x90080000)
#define MEM2_LO ((char*)0x90000000)
#define MEM2_HI ((char*)0x933E0000)
#define MEM2_SIZE (MEM2_HI - MEM2_LO)

Expand Down Expand Up @@ -102,7 +102,7 @@
+ FONT_SIZE + FLASHRAM_SIZE \
+ SRAM_SIZE + MEMPACK_SIZE \
+ BLOCKS_SIZE + RECOMPMETA_SIZE)
#if MEM2_USED_SIZE > (0x933E0000-0x90080000)
#if MEM2_USED_SIZE > (0x933E0000-0x90000000)
#error Too much MEM2 used!
#endif

Expand Down
2 changes: 1 addition & 1 deletion glN64_GX/Config_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void Config_LoadConfig()
OGL.fullscreenHeight = 480;
OGL.windowedWidth = 640;
OGL.windowedHeight = 480;
OGL.forceBilinear = 0;
OGL.forceBilinear = glN64_use2xSaiTextures;
OGL.enable2xSaI = glN64_use2xSaiTextures;
OGL.fog = 1;
OGL.textureBitDepth = 1; // normal (16 & 32 bits)
Expand Down
16 changes: 11 additions & 5 deletions glN64_GX/FrameBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
#include "Combiner.h"
#include "Types.h"

FrameBufferInfo frameBuffer;
FrameBufferInfo frameBuffer;

extern GXRModeObj *vmode, *rmode;

#ifdef __GX__
extern heap_cntrl* GXtexCache;
Expand Down Expand Up @@ -214,9 +216,11 @@ void FrameBuffer_SaveBuffer( u32 address, u16 size, u16 width, u16 height )
#else // !__GX__
//Note: texture realWidth and realHeight should be multiple of 2!
GX_SetTexCopySrc(OGL.GXorigX, OGL.GXorigY,(u16) current->texture->realWidth,(u16) current->texture->realHeight);
GX_SetTexCopyDst((u16) current->texture->realWidth,(u16) current->texture->realHeight, current->texture->GXtexfmt, GX_FALSE);
GX_SetTexCopyDst((u16) current->texture->realWidth,(u16) current->texture->realHeight, current->texture->GXtexfmt, GX_FALSE);
GX_SetCopyFilter(GX_FALSE, NULL, GX_FALSE, NULL);
if (current->texture->GXtexture) GX_CopyTex(current->texture->GXtexture, GX_FALSE);
GX_PixModeSync();
GX_PixModeSync();
GX_SetCopyFilter(GX_FALSE, NULL, GX_TRUE, rmode->vfilter);
#endif // __GX__

*(u32*)&RDRAM[current->startAddress] = current->startAddress;
Expand Down Expand Up @@ -325,9 +329,11 @@ void FrameBuffer_SaveBuffer( u32 address, u16 size, u16 width, u16 height )
#else // !__GX__
//Note: texture realWidth and realHeight should be multiple of 2!
GX_SetTexCopySrc((u16) OGL.GXorigX, (u16) OGL.GXorigY,(u16) current->texture->realWidth,(u16) current->texture->realHeight);
GX_SetTexCopyDst((u16) current->texture->realWidth,(u16) current->texture->realHeight, current->texture->GXtexfmt, GX_FALSE);
GX_SetTexCopyDst((u16) current->texture->realWidth,(u16) current->texture->realHeight, current->texture->GXtexfmt, GX_FALSE);
GX_SetCopyFilter(GX_FALSE, NULL, GX_FALSE, NULL);
if (current->texture->GXtexture) GX_CopyTex(current->texture->GXtexture, GX_FALSE);
GX_PixModeSync();
GX_PixModeSync();
GX_SetCopyFilter(GX_FALSE, NULL, GX_TRUE, rmode->vfilter);
#endif // __GX__

*(u32*)&RDRAM[current->startAddress] = current->startAddress;
Expand Down
2 changes: 1 addition & 1 deletion glN64_GX/GBI.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static inline u8 GXcastf32u8(register f32 in)
return rval;
}

static inline u8 GXcastf32u16(register f32 in)
static inline u16 GXcastf32u16(register f32 in)
{
u16 rval;
asm("psq_st%U0%X0 %1,%0,1,3" : "=m"(rval) : "f"(in) : "memory");
Expand Down
17 changes: 9 additions & 8 deletions glN64_GX/OpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ void OGL_DrawRect( int ulx, int uly, int lrx, int lry, float *color )
OGL_UpdateViewport();
glEnable( GL_SCISSOR_TEST );
#else // !__GX__
GX_SetScissor((u32) 0,(u32) 0,(u32) OGL.width+1,(u32) OGL.height+1); //Disable Scissor
GX_SetScissor((u32) 0,(u32) 0,(u32) OGL.width,(u32) OGL.height); //Disable Scissor
GX_SetCullMode (GX_CULL_NONE);
Mtx44 GXprojection;
guMtxIdentity(GXprojection);
Expand Down Expand Up @@ -1992,7 +1992,8 @@ void OGL_GXinitDlist()
// VIDEO_WaitVSync();

OGL.frameBufferTextures = glN64_useFrameBufferTextures;
OGL.enable2xSaI = glN64_use2xSaiTextures;
OGL.enable2xSaI = glN64_use2xSaiTextures;
OGL.forceBilinear = glN64_use2xSaiTextures;

// init primeDepthZtex, Ztexture, AlphaCompare, and Texture Clamping
TextureCache_UpdatePrimDepthZtex( 1.0f );
Expand Down Expand Up @@ -2077,12 +2078,12 @@ void OGL_GXclearEFB()
GX_SetAlphaCompare(GX_ALWAYS,0,GX_AOP_AND,GX_ALWAYS,0);
GX_SetFog(GX_FOG_NONE,0.1,1.0,0.0,1.0,(GXColor){0,0,0,255});
GX_SetViewport((f32) OGL.GXorigX,(f32) OGL.GXorigY,(f32) OGL.GXwidth,(f32) OGL.GXheight, 0.0f, 1.0f);
GX_SetScissor((u32) 0,(u32) 0,(u32) OGL.width+1,(u32) OGL.height+1); //Disable Scissor
GX_SetScissor((u32) 0,(u32) 0,(u32) OGL.width,(u32) OGL.height); //Disable Scissor
// GX_SetScissor(0,0,rmode->fbWidth,rmode->efbHeight);
GX_SetCullMode (GX_CULL_NONE);
Mtx44 GXprojection;
guMtxIdentity(GXprojection);
guOrtho(GXprojection, 0, OGL.height-1, 0, OGL.width-1, 0.0f, 1.0f);
guOrtho(GXprojection, 0, OGL.height, 0, OGL.width, 0.0f, 1.0f);
GX_LoadProjectionMtx(GXprojection, GX_ORTHOGRAPHIC);
GX_LoadPosMtxImm(OGL.GXmodelViewIdent,GX_PNMTX0);

Expand All @@ -2095,13 +2096,13 @@ void OGL_GXclearEFB()
GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
f32 ZmaxDepth = (f32) -0xFFFFFF/0x1000000;
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
GX_Position3f32(-1.0f, -1.0f, ZmaxDepth);
GX_Position3f32(0.0f, 0.0f, ZmaxDepth);
GX_Color4u8(OGL.GXclearColor.r, OGL.GXclearColor.g, OGL.GXclearColor.b, OGL.GXclearColor.a);
GX_Position3f32((f32) OGL.width+1, -1.0f, ZmaxDepth);
GX_Position3f32((f32) OGL.width, 0.0f, ZmaxDepth);
GX_Color4u8(OGL.GXclearColor.r, OGL.GXclearColor.g, OGL.GXclearColor.b, OGL.GXclearColor.a);
GX_Position3f32((f32) OGL.width+1,(f32) OGL.height+1, ZmaxDepth);
GX_Position3f32((f32) OGL.width,(f32) OGL.height, ZmaxDepth);
GX_Color4u8(OGL.GXclearColor.r, OGL.GXclearColor.g, OGL.GXclearColor.b, OGL.GXclearColor.a);
GX_Position3f32(-1.0f,(f32) OGL.height+1, ZmaxDepth);
GX_Position3f32(0.0f,(f32) OGL.height, ZmaxDepth);
GX_Color4u8(OGL.GXclearColor.r, OGL.GXclearColor.g, OGL.GXclearColor.b, OGL.GXclearColor.a);
GX_End();

Expand Down
20 changes: 7 additions & 13 deletions libgui/GraphicsGX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Graphics::Graphics(GXRModeObj *rmode)

VIDEO_Init();
vmode = VIDEO_GetPreferredMode(&vmode_phys);
vmode->viWidth = 720;
vmode->viXOrigin = 0;
VIDEO_SetTrapFilter(trapFilter);
VIDEO_Configure(vmode);

Expand Down Expand Up @@ -76,7 +78,6 @@ void Graphics::init()
{

f32 yscale;
u32 xfbHeight;
void *gpfifo = NULL;
GXColor background = {0, 0, 0, 0xff};

Expand All @@ -86,20 +87,13 @@ void Graphics::init()

GX_SetViewport(0,0,vmode->fbWidth,vmode->efbHeight,0,1);
yscale = GX_GetYScaleFactor(vmode->efbHeight,vmode->xfbHeight);
xfbHeight = GX_SetDispCopyYScale(yscale);
GX_SetDispCopyYScale(yscale);
GX_SetScissor(0,0,vmode->fbWidth,vmode->efbHeight);
GX_SetDispCopySrc(0,0,vmode->fbWidth,vmode->efbHeight);
GX_SetDispCopyDst(vmode->fbWidth,xfbHeight);
GX_SetCopyFilter(vmode->aa,vmode->sample_pattern,deFlicker,vmode->vfilter);
GX_SetFieldMode(vmode->field_rendering,((vmode->viHeight==2*vmode->xfbHeight)?GX_ENABLE:GX_DISABLE));

if (vmode->aa)
GX_SetPixelFmt(GX_PF_RGB565_Z16, GX_ZC_LINEAR);
else
GX_SetPixelFmt(GX_PF_RGB8_Z24, GX_ZC_LINEAR);
GX_SetDispCopyDst(vmode->fbWidth,vmode->xfbHeight);
GX_SetCopyFilter(GX_FALSE,NULL,GX_TRUE,vmode->vfilter);

GX_SetCullMode(GX_CULL_NONE);
GX_SetDispCopyGamma(GX_GM_1_0);

GX_InvVtxCache();
GX_InvalidateTexAll();
Expand Down Expand Up @@ -223,8 +217,8 @@ void Graphics::loadModelView()

void Graphics::loadOrthographic()
{
if(screenMode) guOrtho(currentProjectionMtx, 0, 479, -104, 743, 0, 700);
else guOrtho(currentProjectionMtx, 0, 479, 0, 639, 0, 700);
if(screenMode) guOrtho(currentProjectionMtx, 0, 480, -104, 744, 0, 700);
else guOrtho(currentProjectionMtx, 0, 480, 0, 640, 0, 700);
GX_LoadProjectionMtx(currentProjectionMtx, GX_ORTHOGRAPHIC);
}

Expand Down
6 changes: 3 additions & 3 deletions libgui/IPLFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ void IplFont::drawInit(GXColor fontColor)
// guMtxTransApply (GXmodelView2D, GXmodelView2D, 0.0F, 0.0F, -5.0F);
GX_LoadPosMtxImm(GXmodelView2D,GX_PNMTX0);
if(screenMode && menuActive)
guOrtho(GXprojection2D, 0, 479, -104, 743, 0, 700);
guOrtho(GXprojection2D, 0, 480, -104, 744, 0, 700);
else if(screenMode == SCREENMODE_16x9_PILLARBOX)
guOrtho(GXprojection2D, 0, 479, -104, 743, 0, 700);
guOrtho(GXprojection2D, 0, 480, -104, 744, 0, 700);
else
guOrtho(GXprojection2D, 0, 479, 0, 639, 0, 700);
guOrtho(GXprojection2D, 0, 480, 0, 640, 0, 700);
GX_LoadProjectionMtx(GXprojection2D, GX_ORTHOGRAPHIC);
// GX_SetViewport (0, 0, vmode->fbWidth, vmode->efbHeight, 0, 1);

Expand Down
1 change: 1 addition & 0 deletions main/gc_dvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ int init_dvd() {
else {
read_cmd = NORMAL;
}
dvd_read_id();
return 0;
#endif
}
Expand Down
Loading

0 comments on commit 1b85d78

Please sign in to comment.