Skip to content

Commit 2255eaf

Browse files
committed
up
1 parent 3ed7526 commit 2255eaf

File tree

13 files changed

+236
-171
lines changed

13 files changed

+236
-171
lines changed

assets/css/style.css

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ img{
4545
justify-content: center;
4646
flex-wrap: wrap;
4747
flex-direction: row;
48-
align-items: stretch;
48+
align-items: center;
4949
}
5050
.wel-start-ready button{
5151
margin: 5px 10px;
5252
width: 33%;
5353
outline: none;
5454
border: 1px solid #fff;
5555
border-radius: 5px;
56+
font-size: 1rem;
5657

5758
}
5859
.wel-ul .db-key {
@@ -172,27 +173,69 @@ img{
172173
position: relative;
173174
width: 100%;
174175
height: 400px;
175-
max-height: 100%;
176+
max-height:calc(100vh - var(--bh) - 75px);
176177
display: flex;
177178
flex-wrap: wrap;
178-
justify-content: space-between;
179+
justify-content:flex-start;
179180
align-content: space-around;
180181
}
181182

182183
.gamepad-left {
183-
width: 50%;
184-
height: 200px;
185-
max-width: 200px;
184+
touch-action: none;
185+
width: min(200px,50%);
186+
margin-right:max(calc(50% - 200px),0px);
187+
height:min(200px,50%);
186188
position: relative;
187189
z-index: 2;
188190
}
191+
.gamepad-left-dp{
192+
position: absolute;
193+
top: 0;
194+
bottom: 0;
195+
left: 0px;
196+
margin: auto;
197+
width:100%;
198+
height:100%;
199+
}
200+
.gamepad-left-arrow{
201+
display: flex;
202+
flex-direction: row;
203+
flex-wrap: wrap;
204+
justify-content: flex-start;
205+
align-content: flex-start;
206+
align-items: stretch;
207+
height: min(150px,100%);
208+
width: min(150px,100%);
209+
position: absolute;
210+
top: 0;
211+
bottom: 0;
212+
left: 0;
213+
right: 0;
214+
margin: auto;
215+
}
189216

217+
.gamepad-left-arrow button{
218+
--btnsize:min(50px,32%);
219+
width:var(--btnsize);
220+
height:var(--btnsize);
221+
border-radius: 10%;
222+
}
223+
.gamepad-left-arrow button:nth-child(1){
224+
margin-left:var(--btnsize);
225+
}
226+
.gamepad-left-arrow button:nth-child(4){
227+
margin-left: var(--btnsize);
228+
}
229+
.gamepad-left-arrow button:nth-child(2){
230+
margin-right:var(--btnsize);
231+
}
190232
.gamepad-right {
191233
touch-action: none;
192-
width: 50%;
193-
max-width: 200px;
194-
height: 200px;
234+
width: min(200px,50%);
235+
margin-left:max(calc(50% - 200px),0px);
236+
height: min(200px,50%);
195237
position: relative;
238+
z-index: 2;
196239
}
197240

198241
.gamepad-top {
@@ -221,7 +264,9 @@ img{
221264
background-color: #00000070;
222265
color: #fff;
223266
}
224-
267+
.gamepad-btn.active{
268+
background-color: #e632326b;
269+
}
225270
.gamepad-top .gamepad-btn {
226271
height: 30px;
227272
width: 60px;
@@ -244,7 +289,7 @@ img{
244289
bottom: unset;
245290
left: unset;
246291
right: 50px;
247-
top: 20%;
292+
top: 10px;
248293
position: absolute;
249294
}
250295

@@ -254,8 +299,8 @@ img{
254299
border-radius: 50%;
255300
bottom: unset;
256301
left: unset;
257-
right: 150px;
258-
top: 30%;
302+
right: 110px;
303+
top: 80px;
259304
position: absolute;
260305
}
261306

@@ -295,6 +340,7 @@ img{
295340
border: 1px solid #fff;
296341
color: #fff;
297342
background-color: #3c85c5;
343+
font-size: 12px;
298344
}
299345

300346
.gba-mobile-menu button.active {
@@ -585,7 +631,7 @@ canvas {
585631
}
586632

587633
.gba-mobile-ctrl {
588-
height: 80%;
634+
max-height: calc(100vh - 80px);
589635
}
590636

591637
.gamepad-bottom {
@@ -631,7 +677,7 @@ canvas {
631677
}
632678

633679
.gba-mobile-ctrl {
634-
height: 80%;
680+
max-height: calc(100vh - 80px);
635681
}
636682

637683
.gamepad-bottom {

assets/js/gb/gb.zip

-3 Bytes
Binary file not shown.

assets/js/gb/retroarch.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/mgba/mgba.zip

4 Bytes
Binary file not shown.

assets/js/mgba/retroarch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7234,7 +7234,7 @@ var EmulatorJS_ = (function () {
72347234
}
72357235

72367236
function _gettimeofday(ptr) {
7237-
var now = 1690674045574;
7237+
var now = Module.HashTime||Date.now;
72387238
HEAP32[ptr >> 2] = now / 1e3 | 0;
72397239
HEAP32[ptr + 4 >> 2] = now % 1e3 * 1e3 | 0;
72407240
return 0

assets/js/vbanext.js

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@
7979
* 启动参数
8080
*/
8181
arguments = ['-v', '', 'c37f5e84f377fb892c851b364c55251132d57c66d2f3ea56d2af90bef14773f0'];
82+
/**
83+
* 破解原emulatorjs的时间验证码
84+
* 修改retroarch.js:function _gettimeofday(ptr)
85+
* var now = Module.HashTime||Date.now;
86+
*/
87+
HashTime = 1690674045574;
8288
/**
8389
* 某些通讯使用
8490
*/
@@ -290,8 +296,10 @@
290296
'#canvas-mouse': this.canvas
291297
});
292298
}
293-
this.DISK = new NengeDisk(T.DB_NAME, MountConfig, this);
294-
await Promise.all(this.DISK.ready);
299+
if(MountConfig){
300+
this.DISK = new NengeDisk(T.DB_NAME, MountConfig, this);
301+
await Promise.all(this.DISK.ready);
302+
}
295303
var optData = Object.entries(VBA.OptionsData).map(optionItem => `${optionItem[0]} = "${optionItem[1] || ''}"`).join('\n');
296304
this.mkdir(FSROOT.saves);
297305
this.writeFile(FSROOT.etc+'retroarch-core-options.cfg', optData);
@@ -750,6 +758,8 @@ audio_latency = "256"`);
750758
}
751759
/**
752760
* 自定义时间
761+
* 需要修改retroarch.js: function _time(ptr) {
762+
* var ret = (Module.NowTime||Date.now()) / 1e3 | 0;
753763
*/
754764
get NowTime() {
755765
if (this.timeMode) {
@@ -1035,6 +1045,7 @@ audio_latency = "256"`);
10351045
VBA.Module.toBiosAdd(GetName(entry[0]), entry[1]);
10361046
}
10371047
});
1048+
this.remove();
10381049
div.remove();
10391050
return;
10401051
}
@@ -1152,11 +1163,13 @@ audio_latency = "256"`);
11521163
this.Module.toStartGame(name, data);
11531164
this.buttons = this.Module.ButtonsInput;
11541165
this.isRunning = !0;
1155-
this.setCoreOption();
1156-
this.setShaderOption();
1157-
this.setMenuEvent();
1158-
this.setGamePadKEY();
1159-
this.setTouchKey();
1166+
setTimeout(()=>{
1167+
this.setCoreOption();
1168+
this.setShaderOption();
1169+
this.setMenuEvent();
1170+
this.setGamePadKEY();
1171+
this.setTouchKey();
1172+
},500);
11601173
return;
11611174
}
11621175
setCoreOption() {
@@ -1463,6 +1476,7 @@ audio_latency = "256"`);
14631476
var portrait = window.matchMedia("(orientation: portrait)").matches;
14641477
document.documentElement.style.setProperty('--bh', (portrait ? VBA.Module.canvas.offsetHeight : VBA.Module.canvas.offsetHeight / VBA.wh) + 'px');
14651478
var audioState = VBA.Module.toAudioChange(function (event) {
1479+
console.log(event);
14661480
if (event.target.state != 'running') {
14671481
VBA.Module.pauseMainLoop();
14681482
VBA.GO_MENU('audio');
@@ -1662,22 +1676,18 @@ audio_latency = "256"`);
16621676
}
16631677
setTouchKey() {
16641678
var { buttons, Module } = this;
1679+
var gamepadState = [];
1680+
var arrow = [buttons.indexOf('UP'), buttons.indexOf('DOWN'), buttons.indexOf('LEFT'), buttons.indexOf('RIGHT')];
16651681
var gamepad = nipplejs.create({
16661682
zone: $('.gamepad-left-dp'),
16671683
'mode': 'static',
16681684
'position': {
16691685
'left': '50%',
16701686
'top': '50%'
16711687
},
1672-
'color': 'red'
1673-
});
1674-
$('.gamepad-left').on('contextmenu', e => {
1675-
e.preventDefault();
1676-
e.stopPropagation();
1677-
return false;
1688+
restJoystick:!0,
1689+
color: '#0057b3c2',
16781690
});
1679-
var gamepadState = [];
1680-
var arrow = [buttons.indexOf('UP'), buttons.indexOf('DOWN'), buttons.indexOf('LEFT'), buttons.indexOf('RIGHT')];
16811691
gamepad.on('end', e => {
16821692
gamepadState.forEach(v => Module.toRunButton(0, v, 0));
16831693
gamepadState = [];
@@ -1704,15 +1714,27 @@ audio_latency = "256"`);
17041714
gamepadState = newState;
17051715
}
17061716
});
1717+
$('.gamepad-left').on('contextmenu', e => {
1718+
e.preventDefault();
1719+
e.stopPropagation();
1720+
return false;
1721+
});
17071722
$$('.gba-mobile-ctrl .gamepad-btn').forEach(elm => {
1708-
var value = elm.innerHTML.trim();
1723+
var value = elm.dataset.act||elm.innerHTML.trim();
17091724
var num = buttons.indexOf(value);
17101725
if (num >= 0) {
1726+
elm.dataset.keynum = num;
17111727
['pointerdown', 'pointerup', 'pointerleave', 'pointerover'].forEach(
17121728
evt => elm.on(evt, function (e) {
1729+
var keynum = this.dataset.keynum;
17131730
var bool = 0;
17141731
if (['pointerdown', 'pointerover'].includes(e.type)) bool = 1;
1715-
Module.toRunButton(0, num, bool);
1732+
if(bool){
1733+
this.classList.add('active');
1734+
}else{
1735+
this.classList.remove('active');
1736+
}
1737+
Module.toRunButton(0, keynum, bool);
17161738
e.preventDefault();
17171739
e.stopPropagation();
17181740
return false;
@@ -1738,6 +1760,20 @@ audio_latency = "256"`);
17381760
VBA.GO_STATUS(data.go, mctrl.hidden ? '隐藏' : '显示');
17391761
VBA.GO_MENU('base');
17401762
break;
1763+
case 'arrow':
1764+
var mctrl = $('.gba-mobile-ctrl');
1765+
var html = VBA.GO_STATUS(data.go);
1766+
var bool = html=='十字键';
1767+
VBA.GO_STATUS(data.go, bool?'摇杆':'十字键');
1768+
if(bool){
1769+
$('.gamepad-left-arrow').style.visibility = 'hidden';
1770+
$('.gamepad-left-dp').style.visibility = '';
1771+
}else{
1772+
$('.gamepad-left-arrow').style.visibility = '';
1773+
$('.gamepad-left-dp').style.visibility = 'hidden';
1774+
}
1775+
VBA.GO_HIDDEN;
1776+
break;
17411777
case 'reload':
17421778
location.reload();
17431779
break;
@@ -1765,7 +1801,9 @@ audio_latency = "256"`);
17651801
this.Module.canvas.scrollIntoView()
17661802
}
17671803
GO_STATUS(name, act) {
1768-
$(`.gba-menu-win button[data-go="${name}"] .status`).innerHTML = act
1804+
var elm = $(`.gba-menu-win button[data-go="${name}"] .status`);
1805+
if(act)elm.innerHTML = act;
1806+
else return elm.innerHTML;
17691807
}
17701808
GO_BUTTON(name, fn) {
17711809
$$(`.gba-options-${name} button`).forEach(elm => elm.on('click', fn));

assets/js/vbanext/retroarch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7101,7 +7101,7 @@ var EmulatorJS_ = (function () {
71017101
}
71027102

71037103
function _gettimeofday(ptr) {
7104-
var now = 1690674045574;
7104+
var now = Module.HashTime||Date.now;
71057105
Date.now();
71067106
HEAP32[ptr >> 2] = now / 1e3 | 0;
71077107
HEAP32[ptr + 4 >> 2] = now % 1e3 * 1e3 | 0;

assets/js/vbanext/vbanext.zip

3 Bytes
Binary file not shown.

index.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
<meta name="apple-mobile-web-app-capable" content="yes">
88
<meta name="apple-mobile-web-app-status-bar-style" content="black">
99
<meta name="viewport" content="initial-scale=1,width=device-width, height=device-height">
10+
<meta name="turbo-cache-control" content="no-preview">
11+
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
12+
<meta http-equiv="Pragma" content="no-cache" />
13+
<meta http-equiv="Expires" content="0" />
1014
<title>最终GBA模拟器</title>
1115
<link rel="apple-touch-icon" href="assets/images/gba2.png">
1216
<link rel="mainifest" href="mainifest.json">
@@ -15,8 +19,6 @@
1519
<body>
1620
<div class="welcome">
1721
<img src="assets/images/zan.jpg">
18-
<p>全面翻新,与旧版不同,默认运行载入电子存档,而不是旧版的载入状态.不再用屎山代码,采用一条龙直写,欢迎在Github fork!</p>
19-
<p>即时存档统一称为"状态",而普通存档称为电子存档.</p>
2022
<div class="wel-index">
2123
<div class="wel-btn">
2224
<button class="wel-start-btn">运行游戏</button>
@@ -54,6 +56,8 @@ <h3>选择一个游戏运行</h3>
5456
<p>没有游戏请导入手机中游戏.百度网盘的压缩文件请改名pdf用打开方式存储到手机,然后导入该pdf.</p>
5557
</div>
5658
</div>
59+
<p>全面翻新,与旧版不同,默认运行载入电子存档,而不是旧版的载入状态.不再用屎山代码,采用一条龙直写,欢迎在Github fork!</p>
60+
<p>即时存档统一称为"状态",而普通存档称为电子存档.</p>
5761
</div>
5862
<div class="gba-body" hidden>
5963
<canvas class="gba-pic" width="600" height="400"></canvas>
@@ -73,7 +77,13 @@ <h3>选择一个游戏运行</h3>
7377
<button class="gamepad-btn">R</button>
7478
</div>
7579
<div class="gamepad-left">
76-
<div class="gamepad-left-dp"></div>
80+
<div class="gamepad-left-dp" style="visibility: hidden;"></div>
81+
<div class="gamepad-left-arrow">
82+
<button class="gamepad-btn" data-act="UP"></button>
83+
<button class="gamepad-btn" data-act="LEFT"></button>
84+
<button class="gamepad-btn" data-act="RIGHT"></button>
85+
<button class="gamepad-btn" data-act="DOWN"></button>
86+
</div>
7787
</div>
7888
<div class="gamepad-right">
7989
<button class="gamepad-btn">A</button>
@@ -104,6 +114,7 @@ <h3>选择一个游戏运行</h3>
104114
<button data-act="reload"><strong>重载:</strong><span>刷新页面</span></button>
105115
<button data-go="videosize"><strong>画质:</strong><span class="status">默认720p</span></button>
106116
<button data-act="pad" data-go="pad"><strong>隐藏触摸按钮:</strong><span class="status">显示</span></button>
117+
<button data-act="arrow" data-go="arrow"><strong>方向键切换:</strong><span class="status">十字键</span></button>
107118
<button data-go="cheat"><strong>金手指:</strong><span class="status">未启用</span></button>
108119
<button data-go="shaders"><strong>滤镜:</strong><span class="status">未启用</span></button>
109120
<button data-go="ctrl"><strong>键位映射</strong><span>设置键盘或者手柄</span></button>

list.html

Whitespace-only changes.

0 commit comments

Comments
 (0)