This repository has been archived by the owner on Sep 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
App.cpp
13290 lines (12328 loc) · 529 KB
/
App.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/******************************************************************************
Ootake
・使用するCDドライブを選択できるようにした。
・バックアップメモリの保存をゲームごとにおこなうようにした。
・CD-ROMのゲームを起動したときは、ステートセーブ&バックアップメモリセーブ時に
ゲーム名をファイル名として使うようにした。
・レジューム機能をつけた。v0.90
・早回しモードを付けた。v0.92
・縦画面モードを付けた。(全てのゲームで縦長モード表示が可能)
・DirectX使用時にデフォルトではパソコンのCPUパワーを100%使用するので、パワーを
セーブしてCPU利用率を下げる省電力モード(音質がやや落ちる)を付けた。
・現状では、描画をDirectX(ハードウェアアクセラレーション)専用とした。
・ウィンドウモードでもVSyncを有効にした。
・フルスクリーンモードでも32ビットカラーに対応した。
・サウンドの再生サンプルレートを44.1KHzに固定した(CD-DA再生時の速度アップのた
め)。
・PSGのボリュームを個別に設定できるようにした。
・各サウンドのボリュームを音割れしない最大限のところまで引き上げて音質を向上さ
せた。
・サウンドのミュート機能、簡易ボリューム調整機能を付けた。
・他のアプリへの影響を考慮して、Windowsのボリュームミキサーは不使用にした。
・音質を重視した(音は大きく遅れる)ビッグサウンドバッファモードを付けた。
・パッドの入力更新をここでは行わず、JoyPad.cで入力要求があるたびにそのつど、入
力状態を更新するようにし、入力反応性を実機に近づけた。
・2ボタンパッドのボタン設定と、6ボタンパッドのボタン設定を、それぞれ別々に保
存するようにした。
・PCEパッド1~5の操作をキーボードにも自由に割り当てられるようにした。
・起動時に、前回使用したときの位置にウィンドウを移動させるようにした。
・スクリーンセーバーの起動を禁止するようにした。
・CD-ROMのアクセスを実機並の遅いスピードにする設定を付けた。
・ラスタ割り込みのタイミングを最適化する設定を付けた。
・スプライト欠けを再現する設定を付けた。
・マニュアルを見るメニューを付けた。
・複数のステートセーブができるようにした。v0.51
・hesファイルの読み込みにも対応した。v0.52
・フルスクリーンでスタートするか、ウィンドウでスタートするかを選択するメニュー
を付けた。v0.55
・CD-ROMアクセス中でも安定してステートセーブできるようにした。v0.61
・システムメッセージをスクリーン上にも表示できるようにした。v0.64
・ZIP圧縮したイメージファイルを読み込めるようにした。v0.65
・CD-ROMを入れ替えて別のゲームを始められるメニューを追加した。v0.73
・リセットせずにCD-ROMを入れ替えられるメニューを追加した。「CDバトル 光の勇
者たち」や内蔵音楽CDプレイヤーなどで必要。v1.00
・Windows Vistaでの動作に対応した。v0.95。
・オーディオ処理時に、クリティカルセクションは必要ない(書き込みが同時に行われ
るわけではない)ようなので、省略し高速化した。v1.09
・DirectX9に対応し、Direct3Dでの描画にも対応した。v2.00
・スクリーンショット機能を付けた。v2.12
Copyright(C)2006-2012 Kitao Nakamura.
Attach the source code when you open the remodeling version and the
succession version to the public. and, please contact me by E-mail.
Business use is prohibited.
Additionally, it applies to "GNU General Public License".
改造版・後継版を公開なさるときは必ずソースコードを添付してください。
その際に事後でかまいませんので、ひとことお知らせいただけると幸いです。
商的な利用は禁じます。
あとは「GNU General Public License(一般公衆利用許諾契約書)」に準じます。
*******************************************************************************
[App.c]
アプリケーションの動作を記述します。
Implement the application's behaviour.
Copyright (C) 2004 Ki
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
******************************************************************************/
#define _CRT_SECURE_NO_DEPRECATE
#pragma warning(disable : 4995) //dshow.h使用時の警告を非表示。v2.52
#define _WIN32_DCOM //v2.23追加
#define DIRECTINPUT_VERSION 0x0800 //Kitao追加。環境にもよるかもしれないが、DirectInput5が軽い。7だとやや遅延あり。スペースハリアーがわかりやすい。
//Kitao更新。v2.00から開発環境を"Visual C++ 2008"に変更しました。
//※Vista以降でOotakeをProgram Filesフォルダで利用したときに、設定&セーブファイルがリダイレクトされることを前提にコーディングしてあります。
// ですので、"Visual C++ 2008"で、構成プロパティの"リンカ→マニフェストファイル→ユーザーアカウント制御(UAC)を有効にする"を「いいえ」に
// 設定してコンパイルしてください。(添付のOotake.vcprojを使うとすでに設定済み)。
//※dinput.libは、古いもの(17.3KBサイズ。DirectX 9.0 SDK Update - (October 2004)以前)を使ってください。
// 反応速度が最も速いです。このlibの違いで、例えばスーパースターソルジャー等でプレイ感とスコアに顕著な差が出ます。
// dinput.libのダウンロード先など、詳しくはReadme.txtを見てください。
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <shlobj.h>
#include <shlwapi.h> //PathFileExists()で必要
#include <dshow.h> //リンカの入力にstrmiids.libの追加も必要。v2.52
//#include <unistd.h>
#include "UNZIP32.H"
#include "App.h"
#include "MainBoard.h"
#include "Screen.h"
#include "ScreenD3D.h"
#include "Resolution.h"
#include "Config.h"
#include "WinMain.h"
#include "AppEvent.h"
#include "Menu.h"
#include "Printf.h"
#include "PadConfig.h"
#include "AudioConfig.h"
#include "CDInterface.h"
#include "TocDB.h"
#include "Startup.h"
#include "AudioOut.h"
#include "CDInstall.h"
#include "Debug.h"
#include "WriteMemory.h"
#include "RecentRom.h"
// ##RA
#include "RA_Resource.h"
#include "RA_Interface.h"
#include "RA_Implementation.h"
#include "RA_httpthread.h"
//Kitao追加。UNZIP32.DLL用定義
typedef WORD (WINAPI* UNZIPGETVERSION)(void);
typedef HARC (WINAPI* UNZIPOPENARCHIVE)(const HWND, LPCSTR, const DWORD);
typedef int (WINAPI* UNZIPCLOSEARCHIVE)(HARC);
typedef int (WINAPI* UNZIPFINDFIRST)(HARC, LPCSTR, LPINDIVIDUALINFO);
typedef int (WINAPI* UNZIP)(const HWND, LPCSTR, LPSTR, const DWORD);
//Kitao追加。dwmapi.dll用定義。v2.21
static HINSTANCE _hDwmapiDll;
typedef HRESULT (WINAPI* FuncDwmIsCompositionEnabled) (BOOL*);
static FuncDwmIsCompositionEnabled _FuncDwmIsCompositionEnabled;
typedef HRESULT (WINAPI* FuncDwmEnableComposition) (UINT);
static FuncDwmEnableComposition _FuncDwmEnableComposition;
static char _AppName[100] = MAINCAPTION; //Kitao追加。Windowに表示するアプリ名
static char _SoftVersion[5] = "2.65"; //Kitao追加。バージョン情報。5バイト(4文字)固定。
static BOOL _bInit = FALSE;//Kitao追加。初期設定が完了したらTRUE
static BOOL _bWindows9x = FALSE; //Kitao追加。OSが98/Me/95ならTRUE。v1.36
static BOOL _bWindowsVista = FALSE; //Kitao追加。OSがVista以上ならTRUE。Win7もTRUE。セーブファイルがリダイレクトする動作の対応に必要。
static BOOL _bWindows7 = FALSE; //Kitao追加。OSがWin7以上ならTRUE。バッファ量を最適化するために使用。v2.20
static char _VirtualStorePath[MAX_PATH+1] = ""; //Kitao追加。Vista/Win7でセーブファイルがリダイレクトする動作の対応に必要。
static char _DesktopPath[MAX_PATH+1] = ""; //Kitao追加。v1.29
static HMIXER _hMix = (HMIXER)INVALID_HANDLE_VALUE; //ボリュームミキサーのハンドル。v1.61
static MIXERCONTROLDETAILS _MixerControlD; //v2.16更新
static MIXERCONTROLDETAILS_UNSIGNED _MixerControlDU;//v2.16更新
static DWORD _dwWaveControlID; //WAVEボリュームのコントロールID。v1.61
static DWORD _dwWaveMaxVolume; //WAVEボリュームの最大値。v1.61
static DWORD _dwDefaultWindowsVolumeValue;//Kitao追加。起動時のWindowsのボリュームコントロール(WAVE)を退避しておく変数。Ootake終了時、この値に戻す。
static Sint32 _PrevMouseX = -1;//Kitao追加
static Sint32 _PrevMouseY = -1;//Kitao追加
static Sint32 _MouseStopCount = 0;//Kitao追加
static char _OpenFilePathName[MAX_PATH+1];
static char _GameFilePathName[MAX_PATH+1] = "";
static char _AppPath[MAX_PATH+1];
static char _ZipTempFilePathName[MAX_PATH+1];//Kitao追加
static char _GameFileNameBuf[MAX_PATH+1];//Kitao追加
static BOOL _bCDGame = FALSE;//Kitao追加。CDのゲームを起動したならTRUEになる(ステートセーブで個別のファイル名が付く)
static BOOL _bCueFile = FALSE;//Kitao追加。フルインストールしたCUEファイルから起動している場合TRUEに。v2.24
static char _CueFilePathName[MAX_PATH+1];//Kitao追加。CUEファイルのファイル名。v2.24
static Sint32 _OtherSysCard = 0;//Kitao追加。デフォルト以外のシステムカードを使用中は1~2の値に。v1.49
static BOOL _bF1NoReset = FALSE;//Kitao追加。F1キーでリセットせずにCD情報だけ更新する場合TRUE。"CDバトル 光の勇者たち" で使用。
static BOOL _bHesFile = FALSE;//Kitao追加
static BOOL _bAutoBigSoundBuffer = FALSE;//Kitao追加
static BOOL _bResumeMode;//Kitao追加
static BOOL _bLoadingResumeFile = FALSE;//v1.61追加
static BOOL _bAutoResumeMode = FALSE;//Kitao追加。ゲーム起動時に自動でレジューム機能をオンにするならTRUE。v1.54
static Sint32 _OverClockTypeR;//Kitao追加
static Sint32 _RenshaSpeedSelR;//Kitao追加
static BOOL _bUseThreeButtonR;//Kitao追加
static BOOL _bArcadeCardR;//Kitao追加
static BOOL _bUseVideoSpeedUpButton;//Kitao追加。VideoSpeedUp時に、専用のボタンを押している間だけスピードアップするならTRUE。常にスピードアップするならFALSE。
static BOOL _bConfigReturnToDefault = FALSE;//Kitao追加。v1.03。設定をデフォルトに戻すときに使用。
static BOOL _bSpriteLayer = TRUE; //v2.06追加。スプライトを全非表示にするならFALSE。(開発向け)
static BOOL _bSprite2Layer = TRUE; //v2.06追加。スーパーグラフィックスの2つ目VDCのスプライトを全非表示にするならFALSE。(開発向け)
static BOOL _bBGLayer = TRUE; //v2.06追加。BGを非表示にするならFALSE。(開発向け)
static BOOL _bBG2Layer = TRUE; //v2.06追加。スーパーグラフィックスの2枚目のBGを非表示にするならFALSE。(開発向け)
static BOOL _bInvalidateCdInstall = FALSE; //v2.34追加。CDインストールしたファイルを利用せずに実CD-ROMで利用する場合TRUE。(動作テスト向け)
// [APP Device] (default values)
static Sint32 _CurrentCdDrive = 0;//Kitao追加。使用するCDドライブナンバー。※0なら1台目。1なら2台目。
static BOOL _bCDSpeedDown = FALSE;//Kitao追加。PCのCD-ROMドライブのREADスピードを遅くするならTRUE。スターパロジャーなど読み込みが厳しいゲームで必要。静音化にもなる。ドライブによっては機能しないかもしれない。v2.50 ※テスト不足のため現在未使用。
static Sint32 _MySetOverClockType = 100;//Kitao追加。[Delete]キーを押したときに設定できるCPUオーバークロックスピード。v1.61
static Sint32 _VideoSpeedUpButton = -1;//Kitao追加。VideoSpeedUp時に使うボタン。
static Sint32 _FastForwarding = 0;//Kitao追加
static BOOL _bSoundAjust = TRUE;//Kitao追加
static BOOL _bLoadStateSpeedSetting = FALSE;//Kitao追加。VideoSpeedUpとCpuSpeedUpの設定をステートロード時に反映するならTRUE。v2.36からデフォルトでは反映しないようにした。
static char _CurrentOpenPath[MAX_PATH+1] = "";//Kitao追加。ROMイメージ等を開くときのカレントパス。v1.29
static char _CurrentSavePath[MAX_PATH+1] = "";//Kitao追加。WAVサウンドなどを保存するときのカレントパス。v1.29
static char _OtherSysCardPath1[MAX_PATH+1] = "";//Kitao追加。別のシステムカードのファイルパス(ファイル名も含む)。v1.49
static char _OtherSysCardPath2[MAX_PATH+1] = "";//Kitao追加。別のシステムカードのファイルパス(ファイル名も含む)。v1.49
static Sint32 _SaveStateButton = DIK_S;//Kitao追加
static Sint32 _LoadStateButton = DIK_L;//Kitao追加
static Sint32 _ScreenshotButton = DIK_SYSRQ;//Kitao追加。PrintScreenキー
static Sint32 _PauseButton = -1;//Kitao追加。ポーズを行うためのボタン。初期設定では誤動作を避けるため未設定にしておく。v2.49
static Sint32 _FunctionButton = -1;//Kitao追加。他のボタンと組み合わせてショートカット動作を行うためのボタン。初期設定では誤動作を避けるため未設定にしておく。v2.38
static Sint32 _FuncSaveStateButton = -1;//Kitao追加。ファンクションボタンとこのボタンを組み合わせてセーブステートを行える。v2.38
static Sint32 _FuncLoadStateButton = -1;//Kitao追加。ファンクションボタンとこのボタンを組み合わせてロードステートを行える。v2.38
static BOOL _bFuncVolume = TRUE;//Kitao追加。ファンクションボタン+十字キーで音量変更を可能にするならTRUE。v2.38
static BOOL _bFuncTurboButton = TRUE;//Kitao追加。ファンクションボタン+I,IIボタンで連射切替を可能にするならTRUE。v2.38
static BOOL _bFuncScreenshot = TRUE;//Kitao追加。ファンクションボタン+SELECTボタンでスクリーンショットを可能にするならTRUE。v2.38
static BOOL _bFuncRecent = TRUE;//Kitao追加。ファンクションボタン+RUNボタンで最近開いたROMの読み込みを可能にするならTRUE。v2.48
static BOOL _bFuncVSpeedUp = TRUE;//Kitao追加。ファンクションボタン+早回しボタンで早回し切替を可能にするならTRUE。v2.38
static BOOL _bKeyRepeatSaveState = FALSE;//Kitao追加
static BOOL _bKeyRepeatLoadState = FALSE;//Kitao追加
static BOOL _bKeyRepeatScreenshot = FALSE;//Kitao追加
static BOOL _bKeyRepeatPause = FALSE;//Kitao追加
static BOOL _bKeyRepeatVolumeChangeUD = FALSE;//Kitao追加
static BOOL _bKeyRepeatVolumeChangeLR = FALSE;//Kitao追加
static BOOL _bKeyRepeatTurboSelect1 = FALSE;//Kitao追加
static BOOL _bKeyRepeatTurboSelect2 = FALSE;//Kitao追加
static BOOL _bKeyRepeatFuncScreenshot = FALSE;//Kitao追加
static BOOL _bKeyRepeatSpeedChange = FALSE;//Kitao追加
static BOOL _bKeyRepeatFuncSave = FALSE;//Kitao追加
static BOOL _bKeyRepeatFuncLoad = FALSE;//Kitao追加
static BOOL _bKeyRepeatFuncRecent = FALSE;//Kitao追加
static DWORD _PriorityClass = NORMAL_PRIORITY_CLASS;//Kitao追加。Ootake実行の優先度。hesやBGMを聞きながらネットサーフィンなどするときにHIGHじゃないと音割れが起こる。(特にDirect3D描画使用時)
// [APP DISPLAY] (default values)
static Sint32 _ScreenWidth = 299 * 3;//Kitao更新。v2.63からデフォルトを*3にした(以前は*2)。
static Sint32 _ScreenHeight = 224 * 3;// v2.63からデフォルトを*3にした(以前は*2)。
static Sint32 _Magnification = 3; //Kitao更新。v2.63からデフォルトを3にした(以前は2)。
static Sint32 _FullMagnification = 3; //Kitao追加。フルスクリーン時には別に設定できるようにした。0(カスタマイズ専用),1(デフォ300x240),5(デフォ400x300)は、カスタマイズ解像度として扱う。v2.63からデフォルトを3にした(以前は2)。
static Sint32 _ScreenshotMagnification = 2; //Kitao追加。スクリーンショット時の表示倍率(1~4)。0の場合ノンストレッチ(x1)。
static Sint32 _CustomWidth1 = 640; //Kitao追加
static Sint32 _CustomHeight1 = 480; //Kitao追加
static Sint32 _CustomWidth2 = 320; //Kitao追加
static Sint32 _CustomHeight2 = 240; //Kitao追加
static Sint32 _CustomWidth3 = 400; //Kitao追加
static Sint32 _CustomHeight3 = 300; //Kitao追加
static BOOL _bResolutionAutoChange = FALSE; //Kitao追加。v1.35
static BOOL _bFullScreen = FALSE;
static double _GammaValue = 1.340; //Kitao追加。v1.41更新
static Sint32 _BrightValue = 1; //Kitao追加。v1.41
static Sint32 _ScanLineType = 0; //Kitao追加。0…ノンスキャンライン,1…縦横スキャンライン,2…横のみスキャンライン,3…縦のみスキャンライン(未実装),4…TVモード。5以降も拡張可能。v2.63からデフォルトを1に。
static Sint32 _ScreenshotScanLineType = 2; //Kitao追加。スクリーンショット時のスキャンラインタイプ。-1の場合、プレイ中と同じ(_ScanLineTypeの値を使用)。デフォルトは静止画で綺麗な2(&Sizeはx2)。
static Sint32 _ScanLineDensity = 70; //Kitao追加。v1.09。v2.35からデフォルトは30%にした。v2.64からデフォルトを70%にした。
static BOOL _bOptimizeGamma = TRUE; //Kitao追加。スキャンラインの濃度に応じてガンマを最適化するならTRUE。v2.35
static BOOL _bTvMode = FALSE; //Kitao追加。TVのビデオ出力ような雰囲気を出すならTRUE。
static Sint32 _MonoColorMode = 0; //Kitao追加。モノクロ(白黒)表示にするなら1。グリーンディスプレイなら2。v2.28
static Sint32 _ShowOverscanTop = 0; //Kitao追加。上側のオーバースキャン領域を表示するドット数。Screenメニューを手動で設定した状態が入る。v.1.43
static Sint32 _ShowOverscanBottom = 0; //下側のオーバースキャン領域を表示するドット数。
static Sint32 _ShowOverscanLeft = 0; //左側のオーバースキャン領域を表示するドット数。
static Sint32 _ShowOverscanRight = 0; //右側のオーバースキャン領域を表示するドット数。
static Sint32 _ShowOverscanHeight = 8; //上下のオーバースキャン領域をオンにしたときのドット数。
static Sint32 _StartShowOverscanTop = 0; //起動時用。"Setting->Screen"メニューでの設定状態が入る。
static Sint32 _StartShowOverscanBottom= 0; //
static Sint32 _StartShowOverscanLeft = 0; //
static Sint32 _StartShowOverscanRight = 0; //オフのときはTop,Bottom.Left.Rightそれぞれ全てが0。
static Sint32 _StartShowOverscanHeight= 8; //
static BOOL _bOverscanHideBlackBelt = TRUE; //ウィンドウモードでオーバースキャン領域を隠す際に、ウィンドウは広げたままで黒帯でマスクする場合TRUE。v1.45追加
static BOOL _bStretched = TRUE;
static BOOL _bFullStretched = FALSE;//Kitao追加。画面一杯まで引き伸ばすならTRUE。
static BOOL _bVStretched = FALSE;//Kitao追加。縦画面モードにするならTRUE。縦画面モードは次回起動時には元に戻すため、Configファイルには記録しない。
static Sint32 _StartStretchMode = 1; //0=ノンストレッチ,1=リアルストレッチ,2=フルストレッチ,3=縦ストレッチ(※現状は縦ストレッチスタートはせず、起動時はリアルストレッチに設定)。v2.64追加
static BOOL _bSyncTo60HzScreen = TRUE;//Kitao変更。ウィンドウモードでも使うので_bSyncTo60HzFullScreenから_bSyncTo60HzScreenへ。
static Sint32 _VSyncAdjust = 0;//Direct3D利用時のV-Syncタイミング補正値。1なら1ライン走査線ぶん、早いタイミングでV-Sync割り込みを発生させる。古めのPCでタイミングが合わないときにこれを使うと改善できる場合がある。うちのRADEON機(XP)は13で640x480が最適になった(※640x480より荒い解像度では補正しない)。14だとGeForce機(Win7)でNG。通常は0。v2.65
static Sint32 _NonVSyncTiming = 10;//10。4-17OK。約59.94Hzに出来るだけ近く。非V-Sync時の動作タイミング。PC環境によって速さが微妙に異なるのでその調整用。1が一番速いタイミング(タイミング処理が遅いPC用),大きな値は遅いタイミング(タイミング処理が速いPC用)。v2.43
static BOOL _bForceVSync = FALSE;//Kitao追加。リフレッシュレートが59~61以外の場合でも、VSyncを有効にする場合はTRUEに。古い環境でリフレッシュレートの値が0を返す場合などで必要。v2.41。_WindowsAutoVSyncを利用してもらうことにしてv2.65から非使用とする。
static Sint32 _WindowsAutoVSync = 0;//1か2の場合、Windowsの自動V-Sync機能でV-Syncを行う。2の場合フルスクリーン時のみ。この自動V-Syncを使うと表示の遅延(おそらく1フレーム)が発生するので、PC環境によってやむ終えない場合のみ利用。v2.65追加
static Sint32 _DrawMethod = 0;//Kitao追加。描画方法を設定する。1ならDirect3D。2ならDirectDraw。
static Sint32 _D3DEffectRGB = 2;//Kitao追加。RGBモード(TVモード以外)時に使う「Direct3Dの描画(転送)エフェクト」を設定する。2ならLINEAR(スムージング)。1ならPOINT(かなりシャープ)。0ならNONE(何もしないのでシャープ)。
static Sint32 _D3DEffectTV = 1;//Kitao追加。TVモード時に使う「Direct3Dの描画(転送)エフェクト」を設定する。値は同上。TVモード時のデフォルトは1(POINT)。RGBモード時のデフォルトは1(LINEAR)。が個人的には最適。
static BOOL _bUseVideoCardMemory = TRUE;//Kitao追加。TRUEならビデオカードのメモリーを使う。FALSEならシステムのメモリを使う(ジャギーが出るがクッキリ&速度やや低下)。
static BOOL _bUseSystemMemoryOnlyWindow = FALSE; //Kitao追加。v1.53。TRUEならウィンドウモード時だけシステムメモリを使う。
static Uint32 _FullScreenColor = 16;//Kitao追加。フルスクリーン時のカラービット数
static BOOL _bStartFullScreen = FALSE;//Kitao追加。ゲーム起動時に自動でフルスクリーンにするかどうか。
static BOOL _bWindowTopMost = FALSE;//Kitao追加。Windowモード時に、Ootakeのウィンドウを最前面に表示するかどうか。v1.34追加
static BOOL _bWindowActivate = TRUE;
static BOOL _bInactivePause = FALSE;
static Sint32 _StartFastCD = 1;
static BOOL _bFastCD = TRUE; //Kitao追加
static Sint32 _StartFastSeek = 1;//Kitao追加。ゲーム起動時の"Fast Seek"設定。0…OFF, 1…ON, 2…前回終了時の設定。v1.08からON(1)をデフォルトにした。
static BOOL _bFastSeek = TRUE; //Kitao追加。v1.08からTRUEをデフォルトにした。
static Sint32 _StartSpriteLimit = 0;//Kitao追加。ゲーム起動時の"Perform SpriteLimit"設定。0…OFF, 1…ON, 2…前回終了時の設定
static BOOL _bSpriteLimit = FALSE; //Kitao追加
static BOOL _bHideMenu = FALSE;//Kitao追加。エミュレータ動作時にメニューを隠すならTRUE
static BOOL _bHideMessage = FALSE;//Kitao追加。メッセージ表示をオフにするならTRUE
static BOOL _bFullHideMessage = FALSE;//Kitao追加。メッセージ表示をオフにするならTRUE。フルスクリーン用
static char _ScreenshotFilePathName[MAX_PATH+1] = ""; //Kitao追加。v2.12
static BOOL _bScreenshotDialog = FALSE; //Kitao追加。v2.13
static BOOL _bDisableWindowsAero = TRUE; //Kitao追加。WindowsAero(Win7/Vistaで透明化などができるデスクトップ)を無効にするならTRUE。無効にしないと表示遅延(2-3フレーム?)がある。v2.21
// [APP SOUND] (default values)
static Sint32 _SoundType = 1;//Kitao追加。1…通常(ソフトバッファ&ミキシング。環境にもよるかもしれないがベストな音質)。2…ハードバッファ&ソフトミキシング(それなりにいい音が鳴る。環境によってはこちらのほうがノイズが載らず安定する)。
static Sint32 _SoundBufferSize = 1664;//Kitao更新。バッファが小さすぎると音のつながりが悪くなりノイズが混じって音質自体が下がりがち。バッファが大きすぎると、音が遅れる&ADPCMの再生が間に合わなず音が切られて大きく飛ぶ。
static Sint32 _SoundSampleRate = 44100;//固定にした。
static Uint32 _SoundApuMasterVolume = 65535;//Kitao変更。65535で音割れしない最大限の音質を目指す。65535以外の場合、設定画面で%に合わせるためには656の倍数で。/* 0 - 65535 */
static Uint32 _SoundPsgVolume = 65535;//Kitao追加。同上。
static Uint32 _SoundAdpcmVolume = 65535;//Kitao変更。同上。
static Uint32 _SoundCdVolume = 65535;//Kitao追加。同上。この変数はミキサーのボリュームとしてではなく、Ootake内部のCDボリューム値として使用。
static Sint32 _WindowsVolume = -1;//Kitao追加。Windowsのボリュームコントロール(WAVE)を設定する。値は1(Min)~120(Max。※101~120はHuカードゲーム時のみ有効。CDゲーム時は100と同じ音量に)。-1ならWindowsデフォルトのままの音量。ボリュームコントロールを直接変更すると、音質をほぼ落とさずにボリューム調整ができる(PC2Eのときと同じ方式)。v1.61
static Sint32 _PrevWindowsVolume = -2;//Kitao追加。レジュームする前の音量値を退避用。退避していないときは-2とする。
static BOOL _bWindowsVolumeChanged = FALSE;//Kitao追加。一度でも音量を変更したらTRUE。これがTRUEのとき、Ootake終了時に音量を元に戻す。v2.16
static Uint32 _VolumeEffect = 1;//Kitao追加。ボリュームをこの値で割ってから出力する。ミュートは0。"4分の3"は3。
static Sint32 _VolumeStep = 4;//ボリューム変更時のステップ数。v2.45
static Sint32 _BigSoundBuffer = 0;//Kitao追加。1のときは曲観賞用サイズで大きくバッファを取る。2のときはさらに大きくサウンドバッファを取る。曲を高音質で鑑賞したい時用。
#define BigSoundBufferRate 4 //Kitao追加。ビッグサウンドバッファモード時のバッファ倍率(通常設定のバッファにこの倍率が掛けられる)
#define MostBigSoundBufferRate 8 //Kitao追加。モーストビッグサウンドバッファモード時のバッファ倍率(通常設定のバッファにこの倍率が掛けられる)
static Sint32 _PsgQuality = 4;//Kitao追加。PSGの再現性を高めるなら4か2。処理速度優先なら1。(1/60)*(1/_HighQualitySound)秒間に1回、実機のタイミングに合わせる。回数が多いほど再現性は高まる(現在4と2と1のみ実装)。v1.39
static BOOL _bAutoStereo = TRUE;//Kitao追加。グラディウス,沙羅曼蛇,パロディウスだ!を起動したときに、自動でステレオモードにするならTRUE。v1.15
static char _WavFilePathName[MAX_PATH+1] = ""; //Kitao追加。v1.29
static BOOL _bOutputWavNext = FALSE; //Kitao追加。v1.29
static BOOL _bOutputWavAddNoSound = TRUE; //Kitao追加。v1.29
static Sint32 _CddaAdjust = 5995; //V-Sync時にディスプレイリフレッシュレートの周波数の微妙な違い(59.3Hz,59.4Hz,59.5Hz,59.6Hz,59.7Hz,59.8Hz,59.9Hz,60.0Hz,60.1Hz,60.2Hz等)で、長いCD-DA再生のビジュアルシーンで音ズレを防ぐための微調整値。v2.32
//フルHD(1920x1080)のワイドディスプレイに多い「59.95Hz」をデフォルト設定とする。59.75Hzを基準(補正なし)とし、59.7Hzでは-1200(画面が20秒間に1フレーム遅い)。59.8Hzでは+1200(画面が20秒間に1フレーム早い)。ゲームの動作を見ながら合わせた。
static Sint32 _CddaAdjustFull[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; //フルスクリーン時の各解像度ごとの_CddaAdjust。ウィンドウとは別で設定を保存。添え字は_FullMagnification(0~6。将来の予備として[10]まで確保しておいた)。v2.32
static Sint32 _CddaAdjustFineTune; //_CddaAdjust(_CddaAdjustFull)の微調整用。設定を行う際の小数点第2位の値。0か5。v2.32
static Sint32 _CddaDelayFrame = 2; //パソコンの液晶ディスプレイ利用時に起こってしまう表示遅延を、何フレームぶん考慮するか。デフォルトは2フレームぶんCD-DAの再生タイミングを遅らせる。v2.33
// [APP INPUT] (default values)
//Kitao更新。キーボードにも対応できるように_JoyPad[]を廃止し、_PcePad2[],_PcePad6[]を新設。2ボタンパッド時と6ボタンパッド時で別々のボタン設定を保存可能にした。
static PCEPAD _PcePad2[6]; //2ボタン使用時の、各PCEパッド[1]~[5]のボタン設定([0]は非使用)
static PCEPAD _PcePad3[6]; //3ボタン使用時の、各PCEパッド[1]~[5]のボタン設定([0]は非使用)。v0.79追加
static PCEPAD _PcePad6[6]; //6ボタン使用時の、各PCEパッド[1]~[5]のボタン設定([0]は非使用)
static Sint32 _RenshaSpeedSel = 1; //起動時の連射スピード(0=強制Off, 1=High, 2=Middle, 3=Low)。v0.62追加
static BOOL _bUseThreeButton = FALSE; //3ボタンパッド設定を使うならTRUE。2ボタンパッド設定を使うならFALSE。
static BOOL _bAutoGradiusII = TRUE;//Kitao追加。グラディウスIIを起動したときに、自動でレーザー・スプレッドボムがちらつかない設定&ステレオ設定にするならTRUE。v1.21。v2.34
static BOOL _bAutoShinMegamiTensei = TRUE;//Kitao追加。実機でも起こる「時々起こる描画関連の細かいバグ」をCPU速度を上げることで解消するならTRUE。v2.20
static BOOL _bJoypadBackground = TRUE; //v1.41追加
static BOOL _bKeyboardBackground = FALSE; //v1.41追加
static Sint32 _InputRecordMode = 2; //プレイレコードのモード(1=1プレイヤーのみ(連射専用ボタン非対応),2=連射専用ボタン対応&2プレイヤーパッド対応)。現状は2固定とする。将来5人プレイ記録にも対応したい。v2.15追加
static Sint32 _InputRecordingNumber = -1; //プレイレコード記録中の場合、ここに記録ナンバー(#0~#10)が入る。v2.15追加
static Sint32 _InputPlayRecordNumber = -1; //プレイレコード再生中の場合、ここに記録ナンバー(#0~#10)が入る。v2.15追加
static BOOL _bCheckSimultaneouslyPush = TRUE; //十字キーの左右(または上下)同時押しを抑制する場合TRUE。v2.59追加
static FILE* _fpRecording = NULL;
static FILE* _fpPlayRecord = NULL;
static HANDLE _Menu;
static HANDLE _FileMenu;
static HANDLE _CaptureMenu;//Kitao追加
static HANDLE _SaveAnotherMenu;//Kitao追加
static HANDLE _SaveAnother2Menu;//Kitao追加
static HANDLE _LoadAnotherMenu;//Kitao追加
static HANDLE _LoadAnother2Menu;//Kitao追加
static HANDLE _RecordingAnotherMenu;//Kitao追加
static HANDLE _PlayRecordAnotherMenu;//Kitao追加
static HANDLE _MoveRecordMenu;//Kitao追加
static HANDLE _AviAttentionMenu;//Kitao追加
static HANDLE _SaveButtonMenu;//Kitao追加
static HANDLE _SShotButtonMenu;//Kitao追加
static HANDLE _SShotSettingMenu;//Kitao追加
static HANDLE _WavAnotherMenu;//Kitao追加
static HANDLE _WavSettingMenu;//Kitao追加
static HANDLE _RecentMenu;//Kitao追加
static HANDLE _DriveMenu;//Kitao追加
static HANDLE _CDChangeNRMenu;//Kitao追加
static HANDLE _SettingMenu;//Kitao更新
static HANDLE _SizeMenu;//Kitao追加
static HANDLE _AudioSubMenu;//Kitao追加
static HANDLE _SpeedMenu;//Kitao追加
static HANDLE _VolumeMenu;//Kitao追加
static HANDLE _InfoMenu;//Kitao追加
static HANDLE _ScreenMenu;
static HANDLE _CpuMenu;
static HANDLE _InputMenu;
static HANDLE _AudioMenu;
static HANDLE _CDROMMenu;//Kitao追加
static HANDLE _SetCpuMenu;//Kitao追加
static HANDLE _SetInputMenu;//Kitao追加
static HANDLE _ToolMenu;//Kitao追加
static HANDLE _TurboButtonMenu;//Kitao追加
static HANDLE _FuncButtonMenu;//Kitao追加
//static HANDLE _SampleRateMenu; Kitaoカット
static HANDLE _DefaultMenu;//Kitao追加
static HANDLE _ScanlineMenu;//Kitao追加
static HANDLE _DensityMenu;//Kitao追加
static HANDLE _GammaMenu;//Kitao追加
static HANDLE _BrightnessMenu;//Kitao追加
static HANDLE _ResolutionMenu;//Kitao追加
static HANDLE _Direct3DMenu;//Kitao追加
static HANDLE _DirectDrawMenu;//Kitao追加
static HANDLE _OverscanMenu;//Kitao追加
static HANDLE _StartOverscanMenu;//Kitao追加
static HANDLE _OtherSyscardMenu;//Kitao追加
static HANDLE _TempVolMenu;//Kitao追加
static HANDLE _VolAttentionMenu;//Kitao追加
static HANDLE _VolDetailMenu;//Kitao追加
static HANDLE _VolStepMenu;//Kitao追加
static HANDLE _MuteMenu;//Kitao追加
static HANDLE _CpuSpeedMenu;//Kitao追加
static HANDLE _WriteAttentionMenu;//Kitao追加
static BOOL _bScreenMenuFull;//Kitao追加。フルスクリーン用のメニューを表示しているときはTRUE。
static BOOL _bRunning = TRUE;
static BOOL _bPauseNoRelease = FALSE; //Kitao追加
static BOOL _bShowFPS = FALSE; //Kitao追加。v1.50
static char _RecentRom[21][MAX_PATH+1] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " "};//Kitao追加。ROMイメージファイルの履歴20個ぶん。[1]~[20]([0]は非使用)
static char _RecentRomTmp[MAX_PATH+1]; //v2.48追加
//Kitao追加。英数大文字を小文字に変換する関数。
static char*
strToLower(
char* pStr)
{
char* p = pStr;
while (*p)
{
*p = tolower(*p);
p++;
}
return pStr;
}
//Kitao追加。英数大文字を小文字に変換する関数。外部から使う用
char*
APP_StrToLower(
char* pStr)
{
return strToLower(pStr);
}
//Kitao追加。ディレクトリパスを取り除いてファイル名だけを返す関数。MinGWでstrrchr関数だと「ソ」等の日本語文字を\の区切りと間違ってしまうため独自の処理で'\'をサーチ。
static char*
extractFileName(
char* p)
{
int a,b;
Uint8 c;
BOOL ok = FALSE;
a = (int)strlen(p);
while (--a > 0)
{
c = *(p+a);
if (c == '\\')
{
b = a;
while (--b >= 0)
{
c = *(p+b); //手前のバイトの文字を調べる
if (!(((c>0x80)&&(c<0xA0))||
((c>0xDF)&&(c<0xFD)))) //「ソ」「表」などの日本語内の「\」ではなければ
{
a++;
ok = TRUE;
break;
}
else // c が全角のLowByte部分である可能性もあるのでそれをチェック。v0.78
{
if (--b >= 0)
{
c = *(p+b); //手前のバイトの文字を調べる
if (!(((c>0x80)&&(c<0xA0))||
((c>0xDF)&&(c<0xFD)))) // c が全角のHighByteではなければ
break;
// c が全角のHighByteならまだ半角の「\」かどうかを決定できず。さらに前のバイトのチェックを続ける。
}
}
}
if (ok)
break;
}
}
return (p+a);
}
//Kitao追加。拡張子だけを返す関数。
static char*
extractFileExt(
char* p)
{
int a;
a = (int)strlen(p);
while (--a > 0)
{
if (*(p+a) == '.')
{
a++;
break;
}
}
return (p+a);
}
//Kitao追加。拡張子だけを返す関数。外部から使う用
char*
APP_ExtractFileExt(
char* p)
{
return extractFileExt(p);
}
//Kitao追加。ゲームのファイル名(拡張子はカット)をpGameFileNameBufに設定する
static void
SetGameFileNameBuf(
BOOL bCDGame,
BOOL bHesFile,
char* pGameFilePathName,
char* pGameFileNameBuf,
BOOL bSetCueMark)
{
char buf[MAX_PATH+1];
strcpy(pGameFileNameBuf, "");
if (bCDGame)
{//CDのゲームだった場合、TOCゲーム名を入れる
strcpy(pGameFileNameBuf, "(CD)");
strcat(pGameFileNameBuf, TOCDB_GetGameTitle());
}
else //Huカードのゲームの場合
{
strcat(pGameFileNameBuf, extractFileName(pGameFilePathName));
strcpy(buf, pGameFilePathName); //pGameFilePathNameは書き換えないようにするためbufを使う
if ((bHesFile)||
(strstr(strToLower(extractFileExt(buf)), "hes"))) //bHesFileがFALSEでも、拡張子がhesなら。
{ //HESファイルの場合
strcpy(buf, pGameFileNameBuf);
if (bSetCueMark)
strcpy(pGameFileNameBuf, "[hes] "); //ROMオープン履歴メニュー表示時に使用。v2.24
else
strcpy(pGameFileNameBuf, "(hes)");
strcat(pGameFileNameBuf, buf);
}
else if (bSetCueMark) //bSetCueMarkをTRUEにして呼んだ時。ROMオープン履歴メニュー表示時のみ使用。[CD][Hu]マークを付ける。v2.24
{
if (strstr(strToLower(extractFileExt(buf)), "cue")) //拡張子がcueなら。
{ //CUEファイルの場合
strcpy(buf, pGameFileNameBuf);
strcpy(pGameFileNameBuf, "[CD] ");
strcat(pGameFileNameBuf, buf);
}
else if (strcmp(pGameFilePathName, " ") != 0)
{ //Huカードの場合
strcpy(buf, pGameFileNameBuf);
strcpy(pGameFileNameBuf, "[Hu] ");
strcat(pGameFileNameBuf, buf);
}
}
//拡張子をカット
if (strrchr(pGameFileNameBuf, '.') != NULL)
*(strrchr(pGameFileNameBuf, '.')) = 0;
}
}
//Kitao追加。ステートセーブ用のファイル名を設定
static void
SetSaveStateFileName(
const Sint32 number, //number=ステートセーブの番号。番号なしは0。
char* pBuf)
{
char c[2+1] = "";
strcpy(pBuf, _AppPath);
strcat(pBuf, "save");
CreateDirectory(pBuf, NULL);//saveディレクトリがない場合作る
strcat(pBuf, "\\");
strcat(pBuf, _GameFileNameBuf);//Kitao更新
strcat(pBuf, "_state");
if (number > 0) //番号付き保存の場合
{
sprintf(c, "%d", (int)number);
strcat(pBuf, c);
}
strcat(pBuf, ".dat");
}
//Kitao追加。プレイレコード保存用のファイル名を設定
static void
SetRecordFileName(
const Sint32 number, //number=ステートセーブの番号。番号なしは0。
char* pBuf)
{
char c[2+1] = "";
strcpy(pBuf, _AppPath);
strcat(pBuf, "record");
CreateDirectory(pBuf, NULL);//recordディレクトリがない場合作る
strcat(pBuf, "\\");
strcat(pBuf, _GameFileNameBuf);//Kitao更新
strcat(pBuf, "_record");
if (number > 0) //番号付き保存の場合
{
sprintf(c, "%d", (int)number);
strcat(pBuf, c);
}
strcat(pBuf, ".dat");
}
//Kitao追加。v2.32
static Sint32
getCddaAdjust()
{
if (_bFullScreen)
return _CddaAdjustFull[_FullMagnification];
else
return _CddaAdjust;
}
//1.61追加
static void
overClockMenuUpdate()
{
switch (VDC_GetOverClockType())
{
case 0: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_P0);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [Normal]"); break;
case 300: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_T3);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [TURBOx3]"); break;
case 200: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_T2);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [TURBOx2]"); break;
case 100: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_T1);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [TURBOx1]"); break;
case 6: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_P6);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [x3.00]"); break;
case 5: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_P5);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [x2.50]"); break;
case 4: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_P4);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [x2.00]"); break;
case 3: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_P3);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [x1.50]"); break;
case 2: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_P2);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [x1.33]"); break;
case 1: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_P1);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [x1.25]"); break;
case -1: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_M1);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [x0.75]"); break;
case -2: MENU_CheckRadioItem(_CpuSpeedMenu, WM_SPEED_P0, WM_SPEED_M2, WM_SPEED_M2);
MENU_ChangeItemText(_SpeedMenu, WM_SPEED_CPU, "CPU Speed [x0.50]"); break;
}
}
//Kitao追加。v2.29
void
updateVolumeMenu()
{
int a;
char buf[32];
switch (_WindowsVolume/10)
{
case 12: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_12); break;
case 11: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_11); break;
case 10: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_10); break;
case 9: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_9); break;
case 8: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_8); break;
case 7: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_7); break;
case 6: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_6); break;
case 5: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_5); break;
case 4: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_4); break;
case 3: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_3); break;
case 2: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_2); break;
case 1: MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_1); break;
case 0:
//if (_WindowsVolume == 0) //MUTE用。現在未実装
//else
if (_WindowsVolume == -1)
MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_DEFAULT);
else
MENU_CheckRadioItem(_VolumeMenu, WM_VOLUME_DEFAULT, WM_VOLUME_1, WM_VOLUME_1); //1~9の場合もVolume1にチェック
break;
}
if (_WindowsVolume == -1)
{
mixerGetControlDetails((HMIXEROBJ)_hMix, &_MixerControlD, MIXER_OBJECTF_HMIXER|MIXER_GETCONTROLDETAILSF_VALUE);
_dwDefaultWindowsVolumeValue = _MixerControlDU.dwValue; //最新のWindowsボリューム値に更新。v2.16
a = (int)((double)_dwDefaultWindowsVolumeValue/(double)_dwWaveMaxVolume * 100 +0.5);
}
else
a = _WindowsVolume;
sprintf(buf, "Detail Volume [%d]", a);
MENU_ChangeItemText(_VolumeMenu, WM_VOLUME_DETAIL, buf);
}
//ゲーム起動からの経過時間(単位はフレーム)を読み込んでメニュー表示用テキストを作成。v2.63追加
//※numを負の数で呼んだ場合、ロードサムネイルへ時間表示を入れる処理用(MainBoard.cppからAPP_CheckStateTime()で利用)。
static void
checkStateTime(
const Sint32 num0,
char* pBufS,
char* pBufL)
{
int a;
char buf2[MAX_PATH+1+9];
char bufT[11+1];
FILE* fp;
Uint32 stateVersion;
Uint32 systemTime;
int t1, t2, t3;
Sint32 num = num0;
if (num0 < 0)
{
strcpy(pBufS, "Former File");
strcpy(pBufL, "");
num = abs(num0);
}
else if (num0 == 0)
{
strcpy(pBufS, "&Save State");
strcpy(pBufL, "&Load State");
}
else
{
sprintf(pBufS, "Save State #%d", num);
sprintf(pBufL, "Load State #%d", num);
}
SetSaveStateFileName(num, buf2); //ステートセーブのファイル名を設定
if ((fp = fopen(buf2, "rb")) != NULL) //セーブファイルがあれば
{
fread(&stateVersion, sizeof(stateVersion), 1, fp);
if (stateVersion > SAVE_STATE_VERSION) //もし旧バージョンのOotakeで未対応の新ver.ステートセーブデータを読み込んだ場合
strcat(pBufL, " x");
else if (stateVersion >= 27) //v1.15以降のセーブファイルなら
{
a = 0x8025A; //経過時間データが入っている位置
if (stateVersion < 32) //v1.43より前のセーブファイルなら
a -= 16;
if (stateVersion < 42) //v2.27より前のセーブファイルなら
a -= 12;
if (stateVersion < 43) //v2.28より前のセーブファイルなら
a -= 4;
fseek(fp, a ,SEEK_SET);
fread(&systemTime, sizeof(systemTime), 1, fp);
if (systemTime == 0xFFFFFFFF)
{
strcat(pBufS, " <--:--:-->");
strcat(pBufL, " <--:--:-->");
}
else
{
//60.00HzなどのディスプレイでV-Sync動作時でも、「59.94フレームでゲーム時間は1秒経過」とし、実機と同時間な表示にする。
systemTime *= 100;
t1 = systemTime / int(59.94 * 59.94 * 59.94 * 100.0);
systemTime -= t1 * int(59.94 * 59.94 * 59.94 * 100.0);
if (t1>99) t1=99;
t2 = systemTime / int(59.94 * 59.94 * 100.0);
systemTime -= t2 * int(59.94 * 59.94 * 100.0);
t3 = systemTime / int(59.94 * 100.0);
sprintf(bufT, " <%02d:%02d:%02d>", t1, t2, t3);
strcat(pBufS, bufT);
strcat(pBufL, bufT);
}
}
else //v1.15より前のセーブファイルなら
{
strcat(pBufS, " <--:--:-->");
strcat(pBufL, " <--:--:-->");
}
fclose(fp);
}
if (num0 == 0)
{
if (_SaveStateButton == DIK_S) //キー設定がデフォルトの場合
strcat(pBufS, "\tS");
if (_LoadStateButton == DIK_L) //キー設定がデフォルトの場合
strcat(pBufL, "\tL");
}
}
//Kitao追加。メニューの選択状態をアップデートする。ステートロード時などでも使用。
static void
updateMenu()
{
int a;
char buf[MAX_PATH+1];
char buf2[MAX_PATH+1+9];
char bufS[14+11+1];
char bufL[14+11+1];
char bufC[33+1+1];
FILE* fp;
//Kitao追加
checkStateTime(0, bufS, bufL);
MENU_ChangeItemText(_FileMenu, WM_SAVE_STATE, bufS);
MENU_ChangeItemText(_FileMenu, WM_LOAD_STATE, bufL);
if (_ScreenshotButton == DIK_SYSRQ) //キー設定がデフォルトの場合
MENU_ChangeItemText(_FileMenu, WM_OUTPUT_SCREENSHOT, "Output Screens&hot\tPrtScr");
else
MENU_ChangeItemText(_FileMenu, WM_OUTPUT_SCREENSHOT, "Output Screens&hot");
//Kitao追加
if (_bCDGame)
{
if (_bF1NoReset) //F1キーでリセットせずにCDを入れ替える設定の場合。"CDバトル 光の勇者たち" で利用。
{
MENU_ChangeItemText(_FileMenu, WM_CD_CHANGE, "&CD Change");
MENU_ChangeItemText(_DriveMenu, WM_CD_CHANGE, "CD Change");
}
else
{
if (_bCueFile)
{
MENU_ChangeItemText(_FileMenu, WM_CD_CHANGE, "&CD Change\tCtrl+F1");
MENU_ChangeItemText(_DriveMenu, WM_CD_CHANGE, "CD Change\tCtrl+F1");
}
else
{
MENU_ChangeItemText(_FileMenu, WM_CD_CHANGE, "&CD Change\tF1");
MENU_ChangeItemText(_DriveMenu, WM_CD_CHANGE, "CD Change\tF1");
}
}
}
else
{
MENU_ChangeItemText(_FileMenu, WM_CD_CHANGE, "&CD Play\tCtrl+F1");
MENU_ChangeItemText(_DriveMenu, WM_CD_CHANGE, "CD Play\tCtrl+F1");
}
//Kitao追加
MENU_CheckItem(_FileMenu, WM_SET_RESUME, _bResumeMode);
MENU_CheckItem(_FileMenu, WM_AUTO_RESUME, _bAutoResumeMode);
//Kitao追加
checkStateTime( 1, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_1, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_1, bufL);
checkStateTime( 2, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_2, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_2, bufL);
checkStateTime( 3, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_3, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_3, bufL);
checkStateTime( 4, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_4, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_4, bufL);
checkStateTime( 5, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_5, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_5, bufL);
checkStateTime( 6, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_6, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_6, bufL);
checkStateTime( 7, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_7, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_7, bufL);
checkStateTime( 8, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_8, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_8, bufL);
checkStateTime( 9, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_9, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_9, bufL);
checkStateTime(10, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_10, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_10, bufL);
checkStateTime(11, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_11, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_11, bufL);
checkStateTime(12, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_12, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_12, bufL);
checkStateTime(13, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_13, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_13, bufL);
checkStateTime(14, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_14, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_14, bufL);
checkStateTime(15, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_15, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_15, bufL);
checkStateTime(16, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_16, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_16, bufL);
checkStateTime(17, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_17, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_17, bufL);
checkStateTime(18, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_18, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_18, bufL);
checkStateTime(19, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_19, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_19, bufL);
checkStateTime(20, bufS, bufL); MENU_ChangeItemText(_SaveAnotherMenu, WM_SAVE_STATE_20, bufS); MENU_ChangeItemText(_LoadAnotherMenu, WM_LOAD_STATE_20, bufL);
checkStateTime(21, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_21, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_21, bufL);
checkStateTime(22, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_22, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_22, bufL);
checkStateTime(23, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_23, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_23, bufL);
checkStateTime(24, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_24, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_24, bufL);
checkStateTime(25, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_25, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_25, bufL);
checkStateTime(26, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_26, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_26, bufL);
checkStateTime(27, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_27, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_27, bufL);
checkStateTime(28, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_28, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_28, bufL);
checkStateTime(29, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_29, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_29, bufL);
checkStateTime(30, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_30, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_30, bufL);
checkStateTime(31, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_31, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_31, bufL);
checkStateTime(32, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_32, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_32, bufL);
checkStateTime(33, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_33, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_33, bufL);
checkStateTime(34, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_34, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_34, bufL);
checkStateTime(35, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_35, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_35, bufL);
checkStateTime(36, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_36, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_36, bufL);
checkStateTime(37, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_37, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_37, bufL);
checkStateTime(38, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_38, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_38, bufL);
checkStateTime(39, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_39, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_39, bufL);
checkStateTime(40, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_40, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_40, bufL);
checkStateTime(41, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_41, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_41, bufL);
checkStateTime(42, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_42, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_42, bufL);
checkStateTime(43, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_43, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_43, bufL);
checkStateTime(44, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_44, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_44, bufL);
checkStateTime(45, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_45, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_45, bufL);
checkStateTime(46, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_46, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_46, bufL);
checkStateTime(47, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_47, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_47, bufL);
checkStateTime(48, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_48, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_48, bufL);
checkStateTime(49, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_49, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_49, bufL);
checkStateTime(50, bufS, bufL); MENU_ChangeItemText(_SaveAnother2Menu, WM_SAVE_STATE_50, bufS); MENU_ChangeItemText(_LoadAnother2Menu, WM_LOAD_STATE_50, bufL);
//Kitao追加。v2.15
strcpy(bufS, "Start Recording #1");
strcpy(bufL, "Play Record #1");
strcpy(bufC, "Move \"Default Record Data\" to #1");
SetRecordFileName(1, buf2); //ステートセーブのファイル名を設定
if ((fp = fopen(buf2, "r")) != NULL) //セーブファイルがあれば
{
fclose(fp);
strcat(bufS, "*");
strcat(bufL, "*");
strcat(bufC, "*");
}
MENU_ChangeItemText(_RecordingAnotherMenu, WM_RECORDING_1, bufS);
MENU_ChangeItemText(_PlayRecordAnotherMenu, WM_PLAYRECORD_1, bufL);
MENU_ChangeItemText(_MoveRecordMenu, WM_MOVERECORD_1, bufC);
strcpy(bufS,"Start Recording #2"); strcpy(bufL,"Play Record #2"); strcpy(bufC, "Move \"Default Record Data\" to #2");
SetRecordFileName( 2,buf2); if ((fp = fopen(buf2, "r")) != NULL) {fclose(fp);strcat(bufS,"*");strcat(bufL,"*");strcat(bufC,"*");}
MENU_ChangeItemText(_RecordingAnotherMenu,WM_RECORDING_2 ,bufS); MENU_ChangeItemText(_PlayRecordAnotherMenu,WM_PLAYRECORD_2 ,bufL); MENU_ChangeItemText(_MoveRecordMenu,WM_MOVERECORD_2 ,bufC);
strcpy(bufS,"Start Recording #3"); strcpy(bufL,"Play Record #3"); strcpy(bufC, "Move \"Default Record Data\" to #3");
SetRecordFileName( 3,buf2); if ((fp = fopen(buf2, "r")) != NULL) {fclose(fp);strcat(bufS,"*");strcat(bufL,"*");strcat(bufC,"*");}
MENU_ChangeItemText(_RecordingAnotherMenu,WM_RECORDING_3 ,bufS); MENU_ChangeItemText(_PlayRecordAnotherMenu,WM_PLAYRECORD_3 ,bufL); MENU_ChangeItemText(_MoveRecordMenu,WM_MOVERECORD_3 ,bufC);
strcpy(bufS,"Start Recording #4"); strcpy(bufL,"Play Record #4"); strcpy(bufC, "Move \"Default Record Data\" to #4");
SetRecordFileName( 4,buf2); if ((fp = fopen(buf2, "r")) != NULL) {fclose(fp);strcat(bufS,"*");strcat(bufL,"*");strcat(bufC,"*");}
MENU_ChangeItemText(_RecordingAnotherMenu,WM_RECORDING_4 ,bufS); MENU_ChangeItemText(_PlayRecordAnotherMenu,WM_PLAYRECORD_4 ,bufL); MENU_ChangeItemText(_MoveRecordMenu,WM_MOVERECORD_4 ,bufC);
strcpy(bufS,"Start Recording #5"); strcpy(bufL,"Play Record #5"); strcpy(bufC, "Move \"Default Record Data\" to #5");
SetRecordFileName( 5,buf2); if ((fp = fopen(buf2, "r")) != NULL) {fclose(fp);strcat(bufS,"*");strcat(bufL,"*");strcat(bufC,"*");}
MENU_ChangeItemText(_RecordingAnotherMenu,WM_RECORDING_5 ,bufS); MENU_ChangeItemText(_PlayRecordAnotherMenu,WM_PLAYRECORD_5 ,bufL); MENU_ChangeItemText(_MoveRecordMenu,WM_MOVERECORD_5 ,bufC);
strcpy(bufS,"Start Recording #6"); strcpy(bufL,"Play Record #6"); strcpy(bufC, "Move \"Default Record Data\" to #6");
SetRecordFileName( 6,buf2); if ((fp = fopen(buf2, "r")) != NULL) {fclose(fp);strcat(bufS,"*");strcat(bufL,"*");strcat(bufC,"*");}
MENU_ChangeItemText(_RecordingAnotherMenu,WM_RECORDING_6 ,bufS); MENU_ChangeItemText(_PlayRecordAnotherMenu,WM_PLAYRECORD_6 ,bufL); MENU_ChangeItemText(_MoveRecordMenu,WM_MOVERECORD_6 ,bufC);
strcpy(bufS,"Start Recording #7"); strcpy(bufL,"Play Record #7"); strcpy(bufC, "Move \"Default Record Data\" to #7");
SetRecordFileName( 7,buf2); if ((fp = fopen(buf2, "r")) != NULL) {fclose(fp);strcat(bufS,"*");strcat(bufL,"*");strcat(bufC,"*");}
MENU_ChangeItemText(_RecordingAnotherMenu,WM_RECORDING_7 ,bufS); MENU_ChangeItemText(_PlayRecordAnotherMenu,WM_PLAYRECORD_7 ,bufL); MENU_ChangeItemText(_MoveRecordMenu,WM_MOVERECORD_7 ,bufC);
strcpy(bufS,"Start Recording #8"); strcpy(bufL,"Play Record #8"); strcpy(bufC, "Move \"Default Record Data\" to #8");
SetRecordFileName( 8,buf2); if ((fp = fopen(buf2, "r")) != NULL) {fclose(fp);strcat(bufS,"*");strcat(bufL,"*");strcat(bufC,"*");}
MENU_ChangeItemText(_RecordingAnotherMenu,WM_RECORDING_8 ,bufS); MENU_ChangeItemText(_PlayRecordAnotherMenu,WM_PLAYRECORD_8 ,bufL); MENU_ChangeItemText(_MoveRecordMenu,WM_MOVERECORD_8 ,bufC);
strcpy(bufS,"Start Recording #9"); strcpy(bufL,"Play Record #9"); strcpy(bufC, "Move \"Default Record Data\" to #9");
SetRecordFileName( 9,buf2); if ((fp = fopen(buf2, "r")) != NULL) {fclose(fp);strcat(bufS,"*");strcat(bufL,"*");strcat(bufC,"*");}
MENU_ChangeItemText(_RecordingAnotherMenu,WM_RECORDING_9 ,bufS); MENU_ChangeItemText(_PlayRecordAnotherMenu,WM_PLAYRECORD_9 ,bufL); MENU_ChangeItemText(_MoveRecordMenu,WM_MOVERECORD_9 ,bufC);
strcpy(bufS,"Start Recording #10"); strcpy(bufL,"Play Record #10"); strcpy(bufC, "Move \"Default Record Data\" to #10");
SetRecordFileName(10,buf2); if ((fp = fopen(buf2, "r")) != NULL) {fclose(fp);strcat(bufS,"*");strcat(bufL,"*");strcat(bufC,"*");}
MENU_ChangeItemText(_RecordingAnotherMenu,WM_RECORDING_10,bufS); MENU_ChangeItemText(_PlayRecordAnotherMenu,WM_PLAYRECORD_10,bufL); MENU_ChangeItemText(_MoveRecordMenu,WM_MOVERECORD_10,bufC);
//Kitao追加。v2.12,v2.13
switch (_ScreenshotMagnification)
{
case 1: MENU_CheckRadioItem(_SShotSettingMenu, WM_SCREENSHOT_X1, WM_SCREENSHOT_XN, WM_SCREENSHOT_X1); break;
case 2: MENU_CheckRadioItem(_SShotSettingMenu, WM_SCREENSHOT_X1, WM_SCREENSHOT_XN, WM_SCREENSHOT_X2); break;
case 3: MENU_CheckRadioItem(_SShotSettingMenu, WM_SCREENSHOT_X1, WM_SCREENSHOT_XN, WM_SCREENSHOT_X3); break;
case 4: MENU_CheckRadioItem(_SShotSettingMenu, WM_SCREENSHOT_X1, WM_SCREENSHOT_XN, WM_SCREENSHOT_X4); break;
default: //0
MENU_CheckRadioItem(_SShotSettingMenu, WM_SCREENSHOT_X1, WM_SCREENSHOT_XN, WM_SCREENSHOT_XN); break;
}
switch (_ScreenshotScanLineType)
{
case 0: MENU_CheckRadioItem(_SShotSettingMenu, WM_SSHOT_SAMEPLAYING, WM_SSHOT_NONSCANLINED, WM_SSHOT_NONSCANLINED); break;
case 1: MENU_CheckRadioItem(_SShotSettingMenu, WM_SSHOT_SAMEPLAYING, WM_SSHOT_NONSCANLINED, WM_SSHOT_SCANLINED); break;
case 2: MENU_CheckRadioItem(_SShotSettingMenu, WM_SSHOT_SAMEPLAYING, WM_SSHOT_NONSCANLINED, WM_SSHOT_HRSCANLINED); break;
//case 3: 縦スキャンライン。現在未実装。
case 4: MENU_CheckRadioItem(_SShotSettingMenu, WM_SSHOT_SAMEPLAYING, WM_SSHOT_NONSCANLINED, WM_SSHOT_TVMODE); break;
default: //-1
MENU_CheckRadioItem(_SShotSettingMenu, WM_SSHOT_SAMEPLAYING, WM_SSHOT_NONSCANLINED, WM_SSHOT_SAMEPLAYING); break;
}
if (_bScreenshotDialog)
MENU_CheckRadioItem(_SShotSettingMenu, WM_SSHOT_SAVEFOLDER, WM_SSHOT_SAVEDIALOG, WM_SSHOT_SAVEDIALOG);
else
MENU_CheckRadioItem(_SShotSettingMenu, WM_SSHOT_SAVEFOLDER, WM_SSHOT_SAVEDIALOG, WM_SSHOT_SAVEFOLDER);
//Kitao追加。v1.29
if (_bOutputWavNext)
MENU_CheckRadioItem(_WavSettingMenu, WM_OUTPUT_WAVS1, WM_OUTPUT_WAVS2, WM_OUTPUT_WAVS2);
else
MENU_CheckRadioItem(_WavSettingMenu, WM_OUTPUT_WAVS1, WM_OUTPUT_WAVS2, WM_OUTPUT_WAVS1);
MENU_CheckItem(_WavSettingMenu, WM_OUTPUT_WAVNT, JOYPAD_GetMakeHesNoSound());
MENU_CheckItem(_WavSettingMenu, WM_OUTPUT_WAVBE, _bOutputWavAddNoSound);
//Kitao追加
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[1], buf, TRUE);
if (strcmp(_RecentRom[1], " ") == 0)
strcpy(buf2, ">> ");//履歴がなかった場合、見栄えを良くするためにスペースを追加。
else
{ //ショートカットキーで選択してしまわないように先頭にスペースを入れる。
//例えばRキーを2回押すとR-TYPEが選択決定されてしまうため、それを防ぐのに必要。
strcpy(buf2, ">> ");
strcat(buf2, buf);
strcat(buf2, " ");
}
MENU_ChangeItemText(_RecentMenu, WM_RECENT_1, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[2], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_2, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[3], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_3, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[4], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_4, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[5], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_5, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[6], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_6, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[7], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_7, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[8], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_8, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[9], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_9, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[10], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_10, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[11], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_11, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[12], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_12, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[13], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_13, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[14], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_14, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[15], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_15, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[16], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_16, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[17], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_17, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[18], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_18, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[19], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_19, buf2);
SetGameFileNameBuf(FALSE,FALSE, _RecentRom[20], buf, TRUE); strcpy(buf2, " :: "); strcat(buf2, buf); strcat(buf2, " "); MENU_ChangeItemText(_RecentMenu, WM_RECENT_20, buf2);
//Kitao追加
switch (MAINBOARD_GetFastForwardingR())
{
case 0: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V0); break;
case 10: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V1); break;
case 5: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V2); break;
case 3: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V3); break;
case 2: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V4); break;
case 1001: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V5); break;
case 1000: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V6); break;
case 2010: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V7); break;
case 2004: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V8); break;
case 2002: MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_V0, WM_SPEED_V9, WM_SPEED_V9); break;
}
if (_bUseVideoSpeedUpButton)
MENU_CheckRadioItem(_SpeedMenu, WM_SPEED_VAL, WM_SPEED_VUSE, WM_SPEED_VUSE);
else