Skip to content

Commit 9ac41e6

Browse files
author
while
committed
更换 核心
1 parent 6a519f1 commit 9ac41e6

15 files changed

Lines changed: 275 additions & 631 deletions

File tree

‎packages/app/public/cores/fceumm_libretro.js‎

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
2.92 MB
Binary file not shown.

‎packages/app/src/App.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async function onLoadSave(payload: {
125125
if (payload.bytes) {
126126
await loadRomBytes(payload.name, payload.bytes, payload.romKey)
127127
}
128-
screen.value?.applyState(payload.state)
128+
await screen.value?.applyState(payload.state)
129129
}
130130
131131
function reset() {

‎packages/player/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
".": "./src/index.ts"
77
},
88
"dependencies": {
9-
"jsnes": "2.1.0",
9+
"nostalgist": "0.21.1",
1010
"vue": "catalog:"
1111
}
1212
}

‎packages/player/src/components/NesScreen.vue‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async function quickSave() {
6868
showToast('请先载入游戏')
6969
return
7070
}
71-
const state = runner.saveState()
71+
const state = await runner.saveState()
7272
if (!state) {
7373
showToast('存档失败')
7474
return
@@ -88,7 +88,7 @@ async function quickNewSave() {
8888
showToast('请先载入游戏')
8989
return
9090
}
91-
const state = runner.saveState()
91+
const state = await runner.saveState()
9292
if (!state) {
9393
showToast('存档失败')
9494
return
@@ -121,7 +121,7 @@ async function quickLoad() {
121121
showToast('暂无存档')
122122
return
123123
}
124-
showToast(runner.loadState(record.state) ? '已读档' : '读档失败')
124+
showToast((await runner.loadState(record.state)) ? '已读档' : '读档失败')
125125
}
126126
127127
const NATIVE_W = 256
@@ -546,12 +546,12 @@ function stop() {
546546
}
547547
548548
// 供存档列表面板使用:抓取当前引擎状态 / 把某条存档状态应用到引擎。
549-
function captureState() {
550-
return runner?.loaded ? (runner.saveState() ?? null) : null
549+
async function captureState(): Promise<SaveState | null> {
550+
return runner?.loaded ? ((await runner.saveState()) ?? null) : null
551551
}
552-
function applyState(state: SaveState): boolean {
552+
async function applyState(state: SaveState): Promise<boolean> {
553553
if (!runner?.loaded) return false
554-
const ok = runner.loadState(state)
554+
const ok = await runner.loadState(state)
555555
showToast(ok ? '已读档' : '读档失败')
556556
return ok
557557
}

‎packages/player/src/emulator/jsnes-mapper90.d.ts‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)