This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It doesn't really do much yet.
- Loading branch information
TheWindowsPro98
committed
Aug 22, 2023
1 parent
992c556
commit a767062
Showing
15 changed files
with
153 additions
and
17 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 |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
#include "spr.h" | ||
#include "mdsdat.h" | ||
#include "mdsdrv.h" | ||
#include "prefs.h" | ||
#include "main.h" | ||
#include "bsod.h" |
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
|
||
void preferences(); |
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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 +1,2 @@ | ||
SPRITE cursor "spr/cursor.png" 1 1 BEST 0 | ||
SPRITE cursor "spr/cursor.png" 1 1 BEST 0 | ||
SPRITE heart "spr/heart.png" 1 1 BEST 0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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 |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#include "includes.h" | ||
|
||
const u8 optX = 10; | ||
const u8 optY = 8; | ||
const u8 optNum = 9; | ||
const u8 optXDelta = 13; | ||
bool player = TRUE; // 0 - Lucy, 1 - Stephanie | ||
u8 difficulty = 1; // 0 - Easy, 1 - Normal, 2 - Hard, 3 - Cement (name subject to change) | ||
Sprite* confCurDiff; | ||
Sprite* confCurChr; | ||
|
||
const Option menuPrefs[] = | ||
{ | ||
{optX+optXDelta, optY, "Easy"}, | ||
{optX+optXDelta, optY+1, "Normal"}, | ||
{optX+optXDelta, optY+2, "Hard"}, | ||
{optX+optXDelta, optY+3, "Cement"}, | ||
{optX+optXDelta, optY+5, "Lucy"}, | ||
{optX+optXDelta, optY+6, "Stephanie"}, | ||
{optX+optXDelta, optY+8, "00"}, | ||
{optX+optXDelta, optY+9, "00"}, | ||
{optX+(optXDelta >> 1) + 1, optY+12, "Exit"}, | ||
}; | ||
|
||
void selectOption_Prefs() | ||
{ | ||
SELECTION_SFX; | ||
u8 timer = palFadeTime; | ||
PAL_FADE_OUT; | ||
MUSIC_FADE; | ||
while(1) | ||
{ | ||
timer--; | ||
SYS_doVBlankProcess(); | ||
MDS_update(); | ||
if (timer == 0) | ||
{ | ||
SPR_releaseSprite(menuCursor); | ||
SPR_update(); | ||
break; | ||
} | ||
} | ||
switch (*currentIndex) | ||
{ | ||
case 8: | ||
{ | ||
CLEAR_BG2; | ||
SPR_reset(); | ||
MEM_free(currentIndex); | ||
MEM_free(musIndex); | ||
title(); | ||
break; | ||
} | ||
default: | ||
{ | ||
killExec(menuIndexInvalid); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
static void joyEvent_Prefs(u16 joy, u16 changed, u16 state) | ||
{ | ||
if (joy != JOY_1) | ||
{ | ||
return; | ||
} | ||
if (changed & state & BUTTON_UP) | ||
{ | ||
curMove(menuPrefs,optNum,FALSE); | ||
} | ||
else if (changed & state & BUTTON_DOWN) | ||
{ | ||
curMove(menuPrefs,optNum,TRUE); | ||
} | ||
if (changed & state & BUTTON_B) | ||
{ | ||
*currentIndex = 8; | ||
selectOption_Prefs(); | ||
} | ||
if (changed & state & BUTTON_START) | ||
{ | ||
selectOption_Prefs(); | ||
} | ||
} | ||
|
||
void preferences() | ||
{ | ||
u16 basetile = TILE_ATTR(PAL3,FALSE,FALSE,FALSE); | ||
CLEAR_BG1; | ||
VDP_drawText("Changes made will only take effect",2,0); | ||
VDP_drawText("upon starting a new game.",2,1); | ||
VDP_drawText("Difficulty:",optX,optY); | ||
VDP_drawText("Character:",optX,optY+5); | ||
VDP_drawText("Lives:",optX,optY+8); | ||
VDP_drawText("Sound Test:",optX,optY+9); | ||
drawMenu(menuPrefs,optNum,PAL3,BG_A); | ||
confCurDiff = SPR_addSprite(&heart,TILE_TO_PIXEL((menuPrefs[difficulty].x + 6)),TILE_TO_PIXEL(menuPrefs[difficulty].y),basetile); | ||
confCurDiff = SPR_addSprite(&heart,TILE_TO_PIXEL((menuPrefs[player].x + 9)),TILE_TO_PIXEL(menuPrefs[player + 4].y),basetile); | ||
JOY_setEventHandler(joyEvent_Prefs); | ||
fadePalette(titlePalette); | ||
MDS_request(MDS_BGM,BGM_MUS_S2BLVS); | ||
while (1) | ||
{ | ||
*scroll -= *scrollSpeed; | ||
SYS_doVBlankProcess(); | ||
SPR_update(); | ||
MDS_update(); | ||
VDP_setHorizontalScroll(BG_B,fix16ToInt(*scroll)); | ||
} | ||
} |