Skip to content

Conversation

@CommanderCoder
Copy link

I've been working on the JSAtom version of JSBeeb since 2020. Originally it was separate from JSBeeb but I've merged it with JSBeeb now. To get access, look at the 'About JSBeeb' page and it has the hidden JSAtom link.

It all works (what I've tested anyway). It can load from MMC (defaults to load Hoglets MMC), create a blank MMC, download MMCs. It can load off discs (using -DOS version) or of cassette tape (using -TAPE) version. I've not testing saving to tape or disc since MMC works fine. Sound works, and colour, and it manages to do mid-frame mode cahnges on the 6847 video chip.

I had to import JSZip ( https://stuk.github.io/jszip/) for the MMC zip and unzip.

Keyboard matches the Acorn Atom as closely as possible, but that means CTRL is used for shift key. CTRL-F12 will issue SHIFT-BREAK and boot *MENU. Left and Right with < , >. Type a letter to boot the program.

No SID support

Coder added 16 commits April 23, 2025 16:20
… are marked with // ATOM

Added ROMS and MMC.  Added 6847 with font data. Added PPIA and MMC.

Added new menus and TV set.

Audio and Tape code added but not tested.

Will do more tidy up.
Separated gamepad and atom keycode mappings to utils_atom.js

Removed deprecated use of keycode and charcode [hopefully won't break BBC]
added PPIA to the DEBUGGER for Atom
Still needs testing since wildcards don't work.  I'm not sure how it is intended to be used.

made an empty MMC (with a readme)
@mattgodbolt mattgodbolt self-requested a review June 11, 2025 10:19
@mattgodbolt
Copy link
Owner

Wow fantastic! I'll try to get to this in the next few days. Thank you so much!!

@mattgodbolt
Copy link
Owner

mattgodbolt commented Jun 28, 2025 via email

Copy link
Owner

@mattgodbolt mattgodbolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some very early first comments. This is a huge amount of work! Thank you!!!

What I think is best is if we go back and forth a little on this to "level set" on the changes.

Then, as we get nearer, I'll look at merging some file parts that can be done already.

For example, we could merge the sound chip changes pretty much as they are, and so on. That way we will gradually make small changes that add functionality to the emulator, and this PR will shrink down as its capabilities merge in, then finally we'll merge this to "turn it all on". etc :)

Thoughts? :)

package-lock.json
*.png
*.zip
.prettierignore
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't put the file in itself here. prettier can format its own configuration file just fine :)

Why did you have to ignore png and zip here? prettier shouldn't have tried to format anything it didn't understand, and that includes binary files.

Can you recall why you added these?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During commit, the pre-commit process was stopping me commit. I was probably tired and overzealous.

README.md Outdated
file assumed to be within.
- (mostly internal use) `logFdcCommands`, `logFdcStateChanges` - turn on logging in the disc controller.
- `audioDebug=true` turns on some audio debug graphs.
- `model=atom` jumps into the hidden [Acorn Atom emulator](README-jsatom.md) with preinserted AtomMMC zip file. Use `model=atom-tape` for just the Acorn Atom without MMC.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice :) We can consider making this a proper "model" in a follow up PR if you'd like.

<a href="#google-drive" class="dropdown-item" id="open-drive-link">From Google Drive</a>
</li>
<hr />
<li class="dropdown-divider"></li>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? Not against it, just trying to understand.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It felt more 'bootstrap'y

index.html Outdated
</li>

<!--
<li class="nav-item dropdown embed-hide">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not add commented in code unless we really need to, this file is already big enough :D

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that. I have a nasty habit of leaving in work-in-progress. I need a new habit to remember to clear it out.

content="script-src 'self' 'unsafe-inline' 'unsafe-eval' *.google-analytics.com *.google.com;"
/>
<title>jsbeeb - Javascript BBC Micro emulator</title>
<title>jsbeeb - Javascript BBC Micro emulator (incl. Acorn Atom)</title>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside: The changes in this file are pretty huge, and hard to follow. That's on me for not making this more modular -- now I'm building things with vite we can probably make this more modular. But for now we might be OK. I'm certainly not expecting you to make that change :)

this.updatePrevMem();
this.cpu.execute(1);
self.debug(this.cpu.pc);
this.debug(this.cpu.pc);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good spot!

*/
export function parseMediaParams(parsedQuery) {
const { disc, disc1, disc2, tape } = parsedQuery;
// ATOM
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it's now broken for BBC? You've commented out the BBC one and returrned only the ATOM one

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry

if (hostname.startsWith("bbc")) return "B-DFS1.2";
if (hostname.startsWith("master")) return "Master";
// ATOM
if (hostname.startsWith("atom")) return "Atom";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - this will mean atom.xania.org would return an Atom. I can set that up elsewhere.

src/tapes.js Outdated
this.cpuSpeed = 1 * 1000 * 1000;
}

_isAtom = this.isAtom;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this local variable that we then check only on the next line?

Copy link
Author

@CommanderCoder CommanderCoder Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use it later in that function but it could be replaced with this.isAtom instead.

@mattgodbolt
Copy link
Owner

Thanks! To set expectations, I'm around this week then on holiday for 2w with limited internet so ... this might take a while! I appreciate your patience!

@mattgodbolt
Copy link
Owner

(I'll make some plans though to, for example, bring in one zip/unzip library into the mainline and then see if I can refactor your code to use it? things like that. Might be a long slow burn this one)

@mattgodbolt
Copy link
Owner

I dug about a bit and fflate seems like a decent library that does async and sync compression and decompression. We can always move to jszip but I'll try that on in main (it's an easier lift) and we can discuss more :)

@mattgodbolt
Copy link
Owner

OK I just hit the .prettierignore issue for zipfiles 😊 that's...surprising! so I was wrong about that earlier!

this.lastCtrlLocation = 1;
this.lastAltLocation = 1;

// set up for BBC or Atom
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the atom have both a VIA and a PIA?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No VIA, just the PIA

@CommanderCoder
Copy link
Author

Happy with the slow burn. It took me months to get it working, then roughly 5 years of minor tweaks when I had the time.

@mattgodbolt
Copy link
Owner

thanks @CommanderCoder - I just got back from a two week holiday so ... I'll get there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants