mirror of
https://github.com/dborth/vbagx.git
synced 2025-01-11 18:19:07 +01:00
change menu bg, zoom feature, fix controller pref bug, fix load SRAM bug
This commit is contained in:
parent
e851cb9dd3
commit
e1c493fed1
13506
source/ngc/images/bg.h
13506
source/ngc/images/bg.h
File diff suppressed because it is too large
Load Diff
@ -26,8 +26,6 @@
|
||||
#include "input.h"
|
||||
#include "tbtime.h"
|
||||
|
||||
#define MAXJP 10
|
||||
|
||||
#define VBA_BUTTON_A 1
|
||||
#define VBA_BUTTON_B 2
|
||||
#define VBA_BUTTON_SELECT 4
|
||||
@ -193,16 +191,15 @@ u32 DecodeJoy(unsigned short pad)
|
||||
{
|
||||
signed char pad_x = PAD_StickX (pad);
|
||||
signed char pad_y = PAD_StickY (pad);
|
||||
signed char gc_px = PAD_SubStickX (0);
|
||||
u32 jp = PAD_ButtonsHeld (pad);
|
||||
u32 J = 0;
|
||||
|
||||
#ifdef HW_RVL
|
||||
signed char wm_ax = 0;
|
||||
signed char wm_ay = 0;
|
||||
u32 wp = 0;
|
||||
wm_ax = WPAD_StickX ((u8)pad, 0);
|
||||
wm_ay = WPAD_StickY ((u8)pad, 0);
|
||||
wp = WPAD_ButtonsHeld (pad);
|
||||
signed char wm_ax = WPAD_StickX ((u8)pad, 0);
|
||||
signed char wm_ay = WPAD_StickY ((u8)pad, 0);
|
||||
u32 wp = WPAD_ButtonsHeld (pad);
|
||||
signed char wm_sx = WPAD_StickX (0,1); // CC right joystick
|
||||
|
||||
u32 exp_type;
|
||||
if ( WPAD_Probe(pad, &exp_type) != 0 ) exp_type = WPAD_EXP_NONE;
|
||||
@ -283,6 +280,16 @@ u32 DecodeJoy(unsigned short pad)
|
||||
}
|
||||
#endif
|
||||
|
||||
// Zoom feature
|
||||
if(
|
||||
(gc_px > 70)
|
||||
#ifdef HW_RVL
|
||||
|| (wm_sx > 70)
|
||||
|| ((wp & WPAD_BUTTON_A) && (wp & WPAD_BUTTON_B))
|
||||
#endif
|
||||
)
|
||||
J |= VBA_SPEED;
|
||||
|
||||
/*** Report pressed buttons (gamepads) ***/
|
||||
int i;
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#define PI 3.14159265f
|
||||
#define PADCAL 50
|
||||
#define MAXJP 10
|
||||
|
||||
extern unsigned int gcpadmap[];
|
||||
extern unsigned int wmpadmap[];
|
||||
|
@ -311,6 +311,7 @@ GameMenu ()
|
||||
|
||||
case 2: // Load Battery
|
||||
quit = retval = LoadBattery(GCSettings.SaveMethod, NOTSILENT);
|
||||
emulator.emuReset();
|
||||
break;
|
||||
|
||||
case 3: // Save Battery
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "fileop.h"
|
||||
#include "smbop.h"
|
||||
#include "filesel.h"
|
||||
#include "input.h"
|
||||
|
||||
extern unsigned char savebuffer[];
|
||||
extern int currconfig[4];
|
||||
@ -76,7 +77,7 @@ void createXMLController(unsigned int controller[], const char * name, const cha
|
||||
mxmlElementSetAttr(item, "description", description);
|
||||
|
||||
// create buttons
|
||||
for(int i=0; i < 12; i++)
|
||||
for(int i=0; i < MAXJP; i++)
|
||||
{
|
||||
elem = mxmlNewElement(item, "button");
|
||||
mxmlElementSetAttr(elem, "number", toStr(i));
|
||||
@ -212,7 +213,7 @@ void loadXMLController(unsigned int controller[], const char * name)
|
||||
if(item)
|
||||
{
|
||||
// populate buttons
|
||||
for(int i=0; i < 12; i++)
|
||||
for(int i=0; i < MAXJP; i++)
|
||||
{
|
||||
elem = mxmlFindElement(item, xml, "button", "number", toStr(i), MXML_DESCEND);
|
||||
if(elem)
|
||||
@ -242,7 +243,6 @@ decodePrefsData (int method)
|
||||
xml = mxmlLoadString(NULL, (char *)savebuffer+offset, MXML_TEXT_CALLBACK);
|
||||
|
||||
// check settings version
|
||||
// we don't do anything with the version #, but we'll store it anyway
|
||||
char * version;
|
||||
item = mxmlFindElement(xml, xml, "file", "version", NULL, MXML_DESCEND);
|
||||
if(item) // a version entry exists
|
||||
@ -250,6 +250,17 @@ decodePrefsData (int method)
|
||||
else // version # not found, must be invalid
|
||||
return false;
|
||||
|
||||
// this code assumes version in format X.X.X
|
||||
// XX.X.X, X.XX.X, or X.X.XX will NOT work
|
||||
char verMajor = version[7];
|
||||
char verMinor = version[9];
|
||||
char verPoint = version[11];
|
||||
|
||||
if(verPoint < '2' && verMajor == '1') // less than version 1.0.2
|
||||
return false; // reset settings
|
||||
else if(verMajor > '1' || verMinor > '0' || verPoint > '2') // some future version
|
||||
return false; // reset settings
|
||||
|
||||
// File Settings
|
||||
|
||||
loadXMLSetting(&GCSettings.AutoLoad, "AutoLoad");
|
||||
|
@ -7,14 +7,13 @@
|
||||
*
|
||||
* This file controls overall program flow. Most things start and end here!
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _VBA_H_
|
||||
#define _VBA_H_
|
||||
|
||||
#include <gccore.h>
|
||||
#define VERSIONNUM "1.0.1"
|
||||
#define VERSIONSTR "VBA GX 1.0.1"
|
||||
#define VERSIONSTRFULL "Visual Boy Advance GX 1.0.1"
|
||||
#define VERSIONNUM "1.0.2"
|
||||
#define VERSIONSTR "VBA GX 1.0.2"
|
||||
#define VERSIONSTRFULL "Visual Boy Advance GX 1.0.2"
|
||||
|
||||
#define NOTSILENT 0
|
||||
#define SILENT 1
|
||||
|
@ -17,11 +17,12 @@
|
||||
#include <malloc.h>
|
||||
#include <wiiuse/wpad.h>
|
||||
#include "images/bg.h"
|
||||
#include "pal60.h"
|
||||
|
||||
/*** External 2D Video ***/
|
||||
/*** 2D Video Globals ***/
|
||||
GXRModeObj *vmode; /*** Graphics Mode Object ***/
|
||||
u32 *xfb[2] = { NULL, NULL }; /*** Framebuffers ***/
|
||||
unsigned int *xfb[2]; /*** Framebuffers ***/
|
||||
int whichfb = 0; /*** Frame buffer toggle ***/
|
||||
|
||||
int screenheight;
|
||||
@ -141,6 +142,12 @@ void InitialiseVideo ()
|
||||
|
||||
VIDEO_SetNextFramebuffer(xfb[0]);
|
||||
VIDEO_SetBlack(FALSE);
|
||||
|
||||
// set timings in VI to PAL60
|
||||
/*u32 *vreg = (u32 *)0xCC002000;
|
||||
for (int i = 0; i < 64; i++ )
|
||||
vreg[i] = vpal60[i];*/
|
||||
|
||||
VIDEO_Flush();
|
||||
VIDEO_WaitVSync();
|
||||
|
||||
@ -310,7 +317,7 @@ void GX_Render(int width, int height, u8 * buffer, int pitch)
|
||||
void
|
||||
clearscreen (int c)
|
||||
{
|
||||
int colour = COLOR_WHITE;
|
||||
int colour = COLOR_BLACK;
|
||||
|
||||
whichfb ^= 1;
|
||||
VIDEO_ClearFrameBuffer (vmode, xfb[whichfb], colour);
|
||||
|
Loading…
x
Reference in New Issue
Block a user