December 10, 2022

How to run Doom in notepad.exe on Windows

How to run Doom in notepad.exe on Windows

the death As it was meant to be played.”/>
Zoom / the death As it was meant to be played.

Pirates of a certain age are closely familiar “Are you going to work the death” me me and the Wide range of ports I was born (including a game the death who – which Runs inside an instance the death Itself). Still, this week viral video And the The ultimate itch release from U.S the death working port The standard notepad.exe text editor in Windows He left us a number of questions.

Most importantly: “How?” And why?”

“My favorite kind of magic trick”

When it comes to “how?” dumbad Programmer Sam Chiet told Ars that the hack is “my favorite kind of magic trick,” the kind that “looks wild, but is very simple.”

Building a C# port of open source the death Code source (And later turned into Chocolate Dome for the generic version), Chiet first converts each successive frame of the game to ASCII text. This is done using a simple algorithm that determines the “brightness” of each pixel (by averaging the RGB color channel data), and then converts that to a similar bold ASCII character using a predefined lookup table (ranging from “$” and “@” for the darkest pixel to “\” and “.” for lighter).

“[The] The conversion is very simple and probably “incorrect,” but it works, and that’s what matters,” Cheett said. magic tricks [like this] Always equal parts disappointing and wonderful! “

Because “a notepad line is twice as wide,” dumbad It initially subtracts every other row of the generated text to keep the resulting ASCII in correct proportions. From there, Windows makes it relatively easy to insert a 360×240 text into Notepad at any font size the window and screen can handle, Chiet said.

“I’m stealing a reference to an internal text box and sticking it in my memory via the OS ‘message’ and forcing it to repaint,” he said. As for reading player input, this is “just something you can steal from anywhere in Windows; you don’t need to ‘open’ your specific software.”

قال Chiet إنه كان مستوحى إلى حد ما من المشاريع السابقة مثل ASCII <a href =
Zoom / Chiet said he was somewhat inspired by earlier projects like ASCII 1337 pm 00 pmwhich has the main advantage of using colored characters.