File tree Expand file tree Collapse file tree 8 files changed +69
-9
lines changed Expand file tree Collapse file tree 8 files changed +69
-9
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,7 @@ enum SETTINGS_OPTIONS
255
255
256
256
enum SETTINGS_RETURN_CODES
257
257
{
258
+ MEMCARD_IN_USE = -200 ,
258
259
LOAD_FAILED = 1 ,
259
260
LOAD_FAILED_NO_FILE,
260
261
LOAD_SUCCESSFUL,
@@ -803,7 +804,7 @@ struct DisplayActionCommandsTiming
803
804
804
805
struct MemoryCardStruct
805
806
{
806
- uint8_t ReturnCode;
807
+ int32_t ReturnCode;
807
808
const char *SettingsFileName;
808
809
const char *SettingsDescription;
809
810
const char *RelFileName;
Original file line number Diff line number Diff line change 1050
1050
// 800B33D8:cardCopy2Main
1051
1051
// 800B3564:cardMain
1052
1052
// 800B3BDC:cardGetCode
1053
- // 800B3BE8:cardIsExec
1053
+ 800B3BE8:cardIsExec
1054
1054
// 800B3CB4:cardInit
1055
1055
// 800B3F28:cardBufReset
1056
1056
// 800B4118:cardGetFilePtr
Original file line number Diff line number Diff line change 1047
1047
// 800B0640:cardCopy2Main
1048
1048
// 800B07AC:cardMain
1049
1049
// 800B0E24:cardGetCode
1050
- // 800B0E30:cardIsExec
1050
+ 800B0E30:cardIsExec
1051
1051
// 800B0EFC:cardInit
1052
1052
// 800B1304:cardBufReset
1053
1053
// 800B1688:cardGetFilePtr
Original file line number Diff line number Diff line change 1048
1048
// 800B2388:cardCopy2Main
1049
1049
// 800B2508:cardMain
1050
1050
// 800B2B80:cardGetCode
1051
- // 800B2B8C:cardIsExec
1051
+ 800B2B8C:cardIsExec
1052
1052
// 800B2C58:cardInit
1053
1053
// 800B3060:cardBufReset
1054
1054
// 800B33E4:cardGetFilePtr
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ extern "C" {
69
69
// cardCopy2Main
70
70
// cardMain
71
71
// cardGetCode
72
- // cardIsExec
72
+ bool cardIsExec ();
73
73
// cardInit
74
74
// cardBufReset
75
75
// cardGetFilePtr
Original file line number Diff line number Diff line change @@ -5487,37 +5487,73 @@ void drawSettingsCurrentWork()
5487
5487
{
5488
5488
const char *String;
5489
5489
int32_t WindowWidth;
5490
+ int32_t TextPosX = -50 ;
5490
5491
5491
5492
switch (MenuSettings.ReturnCode )
5492
5493
{
5493
5494
case LOAD_FAILED:
5494
5495
{
5495
5496
String = " Load Failed" ;
5496
5497
WindowWidth = 129 ;
5498
+
5499
+ #ifdef TTYD_JP
5500
+ WindowWidth -= 7 ;
5501
+ TextPosX += 4 ;
5502
+ #endif
5497
5503
break ;
5498
5504
}
5499
5505
case LOAD_FAILED_NO_FILE:
5500
5506
{
5501
- String = " Settings file not found" ;
5502
- WindowWidth = 218 ;
5507
+ String = " Settings File Not Found" ;
5508
+ WindowWidth = 226 ;
5509
+ TextPosX -= 48 ;
5510
+
5511
+ #ifdef TTYD_JP
5512
+ WindowWidth -= 8 ;
5513
+ TextPosX += 3 ;
5514
+ #endif
5503
5515
break ;
5504
5516
}
5505
5517
case LOAD_SUCCESSFUL:
5506
5518
{
5507
5519
String = " Load Successful" ;
5508
5520
WindowWidth = 162 ;
5521
+ TextPosX -= 16 ;
5509
5522
break ;
5510
5523
}
5511
5524
case SAVE_FAILED:
5512
5525
{
5513
5526
String = " Save Failed" ;
5514
5527
WindowWidth = 129 ;
5528
+
5529
+ #ifdef TTYD_JP
5530
+ WindowWidth -= 7 ;
5531
+ TextPosX += 4 ;
5532
+ #endif
5515
5533
break ;
5516
5534
}
5517
5535
case SAVE_SUCCESSFUL:
5518
5536
{
5519
5537
String = " Save Successful" ;
5520
- WindowWidth = 162 ;
5538
+ WindowWidth = 160 ;
5539
+ TextPosX -= 15 ;
5540
+
5541
+ #ifdef TTYD_JP
5542
+ WindowWidth += 4 ;
5543
+ TextPosX -= 2 ;
5544
+ #endif
5545
+ break ;
5546
+ }
5547
+ case MEMCARD_IN_USE:
5548
+ {
5549
+ String = " Memory Card Currently In Use" ;
5550
+ WindowWidth = 275 ;
5551
+ TextPosX -= 73 ;
5552
+
5553
+ #ifdef TTYD_JP
5554
+ WindowWidth -= 3 ;
5555
+ TextPosX += 2 ;
5556
+ #endif
5521
5557
break ;
5522
5558
}
5523
5559
default :
@@ -5530,7 +5566,6 @@ void drawSettingsCurrentWork()
5530
5566
uint32_t TextColor = 0xFFFFFFFF ;
5531
5567
uint32_t WindowColor = 0x151515F4 ;
5532
5568
uint8_t Alpha = 0xFF ;
5533
- int32_t TextPosX = -80 ;
5534
5569
int32_t TextPosY = 0 ;
5535
5570
int32_t WindowCurve = 10 ;
5536
5571
float Scale = 0.6 ;
Original file line number Diff line number Diff line change @@ -201,6 +201,12 @@ int32_t createSettingsFile(gc::card::CARDFileInfo *settingsFileInfo)
201
201
202
202
int32_t saveSettings ()
203
203
{
204
+ // Make sure the vanilla code isn't currently doing memory card stuff
205
+ if (ttyd::cardmgr::cardIsExec ())
206
+ {
207
+ return MEMCARD_IN_USE;
208
+ }
209
+
204
210
// Make sure a memory card is inserted into slot A
205
211
int32_t ReturnCode = checkForMemoryCard ();
206
212
if (ReturnCode != CARD_RESULT_READY)
@@ -369,6 +375,12 @@ int32_t saveSettings()
369
375
370
376
int32_t loadSettings ()
371
377
{
378
+ // Make sure the vanilla code isn't currently doing memory card stuff
379
+ if (ttyd::cardmgr::cardIsExec ())
380
+ {
381
+ return MEMCARD_IN_USE;
382
+ }
383
+
372
384
// Make sure a memory card is inserted into slot A
373
385
int32_t ReturnCode = checkForMemoryCard ();
374
386
if (ReturnCode != CARD_RESULT_READY)
Original file line number Diff line number Diff line change @@ -1679,6 +1679,12 @@ void menuCheckButton()
1679
1679
MenuVar.Timer = secondsToFrames (3 );
1680
1680
break ;
1681
1681
}
1682
+ case MEMCARD_IN_USE:
1683
+ {
1684
+ MenuSettings.ReturnCode = MEMCARD_IN_USE;
1685
+ MenuVar.Timer = secondsToFrames (3 );
1686
+ break ;
1687
+ }
1682
1688
default :
1683
1689
{
1684
1690
MenuSettings.ReturnCode = LOAD_FAILED;
@@ -1699,6 +1705,12 @@ void menuCheckButton()
1699
1705
MenuVar.Timer = secondsToFrames (3 );
1700
1706
break ;
1701
1707
}
1708
+ case MEMCARD_IN_USE:
1709
+ {
1710
+ MenuSettings.ReturnCode = MEMCARD_IN_USE;
1711
+ MenuVar.Timer = secondsToFrames (3 );
1712
+ break ;
1713
+ }
1702
1714
default :
1703
1715
{
1704
1716
MenuSettings.ReturnCode = SAVE_FAILED;
You can’t perform that action at this time.
0 commit comments