跳到主要内容

18 篇博文 含有标签「dosbox」

查看所有标签

WhereQ-DOSBox 的中断地图:模拟器里每一个 INT 都在干什么

· 阅读需 14 分钟
WhereQ-DOSBoxWhereQ-DOSBox

所有 DOS 程序唯一都认同的那一个接口​

有一件事是我没料到自己会在意,然后一旦在意就停不下来的。

1987 年的 DOS 游戏并不知道显卡是什么。它不知道鼠标存在,也不知道键盘有个缓冲区。它只认一件事:往栈里推一个数,执行 INT,机器就会回答。INT 10h,机器把一个字符画到屏幕上。INT 16h,机器交出一个按键。INT 33h,机器告诉你鼠标在哪、哪些按钮按着。

契约就这么多。1991 到 1994 年的每一个游戏都是照着它写的,而且它从来没有变过。

为了写这篇文章,我把 DOSBox 的中断层认真读了一遍。它是整个模拟器里建得最用心的部分之一——同时也是这个移植版被迫想得最多的部分之一,因为触摸屏不是鼠标,手机也不是 PC。

所以,地图在这里。

WhereQ-DOSBox interrupts: the map of every INT in the emulator

· 阅读需 14 分钟
WhereQ-DOSBoxWhereQ-DOSBox

The one interface every DOS program agrees on​

Here is something I did not expect to care about, and then could not stop caring about.

A DOS game from 1987 does not know what a graphics card is. It does not know that a mouse exists, or that a keyboard has a buffer. It knows exactly one thing: it can ask the machine a question by pushing a number onto the stack and executing INT. INT 10h and the machine will put a character on the screen. INT 16h and the machine will hand over a keystroke. INT 33h and the machine will tell it where the mouse is and which buttons are down.

That is the whole contract. Every game from 1991 to 1994 is written against it, and it never changed.

I have been reading DOSBox's interrupt layer properly for this article, and it turns out to be one of the most carefully built parts of the emulator — and one of the parts this port has had to think about hardest, because a touch screen is not a mouse and a phone is not a PC.

So here is the map.

WhereQ-DOSBox 1.0.0.13:读档之后,存档还记得自己是什么时候存的

· 阅读需 6 分钟
WhereQ-DOSBoxWhereQ-DOSBox

「刚刚」​

午饭之后你回来接着打。点那个写着「五小时前」的档位。游戏原样回来了——那只大家伙、血条、你当时站着的那个房间,都在你离开时的样子。

然后档位上写着的是「刚刚」。

存档还是你存的那一份,游戏还是你走时的那一刻。只有时间在说谎,而且它撒的方向刚好是让这个应用显得不可信:它唯一该记住的事,它自己没记住。

1.0.0.13 的全部内容就是这个。这是我发过的最小的一版,修复也只有三行。

WhereQ-DOSBox 1.0.0.13: a restored save keeps the time it was made

· 阅读需 6 分钟
WhereQ-DOSBoxWhereQ-DOSBox

"Just now"​

You come back to the game after lunch. You tap the slot that said you saved it five hours ago. The game loads exactly where you left it — the boss, the health bar, the room you were in.

And the slot now says "just now".

The save is the save you made. The game is the game you left. Only the timestamp lies, and it lies in the direction that makes the app feel like it cannot be trusted with the one thing it is supposed to remember.

That is the whole of 1.0.0.13. It is the smallest release I have shipped and the only one where the fix is three lines long.

WhereQ-DOSBox 使用指南:五分钟把 DOS 游戏装进手机

· 阅读需 17 分钟
WhereQ-DOSBoxWhereQ-DOSBox

一份我想要却找不到的指南​

在自己的手机上试用这个应用时,我注意到一件事:我读过的每一份 DOSBox 指南,作者都默认你已经知道 .zip 包是什么。他们直接从有意思的部分讲起——声音芯片、存档格式、JIT——然后假定你从 1994 年起就一直在用 DOS。

对大多数拿着手机的人来说,这个假定是错的。把老游戏搬上现代手机,难的从来不是模拟器,而是最初那五分钟:怎么把游戏弄进手机,而且是应用能启动的形状。

