Skip to content

vc64webplayer_roms

mithrendal edited this page Nov 8, 2022 · 13 revisions

normally the vc64web emulator fetches its roms automatically from the openROMS website, but these do not include a 1541.rom which is needed for .d64 files. The rom-dialog UI is a way that lets the user choose his own roms. There could be situations where you want to automatically preload with your own specific set of roms instead of a user choosen ones.

so this chapter explains how to preload the emulator with your own specific roms ...

In case you have not yet read the chapter using the web player for embedding and controlling vc64web inside another webpage. You should read that one first before continue reading here.

you can preload urls or you can preload the roms as base64 encoded strings

lets go with urls first

step 1 define the urls

<script>
  file_url='http://my-site.de/my_demo.d64';
  floppy_url='http://my-site.de/floppy.rom';
  kernal_url='http://my-site.de/kernal.rom';
  basic_url='http://my-site.de/basic.rom';
  charset_url='http://my-site.de/charset.rom';
</script>

step2 define the player to preload these system roms files into the sockets of the vc64web

you do this with

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'
};

also we preconfig

  • to not show dialogs when no rom has been loaded yet
  • to not show dialogs when disk has been inserted, so forcing the user to type load"$",8 by himself
  • to hide the navbar menu

with

let config={
  dialog_on_missing_roms:false,
  dialog_on_disk:false,
  navbar:false
};

here is the complete code

<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>

If you like to use base64 encoded roms inside your html page follow this way

first define the variables which hold the base64 encoded roms

like so

<script>
  floppy_base64_encoded='l6q...g=='; //the bas64 string has been shortened
  ...
</script>

and then you use them in the samesite_file of the vc64web_player before the load command

vc64web_player.samesite_file={
  floppy_rom_base64:floppy_base64_encoded,
  ...
};

maybe you like to see the next chapter ? We like to talk with the emulator ....

send scripts into the emulator via the webplayer

or you just missed here how to autoload/autorun any file from the disk ? then you may want to jump directly to how to preload original system roms and autostart a .d64 title

Clone this wiki locally