JaC64/How to Use

Aus C64-Wiki
Zur Navigation springenZur Suche springen

<< zurück zu JaC64


Written by Joakim Eriksson
Thursday, 19 August 2004


Using JaC64[Bearbeiten | Quelltext bearbeiten]

JaC64 is a 100% Java C64 emulator and thus requires Java (1.4 or better) installed.

Keyboard emulation is trying to emulate the real C64 keyboard as close as possible. Have a look at the image for that keyboard

A typical PC (or Mac?) keyboard would have more keys than the ones on the C64, but also missing a few of the C64 special keys. Here is a mapping of the most important keys on a english keyboard:

PC Key          C64 Key         PC Key          C64  Key
Left Control    Commodore       [               @
Tab             CTRL (Control)  ]               *
Esc             Run-Stop        ;               :
~ (top-left)    Arrow left      '               ;
-               +               Insert          £
=               -               End             Arrow up              

Joystick emulation (joystick 1 or 2):

Up:    Numpad 8 or arrow up
Down:  Numpad 5,2 or arrow down
Left:  Numpad 4 or arrow left
Right: Numpad 6 or arrow right
Fire:  Numpad 0 or shift

Other important key kombinations

control-f12           - toggle fullscreen mode (from 1.0 beta3)
control-alt-backspace - resets the emulator
control-w             - toggle fullspeed mode


Installing/deploying JaC64[Bearbeiten | Quelltext bearbeiten]

If you want to use JaC64 on your own website you need to have the c64.jar and a folder called "roms" with the rom files for the C64 for the applet to work. (This is included in the zip file). Then you need to add the applet specification. An example below:

<object
  classid='clsid:8AD9C840-044E-11D1-B3E9-00805F499D93'
  codebase='http://java.sun.com/products/plugin/autodl/jinstall-1_4_1-windows-i586.cab#Version=1,4,1,0'
  width='384' height='270' id='c64'>
  <param name=code value='C64Applet'>
  <param name=archive value='c64.jar'>
  <param name=codebase value='/c64/'>
  <param name='doubleScreen' value='0'>

  <param name=type value='application/x-java-applet;version=1.4.1'>
  <param name='scriptable' value='true'>

 <COMMENT>
   <embed
      type='application/x-java-applet;version=1.4.1'
      name='c64'
      code='C64Applet'
      codebase='/c64/'
      archive='c64.jar'
      width='384'
      height='270'
      doubleScreen='0'
      autostartPGM='games/ARKANOID.PRG'
      scriptable='true'
      pluginspage='http://java.sun.com/products/plugin/index.html#download'
      alt='Your browser understands the <EMBED> tag but is not running the Java Applet, for some reason.'>
      <noembed>
     Your browser is completely ignoring the Java Applet!
      </noembed>
   </embed>
 </COMMENT>
</object>

This example autostarts the game Arkanoid in the file ARKANOID.PRG (in the folder /c64/games/). No double screen mode and applet size is 384x270.


Applet Parameters[Bearbeiten | Quelltext bearbeiten]

Parameter         Value           Description
Name              *=default
doubleScreen      0*/1            double the size of the generated C64 screen 
autostartDisk     string          URL to the disk or tapefile (.d64/.t64) to load from 
autostartPGM      string          1 name of the file on disk/tape given with disk, or
                                  2 URL to file (.prg file) to load directly 
autostartProgram  string/int      same as above, except that it also can be used for starting a game in the games.txt file 
                                  (by giving its index). If giving "random" as name, this will load a random program from 
                                  the games.txt file
colorset          0*/1/2/3        different colorsets, 0 - default old JaC64 colors, 1/2/3 - other more c64 near colorsets.
joystick          0*/1            select joystick 
soundOn           0/1*            sound on if 1, off if 0.


Javascript calls[Bearbeiten | Quelltext bearbeiten]

There are a lot of useful Java methods that can be called from Javascript to script the applet. Some of the most important are:

Method                     Description    
reset()                    resets the emulator
setSoundOn(true/false)     controls if sound should be on or off
setStick(0/1)              controls if stick 1 or 2 should be emulated
loadPGM(Filename)          loads a program file directly
loadPGM(Disk, Filename)    loads a program file from a specified disk

Typical usage is to add a link with a javascript call on, an example (where the applet is called c64):

<a href=javascript:document.c64.reset()>Reset</a>


<< zurück zu JaC64