Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a bit more explanation on creating a static distribution #207

Open
sadam029 opened this issue Feb 13, 2024 · 1 comment
Open

a bit more explanation on creating a static distribution #207

sadam029 opened this issue Feb 13, 2024 · 1 comment

Comments

@sadam029
Copy link

Hey, whscullin!

I love your emulator. Its allowed me to play some great old games from my childhood. I'm trying to host one of those old games that made a positive impact on me. I'm a pretty big noob with all of this, but I've isolated the game from the collection of games it came with. But, I'm having trouble understanding what/where to edit to create a static distribution that autoloads the game when accessed. Any advice or help would be greatly appreciated. Regardless, thanks again for your work on this emulator.

@rgov
Copy link

rgov commented Jun 10, 2024

The loaded disk is put in the URL hash, e.g., https://www.scullinsteel.com/apple2/#crimson1. The onLoaded() function in apple2.ts checks for either #crimson1 or ?disk=crimson1 to know what to automatically load:

apple2js/js/ui/apple2.ts

Lines 1020 to 1026 in 838fda6

// Check for disks in hashtag
const hash = gup('disk') || hup();
if (hash) {
_apple2.stop();
processHash(hash);
} else {

So if you don't want to modify the code, just add the disk you want to the URL accordingly. Or if you want a very minimal code modification, set the variable hash to a fixed string as desired.

If you follow the logic through you can see how it parses the hash and then calls either loadData(), which copies the program directly into RAM, or loadDisk(), which is a more complicated process.

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

No branches or pull requests

2 participants