Wednesday, October 4, 2023
HomeTechnology Newsget Doom operating in Home windows’ notepad.exe

get Doom operating in Home windows’ notepad.exe

[ad_1]

<em>Doom</em> as it was meant to be played.
Enlarge / Doom because it was meant to be performed.


Hackers of a sure age are intimately aware of the “Will it run Doom” meme and the big selection of ports it has engendered (together with a recreation of Doom that runs inside an occasion of Doom itself). Nonetheless, this week’s viral video and eventual itch.io launch of a Doom port operating in Home windows’ normal notepad.exe textual content editor left us with numerous questions.

Chief amongst them: “How?” and “Why?”

“My favourite sort of magic trick”

Relating to the “How?” DoomPad coder Sam Chiet informed Ars that the hack is “my favourite sort of magic trick,” the sort that “appears wild, but it surely’s tremendous easy.”

Constructing off a C# port of the open-sourced Doom supply code (and later shifted to Chocolate Doom for public launch), Chiet’s program first converts each successive body from the sport into ASCII textual content. That is executed utilizing a easy algorithm that figures out the “brightness” of every pixel (by averaging out the RGB colour channel information), then changing that to a equally darkish ASCII character utilizing a pre-set lookup desk (starting from “$” and “@” for the darkest pixels to “” and “.” for the lightest).

“[The] conversion is tremendous easy and possibly ‘incorrect,’ but it surely works, and that is what issues,” Chiet mentioned. “Magic methods [like this] are at all times equal elements disappointing and funky!”

As a result of “the Notepad font is twice as tall as it’s large,” DoomPad initially throws out each different row of generated textual content to maintain the ensuing ASCII within the right proportions. From there, Home windows makes it comparatively straightforward to insert that 360×240 array of textual content into Notepad at no matter font dimension your window and monitor can deal with, Chiet mentioned.

“I am stealing a reference to the interior textbox and simply sticking my reminiscence into it through an working system ‘message’ and forcing it to re-draw,” he mentioned. As for studying participant enter, that is “simply one thing you possibly can steal from anyplace in Home windows; you do not want your particular program ‘open.'”

Chiet said he was somewhat inspired by previous projects like the ASCII-based <a href=
Enlarge / Chiet mentioned he was considerably impressed by earlier initiatives just like the ASCII-based 1337d00m, which has a key benefit of utilizing colour characters.



[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments