nippur72 / c64-emu

6 stars 2 forks source link

JS console commands not working. #4

Open jojowil opened 1 year ago

jojowil commented 1 year ago

Perhaps I am missing something silly. I tested the JS console commands:

load("file.prg" [,start]) loads a file at the specified address
save("file.prg" [,start, end]) saves a file
download("file.prg") gets the file as a browser download
remove("file.prg") remove file from browser's cache
dir() lists files on browser's cache
paste(text) paste a string of text (e.g. containing a BASIC program)
makeBase64("file.prg") encodes the file for use with the b= query string parameter (see)

And they are not working for me. I get errors like Uncaught ReferenceError: dir is not defined

Bill

jojowil commented 1 year ago

Okay, I see. Looking through the commit history, they were removed during the conversion to typescript, and filesystem.js got moved to src/filesystem.ts. The idb-keyval went away and so did these features. The README.md wasn't updated.

nippur72 commented 1 year ago

yes the documentation is a disaster -- this emulator was build above another emulator which had JavaScript commands, but then I switched to WebAssembly and TypeScript so the commands became obsolete. Lot of code and docs to clean... I have eight web-based emulator I struggle to maintain 😢 (VIC20, C64, Laser500, Laser310, General Processor, ChipZ, LM80C, Apple1), it's a pain when you change one and want to sync it to the others.

jojowil commented 1 year ago

Well, I'd love to help out. I use the VIC20 and C64 in my classes to teach computing history and assembler/machine-code basics while writing (dis)assembly tools.

I could work on the docs, plus I'd like to change the default behavior of automatically running on PRG drop. RUN is extraneous for assembled programs, and it provides an opportunity (in education) to discuss the code before it runs.

I love VICE, but I really wanted a JS emulator to help my students. I spent half my summer in class prep trying to get Thomas Hochgoetz's emulator the way I wanted, but there were too many issues to overcome, and the keyboard would somtimes lock the emulator. Then I came across yours, saw active development, and thought, well, maybe I can help add CRT, and D64 support. Plus, your keyboard support is awesome and needs some documentation on where the C64 keys map (like ESC).

Let me know what you think. Bill

nippur72 commented 1 year ago

About the auto running, I would keep the feature (which I use a lot), but perhaps we can have a switch somewhere... for example something like this in the URL: ?autorun=false ... let me know, it's an easy fix.

Honestly the keyboard emulation is a disaster... this because the browser keyboard doesn not match perfectly the C64 one, and some key combinations makes it stuck, so I have to "clear" the bits periodically. But it's good if you type slowly (we use the C64 for the BBS on bbs.retrocampus.com).

D64 is very difficult to implement, as the 1541 drive is a whole computer by itself (it has a 6502 and a 6522), I tried before but I had to give up.

I need also to document the way I hack the emulator from JavaScript, it's the most important feature for me as I use the emulator for developing/debugging purposes.

jojowil commented 1 year ago

I'm happy to help in any way. Let me know how I can be of service and give something back to this wonder set of tools. Bill

jojowil commented 10 months ago

Wanted to circle back on this. How can I paste source code directly to the WASM interface as if I typed it from the keyboard? I have some new projects for my students and this would be very helpful!

Thank you, Bill