-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
898 additions
and
898 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,103 @@ | ||
#include "smgbalib.h" | ||
#include "common.h" | ||
|
||
int ROMpage =0; | ||
int ROMPointer=0; | ||
int x=0; | ||
int y=0; | ||
int Keyhold=0; | ||
|
||
void Redraw(); | ||
void keyPadSelect(); | ||
void Redraw(){ | ||
char t=0; | ||
int MB_Offset = 4;//前4个MB是Menu的,从4MB后开始找 | ||
int gameIdx = 0; | ||
const int menuBaseY = 20; | ||
EraseScreenNoPaletteNoFlip(); | ||
|
||
WriteStringWide(5,0,"BennVenn's Menu Mod by Ausar"); | ||
|
||
if(gameCnt==0){ | ||
WriteStringWide(0,0,"No games found"); | ||
} | ||
for (y=0,gameIdx=EntriesPerPage * ROMpage + t;y<EntriesPerPage*10 && gameIdx < gameCnt;y+=10,t++,gameIdx = EntriesPerPage * ROMpage + t){ | ||
|
||
WriteStringWide(0,menuBaseY+(ROMPointer*10),">"); | ||
WriteStringWide( 8, menuBaseY+y, gameEntries[EntriesPerPage * ROMpage + t].name); | ||
|
||
Itoa(string,gameEntries[EntriesPerPage * ROMpage + t].MB_offset); | ||
WriteStringWide(8+80,menuBaseY+y,string); | ||
WriteStringWide(8+95,menuBaseY+y,"MB"); | ||
} | ||
Itoa(string,ROMpage); | ||
WriteStringWide(5,145,"Page"); | ||
WriteStringWide(25,145,string);//第几页 | ||
WriteStringWide(20, 133, "Select ROM, Press A" ); | ||
Keyhold=0; | ||
Flip(); | ||
} | ||
int main() { | ||
|
||
EraseScreenNoPaletteNoFlip(); | ||
Initialize(); | ||
WriteStringWide( 20, 8, "Loading Roms" ); | ||
|
||
Flip(); | ||
findGames(); | ||
|
||
Redraw(); | ||
keyPadSelect(); | ||
|
||
|
||
return 0; | ||
} | ||
|
||
void keyPadSelect(){ | ||
while(1) { | ||
if(!((*KEYpad) & KEY_RIGHT)) { | ||
ROMpage++; | ||
ROMPointer=0; | ||
if (*(unsigned char*)(gameEntries[EntriesPerPage*ROMpage+ROMPointer].name)==0){ROMpage--;} | ||
PlayNote(2000,5); | ||
Redraw(); | ||
while(!((*KEYpad)& KEY_RIGHT)){Keyhold++;if(Keyhold==100000){Keyhold=0;break;}} | ||
} | ||
if(!((*KEYpad) & KEY_LEFT)) { | ||
ROMpage--; | ||
ROMPointer=0; | ||
if (ROMpage<0){ROMpage=0;} | ||
PlayNote(2000,5); | ||
Redraw(); | ||
while(!((*KEYpad)& KEY_LEFT)){Keyhold++;if(Keyhold==100000){Keyhold=0;break;}} | ||
} | ||
if(!((*KEYpad) & KEY_UP)) { | ||
ROMPointer--; | ||
if (ROMPointer<0){ROMPointer=EntriesPerPage-1;} | ||
|
||
// while(*(unsigned char*)(ROMTableStart + (BytesPerEntry * EntriesPerPage * ROMpage)+(ROMPointer*32))==0){ROMPointer--;} | ||
while(*(unsigned char*)(gameEntries[EntriesPerPage*ROMpage+ROMPointer].name)==0){ROMPointer--;} | ||
|
||
|
||
PlayNote(2000,5); | ||
Redraw(); | ||
while(!((*KEYpad)& KEY_UP)){Keyhold++;if(Keyhold==50000){Keyhold=0;break;}} | ||
} | ||
if(!((*KEYpad) & KEY_DOWN)) { | ||
ROMPointer++; | ||
if (*(unsigned char*)(gameEntries[EntriesPerPage*ROMpage+ROMPointer].name)==0){ROMPointer=0;} | ||
|
||
if (ROMPointer==EntriesPerPage){ROMPointer=0;} | ||
PlayNote(2000,5); | ||
Redraw(); | ||
while(!((*KEYpad)& KEY_DOWN)){Keyhold++;if(Keyhold==50000){Keyhold=0;break;}} | ||
} | ||
|
||
if(!((*KEYpad) & KEY_A)) { | ||
REG_IE=0; | ||
gotoChipOffset(gameEntries[EntriesPerPage*ROMpage+ROMPointer].MB_offset,1); | ||
|
||
} | ||
} | ||
#include "smgbalib.h" | ||
#include "common.h" | ||
__attribute__ ((section(".devkitadv.config"))) int __gba_multiboot; | ||
// MULTIBOOT | ||
int ROMpage =0; | ||
int ROMPointer=0; | ||
int x=0; | ||
int y=0; | ||
int Keyhold=0; | ||
|
||
void Redraw(); | ||
void keyPadSelect(); | ||
void Redraw(){ | ||
char t=0; | ||
int MB_Offset = 4;//前4个MB是Menu的,从4MB后开始找 | ||
int gameIdx = 0; | ||
const int menuBaseY = 20; | ||
EraseScreenNoPaletteNoFlip(); | ||
|
||
WriteStringWide(5,0,"BennVenn's Menu Mod by Ausar"); | ||
|
||
if(gameCnt==0){ | ||
WriteStringWide(0,0,"No games found"); | ||
} | ||
for (y=0,gameIdx=EntriesPerPage * ROMpage + t;y<EntriesPerPage*10 && gameIdx < gameCnt;y+=10,t++,gameIdx = EntriesPerPage * ROMpage + t){ | ||
|
||
WriteStringWide(0,menuBaseY+(ROMPointer*10),">"); | ||
WriteStringWide( 8, menuBaseY+y, gameEntries[EntriesPerPage * ROMpage + t].name); | ||
|
||
Itoa(string,gameEntries[EntriesPerPage * ROMpage + t].MB_offset); | ||
WriteStringWide(8+80,menuBaseY+y,string); | ||
WriteStringWide(8+95,menuBaseY+y,"MB"); | ||
} | ||
Itoa(string,ROMpage); | ||
WriteStringWide(5,145,"Page"); | ||
WriteStringWide(25,145,string);//第几页 | ||
WriteStringWide(20, 133, "Select ROM, Press A" ); | ||
Keyhold=0; | ||
Flip(); | ||
} | ||
int main() { | ||
|
||
EraseScreenNoPaletteNoFlip(); | ||
Initialize(); | ||
WriteStringWide( 20, 8, "Loading Roms" ); | ||
|
||
Flip(); | ||
findGames(); | ||
|
||
Redraw(); | ||
keyPadSelect(); | ||
|
||
|
||
return 0; | ||
} | ||
|
||
void keyPadSelect(){ | ||
while(1) { | ||
if(!((*KEYpad) & KEY_RIGHT)) { | ||
ROMpage++; | ||
ROMPointer=0; | ||
if (*(unsigned char*)(gameEntries[EntriesPerPage*ROMpage+ROMPointer].name)==0){ROMpage--;} | ||
PlayNote(2000,5); | ||
Redraw(); | ||
while(!((*KEYpad)& KEY_RIGHT)){Keyhold++;if(Keyhold==100000){Keyhold=0;break;}} | ||
} | ||
if(!((*KEYpad) & KEY_LEFT)) { | ||
ROMpage--; | ||
ROMPointer=0; | ||
if (ROMpage<0){ROMpage=0;} | ||
PlayNote(2000,5); | ||
Redraw(); | ||
while(!((*KEYpad)& KEY_LEFT)){Keyhold++;if(Keyhold==100000){Keyhold=0;break;}} | ||
} | ||
if(!((*KEYpad) & KEY_UP)) { | ||
ROMPointer--; | ||
if (ROMPointer<0){ROMPointer=EntriesPerPage-1;} | ||
|
||
// while(*(unsigned char*)(ROMTableStart + (BytesPerEntry * EntriesPerPage * ROMpage)+(ROMPointer*32))==0){ROMPointer--;} | ||
while(*(unsigned char*)(gameEntries[EntriesPerPage*ROMpage+ROMPointer].name)==0){ROMPointer--;} | ||
|
||
|
||
PlayNote(2000,5); | ||
Redraw(); | ||
while(!((*KEYpad)& KEY_UP)){Keyhold++;if(Keyhold==50000){Keyhold=0;break;}} | ||
} | ||
if(!((*KEYpad) & KEY_DOWN)) { | ||
ROMPointer++; | ||
if (*(unsigned char*)(gameEntries[EntriesPerPage*ROMpage+ROMPointer].name)==0){ROMPointer=0;} | ||
|
||
if (ROMPointer==EntriesPerPage){ROMPointer=0;} | ||
PlayNote(2000,5); | ||
Redraw(); | ||
while(!((*KEYpad)& KEY_DOWN)){Keyhold++;if(Keyhold==50000){Keyhold=0;break;}} | ||
} | ||
|
||
if(!((*KEYpad) & KEY_A)) { | ||
REG_IE=0; | ||
gotoChipOffset(gameEntries[EntriesPerPage*ROMpage+ROMPointer].MB_offset,1); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#include "common.h" | ||
|
||
u8 gameCnt = 0; | ||
int* KEYpad = (int*)0x04000130; | ||
char* MapperReg1 = (char*)0x0E000002;//Bank 选择信号 | ||
char* MapperReg2 = (char*)0x0E000003;// 与上0x80=Lock | ||
char* MapperReg3 = (char*)0x0E000004; | ||
|
||
char string[]=" "; | ||
#include "common.h" | ||
|
||
u8 gameCnt = 0; | ||
int* KEYpad = (int*)0x04000130; | ||
char* MapperReg1 = (char*)0x0E000002;//Bank 选择信号 | ||
char* MapperReg2 = (char*)0x0E000003;// 与上0x80=Lock | ||
char* MapperReg3 = (char*)0x0E000004; | ||
|
||
char string[]=" "; | ||
char Dummy_SaveType[]="SRAM_V113"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
|
||
#ifndef BVHEADER_H_ | ||
#define BVHEADER_H_ | ||
#include "smgbalib.h" | ||
|
||
#define KEY_A 1 | ||
#define KEY_B 2 | ||
#define KEY_SELECT 4 | ||
#define KEY_START 8 | ||
#define KEY_RIGHT 16 | ||
#define KEY_LEFT 32 | ||
#define KEY_UP 64 | ||
#define KEY_DOWN 128 | ||
#define KEY_R 256 | ||
#define KEY_L 512 | ||
#define EntriesPerPage 11 | ||
#define BytesPerEntry 32 | ||
#define GAME_NAME_LEN 16 | ||
|
||
|
||
struct GameEntry{ | ||
char name[GAME_NAME_LEN + 1]; | ||
u8 MB_offset; | ||
}gameEntries[64];//最多64个游戏 | ||
|
||
u8 sramBackup[3]; | ||
extern char string[]; | ||
extern u8 gameCnt; | ||
extern int* KEYpad; | ||
extern char* MapperReg1; | ||
extern char* MapperReg2; | ||
extern char* MapperReg3; | ||
//! Put function in IWRAM. | ||
#define IWRAM_CODE __attribute__((section(".iwram"), long_call)) | ||
|
||
//! Put function in EWRAM. | ||
#define EWRAM_CODE __attribute__((section(".ewram"), long_call)) | ||
IWRAM_CODE void findGames(); | ||
IWRAM_CODE void gotoChipOffset(u8 MB_Offset,char Lock); | ||
IWRAM_CODE char isGame(); | ||
#endif | ||
|
||
#ifndef BVHEADER_H_ | ||
#define BVHEADER_H_ | ||
#include "smgbalib.h" | ||
|
||
#define KEY_A 1 | ||
#define KEY_B 2 | ||
#define KEY_SELECT 4 | ||
#define KEY_START 8 | ||
#define KEY_RIGHT 16 | ||
#define KEY_LEFT 32 | ||
#define KEY_UP 64 | ||
#define KEY_DOWN 128 | ||
#define KEY_R 256 | ||
#define KEY_L 512 | ||
#define EntriesPerPage 11 | ||
#define BytesPerEntry 32 | ||
#define GAME_NAME_LEN 16 | ||
|
||
|
||
struct GameEntry{ | ||
char name[GAME_NAME_LEN + 1]; | ||
u8 MB_offset; | ||
}gameEntries[64];//最多64个游戏 | ||
|
||
u8 sramBackup[3]; | ||
extern char string[]; | ||
extern u8 gameCnt; | ||
extern int* KEYpad; | ||
extern char* MapperReg1; | ||
extern char* MapperReg2; | ||
extern char* MapperReg3; | ||
//! Put function in IWRAM. | ||
#define IWRAM_CODE __attribute__((section(".iwram"), long_call)) | ||
|
||
//! Put function in EWRAM. | ||
#define EWRAM_CODE __attribute__((section(".ewram"), long_call)) | ||
IWRAM_CODE void findGames(); | ||
IWRAM_CODE void gotoChipOffset(u8 MB_Offset,char Lock); | ||
IWRAM_CODE char isGame(); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
@path=C:\devkitadv\bin | ||
|
||
@REM Clean binaries | ||
@cls | ||
@del *.o | ||
@del *.elf | ||
@del *.gba | ||
|
||
@REM Compile game | ||
gcc -c -O3 bvmenu.c utils.c common.c -marm | ||
@REM link to smgbalib | ||
gcc -o bvmenu.elf bvmenu.o utils.o common.o smgbalib.a | ||
|
||
@REM Translate executable to GBA rom format | ||
objcopy -O binary bvmenu.elf bvmenu.gba | ||
|
||
|
||
@REM Fix header | ||
gbafix.exe bvmenu.gba -tBVAMENU -cMROM -mCN -r11 -p | ||
|
||
@REM Clean binaries | ||
@del *.o | ||
@del *.elf | ||
@path=C:\devkitadv\bin | ||
|
||
@REM Clean binaries | ||
@cls | ||
@del *.o | ||
@del *.elf | ||
@del *.gba | ||
|
||
@REM Compile game | ||
gcc -c -O3 bvmenu.c utils.c common.c -marm | ||
@REM link to smgbalib | ||
gcc -o bvmenu.elf bvmenu.o utils.o common.o smgbalib.a | ||
|
||
@REM Translate executable to GBA rom format | ||
objcopy -O binary bvmenu.elf bvmenu.gba | ||
|
||
@REM Fix header | ||
gbafix.exe bvmenu.gba -tBVAMENU -cMROM -mCN -r12 | ||
|
||
@REM Clean binaries | ||
@del *.o | ||
@del *.elf |
Oops, something went wrong.