Hacker News new | past | comments | ask | show | jobs | submit login
DOjS – A DOS JavaScript Canvas with Sound (github.com/superilu)
193 points by AlexeyBrin 5 months ago | hide | past | favorite | 33 comments



Discovered to my delight that iDOS is back on the App Store[1]. Immediately got Windows 3.11 and MSVC++ 1.52 up and running, and will definitely experiment with DOjS now. Much more fun than getting iSH up to scratch for a real development environment, honestly.

1: https://apps.apple.com/us/app/idos-3/id1580768213


Are there any good guides to running 3.11?


It basically just works, but if you want slightly better drivers you can follow:

https://www.vogons.org/viewtopic.php?t=9405

I found it necessary to add an oplmode to get MIDI working, as described at:

https://www.dosbox.com/wiki/Sound

I’ve got some nostalgia hits like Encarta 94 and Castle of the Winds up and running. You can see more at WinWorld:

https://winworldpc.com/home

I jumped through the same hoops on my Steam Deck (although you can use DOSBox-X there which is slightly more capable) but the iPad has become by far my favourite DOS gaming experience. With Stage Manager, you can have Norton Commander in iDOS running side by side with Midnight Commander in iSH, on a tablet with all day battery life. Anything for a weird life.


Thank you, that is helpful.


This is great work! I've been interested in having a ready to go dev environment for DOS where you just do straight INT 10H development like back in the day. Is it possible to compile work here to an actual x86 DOS executable that could run on DOS without this environment?


No, sadly you can't. But there is a packaging mechanism where you can put all scripts and assets into a ZIP file and you only need to ship the DOJS.EXE and the ZIP.

You can also (sort of) rename the EXE...


You should be able to use COPY /B DOJS.EXE + PACKAGE.ZIP DOJSPACK.EXE to end up with a single .EXE file that still contains the packaged data when read as a ZIP file. The .ZIP format is specifically designed so that this will work.


well, the format maybe, but I have to check if my ZIP library supports that, too...


I wonder if @jart's Cosmopolitan could target web browsers

https://justine.lol/ape.html


This seems really neat. However, I'm on a Mac M1 with a stock install of DosBox-X and it seems like all the examples run incredibly slow even when I crank up the cycles to emulate a Pentium 100mHz (~60_000 cycles).

What would be nice is an example JS file called something like "bench-p100.js" along with an expected framerate range you should be seeing assuming running on various Pentium 100mHz systems (DosBox, DosBox-X, bare metal, etc).


Well, the speed really depends on what you wanna do. But yes, the interpreter is quite slow.

I'd say a P133 is feasible. I never benchmarked DOSBox against real HW, that would be interesting to check...


Needs NIBBLES and GORILLA or it's not real. Maybe that can be my first project. It looks delightful.


I'd love to include that as a contribution.

I've created a text adventure with a friend and a number puzzle using DOjS: https://superilu.itch.io/


> If you run it on real hardware, you need at least an 80386 with 4MB. I recommend a Pentium class machine (>= 100MHz) with at least 32MB RAM.

This is nostalgic (¬‿¬)

I recall my very first computer was an Intel Pentium I with 16MB of RAM and around 2.5GB of HDD. Nowadays, even the cheapest smartphone would outperform, by far, those machines.


My first¹ computer was a 386DX with 1MB of RAM (which I quickly upgraded to 13MB as with 1MB, LaTeX compiled documents at 1 page per minute, but that was the plan all along—just trying to avoid the high cost of RAM from the computer vendor).

1. Technically, my first computer was a 64K Spectravideo that I got as payment for writing some demo programs for the Chicago distributor of that system, but as it was pretty quickly orphaned, it’s easy to forget about.


> LPT or parallel port access

Last time I tried I couldn't get this working with DOSBox. Can someone who knows this stuff well comment on whether this represents an extension of DOSbox capabilities or if I've just missed what DOSbox can already do?


This is a framework for building things that run on DOS (yes, that means running JavaScript on DOS). If what you’re running DOS on has a working parallel port, DOjS can use it.


Ah yes sorry that is clear in my head now


Vanilla DOSBox does not do printer emulation.

DOSBox-X (https://dosbox-x.com/), a fork with extended features, implements full parallel port emulation.


This is amazing, represents a beautiful playground similar to the early systems, Basic, Amos, aso.


And you can create real applications with it. Like DOStodon, the mastodon client for MS-DOS: https://github.com/SuperIlu/DOStodon


Time to fire up the Diamond Stealth Pro VLB 2 MiB on a socket 3 monster. :)


What you need is an ‘Acme i986DX7/900 PC with a SCSI-III 10-Terabyte disk drive under MulticOS/42 v7.99’.

https://www.delorie.com/djgpp/v2faq/faq3_1.html


Nawh, I already have one.


One of these days, I'll write a TypeScript reinterpretation of an early version of the Macintosh Toolbox, and a little sandboxed web environment for its software to cosplay in


I would like something that goes the opposite way. A full IDE in JS that compiles C/C++ code down to DOS code. Ideally using djgpp



Can't you just use a modern IDE with DJGPP? Maybe you'd just need some wrapper scripts to invoke the compiler.


Are there any terminal UI frameworks for the web? I want to create web apps that only use keyboard shortcuts.


Not exactly what you're looking for, but there's Shell in a Box (see https://github.com/shellinabox/shellinabox), that can create a terminal on a web page, and expose an actual terminal application running on a server.

One thing that is certainly doable is also to use a standard TUI framework in another language (there are many of them, e.g. https://github.com/magiblot/tvision for C++, https://github.com/charmbracelet/bubbletea for Go, etc.), compile it to WASM, and find how to bridge the WASM output to the browser (I've seen this: https://github.com/cryptool-org/wasm-webterm, but never tried it).


Shellinabox doesn’t seem to have a lot of development. Try ttyd instead

https://github.com/tsl0922/ttyd


Looks nice, thanks for sharing!


Very cool, but requires a fancy computer (pentium territory) and is still very slow.

I'll stick to 8086 assembly.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: