jsbeeb - a Javascript emulator

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
User avatar
sa_scott
Posts: 96
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: jsbeeb - a Javascript emulator

Postby sa_scott » Fri May 01, 2015 1:45 am

I must say this would be a great feature for jsbeeb:

http://www.wired.com/2015/04/embed-games-into-tweets/

How about it Matt - embed BBC games in tweets? Wonder if this involves Twitter (would be fun finding out).

Cursory check using Chrome and Firefox suggests the game is not appearing within said tweet (for example, https://twitter.com/kobunheat/status/593530809715331072)

Still, worth a shot!
--
Stephen Scott, Digital Media Professional
www.sassquad.com

jimmy
Posts: 99
Joined: Tue May 06, 2008 6:37 pm

Re: jsbeeb - a Javascript emulator

Postby jimmy » Sat Jul 11, 2015 10:15 am

I played JSBeeb online and it looked really good. I downloaded the latest ZIP archive of JSBeeb and am trying to run it on a PC which is offline, ie: not on the internet.

It doesn't work for me in Firefox (can't find rom file - even though it's there) or IE11 (struggles with localstorage at trying to work out what keyboard map I have)
All I've done is extract all the files in the zip into a folder and then run the index.html file

Is this code actually capable of running on a standalone machine? I can see references to google API and analytics, and they won't get very far in this case...

Would love to get this running - help!!

User avatar
Pernod
Posts: 995
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK

Re: jsbeeb - a Javascript emulator

Postby Pernod » Sat Jul 11, 2015 11:01 am

jimmy wrote:Is this code actually capable of running on a standalone machine? I can see references to google API and analytics, and they won't get very far in this case...

Would love to get this running - help!!

Yes, but you can't simply open the index in a browser. You need to setup a local web server. Try something like XAMPP.
Maybe start a new topic if you need further help configuring a web server.
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.

User avatar
vanekp
Posts: 335
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands

Re: jsbeeb - a Javascript emulator

Postby vanekp » Sat Jul 11, 2015 12:00 pm

OOOps! Matt, I think I crashed your jsbeeb it will not run anymore , was trying to load the protected tape version of Repton, it came up with a debug screen as Repton uses unofficial op codes to decode itself (in this version anyway).

Peter.

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sat Jul 11, 2015 12:42 pm

No worries. Reload the page to get it working again :)

Which Repton image did you try? jsbeeb supports all the "defined" undefined opcodes, but it doesn't treat the remaining ones as NOPs. I will take a look if you let me know which Repton you tried :)

User avatar
Pernod
Posts: 995
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK

Re: jsbeeb - a Javascript emulator

Postby Pernod » Sat Jul 11, 2015 12:56 pm

Matt Godbolt wrote:Which Repton image did you try?

I just tried Repton_B.zip from STH and it stopped loading after the title screen.
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.

User avatar
vanekp
Posts: 335
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands

Re: jsbeeb - a Javascript emulator

Postby vanekp » Sat Jul 11, 2015 1:19 pm

It's the tape version of Repton, I had made it from my own Repton tape and was one I submitted to Acorn preservation org at the time, which till now has never worked with any emulators as it uses undocumented op-codes, also won't work in a BBC if you have a 65c02 processor fitted.

I still can’t get jsbeeb to run anymore just get a blank screen every time I go to the site now, no BBC prompt >.
Attaches is a copy of it.
Regards Peter.
Attachments
Repton (Superior) (B) (Tape) [side-lab].hq.uef.zip
(29.52 KiB) Downloaded 36 times

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sat Jul 11, 2015 1:27 pm

That's very odd re: jsbeeb site. There's nothing that's saved between sessions. Can you do me a favour and bring up the Javascript console (which browser are you using?) and see if there's any errors there?

Thanks! I'll also take a look at the tape image, thanks for attaching it!

-matt

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sat Jul 11, 2015 1:32 pm

jimmy wrote:Is this code actually capable of running on a standalone machine? I can see references to google API and analytics, and they won't get very far in this case...


Absolutely, and 99% of the development is done this way: without internet access on a train back and forth to work on my commute! :) jsbeeb runs just fine without a real connection; the analytics stuff and google API are not required and jsbeeb runs just fine without it.

Due to weird browser permissions though you need to serve it up from an actual web server, like Pernod says.

I'm no Windows expert so I can't help you there. When Rich TW runs locally (on Windows) I think he uses IIS but I'm not sure.

If you have python available then there's a really simple built-in webserver I used to use that works well. Bring up a command prompt, CD to the jsbeeb folder and run "python.exe -mSimpleHTTPServer" -- this will start serving files locally on http://localhost:8000/.

Hope that helps!

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sat Jul 11, 2015 1:47 pm

vanekp wrote:It's the tape version of Repton, I had made it from my own Repton tape and was one I submitted to Acorn preservation org at the time, which till now has never worked with any emulators as it uses undocumented op-codes, also won't work in a BBC if you have a 65c02 processor fitted.


I tried the tape and I don't see the undocumented opcodes: I don't get dropped into jsbeeb's debugger. I get to the MODE 7 "SUPERIOR SOFTWARE PRESENTS / REPTON" splash screen and then I get dropped back to the BASIC prompt. Is this what you see too?

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sat Jul 11, 2015 1:53 pm

Replying to myself; if I just "*/" from then on, I get to an undefined opcode at $124b, opcode $72. I'll try ignoring that and see if Repton works.

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sat Jul 11, 2015 1:55 pm

(though $72 is one of the "crash the CPU" instructions, apparently: http://www.ffd2.com/fridge/docs/6502-NMOS.extra.opcodes)

User avatar
vanekp
Posts: 335
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands

Re: jsbeeb - a Javascript emulator

Postby vanekp » Sat Jul 11, 2015 2:00 pm

Ok Just got jsbeeb working again and now I get the same as you 1st time I got the build in debugger wich you can also get into with ctrl home I discovered, b.t.w how do you get out of the debugger ? as I am now stuck in there :(
hmmm seems any tapes I have created with beebEm it does nothing with them just sits there does not read the tape image.

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sat Jul 11, 2015 2:09 pm

If you're not trapped on an undefined opcode then 'g' is "go" in the debugger.

I've just put the current keys at https://github.com/mattgodbolt/jsbeeb/wiki/Debugger

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sat Jul 11, 2015 2:20 pm

I tried ignoring all the "halt" opcodes; treating them as NOPs, but then it gets stuck in an infinite loop. Very weird! I'll dig more later on. At the very least I'll have to put "turbo tape" loading in else I'll die of old age before I get to the bottom of this :)

I can see why no other emulator runs it: Are you certain this works on a real Beeb? :)

User avatar
vanekp
Posts: 335
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands

Re: jsbeeb - a Javascript emulator

Postby vanekp » Sat Jul 11, 2015 2:29 pm

Yes I am certain it does work on a real BBC. and thanks for the debugger keys, useful to know :) Turbo tape mode would be useful :D

Here is a disc image with the 1st two files on and have tested it on a real BBC (see photo) it takes some 5 seconds (I guess as its running some serious timing decrypting of the code) before it comes up with the searching message. Also hangs a real BBC if you press break and the only way out is to turn the BBC off/on.
Attachments
Repton.zip
(1.03 KiB) Downloaded 31 times
20150711_164251.PNG
Last edited by vanekp on Sat Jul 11, 2015 2:49 pm, edited 1 time in total.

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sat Jul 11, 2015 2:33 pm

The "infinite loop" is actually the default BRK handler being called with bit 0 of $0267 set (DISC EXEC error according to my docs)...this causes OS1.2 to spin forever (on purpose).

Suspiciously the stack pointer is at $ff, and $fd/$fe (BRK addr pointer) point at a wall of zero bytes; so it's likely that something deeper is going wrong much earlier!

I have to pop out now but will return to this later in the weekend! Thanks for the info so far!

User avatar
vanekp
Posts: 335
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands

Re: jsbeeb - a Javascript emulator

Postby vanekp » Sat Jul 11, 2015 6:53 pm

Zalaga also gives problems with jsbeeb, I remeber it not working in a real beeb as well when I had a 65c02 cpu in my bbc, wich is the same for repton will also not load if you have a 65c02 cpu in the BBc.
Attachments
Zalaga.png
Zalaga crashes in JSbeeb when loading

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sun Jul 12, 2015 8:34 pm

Thanks! I think we've sussed out what's going on: and by "we" I mean Rich TW :)

Hoping to have a fix for both Repton and Zalaga soon!

User avatar
vanekp
Posts: 335
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands

Re: jsbeeb - a Javascript emulator

Postby vanekp » Sun Jul 12, 2015 9:14 pm

thanks for the update will watch out for that :)

User avatar
billcarr2005
Posts: 1094
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: jsbeeb - a Javascript emulator

Postby billcarr2005 » Sun Jul 12, 2015 9:58 pm

Is this a similar problem which was discussed by RTW, with regards to the original disk version, all that time ago here

viewtopic.php?f=4&t=6180&p=58763#p58657

or something else entirely?

Only asking because the UEF loads up correctly on FSDBeebEM with the full set of undocumented instructions checked, but not on BeebEM 4.14 :roll:

Also, keep up the good work! =D>

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sun Jul 12, 2015 10:08 pm

It was exactly that and the jsbeeb beta site is now up and running with the fix (http://bbc.godbolt.org/beta) - we're getting some other fixes together then I'll update the main site!

Thanks Rich!

User avatar
Arcadian
Posts: 2795
Joined: Fri Nov 24, 2000 12:16 pm
Contact:

Re: jsbeeb - a Javascript emulator

Postby Arcadian » Sun Jul 12, 2015 10:36 pm

Speaking of FSDs and jsbeeb ... what are the chances of getting FSD support added into jsbeeb, Matt? :)
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk

Image
ABug NORTH (Manchester) (19-21 January 2018)
ABug SOUTH (Hampshire) (1-3 June 2018)

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Sun Jul 12, 2015 11:41 pm

If there are some specs and some examples somewhere absolutely!

User avatar
billcarr2005
Posts: 1094
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: jsbeeb - a Javascript emulator

Postby billcarr2005 » Mon Jul 13, 2015 5:15 am

Specs are here
http://www.stardot.org.uk/forums/viewto ... =30#p63142

I can happily send over the bodged disc8271.CPP from BeebEM which I mangled to get it working, and also the "standout" disk images, Exile (mismatched track IDs, unequal track IDs), Infinity (different sized sectors per track), Mini Office II (repeated sector IDs in one track), etc.

User avatar
Rich Talbot-Watkins
Posts: 1117
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: jsbeeb - a Javascript emulator

Postby Rich Talbot-Watkins » Mon Jul 13, 2015 7:58 am

I have it on my to-do list. The only problem with FSD as a format was that it loses the sector ordering which would lead to inaccurate emulation when emulating the timing of the disc spin. Bill, it'd be great if you could revise the format to not sort the sectors by ascending index, or at very least, just skew the sector dump to put the lowest first, and then add an extra field to specify which sector in the list corresponds to the index hole sector (first physical sector). FDI dumps have something similar.

I have that big FSD dump you sent me once (plus a few FDIs) so definitely have plenty of test material!

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: jsbeeb - a Javascript emulator

Postby Matt Godbolt » Mon Jul 13, 2015 2:45 pm

And indeed someone had already added it to the feature tracker: https://github.com/mattgodbolt/jsbeeb/issues/30 -- feel free to add more suggestions there if you have a github account. Or just post 'em here :)

User avatar
vanekp
Posts: 335
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands

Re: jsbeeb - a Javascript emulator

Postby vanekp » Mon Jul 13, 2015 5:26 pm

Is this a similar problem which was discussed by RTW, with regards to the original disk version, all that time ago here

viewtopic.php?f=4&t=6180&p=58763#p58657

or something else entirely?

Only asking because the UEF loads up correctly on FSDBeebEM with the full set of undocumented instructions checked, but not on BeebEM 4.14 :roll:

Also, keep up the good work! =D>


Yes this is the same problem as with the disc version and found the FSD Version of beebem wich is also version 4,14 but with FDS suport, and as you say it does work on there, 1st time I have seen it load up on an emulator so it had been fixed once but has since been broken again :lol:

User avatar
billcarr2005
Posts: 1094
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: jsbeeb - a Javascript emulator

Postby billcarr2005 » Mon Jul 13, 2015 5:53 pm

Rich Talbot-Watkins wrote:I have it on my to-do list. The only problem with FSD as a format was that it loses the sector ordering which would lead to inaccurate emulation when emulating the timing of the disc spin. Bill, it'd be great if you could revise the format to not sort the sectors by ascending index, or at very least, just skew the sector dump to put the lowest first, and then add an extra field to specify which sector in the list corresponds to the index hole sector (first physical sector). FDI dumps have something similar.


Provided that *IDDUMP on Enigma Disc Imager correctly reports the sector ordering (which I think it does), then Exile (FSD dump #001), at least, has the sectors in ascending order as per the FSD, ie. no skew - whether this is true of the majority of protected titles, I'd have to check.
Infinity (FSD #002) has sectors of 1024,1024, 512 & 256 bytes - so i'm fairly certain they stay in this order too.
Summer Olympiad (FSD #060), since i had a copy at hand, has a skew of +7 each track, starting 0, 7, 4, 1, 8, 5, 2, etc.
The disk i use for saving in drive 1 has sector 8 & 9 then back to 0 through 7.
Even with a correctly emulated disk (speed?) spin, since FSD doesn't store the ~46 bytes in the sector gap, I'm not sure how accurate it could get, and also, I've not seen any protection methods (500+ disks) which rely on this.
Will look at some others when I get my faster disk imager finished.
Also, thanks for having it on your (hopefully short? :P) to do list =D>

User avatar
vanekp
Posts: 335
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands

Re: jsbeeb - a Javascript emulator

Postby vanekp » Mon Jul 13, 2015 6:15 pm

Is there a FDI copy of the Repton floating around, I have never come across it, be intrested to get a copy if possibvle to play with.
Peter.


Return to “emulators”

Who is online

Users browsing this forum: No registered users and 2 guests