38,59d37
< #ifdef DEBUG
< #include "font.h"
< #endif
< 
< 
< #ifdef HAVE_LIBGL
< #define USE_OPENGL
< #endif
< 
< #ifdef USE_OPENGL
< #include "../ygl.h"
< extern Mtx model;
< #define DEFAULT_FIFO_SIZE       (256*1024)
< GXColor background = {0, 0, 0, 0xff};
< #endif
< 
< #ifdef HAVE_LIBGLUT
< //#define GLUT_BITMAP_HELVETICA_12        ((void*)7)
< //#define GLUT_BITMAP_TIMES_ROMAN ((void*)4)
< //#define GLUT_BITMAP_HELVETICA_12        ((void*)4)
< //GLUTAPI void *glutBitmapHelvetica12;
< #endif
120,122d97
< #ifdef HAVE_Q68
< &M68KQ68,
< #endif
135,137d109
< #ifdef WIIDEBUG
<    FILE *debugfp;
< #endif
156,219d127
< GLenum MatorixMode;
< Mtx44 project;
< 
< 
< 
< ////GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character) {
< //void glutBitmapCharacter(void *font, int character) {
< //}
< 
< GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ) {
< 	MatorixMode=mode;
< }
< 
< void Mtx44Identity(Mtx44 mt)
< {
<         s32 i,j;
< 
<         for(i=0;i<4;i++) {
<                 for(j=0;j<4;j++) {
<                         if(i==j) mt[i][j] = 1.0;
<                         else mt[i][j] = 0.0;
<                 }
<         }
< }
< 
< GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
<                                  GLdouble bottom, GLdouble top,
<                                  GLdouble near_val, GLdouble far_val ) {
<   if(MatorixMode==GL_PROJECTION) {
<     Mtx44Identity(project);
<     guOrtho(project,top, bottom, left, right, near_val, far_val);
<     GX_LoadProjectionMtx(project, GX_ORTHOGRAPHIC);
<   } else if (MatorixMode==GL_TEXTURE) {
<     guLightOrtho(model, top, bottom, left, right, 1, 1, 0, 0);    
<     GX_LoadTexMtxImm(model, GX_TEXMTX0,GX_MTX3x4);
<   }
< }
< 
< 
< GLAPI void GLAPIENTRY glViewport( GLint x, GLint y,
<                                     GLsizei width, GLsizei height ) {
<   GX_SetViewport(x, y, width, height, 0, 1);
< }
< 
< GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ) {
<   rmode->viXOrigin = x;
<   rmode->viYOrigin = y;
< }
< 
< GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ) {
< }
< 
< //GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height,
< //                                    GLenum format, GLenum type,
< //                                    const GLvoid *pixels ) {
< //}
< 
< void YuiSetVideoAttribute(int type, int val) {
< }
< 
< int YuiSetVideoMode(int width, int height, int bpp, int fullscreen) {
<         return 0;
< }
< 
265a174
>    PAD_Init();
271d179
<    //fat_remount();
287,289d194
< if(FirstRun) {
<    FirstRun=0;
< 
308a214,220
>    if(FirstRun) {
>       FirstRun=0;
>    } else {
>      //YabauseDeInit();
>    }
> 
> 
328,352d239
< #ifdef USE_OPENGL
<         // setup the fifo and then init the flipper
<         void *gp_fifo = NULL;
<         gp_fifo = memalign(32,DEFAULT_FIFO_SIZE);
<         memset(gp_fifo,0,DEFAULT_FIFO_SIZE);
< 
<         GX_Init(gp_fifo,DEFAULT_FIFO_SIZE);
< 
<         // clears the bg to color and clears the z buffer
<         GX_SetCopyClear(background, 0x00ffffff);
< #endif
< 
< } else {
<    //YabauseDeInit();
<    //YabauseReset();
<    YabauseResetButton();
< }
< #ifdef WIIDEBUG
<    if((debugfp=fopen("/SSROMS/debug.txt","a"))==NULL)
<       exit(-1);
<    fprintf(debugfp,"-----------------------------\r\n");
<    fprintf(debugfp,"Start %s\r\n",isofilename);
<    fclose(debugfp);
< #endif
< 
359,361d245
< #ifdef HAVE_Q68
<    yinit.m68kcoretype = M68KCORE_Q68;
< #else
363d246
< #endif
388d270
< 
440,442c322
< #ifndef GEKKO
<       for (i = 0; i < vdp2width; i++)
< #else
---
> //      for (i = 0; i < vdp2width; i++)
444d323
< #endif
446d324
< #ifndef OLD_COLDE
449c327
<       
---
> 
454c332
<         
---
> 
461,480d338
< #else
<          // This isn't pretty
<          int y1, cb1, cr1;
<          int cb, cr;
<          u8 r, g, b;
<       
<          r = buf[0] >> 24;
<          g = buf[0] >> 16;
<          b = buf[0] >> 8;
<          buf++;
<         
<          y1 = (299 * r + 587 * g + 114 * b) / 1000;
<          cb1 = (-16874 * r - 33126 * g + 50000 * b + 12800000) / 100000;
<          cr1 = (50000 * r - 41869 * g - 8131 * b + 12800000) / 100000;
<          cb = (cb1 + cb1) >> 1;
<          cr = (cr1 + cr1) >> 1;
< 
<          curfb[0] = (y1 << 24) | (cb << 16) | (y1 << 8) | cr;
<          curfb++;
< #endif
496d353
<    char debug_buff[256];
503,509d359
< #ifdef DEBUG
<    sprintf(debug_buff, string, arglist);
<         //Write menu/debug text on screen
<         GXColor fontColor = {150,255,150,255};
<         write_font_init_GX(fontColor);
<                 write_font(10,35,debug_buff, 1.0);
< #endif
592a443
>       PAD_ScanPads();
596c447,448
<           WPAD_ButtonsDown(0) & WPAD_BUTTON_RIGHT)
---
>           WPAD_ButtonsDown(0) & WPAD_BUTTON_RIGHT ||
>           PAD_ButtonsDown(0) & PAD_BUTTON_UP)
607c459,460
<                WPAD_ButtonsDown(0) & WPAD_BUTTON_LEFT)
---
>                WPAD_ButtonsDown(0) & WPAD_BUTTON_LEFT ||
>                PAD_ButtonsDown(0) & PAD_BUTTON_DOWN)
620c473,474
<           WPAD_ButtonsDown(0) & WPAD_BUTTON_2)
---
>           WPAD_ButtonsDown(0) & WPAD_BUTTON_2 ||
>           PAD_ButtonsDown(0) & PAD_BUTTON_A)
