jeffpar / pcjs

The original IBM PC and other machine emulations in JavaScript
https://www.pcjs.org
Other
809 stars 122 forks source link

ERROR `/api/v1/dump' not found. #63

Closed AndersBNielsen closed 1 year ago

AndersBNielsen commented 1 year ago

Running pcjs locally.

When trying to load a ROM then backend reports ERROR `/api/v1/dump' not found.

The debugger reports: ROMx86: Unable to load system ROM (error 404: http://localhost:4000/api/v1/dump?file=/machines/pcx86/ibm/5160/rom/fdc/floppy_bios.bin&format=bytes&decimal=true) (I created the fdc/floppy_bios.bin file)

I got the impression conversion to json was automatic but seeing this, it looks like that feature is broken.

jeffpar commented 1 year ago

That API was a feature of PCjs v1 when PCjs ran from a node.js web server. PCjs v2 doesn't support any server APIs, so that it can be hosted with GitHub Pages. This means that any ROMs hosted by the server must be converted to JSON first. The PCx86 app could be modified to load binary files as well as JSON files, but it's not a feature I've needed. To convert a binary file to JSON, see the filedump utility. There's some documentation for it buried in the code.

AndersBNielsen commented 1 year ago

Thank you! That makes sense. I found the utility and successfully converted some code while waiting.

Took some digging to find it, had to install a fresh node.js and resolve a dependency of mkdirp but it did the job perfectly.

I guess most people could find it too with some digging. And most people won't need it.