-
-
Notifications
You must be signed in to change notification settings - Fork 5
vc64webplayer_d64
how to preload other roms than the open roms you have learned already in chapter preloading the web player with specific system roms
also in that chapter you know that you could add an arbitrary .d64 diskfile ....
like so
<div>
<img
style="width:60vw" src="my_demo.gif"
onclick="
let config=
{
dialog_on_missing_roms:false,
dialog_on_disk:false,
navbar:false
};
vc64web_player.samesite_file=
{
floppy_rom_url:floppy_url,
basic_rom_url:basic_url,
kernal_rom_url:kernal_url,
charset_rom_url:charset_url,
url:file_url,name:'my_demo.d64'
};
vc64web_player.load(this,encodeURIComponent(JSON.stringify(config)));
return false;
"
/>
</div>
now this starts the emulator but leaves the user to type load"*",8,1 or something like that on his own ...
what about to auto load and auto run a disk ? Yes we can do this easily by scripting ...
first our autoload/autorun script is this
async function load_from_inserted_disk(prg_or_dir)
{
if(prg_or_dir != null)
{
if(prg_or_dir=="$")
{
await action(`'load"$",8'=>Enter`);
await disk_loading_finished();
await action(`'list'=>Enter`);
}
else
{
await action(`'load"${prg_or_dir}*",8,1'=>Enter`);
await disk_loading_finished();
await action(`'run'=>Enter`);
}
}
}
and second do we add this script to the config object before we load the emulator with vc64web_player.load
any_prg_from_that_disk='myprogram'; // the name of the program on the disk you like to start
config.buttons= [{
run: true,
script: `await wasm_ready_after_reset();(${load_from_inserted_disk.toString()})('${any_prg_from_that_disk}');`
}];
summary this autorun actionbutton script waits until the emulator is ready and then starts to load the disk. It waits until loading is finished and then runs automatically the program.
- simple hashtag preconfiguration
- preconfig with JSON notation
- using direct start links for sharing on social media
- preconfig of scripts and buttons
- scripting support for simple tasks
- scripting support for complex tasks like programming a game specific AI
lightweight integration into your own webpage (with only a few lines of code)
- using the web player for embedding and controlling vc64web inside another webpage
- preloading the web player with specific system roms
- send scripts into the emulator via the webplayer
- customizing the icon bar at the bottom of the webplayer
- how to preload original system roms and autostart a .d64 title
create a standalone package which contain all files to run your C64 program