所以我干脆写了一份我想要的那一份。七个步骤,每一步都配一张真机截图,不假设你见过命令行。

WhereQ-DOSBox user guide: put a DOS game on your phone in five minutes

· 阅读需 17 分钟
WhereQ-DOSBoxWhereQ-DOSBox

The guide I wanted and could not find​

Here is a thing I noticed while I was testing the app on my own phone. Every DOSBox guide I have ever read was written by somebody who already knew what a .zip bundle was. They start at the interesting part — the sound chips, the save-state format, the JIT — and assume you have been running DOS since 1994.

That assumption is wrong for most people holding a phone. The hardest part of putting an old game on a modern phone is not the emulator. It is the first five minutes: getting the game onto the phone at all, in a shape the app can start.

So I wrote the guide I wanted instead. Seven steps, one screenshot of every screen, and no assumption that you have ever seen a command prompt.

WhereQ-DOSBox 1.0.0.10:声音也活过了存档

· 阅读需 10 分钟
WhereQ-DOSBoxWhereQ-DOSBox

那段留在后面的音乐​

你在 boss 打到一半的时候按了存档。音乐正响,那只大家伙正在做一件让人难受的事,你把手机放下,去回一条消息。

两分钟后你回来,读档。

战斗和你离开时一模一样——怪物、血条、它的坐标,样样都对。可音乐完全不在同一条时间线上:它从来没有跟机器一起被冻住,于是一切都倒回去了,它还在往前放。而 PC 喇叭那头的哔哔声还在后台嗡嗡地响,谁也不理。

那是 1.0.0.9。存档做得很好,好到只差一样东西:声音。

WhereQ-DOSBox 1.0.0.10: the sound survives the save state

· 阅读需 10 分钟
WhereQ-DOSBoxWhereQ-DOSBox

The music that stayed behind​

You freeze a game in the middle of a fight. The music is loud, the boss is doing something unpleasant, and you put the phone down to answer a message.

You come back two minutes later and load the state.

The fight is exactly where you left it — the sprites, the health bar, the position of the boss, all of it. The music, though, is somewhere else entirely: it was never frozen with the rest of the machine, so it carried on playing while everything else went back. And the beeping that was coming out of the PC speaker is still going on in the background, droning at nobody.

That was 1.0.0.9. The snapshot was very good, and it was missing the sound.

WhereQ-DOSBox:昨日的计算世界,今日的掌上体验,明日的无限可能

· 阅读需 6 分钟
WhereQ-DOSBoxWhereQ-DOSBox

还记得那个没有应用商店、没有触摸屏、没有云账号的年代吗?但我们依然可以为了玩一款游戏,心甘情愿地耗上整个周末。😂

那时候,我们敲着 C:\GAMES\DOOM.EXE,就觉得自己已经是计算机专家了。

其实,DOS 从未真正离开。它只是在等待一台更小的电脑。

今天,我们希望通过 WhereQ-DOSBox,让这段经典的计算机世界在 Android 手机上继续延续。

它不是运行在浏览器里的 DOS 模拟器,也不是连接到某台老电脑的远程桌面。它是一个原生 Android 应用,真正的 DOSBox 模拟器核心以原生动态库的形式集成在 APK 内部。

而它背后,还有不少值得分享的东西。

WhereQ-DOSBox: Yesterday's Computing. Today's Pocket. Tomorrow's Possibilities.

· 阅读需 6 分钟
WhereQ-DOSBoxWhereQ-DOSBox

Remember when computers had no app stores, no touchscreens, no cloud accounts, and somehow we still managed to spend entire weekends playing games? 😂

We used to type commands like C:\GAMES\DOOM.EXE and consider ourselves computer experts.

Well, DOS never really left. It was just waiting for a smaller computer.

Today, we're taking a meaningful step in bringing that world to Android with WhereQ-DOSBox.

Not a DOS emulator running inside a browser. Not a remote desktop connecting to an old PC. It's a native Android application with the actual DOSBox emulator core running as a native library inside the APK.

And there's quite a bit more behind it.