![]() ![]() With this, Alley Cat can load nicely in the browser after just a few seconds and the entire game is playable: To hide the PC XT boot process, the HTML body is hidden at load and only made visible by JavaScript codes after a few seconds, after the machine has finished loading. Where alleycat.json is the bootable version of Alle圜at, converted to JSON using PCjs instructions. This can be done with just the following HTML code: I decided to go with PCjs, a JavaScript based PC emulator, and build a PC XT image that can boot Alley Cat in a browser, ready to play in just a few seconds. I however do not think that this is an efficient approach since the final C codes are simply assembly instructions converted to C and not maintainable. After all, the converted C functions are cryptic and do not have meaningful names. The JavaScript port still works to show the intro screen (see this for a demo) but hangs afterwards since its development was never completed.Īlthough I do not have the time to continue with the project, I was impressed by the efforts spent in porting the intro screen to JavaScript. ![]() Several functions are present in the JavaScript port, but not in the C codes, which indicates that the uploads were most likely incomplete. Unfortunately, although I tried hard to replicate the author’s progress, the provided C code is missing several important pieces. Using a similar approach, the code is then converted to JavaScript to be executed on a browser. The ported C code also loads the original. PC speaker functions are also converted to Visual C’s Beep() function. M_ourbitmap=CreateDIBSection(hDC,&bitmapinfo,DIB_RGB_COLORS,&m_pBuffer, 0, 0) įillMemory(m_pBuffer, sizeof(DWORD)*Width*Height, 0xb0) With this approach, there is no need to modify the converted code, except perhaps to fix places where the converter did not do a good job, mostly obscure jumps that cannot be automatically translated into C code. Graphics calls are then modified to update a centralized CGA frame buffer, declared as a bitmap, to be drawn on screen when necessary:ī= sizeof(BITMAPINFOHEADER) ī=-Height /* top-down */ī=BI_RGB ī= 256 Instead of spending time understanding the logic and rewriting the code in a more readable (and maintainable manner), the author implements a miniature 8086 emulator in C which can be used to run the converted code. Assembly instructions such as push and pop are also written as C methods: ![]() However, this is where things become interesting. ![]() Although the output is in C syntax, it is still cryptic as it still contains register-like variables and methods with hexadecimal names: In a nutshell, the author used The Interactive Disassembler (IDA) to generate the ASM code for the original Alley Cat executable and then used another tool to convert the assembly code to its C equivalent. The idea also reminds me of SDLPoP, another similar and still active project which develops an SDL version of Prince of Persia using mostly knowledge gained from the disassembly process. Last week I explored gabonator’s Visual C++ and Javascript port of Alley Cat, one of my favourite DOS games. The project, despite being apparently abandoned since 2014, is still exciting to me as I love the idea of being able to play classic MS-DOS games the modern way without having to start any emulator. ![]()
0 Comments
Leave a Reply. |