X64(N) DEMOS X64(N) NAME x64,c1541 - Commodore 64 Emulator And Program Development System for X display SYNOPSIS x64 [-A] [-a] [-g] [-h] [-t] [-v] [-f _d_i_s_k] [-l _f_i_l_e_n_a_m_e] [-p _p_a_t_h] [-e _e_x_r_o_m_f_i_l_e] [-m _n] [-R [_r_e_v_i_s_i_o_n]] [-r [_r_e_u_- _f_i_l_e]] [_m_e_m_o_r_y__a_d_d_r_e_s_s] c1541 _o_p_t_i_o_n _d_i_s_k_n_a_m_e [_p_a_r_a_m_e_t_e_r_s] DESCRIPTION _X_6_4 is a powerful Commodore 64 emulator with a Machine Language Monitor built-in. For the best possible compati- bility _X_6_4 emulates the hardware so that the original basic and kernel routines can be used. Also cartridge support and disk drive are included. Thus, _X_6_4 is capable to run most of the normal C64 programs which do not require other peri- pherals nor high speed computing like sound and rasterline effects. OPTIONS -A causes _X_6_4 to store automatically ram to file "ram" for later use when exiting the emulator. -a starts the monitor upon initialization. -e _e_x_r_o_m specify the file to be loaded to cartridge ROM slot with -m option. As default the name is "exrom". -f _d_i_s_k attaches specified file containing floppy disk image. -g select debug mode. toggle default number base to 10 or 16. Default is hexadecimal. -l _c_6_4__p_r_o_g_r_a_m__n_a_m_e load a program into ram. There has to be the start address included in the beginning of the program. -m _n select the memory area where the _e_x_r_o_m module is located: 1 = 8000-9FFF 2 = A000-BFFF 3 = 8000-BFFF -p _p_a_t_h set directory path for project directory. -R [_r_e_v_i_s_i_o_n] If installed in compilation, changes loaded Kernal X Version 11 Last change: 19 Jan 1994 1 X64(N) DEMOS X64(N) code so hat you can use whichever _r_e_v_i_s_i_o_n you select. -r [_r_e_u_f_i_l_e] If installed in compilation, activates the RAM Expansion Unit and specifies the filename for RAM image of the REU. Existing file is loaded to memory upon startup. The default filename is "reu". -v select verbose mode. _a_d_d_r_e_s_s address of the power-up initialization routine. The default is RESET (FCE2). With a BASIC program being loaded, better result may be achieved by using the BASIC warm start vector (FE66) instead. This must be the last argument on the command line. USAGE Keyboard Layout The following keys have special meaning for _X_6_4: F1 F2 F3 F4 F5 F6 F7 F8 The C64 function keys asciicircum or asciitilde up arrow (on US and scandinavian keyboards respectively). underscore right arrow bar Pound Sign Backspace Inst Linefeed Shifted Return Control_L Control Alt_L CBM Key (Press down Left Shift and then Alt to change character set.) Escape STOP Tab Restore Shift_R The Right Shift key can be used to achieve characters shifted on the actual keyboard but unshifted on the C64 one. Joystick Currently joystick #1 can be found on the keys Up, Down, Left and Right of the Numerical Keypad while Enter is the X Version 11 Last change: 19 Jan 1994 2 X64(N) DEMOS X64(N) Fire Button. That works when pointer is in control window. In main window these keys works as normal cursor keys. Mouse The left mouse button while focus is in control window may be used to toggle on and off _d_e_b_u_g _m_o_d_e. A press of the middle button halts the emulator and starts the _M_o_n_i_t_o_r. The right mouse button will open and close a _c_o_n_t_r_o_l _w_i_n_d_o_w, which contains some useful gadgets as well as some debug information. Control Window Trace causes _x_6_4 to update assembly window each time a new intruction is to be run. Stop enforces the C64 emulator to halt. Exit This gadget, of course, quits the program. Two additional functions are available while emulator is halted. Cont resumes the emulator. Step CPU performs the next consecutive machine language instruction. The upper left part of the control window displays the 6510 registers with their current content. The right side of the control window displays the part of program the CPU is executing. In the lower left corner are gadgets for controling the emu- lator. MONITOR The _M_o_n_i_t_o_r has command line editor and history utility con- trolled by the cursor keys. The following monitor commands are implemented: #%&$ Base conversion prefixes > _a_d_d_r _b_y_t_e_s|'_s_t_r_i_n_g' Write data into memory. : _a_d_d_r _b_y_t_e_s|'_s_t_r_i_n_g' Write image data (e.g. sprites) into memory. The values are represented by sequense of '-' and '*' for '0' and '1' respectively. (code is not complete) ; [_r_e_g_i_s_t_e_r_s] Same as 'registers' ? [_t_o_p_i_c] X Version 11 Last change: 19 Jan 1994 3 X64(N) DEMOS X64(N) Help asm [_a_d_d_r] Enters to line interpreter. Use `.' or `x' to return command mode. The following syntax is used: [_a_d_d_r] _m_n_e_m_o_n_i_c [_o_p_e_r_a_n_d] break [_s_t_a_r_t] [_e_n_d] Set up breakpoints (region). New timer code only. call [_a_d_d_r] Run code at address specified. clear _s_t_a_r_t [_e_n_d] Clear breakpoints in specified region. New timer code only. compare _s_t_a_r_t _e_n_d|+_l_e_n _t_a_r_g_e_t disassemble [_a_d_d_r] [_e_n_d|+_l_e_n] dump [_f_i_l_e_n_a_m_e] Save ram image to a file. fill _s_t_a_r_t _e_n_d|+_l_e_n _b_y_t_e_s|'_s_t_r_i_n_g' floppy [_i_m_a_g_e_n_a_m_e] Attach floppy disk image file _i_m_a_g_e_n_a_m_e for use. help [_t_o_p_i_c] hunt _s_t_a_r_t _e_n_d|+_l_e_n _b_y_t_e_s|'_s_t_r_i_n_g' image [_a_d_d_r] [_e_n_d|+_l_e_n] Displays memory dump in bit format. jump [_a_d_d_r] Run code at address specified. load _f_i_l_e_n_a_m_e [_a_d_d_r] Load program into memory emulating Kernal load rou- tine. memory [_a_d_d_r] [_e_n_d|+_l_e_n] Displays memory dump in hex format. registers [_r_e_g_i_s_t_e_r_s] Show or change the 6510 registers (PC AC AX YR PF SP). save _f_i_l_e_n_a_m_e _a_d_d_r _e_n_d|+_l_e_n X Version 11 Last change: 19 Jan 1994 4 X64(N) DEMOS X64(N) Saves memory area. time [_a_d_d_r] calls _a_d_d_r and displays the amount of 6502 time used until a _B_R_K instruction is encountered. Without parameters the previous time is displayed. transfer _s_t_a_r_t _e_n_d|+_l_e_n _d_e_s_t Moves a memory area. undump [_f_i_l_e_n_a_m_e] Loads ram image from a file. x Exits the Monitor. I.e. returns to emulator. quit Exits the _x_6_4 Note: All commands may be abbreviated. DISK DRIVE _X_6_4 offers you also disk drive emulator which can also be compiled as a separate program. The 1541 emulation uses now binary files of length 170kb as floppy disks. Currently, PRG and SEQ file types as well as block operations are sup- ported. To create such a disk use separate command _c_1_5_4_1 c1541 _o_p_t_i_o_n _d_i_s_k_n_a_m_e _p_a_r_a_m_e_t_e_r_s The following commands are supported on c1541: c1541 -f _d_i_s_k_n_a_m_e name,id Format _d_i_s_k_n_a_m_e. Creates the file if needed. c1541 -d _d_i_s_k_n_a_m_e files Delete files from _d_i_s_k_n_a_m_e c1541 -l _d_i_s_k_n_a_m_e List files on _d_i_s_k_n_a_m_e c1541 -c _d_i_s_k_n_a_m_e _d_u_m_p Make disk _d_i_s_k_n_a_m_e out of raw blockdump (683 blocks 256 bytes each). c1541 -v _d_i_s_k_n_a_m_e Validate disk c1541 -i _d_i_s_k_n_a_m_e Show _d_i_s_k_n_a_m_e and 1541 version. c1541 -r _d_i_s_k_n_a_m_e 1541name fsname X Version 11 Last change: 19 Jan 1994 5 X64(N) DEMOS X64(N) Read 1541name on _d_i_s_k_n_a_m_e to file fsname c1541 -w _d_i_s_k_n_a_m_e _f_s_n_a_m_e _1_5_4_1_n_a_m_e Write file _f_s_n_a_m_e to _d_i_s_k_n_a_m_e. Examples First, a disk image has to be formatted in file, say test.dsk: c1541 -f test.dsk 'DISKI,ID' to move programs to it one may type e.g.: c1541 -w test.dsk pieces_of_light PIECESOFLIGHT Finally, start emulator with option: x64 -f test.dsk or use the monitor command floppy test.dsk After that you can load programs in emulator with simple LOAD $ ,8 LOAD PIECESOFLIGHT ,8 etc. FILES basic C64 BASIC ROM Routines kernel C64 KERNEL ROM Routines ram Completed execution RAM Image exrom Cartridge ROM Image reu RAM Expansion Image The REU size can be defined at compilation time to 128, 256 or 512 KB. inst Debug information about executed program. SEE ALSO sed(1), tr(1), vi(1), X(1), _X _T_o_o_l_k_i_t _d_o_c_u_m_e_n_t_a_t_i_o_n, ASCII(7) BUGS Since this program is under development bugs are included for free. Please send your patches and bug fixes to sonninen@lut.fi or jopi@stekt.oulu.fi. RESTRICTIONS C64 basic and kernel are copyrighted to commodore, and thus not included in the emulator. You have to grab your own copy of them. To prevent fatal shock hazard do not disassemble nor hexdump this program. No user crackable routines inside. X Version 11 Last change: 19 Jan 1994 6 X64(N) DEMOS X64(N) COPYRIGHT Copyright (c) 1993 Jarkko Sonninen, Teemu Rantanen and Jouko Valta. Command line history editor "ed.c" Copyright (c) 1993 Jarkko Sonninen (sonninen@lut.fi). All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later ver- sion. AUTHORS Jarkko Sonninen (sonninen@lut.fi) Jouko Valta (jopi@stekt.oulu.fi) Teemu Rantanen (tvr@cs.hut.fi) THANKS TO Vesa-Matti Puro (vmp@lut.fi) Hannu Helminen (dm@stekt.oulu.fi) Richard Hable (Richard.Hable@jk.uni-linz.ac.at) Frank Prindle (Frank.Prindle@lambada.oit.unc.edu) Peter Weighill (stuce@csv.warwick.ac.uk) Marko Makela (msmamela@hylk.helsinki.fi) Dan Miner (dminer@nyx.cs.du.edu) X Version 11 Last change: 19 Jan 1994 7