Series of blog posts on C64 JavaScript emulator from scratch
Re: Series of blog posts on C64 JavaScript emulator from scr
There's no doubt Klaus has revolutionised our world with his test suite. Many thanks to him for that.
Re: Series of blog posts on C64 JavaScript emulator from scr
BigEd wrote:
There's no doubt Klaus has revolutionised our world with his test suite. Many thanks to him for that.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Series of blog posts on C64 JavaScript emulator from scr
I can't agree more.
Klaus's test suite and Visual6502 are two essential tools to have in your toolset when taking on a 6502 emulation project.
Klaus's test suite and Visual6502 are two essential tools to have in your toolset when taking on a 6502 emulation project.
Re: Series of blog posts on C64 JavaScript emulator from scr
I just released part 9 of this series. In this blog I will be booting the C64 system with its Kernel Rom and Basic Rom. Here is the link:
https://emufromscratch.blogspot.co.za/2 ... ystem.html
Enjoy!
https://emufromscratch.blogspot.co.za/2 ... ystem.html
Enjoy!
Re: Series of blog posts on C64 JavaScript emulator from scr
Interesting development... is there a repo or a download for the final code at the end of each of the episodes?
Re: Series of blog posts on C64 JavaScript emulator from scr
There is indeed a way to access the final source code for each episode. When visiting my github site https://github.com/ovalcode/c64jscript just click on releases and you will see the source available for each episode as a zip file. The source code for my last post, for example, will be ch9.zip
Iuse the main branch for new development, so if you peek at this branch at any time you will get an idea what I was up to recently.
Iuse the main branch for new development, so if you peek at this branch at any time you will get an idea what I was up to recently.
Re: Series of blog posts on C64 JavaScript emulator from scr
That's great, thanks! I just wanted to test something - and it turns out Python's built-in one-line web server is enough for this purpose:
which might be easier, for some, than setting up a full-sized webserver. (Some people won't have Python and might not want it, but it's available for all platforms.)
Cheers
Ed
Code: Select all
ed$ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [21/May/2016 15:59:30] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [21/May/2016 15:59:30] "GET /Memory.js HTTP/1.1" 200 -
127.0.0.1 - - [21/May/2016 15:59:30] "GET /Cpu.js HTTP/1.1" 200 -
127.0.0.1 - - [21/May/2016 15:59:30] "GET /basic.bin HTTP/1.1" 200 -
127.0.0.1 - - [21/May/2016 15:59:30] "GET /kernal.bin HTTP/1.1" 200 -Cheers
Ed
Re: Series of blog posts on C64 JavaScript emulator from scr
This is really awesome! I see it works out of the box for Ubuntu. The nice things is that it takes the current directory from which you invoked python as the context root of the web pages it is serving.
This is definitely going to be of great help since I always end up with copies of the source code in two places (e.g. tomcat webapps folder and the folder that is under git source control) and copying between the two.
Thanks Ed!
This is definitely going to be of great help since I always end up with copies of the source code in two places (e.g. tomcat webapps folder and the folder that is under git source control) and copying between the two.
Thanks Ed!
Re: Series of blog posts on C64 JavaScript emulator from scr
You're welcome - eventually I used this so often I didn't have to keep looking up how to do it! You can give a port number as a parameter - sometimes I run several, in different dirs.
Re: Series of blog posts on C64 JavaScript emulator from scr
Hi all!
I just released Part 10 of my series on a Emulator from scratch. In this blog we will code the emulation of a very basic C64 screen.
http://emufromscratch.blogspot.co.za/20 ... creen.html
I just released Part 10 of my series on a Emulator from scratch. In this blog we will code the emulation of a very basic C64 screen.
http://emufromscratch.blogspot.co.za/20 ... creen.html
Re: Series of blog posts on C64 JavaScript emulator from scr
Drawing text in the browser using the emulated character ROM - very nice!
Re: Series of blog posts on C64 JavaScript emulator from scr
If you wanted to eliminate the web server requirement, you could shove the ROMs in to an uncompressed GIF, render the GIF to a (offscreen) canvas, and then get the pixel values (RGB, RGBA) from the image. That way you could bundle ROMS as simple static images.
Bit of a hack, but it should work.
Bit of a hack, but it should work.
Re: Series of blog posts on C64 JavaScript emulator from scr
That's a neat idea! The visual6502 abuses 24-bit colour - each node's polygons carry their ID in the low bits of the colour space, which allows for easy ID of which polygon you clicked.
Re: Series of blog posts on C64 JavaScript emulator from scr
Very interesting concept! I am going to play a bit with this idea and see if I can give some feedback in my next Blog.
Thanks Whartung!
Thanks Whartung!
Re: Series of blog posts on C64 JavaScript emulator from scr
Hi Whartung and BigEd
I had some spare time to play with the off screen GIF idea. This method works perfectly in Debian's Iceweasel browser.
Unfortunately, it looks like Google chrome and browsers on Android doesn't like this approach.
My first try on Chrome yielded the following error: Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.
Some Googling suggested the use of
imageObj.crossOrigin = "Anonymous";
Where imageObj is the JavaScript Image that used to load the gif into.
This yielded the following error:
Image from origin 'file://' has been blocked from loading by Cross-Origin Resource Sharing policy: Invalid response. Origin 'null' is therefore not allowed access.
It appears that with recent HTML specifications they have become more strict for situations where you try to access the data from a IMG tag:
https://developer.mozilla.org/en-US/doc ... bled_image
Anyway, in my next blog I will provide access to my code attempt.
I had some spare time to play with the off screen GIF idea. This method works perfectly in Debian's Iceweasel browser.
Unfortunately, it looks like Google chrome and browsers on Android doesn't like this approach.
My first try on Chrome yielded the following error: Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.
Some Googling suggested the use of
imageObj.crossOrigin = "Anonymous";
Where imageObj is the JavaScript Image that used to load the gif into.
This yielded the following error:
Image from origin 'file://' has been blocked from loading by Cross-Origin Resource Sharing policy: Invalid response. Origin 'null' is therefore not allowed access.
It appears that with recent HTML specifications they have become more strict for situations where you try to access the data from a IMG tag:
https://developer.mozilla.org/en-US/doc ... bled_image
Anyway, in my next blog I will provide access to my code attempt.