Hello everyone!
Noticed that there aren't that many new posts in this pas2js section, which is a bit of a shame, considering how really powerful it can be. I've been busy at more fun pas2js projects, some closed source, but some open sourced, such as my Web6502 project, which can be found here on GitHub:
https://github.com/kveroneau/Web6502 Your first question might be, especially if you aren't a avid fan of the 6502 processor, is what's the point of this project, it doesn't even emulate any real 6502 systems or hardware? Emulating an existing 6502 system is not the purpose of this project. Rather, it allows someone to experiment with 6502 right inside of their web browser, and easily share what they may have created with the world, without needing to be concerned ever about the copyright or rights of any 6502 emulator or system which would otherwise be required legally to distribute your 6502 program and for people to enjoy. This project eliminates that barrier, and instead provides a truly open sources 6502 system built for use on the web. The 6502 instruction set was created with human beings in mind, so the assembly for the 6502 is really fun to learn and use. If you are a techy and love learning new things as I do, but feel that learning some of the real 6502s is a bit much, then this project might be a fun stepping stone to getting to where you want to be.
There is an online demo site you can visit here to see both a virtual DOM card in action, and another demo site shows a virtual VT100 card in action.
Main website and blog, which runs in 6502 code:
https://web6502.puter.site/The VT100 website demo running a copy of EhBASIC:
https://web6502.puter.site/vt100.html?boot=basic.binI write a lot of the 6502 programs in Pascal, namely the P65Pas compiler:
https://github.com/t-edson/P65PasBlog source code in P65Pas:
https://github.com/kveroneau/Web6502/blob/main/src6502/P65Pas/blog.pasThis project might also be useful to someone who is interested in learning more about P65Pas as well.
The actual ObjectPascal using pas2js makes use of classes and components, which allows a custom 6502 system to be built with cards in different slots with varying amounts of other devices. All of these virtual cards and devices are all created in ObjectPascal using a sub-class to define their functionality. In theory it could be possible to emulate a real 6502 system, such as running Apple's ProDOS or something if the devices which emulate an Apple ][ were properly created. Although, cycle-accuracy wouldn't be easy at this point, this project is meant to either run at maximum speed, or using a simple timer. It was built for use on the web, so both of these in that context work for the project. The initial boot you will see if you visit the demo sites do seem to take a bit of time, however, it is entirely possible to have their code run at maximum speed instead of the current timer system it is using. I opt'd for the timer system during boot as it shows the actual Web6502 system running, if it only displayed in a flash, then it wouldn't look as cool. And yes, 6502 code running at maximum speed far exceeds the speed of any existing 6502 system or any of their accelerator cards, this project is merely making use of the 6502's instruction set and basic memory system, nothing else is related to a real 6502.
One interesting side effect of Web6502, is that it does isolate the program code entirely in a virtual 6502 sandbox, allowing only access to what devices and cards it can use. The DOM Interface Card for example is configured in ObjectPascal to set which ID elements in the HTML document it should be-able to access, and once the 6502 code is running, it can then only access those very specific DOM elements it was given access to. The storage cards will all be mostly compatible with each other soon, and one can easily be swapped with another, and the 6502 code wouldn't need to change. This ability to swap devices and cards while keeping the actual 6502 unchanged I think is very powerful. For example, one storage card can use the browser's localStorage to save and load files. Now, this card could for example be swapped with a Card that can connect to say a server side API, and now all of your 6502 programs which use storage now immediately have access to server-side storage without any other modifications.
I love abstraction! I love how the LCL works in this regard to support multiple platforms while the developer doesn't need to ever change their own source code. It's magical, and I think this sort of system I built in Web6502 could have some rather interesting uses in the right hands. I will be adding more and more interface cards and devices to this project as time goes on to access other resources, so the amount of abilities will only grow.