跳到主要内容

4 篇博文 含有标签「savestate」

查看所有标签

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: 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 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: 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.