Page 2 of 4
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Thu May 19, 2016 2:06 pm
by BigEd
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
Posted: Thu May 19, 2016 5:49 pm
by Dr Jefyll
There's no doubt Klaus has revolutionised our world with his test suite. Many thanks to him for that.
Hear, hear!
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Fri May 20, 2016 7:29 am
by fastgear
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.
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Sat May 21, 2016 10:06 am
by fastgear
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!
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Sat May 21, 2016 10:26 am
by BigEd
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
Posted: Sat May 21, 2016 2:17 pm
by fastgear
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.
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Sat May 21, 2016 3:03 pm
by BigEd
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:
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 -
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
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Sat May 21, 2016 4:02 pm
by fastgear
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!
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Sat May 21, 2016 4:14 pm
by BigEd
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
Posted: Tue May 24, 2016 11:50 pm
by fastgear
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
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Wed May 25, 2016 7:27 am
by BigEd
Drawing text in the browser using the emulated character ROM - very nice!
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Wed May 25, 2016 9:25 pm
by whartung
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.
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Thu May 26, 2016 7:53 am
by BigEd
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
Posted: Thu May 26, 2016 8:57 am
by fastgear
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!
Re: Series of blog posts on C64 JavaScript emulator from scr
Posted: Fri May 27, 2016 8:16 pm
by fastgear
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.