CyberpunX Replay Manual v3.99: Difference between revisions
Count Zero (talk | contribs) No edit summary |
Count Zero (talk | contribs) No edit summary |
||
(32 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
{{ReplayResources:RoadWorks}} | {{ReplayResources:RoadWorks}} | ||
'''IGNORE - this is for an upcoming release *g*''' | '''IGNORE - this is for an upcoming release *g*''' | ||
'''WARNING! Toying with SD2IEC and alike will easily reveal that a kernal SAVE fallback is (naturally) saving ROM content :)''' | |||
__TOC__ | __TOC__ | ||
Line 15: | Line 17: | ||
The '''''CyberpunX Replay''''' is based on resources by Count Zero of the ''Action Replay MK5'' ROM. A [[CyberpunX_Replay_Changelog|Changelog]] is available and points out future plans. | The '''''CyberpunX Replay''''' is based on resources by Count Zero of the ''Action Replay MK5'' ROM. A [[CyberpunX_Replay_Changelog|Changelog]] is available and points out future plans. | ||
=Thanks '''AND''' Credits= | =Thanks '''AND''' Credits= | ||
Line 30: | Line 33: | ||
* many more | * many more | ||
* and all other cart lovers | * and all other cart lovers | ||
=Startup Menu= | =Startup Menu= | ||
Line 176: | Line 180: | ||
such as the CURSOR keys, INSERT, DELETE, etc., plus some extra ones: | such as the CURSOR keys, INSERT, DELETE, etc., plus some extra ones: | ||
R/S exits the | R/S exits the editor | ||
CTRL-I inserts a line | CTRL-I inserts a line | ||
CTRL-D deletes a line | CTRL-D deletes a line | ||
F3 | F3/F4 changes the border colour | ||
F5 | F5/F6 changes the background colour. | ||
F7 Toggles the Position Display On and Off | F7 Toggles the Position Display On and Off | ||
Return and Shift-Return act normal now. No more screen scrolling on them as well. | Return and Shift-Return act normal now. No more screen scrolling on them as well. | ||
You can change the text colour in the normal way - hold down the CTRL or CBM key and press keys 1-8 | You can change the text colour in the normal way - hold down the CTRL or CBM key and press keys 1-8. | ||
The editor works with text based screens only - you cannot get useful results on a bitmapped screen. Also, if the frozen program uses a different character set, the display characters may not | The editor works with text based screens only - you cannot get useful results on a bitmapped screen. Also, if the frozen program uses a different character set, the display characters may not correspond with those printed on the keyboard, so a little experimentation may be necessary - try pressing SHIFT and CBM together to change characters. | ||
correspond with those printed on the keyboard, so a little experimentation may be necessary - try pressing SHIFT and CBM together to change characters | |||
Text searching is more easily achieved via the monitor. Enter the monitor and type I (RETURN). This displays memory in the form of screen codes. You can scan through the whole of the memory looking for text strings - to change any text simply type over it and RETURN. Make sure you don't type over non-text areas. | Text searching is more easily achieved via the monitor. Enter the monitor and type I (RETURN). This displays memory in the form of screen codes. You can scan through the whole of the memory looking for text strings - to change any text simply type over it and RETURN. Make sure you don't type over non-text areas. | ||
You can also display ASCII codes by typing J (RETURN). Type X to leave the monitor. Refer to [[#MACHINE CODE MONITOR|MACHINE CODE MONITOR]] for more details. | You can also display ASCII codes by typing J (RETURN). Type X to leave the monitor. Refer to [[#MACHINE CODE MONITOR|MACHINE CODE MONITOR]] for more details. | ||
=Pokes & Parameters= | =Pokes & Parameters= | ||
Line 315: | Line 315: | ||
=Fastload and BASIC= | |||
FASTLOAD is the turbo and utilities function of CyberpunX Replay. Operating in the BASIC environment, numerous extra commands and facilities are available. To install, select INSTALL FASTLOAD from the | FASTLOAD is the turbo and utilities function of CyberpunX Replay. Operating in the BASIC environment, numerous extra commands and facilities are available. To install, select INSTALL FASTLOAD from the | ||
Startup Menu, or hold down the CBM key when you power up or press the Reset Button. | Startup Menu, or hold down the CBM key when you power up or press the Reset Button. | ||
changelog entry: | |||
* Compatiblity fixes for '''SD2IEC''' devices | |||
** /$ %$ and other load commands were changed on Beta 2 introducing an incompatibilty with these newish devices. Reverted to e.g. fix that infamous ''filebrowser'' (fb64.prg) | |||
** '''JiffyDOS''' is used for LOAD/VERIFY, Directory, Change Device as fall back for IEC-Devices supporting it - FROM CART ROM - '''''No C64/C128 Jiffy Kernal required!''''' | |||
There is of course more to come, e.g. SAVE, ahem :) - AND all the @-commands need testing. Esp. SCRATCH is prone to crash but ALL need to be tested put on a table, compared ... | |||
NEEDS to be worth it for the sheer amount of space this code eats! | |||
On normal detection of a drive the standard track loader using the Replay RAM will be used (or the "slow loader" whenever "@K-" was used to enable it.) | |||
Failed detection should lead to JiffyDOS fall back which also allows ''loading under I/O and kernal'' from SD2IEC/UIEC and such. | |||
==Disk Turbo== | ==Disk Turbo== | ||
Line 325: | Line 334: | ||
The CyberpunX Replay disk turbo uses standard GCR format, so it works with all your existing programs without special conversion. It will load a 202 block program in around 9 seconds and works with all drives from the 1541 upwards (including the 1581 and the 1571 in two-sided mode). | The CyberpunX Replay disk turbo uses standard GCR format, so it works with all your existing programs without special conversion. It will load a 202 block program in around 9 seconds and works with all drives from the 1541 upwards (including the 1581 and the 1571 in two-sided mode). | ||
With the advent of SD2IEC, 1541U sd-card-DOS and other devices usually having a ''file browser'' coming with it we changed a few things and ''added'' '''JiffyDOS''' support to the cartridge routines which do '''not require a C64 Kernal change'''. | |||
Some other standard routines were changed to the Jiffy replacements speeding up directory display or change device handling - '''REPORT PROBLEMS!''' :) | |||
''' | The Disk Turbo can be switched out with the command '''OFF''' completely. Load and Save will then operate using the standard Kernal calls. Type '''ON''' to re-enable the Disk Turbo. | ||
The ''Disk Turbo'' now has '''three'' modes which can be switched off and on with the commands @K-, @KJ and @K+. | |||
@KJ switches the turbo mode to JiffyDOS compatible cartridge routines to support JD enabled devices | |||
@K- switches the turbo mode to the "freeze loader" which supports most 5.25" and 3.5" drives (NOT IEC emulators such as SD2IEC though) | |||
@K+ re-enables the Replay RAM supported GCR trackloader again | |||
All loaders will load under IO and kernal. The JiffyDOS mode has the same "advantages" over the trackloader as the "freeze mode loader": | |||
a) The Replay RAM is kept so previously loaded freezer extensions stay in RAM ('CyberpunX Replay' always keeps the extension RAM). | |||
b) Programs can sometimes be loaded from bad disks using this mode. | |||
c) PAL/NTSC compatibility. | |||
The "freeze mode loader" is faster than the JD routines, so keeping them for the moment. Especially since not everybody can switch to a JiffyDOS drive rom. :) | |||
Standard GCR track loader was changed to load ''splatfiles'' as well. Shown as *PRG in directories. Also USR files are handled like DEL now to skip directory art. | |||
'''Note''': 40 tracks formatting and saving is not supported but nothing loading off track 36-40 is fine whenever using the track loader and a standard drive ROM. (JiffyDOS drive roms fail). | |||
'''NOTE''': Some commercial programs may override the Disk Turbo - see Turbolinker(link) | |||
''Ninja/The Dreams reported functionality of the Disk Turbo on FD drives as well. Also CMD HD devices shouldn't cause major trouble. The saver doesn't work for FD drives though (TEST ME!).'' | |||
'''*FIXME*''' document behaviour better - re-test freezer loader handling | |||
==WARP*25 Disk Turbo== | ==WARP*25 Disk Turbo== | ||
Line 349: | Line 380: | ||
==Single Stroke Commands== | ==Single Stroke Commands== | ||
A number of single stroke commands are available from Fastload: | A number of single stroke commands are available from Fastload: | ||
===FUNCTION KEYS=== | |||
F1 LOAD the first file on the disk to its' absolute address and run it if it's at basic start. (LOAD "0:*",8,1) | F1 LOAD the first file on the disk to its' absolute address and run it if it's at basic start. (LOAD "0:*",8,1) | ||
F2 LOAD the first file on the disk to the Basic program area without running it. (LOAD "0:*",8) | F2 LOAD the first file on the disk to the Basic program area without running it. (LOAD "0:*",8) | ||
F3 Display disk directory without corrupting memory | F3 Display disk directory without corrupting memory | ||
F4 Toggle available drives | F4 Toggle available drives | ||
F5 LIST | F5 LIST | ||
F6 Freeze Menu | F6 Freeze Menu | ||
Line 363: | Line 395: | ||
F8 MON [[#MACHINE CODE MONITOR|See here]] | F8 MON [[#MACHINE CODE MONITOR|See here]] | ||
''There have been some | ''There have been some complaints about this F-key setup, but this is the '''original Action Replay V5''' setup. Future versions may allow configuration. We'll see.'' | ||
'''Note:''' | '''Note:''' | ||
''For drive toggle, | ''For drive toggle, a Jiffydos compatible routine will search for the next available drive on the bus. Tested in monitor and freezemode. Be careful on a busy drive chain when IRQ or fast loaders keep the serial bus for themselves. JiffyDOS supplies drive checking up to drive #30, and so do we. (Bug reports welcome.)'' | ||
===EASY LOAD/SAVE COMMANDS=== | |||
/PROGNAME equals to LOAD "PROGNAME",8,1 | /PROGNAME equals to LOAD "PROGNAME",8,1 | ||
Line 378: | Line 409: | ||
{POUND_SIGN}PROGNAME equals to SAVE "PROGNAME",8 | {POUND_SIGN}PROGNAME equals to SAVE "PROGNAME",8 | ||
Loading with these commands will only set the BASIC end pointers if the program loads to the start of Basic ($0801). Also, the Filename does not corrupt the Basic String area ($9FF0-$9FFF usually). Very long files can be saved with the {POUND_SIGN} command where the normal | Loading with these commands will only set the BASIC end pointers if the program loads to the start of Basic ($0801). Also, the Filename does not corrupt the Basic String area ($9FF0-$9FFF usually). Very long files can be saved with the {POUND_SIGN} command where the normal SAVE command would give an ''?OUT OF MEMORY ERROR''. | ||
LOADING FROM THE DIRECTORY | LOADING FROM THE DIRECTORY | ||
Line 384: | Line 415: | ||
If you display the directory and then move the cursor onto a line containing an entry, you can load that program simply by pressing '''F1''' to load and run or '''F2''' to load without running. This is the most convenient way of loading a program. | If you display the directory and then move the cursor onto a line containing an entry, you can load that program simply by pressing '''F1''' to load and run or '''F2''' to load without running. This is the most convenient way of loading a program. | ||
===ACCESSING THE ERROR CHANNEL=== | |||
Instead of using OPEN 15,8,15 "COMMANDSTRING":CLOSE 15, you may use the '''@''' key to send disk commands and read the error channel: | |||
@ - reads the error channel of the current device. | @ - reads the error channel of the current device. | ||
Line 410: | Line 440: | ||
NOTE: @s:name1,name2,name3,names* works to scratch several files at once. | NOTE: @s:name1,name2,name3,names* works to scratch several files at once. | ||
@K-, @KJ and @K+ control the fastload-mode as already explained at [[#Disk Turbo]]. | |||
@ | @=8 to @=30 will change the current device to the given device number (''Softwire drives''). | ||
a | ''This is a sort of drive toggle, like some old copy programs provide it. Use the logical turn-off/on drive sequence to avoid device number collisions. This command should work fine with 1541 and 1581 drives, as the required Zeropage adresses on the drive memory are used the same way. I am not sure about FD drives, as I found no documentation about them so far.'' It '''WILL''' fail with e.g. SD2IEC devices. | ||
Hints: | Hints: | ||
If you use a two drive system, the second drive can be accessed by reading its error channel, e.g. @9. | * If you use a two drive system, the second drive can be accessed by reading its error channel, e.g. @9. Subsequent single stroke commands will be directed to device 9. | ||
Subsequent single stroke commands will be directed to device 9. If a filename contains leading or trailing | * If a filename contains leading or trailing spaces, it should be enclosed in quotes, e.g. ''" PROGNAME"''. | ||
spaces, it should be enclosed in quotes, e.g. " PROGNAME". | |||
You may also use: @(device)(command) to change to the device and immediately execute the command (e.g. @8$ or @9N:TEST,ID). | |||
Consult your disk drive manual for further information about the error channel. | Consult your disk drive manual for further information about the error channel. | ||
Line 441: | Line 458: | ||
'''ARE YOU SURE?''' has been removed - so be careful again on scratch and format. | '''ARE YOU SURE?''' has been removed - so be careful again on scratch and format. | ||
==SWAP Screen== | ==SWAP Screen== | ||
''' | Pressing '''CBM''' and '''F1''' together allows you to switch between different copies of the normal screen area ($0400-$0800). | ||
normal screen area ($0400-$0800). | |||
Our main intention was to save some output of e.g. the monitor to another screen to not always have to re-search the memory or keep adresses in mind for examining routines. You may find different usages for this option though. :) | Our main intention was to save some output of e.g. the monitor to another screen to not always have to re-search the memory or keep adresses in mind for examining routines. You may find different usages for this option though. :) | ||
These areas are kept untouched (as far as possible) and may even serve you as a reset-proof ramdisk. | These areas are kept untouched (as far as possible) and may even serve you as a reset-proof ramdisk. | ||
==Extended Basic Commands== | |||
A number of extra basic commands are provided, which operate in direct mode. The commands may be abbreviated by typing just the first three characters. | |||
===Hex (''$''), binary (''%'') and octal (''&'')=== | |||
numbers can be included in basic expressions now, e.g. ''SYS 49152'' could be entered as ''SYS $C000''. | |||
=== ''MONITOR'' === | |||
or '''MON''' will start the [[#MACHINE CODE MONITOR|machine code monitor]]. | |||
=== ''APPEND'' === | |||
or '''APP''' differs from ''MERGE'' in that the new program is tagged onto the end of the previous one. It also occurs at turbo speed, e.g.: | |||
APP "PROGNAME",8 | |||
loads the program starting at the end of the previous one. For APPEND to be useful, the program to be appended should have line numbers greater than the existing program. | |||
=== ''AUTO'' === | |||
or '''AUT''' provides automatic line numbering as you type in a program, e.g.: | |||
AUTO 1000,10 | |||
starts automatic line numbering at line 1000 and increments in steps of 10. To turn AUTO off, press RETURN against a blank line. If you subsequently want to continue automatic numbering type AUTO | |||
on its own and numbering will continue from the last line number which was automatically displayed. | |||
=== ''BACKUP'' === | |||
or '''BAC''' will start the [[#WHOLE DISK BACKUP|Whole Disk Backup]] | |||
=== ''BOOT'' === | |||
will load a machine code file and jump to the first address loaded. E.G. You have a program which you would normally load with | |||
LOAD "PROGNAME",8,1 | |||
followed by a SYS number. BOOT will perform the same function . NOTE that BOOT will only work when the program is started by SYSing to the first address loaded. Syntax: | |||
BOOT "PROGNAME",8. | |||
=== ''COPY'' === | |||
or '''COP''' will start the [[#DISK FILECOPIER|Disk Filecopier]]. | |||
=== ''DELETE'' === | |||
or '''DEL''' will delete a block of program lines. Syntax is like LIST except that the first line to be deleted must be specified e.g. DEL 1000-2000 will delete lines 1000 to 2000 inclusive. DEL 1000- will delete from line 1000 to the end of the program. | |||
=== ''FIND'' === | |||
or '''FIN''' will perform a search on the basic program currently in ram and when a line contains matches to the given string, it'll be returned as result. | |||
Examples: FIND REM | Examples: FIND REM | ||
FIND 20 | FIND 20 | ||
Line 500: | Line 520: | ||
=== ''LINESAVE'' === | |||
or '''LIN''' will save to disk a section of a basic program e.g.: | |||
LIN "PROGNAME",8,1000-2000 | |||
will save program lines from 1000 to 2000 inclusive. Lines saved in this way may be loaded back as separate basic programs, or MERGEd into other programs. | |||
=== ''LIST'' === | |||
basic command output was patched to properly display control characters and allow breaking simple LIST protections. (E.g. ''REM SHIFT+L'' breaks the original BASIC V2 listing output) | |||
=== ''MERGE'' === | |||
or '''MER''' loads a basic program from disk and combines it with a program in memory if two lines have the same number, the new line replaces the existing line. A program may also be merged with new line numbers e.g.: | |||
MERGE "PROGNAME",8 | |||
merges a program with the program in memory. | |||
MERGE "PROGNAME",8,1000,10 | |||
will renumber the lines before they are merged, starting with line 1000 and incrementing in steps of 10 GOTO & GOSUB statements will NOT be renumbered. Merging into a long program is a lengthy process, so be patient. | |||
=== ''OFF'' / ''ON'' === | |||
switches the disk turbo routines off and on. | |||
=== ''OLD'' === | |||
will recover a basic program which has just been NEWed. | |||
=== ''PLIST'' / ''SLIST'' === | |||
will list a basic program directly from disk to a CBM printer (device 4) or the screen without overwriting the program in memory. Syntax: | |||
PLIST"PROGNAME",8 | |||
SLIST"PROGNAME",8 | |||
This command can also be used to print the directory using | |||
PLIST"$",8 | |||
''PLIST''/''SLIST'' won't work with machine code and sequential files. | |||
=== ''ZAP'' === | |||
will reset the computer and disable the cartridge, just like ''Reset'' and holding the CTRL Key. | |||
Locations $0000-$07ff will be corrupted but $0800 - $0803 is restored to enable running of machine language programs with a SYS header. (Those infamous '''KILL CARTRIDGE''' things can be tried by loading with turbo speed, '''ZAP''' and then '''RUN''' - give it a try!). Basic programs won't have the pointers set correctly though. | |||
''' | === ''TASS'' === | ||
or '''TAS''' simply copies a version of Turbo Assembler Macro (REU or non-REU depending on used ROM) to RAM $8000-$ce00 and starts it. | |||
==Centronics Printer Interface== | ==Centronics Printer Interface== | ||
(FIXME) | |||
''CyberpunX Replay'' can drive a Centronics printer connected to the parallel port. If a parallel device is connected and | ''CyberpunX Replay'' can drive a Centronics printer connected to the parallel port. If a parallel device is connected and | ||
Line 596: | Line 623: | ||
''Hope all of these printer commands still work. Someone test and let me know!'' | ''Hope all of these printer commands still work. Someone test and let me know!'' | ||
The CENTRONICS interface emulates channel 4 & 5 serial | |||
printers. If you have both serial & centronics printers the | |||
first has higher priority (use ONLINE on printer if necessary). | |||
Without secondary addr your printer emulates MPS801 characters, | |||
but with secondary address 9 on CENTRONICS native(raw) chars will be | |||
printed. | |||
---- | ---- | ||
Line 601: | Line 635: | ||
=Machine Code Monitor= | =Machine Code Monitor= | ||
''CyberpunX Replay'' includes a powerful extended Machine Code Monitor. To call the Monitor from Fastload, | ''CyberpunX Replay'' includes a powerful extended Machine Code Monitor. To call the Monitor from Fastload, enter '''MON''' or press '''F8'''. The Monitor is also available from the Freeze Menu. In this mode all of the memory including the screen, stack and zero page may be examined in its condition at the point at which the program was frozen. | ||
enter '''MON''' or press '''F8'''. The Monitor is also available from the Freeze Menu. In this mode all of the memory | |||
including the screen, stack and zero page may be examined in its condition at the point at which the program | |||
was frozen. | |||
All 64K of memory remains unaffected by the Freeze Monitor. Any alterations made will be incorporated | All 64K of memory remains unaffected by the Freeze Monitor. Any alterations made will be incorporated into the program when it is restarted or saved. A working knowledge of 6502 assembly language and Hex notation is required by the user, if the Monitor is to be used effectively. Some of the Monitor instructions can cause the system to crash if the user is not fully aware of what is going on. | ||
into the program when it is restarted or saved. A working knowledge of 6502 assembly language and Hex | |||
notation is required by the user, if the Monitor is to be used effectively. Some of the Monitor instructions | |||
can cause the system to crash if the user is not fully aware of what is going on. | |||
==Command Summary== | ==Command Summary== | ||
A - Assemble | A - Assemble | ||
B - Execute a Basic command | B - Execute a Basic command | ||
C - Compare memory | C - Compare memory | ||
D - Disassemble | D - Disassemble | ||
F - Fill memory | F - Fill memory | ||
G - Go. Execute program as per register display | G - Go. Execute program as per register display | ||
H - Hunt for byte/text-sequence | H - Hunt for byte/text-sequence | ||
IO - Displays I/O registers (freeze mode only) | IO - Displays I/O registers (freeze mode only) | ||
I - Interpret memory as CBM codes | I - Interpret memory as CBM codes | ||
I* - Interpret memory as CBM codes | I* - Interpret memory as CBM codes | ||
J - Interpret memory as ASCII codes. Former I function | J - Interpret memory as ASCII codes. Former I function | ||
L - Load | L - Load | ||
M - Display memory in Hex | M - Display memory in Hex | ||
N - Number conversion | N - Number conversion | ||
P - (prefix). Direct output to the printer (device 4) | P - (prefix). Direct output to the printer (device 4) | ||
R - Display registers at entry or freeze time | R - Display registers at entry or freeze time | ||
S - Save | S - Save | ||
T - Transfer memory | T - Transfer memory | ||
U - User function | U - User function | ||
V - Verify | V - Verify | ||
W - Watch Freeze/BreakPoints | W - Watch Freeze/BreakPoints | ||
X - Exit to Basic or Freeze Menu | X - Exit to Basic or Freeze Menu | ||
* - Toggle RAM/ROM modes | * - Toggle RAM/ROM modes | ||
@ - Read error channel or send disk command | @ - Read error channel or send disk command | ||
@(dev) - Changes device and display status | @(dev) - Changes device and display status | ||
@#(dev)- Only changes device | @#(dev)- Only changes device | ||
$ - Display directory | $ - Display directory | ||
Special disk related commands only available in MON: | Special disk related commands only available in MON: | ||
@*8 - Access drive memory (device 8) | @*8 - Access drive memory (device 8) | ||
@*9 - Access drive memory (device 9) | @*9 - Access drive memory (device 9) | ||
@* - Return access to computer memory | @* - Return access to computer memory | ||
@ME - Execute memory in disk drive | @ME - Execute memory in disk drive | ||
@BR - Read a disk sector into computer memory | @BR - Read a disk sector into computer memory | ||
@BW - Write a sector from computer memory to disk | @BW - Write a sector from computer memory to disk | ||
'''Note:''' | '''Note:''' | ||
Whenever using one of the commands to edit memory locations, just go over the line, edit as needed and hit | Whenever using one of the commands to edit memory locations, just go over the line, edit as needed and hit | ||
* '''RETURN''' to accept the changes | * '''RETURN''' to accept the changes | ||
* '''CBM+Return''' accept the changes, keep you in editmode and present the next editable line to you | * '''CBM+Return''' accept the changes, keep you in editmode and present the next editable line to you | ||
* '''SHIFT+RETURN''' leaves editmode without accepting changes | * '''SHIFT+RETURN''' leaves editmode without accepting changes | ||
==Command Description== | ==Command Description== | ||
Line 661: | Line 690: | ||
'''Important Notes:''' | '''Important Notes:''' | ||
When an end address is specified it should be exclusive. | When an end address is specified it should be exclusive. The end address is one byte greater than the last address to be operated on, e.g.: | ||
The end address is one | |||
operated on e.g.: | .S"PROGNAME",8,C000,D000 saves up to but not including D000. | ||
Usually all numbers you enter after a command are interpreted as hex. (An exception are drive numbers which are always decimal). You can also force the commands to deal with decimal numbers by using a leading plus (+) sign though you have to enter the numbers in high/low order and only 0-255 are accepted then. | |||
Examples: M +0+186 - start hexdump at $00ba | |||
I +32+0 - start asciidump at $2000 | |||
A trailing hyphen (-) will scroll the output until you abort it with RUN/STOP or start controlling it using the F-keys. | |||
Examples: M 1000 - - hexdump from $1000 to xxx | |||
I 3000 - - asciidump from $3000 to xxx | |||
=== EXAMINING MEMORY === | |||
A trailing hyphen (-) will scroll the output until you abort it with | |||
the F-keys. | |||
Examples: M 1000 - - hexdump from $1000 to xxx | |||
Memory may be examined in Hex/ASCII, Disassembly, or Interpreted as ASCII or screen codes: | Memory may be examined in Hex/ASCII, Disassembly, or Interpreted as ASCII or screen codes: | ||
.D C000 D000 - disassemble from $C000 to $D000 | .D C000 D000 - disassemble from $C000 to $D000 | ||
.M C000 D000 - display memory from $C000 to $D000 | .M C000 D000 - display memory from $C000 to $D000 | ||
.I C000 D000 - interpret Screen Codes from $C000 to $D000 | .I C000 D000 - interpret Screen Codes from $C000 to $D000 | ||
.D C000 - disassemble one instruction at $C000 | .D C000 - disassemble one instruction at $C000 | ||
.M C000- - display memory from $C000 onwards | .M C000- - display memory from $C000 onwards | ||
.D - disassemble from the current address onwards | .D - disassemble from the current address onwards | ||
.I - interpret Screen Codes from the current address | .I - interpret Screen Codes from the current address | ||
.I* - interpret Screen Codes from the current address | .I* - interpret Screen Codes from the current address | ||
.J - interpret ASCII from the current address | .J - interpret ASCII from the current address | ||
'''J''' acts as former plain '''I''' now and displays memory in ASCII format. | |||
The display can be controlled in two ways: | The display can be controlled in two ways: | ||
a) Function keys F5 and F7 cause continual scrolling up or down respectively. Set for fast scanning through | a) Function keys F5 and F7 cause continual scrolling up or down respectively. Set for fast scanning through memory. Any other key will stop or start the display. F5 and F7 change the direction of the scroll. STOP or CURSOR DOWN returns to the input prompt. | ||
memory. Any other key will stop or start the display. F5 and F7 change the direction of the scroll. STOP or | |||
CURSOR DOWN returns to the input prompt. | |||
b) Cursor Up and Cursor Down will scroll the display by one line at the top or bottom of the screen and | b) Cursor Up and Cursor Down will scroll the display by one line at the top or bottom of the screen and return to input prompt. Best for editing. Memory may be altered - type over any byte, code or mnemonic and press RETURN. A question mark indicates an error. | ||
return to input prompt. Best for editing. Memory may be altered - type over any byte, code or mnemonic and | |||
press RETURN. A question mark indicates an error. | |||
=== BANK SWITCHING === | |||
On entry, the Monitor is in RAM mode - all | On entry, the Monitor is in RAM mode - all system ROMs are switched out during memory access. To access the ROMs and I/O devices, use the * command, which toggles between modes. | ||
the | |||
In normal Monitor mode this also enables the cart ROM mirroring. I | In normal Monitor mode this also enables the cart ROM mirroring. ''I 8000'' will show you a dump of that area. (Usually bank 1 as that is where the monitor and toolkit routines mainly work.) | ||
area. (Usually bank 1 as that | |||
In FREEZE | In FREEZE Monitor mode this command also enables mirroring of $0000 to $09ff of the Cartridge RAM (!). | ||
$09ff of the Cartridge RAM (!). | |||
Hint to ''abuse'' '''*''' in Freeze Mode: | |||
* ; Switch RAM-ROM ON | |||
@BR (track)(sector) 09 ; Loads a block from disk into the Replay RAM | |||
@BW (track)(sector) 09 ; Saves the modded block, but this way none of the normal RAM gets corrupted and flawlessly restarting the frozen program is possible. | |||
'' | ===''ASSEMBLY''=== | ||
.A C000 LDA #$01 | |||
.A C000 LDA #$01 | Assemble an instruction in standard 6502 mnemonics at $C000. The next memory address will be displayed ready for the next instruction. | ||
Assemble an instruction in standard 6502 mnemonics at $C000. The next memory address will be displayed | |||
ready for the next instruction. | |||
''Before you had to enter the '''$''' all the time to assemble properly: the monitor now assumes Hex all the time.'' | |||
LDA 01 will turn into LDA $01 | LDA 01 will turn into LDA $01 | ||
LDA 1000,X will turn into LDA $1000,X | LDA 1000,X will turn into LDA $1000,X | ||
LDA (FE),Y will turn into LDA ($FE),Y | LDA (FE),Y will turn into LDA ($FE),Y | ||
'' | ===''REGISTER DISPLAY''=== | ||
.R | |||
.R | The program counter, A, X & Y registers, location $01 and the stack pointer are displayed in Hex. The Status register is displayed in Binary. Alter registers by typing over the relevant byte or flag (and hitting return on that line). | ||
The program counter, A, X & Y registers, location $01 and the stack pointer are displayed in Hex. The | |||
Status register is displayed in Binary. Alter registers by typing over the relevant byte or flag (and | |||
'' | ===''FILL MEMORY''=== | ||
.F C000 D000 AA | |||
.F C000 D000 AA | |||
Fill memory from $C000 to $D000 with the byte $AA. | Fill memory from $C000 to $D000 with the byte $AA. | ||
''Now supports pattern fill as well.'' | ''Now supports pattern fill as well.'' | ||
.F C000 D000 "foobar!!!" | .F C000 D000 "foobar!!!" | ||
.F C000 D000 ee 20 d0 | .F C000 D000 ee 20 d0 | ||
'' | ===''HUNT MEMORY''=== | ||
.H C000 D000 01 02 03 | |||
.H C000 D000 01 02 03 | .H C000 D000 "STRING" | ||
.H C000 D000 "STRING" | .H C000 D000 8D 2? d0 | ||
.H C000 D000 8D 2? d0 | .H C000 D000 20 ?? 10 | ||
.H C000 D000 20 ?? 10 | |||
Hunt through memory for a sequence of bytes or an ASCII string. If any occurrence is detected, the address will be displayed. | |||
Hunt through memory for a sequence of bytes or an ASCII string. If any occurrence is detected, the address | |||
will be displayed. | |||
''Wildcard hunt added.'' | ''Wildcard hunt added.'' | ||
Hunt is using a certain priority to search memory. Wildcard hunt as well as ordinary pattern hunt are | Hunt is using a certain priority to search memory. Wildcard hunt as well as ordinary pattern hunt are only performed when no stacking is done. In this example, only the string search will be performed: | ||
only performed when no stacking is done. In this example, only the string search will be performed: | |||
H C000 D000 01 02 03 "TEST" | H C000 D000 01 02 03 "TEST" | ||
In general, command stacking only works on a few locations, so it's a good idea to avoid it. Only on the disk command Scratch, filename stacking is a good idea sometimes. | |||
'' | ===''COMPARE''=== | ||
.C C000 D000 E000 | |||
Compare the area of memory from $C000 to $D000 with memory starting at $E000. If there is any discrepancy, the memory locations will be displayed together with the bytes at those locations. ''With optimized and colored output now.'' | |||
===''TRANSFER MEMORY''=== | |||
.T C000 D000 E000 | |||
Move memory from $C000 to $D000 to the memory starting at $E000. This is an intelligent transfer - memory areas may overlap and may be moved either up or down in memory. | |||
$ | |||
''' | ===''GO''=== | ||
.G C000 | |||
. | |||
Load registers as per the register display and start executing the machine code program starting at $C000. The program may end with either a BRK or an RTS instruction. A plain ''.G'' will use the register display of ADDR as the start address. | |||
===''NUMBER CONVERSION''=== | |||
.N $C000 | |||
.N 49152 | |||
.N %10101010 | |||
.N $C000+$FF | |||
.N $FF-1+$4000 | |||
.N $FF00/(2 * $AA) | |||
Displays the result of an expression in HEX, DECIMAL and BINARY. If the expression is a single byte value, a PETASCII character is displayed. | |||
. | |||
. | |||
'' | ===''OUTPUT TO PRINTER''=== | ||
.PM C000 D000 | |||
.PH C000 D000 "STRING" | |||
P is used as a prefix to another command. Memory display will be directed to the printer (device 4). Hold STOP to quit. | |||
===''EXECUTE A BASIC COMMAND''=== | |||
.BPRINT 8*256 | |||
.BPRINT "TEST" | |||
.BPLIST ''SHOULD work ? I have no printer :)'' | |||
===''EXECUTE A USER FUNCTION''=== | |||
.U <start> <end> <list_of_opcodes> | |||
Using this function, you can change a memory area to your own needs. | |||
Basically, the list of opcodes is a small subroutine which will be accessed for every byte in that memory area. The original byte comes in the accumulator and the modified value has also to be in the accu. You don't have to specify an RTS or other return code. | |||
will | |||
So, this routine will invert the memory from $1000 to $1fff (49 FF = EOR #$FF): | |||
.U 1000 2000 49 FF | |||
This routine will shift the high-nybbles into the low-nybbles (4A = LSR A): | |||
.U 1000 2000 4A 4A 4A 4A | |||
Before each call of the subroutine, the carry-flag is cleared. The X-Register will be set to 0 before the very first call and can then be used freely. | |||
'''Y-register must be 0 on exit, better don't touch it!''' | |||
Using the X-Register you can easily watch a charset, for example (8A E8 = TXA; INX): | Using the X-Register you can easily watch a charset, for example (8A E8 = TXA; INX): | ||
.U 0400 0500 8A E8 | |||
As you can see, this is a powerful option giving you a lot of possibilities. But really think twice before pressing enter, a wrong opcode might lead to a serious crash and/or loss of data, of course! | |||
'''''Ninja''' added this nice function on very early 3.8 ROMs already - blame Count Zero for the documentation!'' | |||
===''LOAD, SAVE, VERIFY''=== | |||
(FIXME) | |||
.L"PROGNAME" | |||
.L"PROGNAME",8,C000 | |||
.S"PROGNAME",8,C000,D000 | |||
.S"PROGNAME",8,C000,D000,E000 | |||
.V"PROGNAME" | |||
Load, Save, Verify. If a load address is specified, the program will be loaded to that location, otherwise it will be loaded to the address from which it was saved. Save requires a start and end address, which should be one byte after the last address to be saved. If an additional address is added to the save addresses, this will be saved as the reload address of the program (disk only). All disk I/O uses RAM locations. | |||
NOTE: You cannot load and save memory below $0800 if the Monitor was entered from the Freeze Menu. | |||
''' | ''It is possible to save that area using the Memory Saver in freezer's Saveland now. Remember that the ending address is exclusive. You may save address $FFFF by using $0000 as the ending address.'' | ||
.S"NAME",8,0800,0000 | |||
. | |||
. | NOTE: Tape accesses are '''avoided''' by the monitor now. | ||
. | |||
.S" | |||
'' | ===''I/O REGISTERS''=== | ||
.IO | |||
Displays the I/O registers $DC00-$DC0F,$DD00-$DD0F & $D000-$D02E. Any alternations will be incorporated on Restart or Backup. This command only works if the Monitor was called from the Freeze Menu. | |||
===''WATCH FREEZE/BREAK-POINTS''=== | |||
.W | |||
Displays the memory locations of the Freeze- and Break-Points and only works in freeze mode monitor. Freezepoints are displayed in white color, Breakpoints in gray color. Disassembling freezepoints will | |||
show you the obligatory '''JSR $Dxxx'''. Having it set using the SF command and restarting will restart at the location where the $Dxxx was hit. When setting it manually in a program with the assemble | |||
Displays the memory locations of the Freeze- and Break-Points and only works in freeze mode monitor. | |||
Freezepoints are displayed in white color, Breakpoints in gray color. Disassembling freezepoints will | |||
show you the obligatory JSR $Dxxx. Having it set using the SF command and restarting will restart at | |||
the location where the $Dxxx was hit. When setting it manually in a program with the assemble | |||
command the next command will be executed after restart. | command the next command will be executed after restart. | ||
==Disk Monitor Functions== | ==Disk Monitor Functions== | ||
In monitor mode all the usual disk command options work as normal. This includes device changing using | In monitor mode all the usual disk command options work as normal. This includes device changing using @(device) and @#(device). Output for the error channel using @ was changed a little to save display space. The monitor mode also has some additional functions, described below. | ||
@(device) and @#(device). Output for the error channel using @ was changed a little to save display space. | |||
The monitor mode also has some additional functions, described below. | |||
===''Access drive memory''=== | |||
@* (read device) (write device) | |||
Device 0 indicates that the "device" is computer RAM. If no write device is specified, the write device will be set to the read device number. If no parameters are specified, then the monitor reverts to its default (read and write to computer RAM). | |||
Examples: | Examples: | ||
@*8 Read and write to device 8. | @*8 Read and write to device 8. | ||
Line 954: | Line 895: | ||
@* Return to default. | @* Return to default. | ||
All the Monitor's memory access commands can be used with drive memory. Memory can be transferred between | All the Monitor's memory access commands can be used with drive memory. Memory can be transferred between devices by setting up the required parameters before using the '''T''' command. | ||
devices by setting up the required parameters before using the '''T''' command. | |||
''As this is a real hardcore hack option, | ''As this is a real hardcore hack option, we decided to not mess with the line parsing AGAIN and limit this to devices 8 and 9. '''Devices 10-30 are not possible here.''''' | ||
to devices 8 and 9. '''Devices 10-30 are not possible here.''''' | |||
===''Other Disk Commands''=== | |||
@ME (address) - executes a program in drive memory. | @ME (address) - executes a program in drive memory. | ||
@BR (TRACK) (SECTOR) (MEMORY PAGE). | @BR (TRACK) (SECTOR) (MEMORY PAGE). | ||
Line 967: | Line 906: | ||
These are block read and write commands. If no memory page is specified, then page $CF (=$CF00) will be used. | These are block read and write commands. If no memory page is specified, then page $CF (=$CF00) will be used. | ||
@BR 12 01 40 - Read track 18, sector 1 to page $4000. | @BR 12 01 40 - Read track 18, sector 1 to page $4000. | ||
@BW 11 00 40 - Write page $40 to track 17, sector 0. | @BW 11 00 40 - Write page $40 to track 17, sector 0. | ||
@BR +18,+1,40 - same as the first example. | @BR +18,+1,40 - same as the first example. | ||
You can specify decimal notation for the track and sector numbers by prefixing with the + character. Separate the parameters with a comma when using decimals. | |||
Take care when writing a disk block - if you accidentally specify the wrong parameters, you cand easily trash the disk! | |||
''These routines should work fine on devices 8-30.'' | ''These routines should work fine on devices 8-30.'' | ||
Line 984: | Line 918: | ||
==Freeze & Break Points== | ==Freeze & Break Points== | ||
Please read [[#Appendix | Please read [[#Appendix B|Appendix B]] as well about different cartridge RAM configurations. | ||
From the Freeze Monitor, you can set explicit Freeze and Break points in a program. Up to five Freeze or Break points can be set, which are cleared when program control passes to the Monitor. Following are the Freeze and Break instructions: | |||
SF - Set Freeze Point | SF - Set Freeze Point | ||
Line 996: | Line 927: | ||
RZ - Remove Break Point ('''formerly CB''') | RZ - Remove Break Point ('''formerly CB''') | ||
To set a Freeze or Break point, disassemble the required part of the program, and type the command at the | To set a Freeze or Break point, disassemble the required part of the program, and type the command at the address at which the program should be interrupted. | ||
address at which the program should be interrupted. | |||
.> C000 A9 41 LDA #$41 | .> C000 A9 41 LDA #$41 | ||
.> C002 20 D2 FF JSR $FFD2 | .> C002 20 D2 FF JSR $FFD2 | ||
.> C005 60 RTS | .> C005 60 RTS | ||
.> C002 '''SF''' D2 FF JSR $FFD2 | .> C002 '''SF''' D2 FF JSR $FFD2 ''RETURN'' ;Modify location $C002 | ||
.> C002 20 D3 DF JSR $DFD3 ;Freeze Point is set | .> C002 20 D3 DF JSR $DFD3 ;Freeze Point is set | ||
Control will pass to the Freeze Monitor at address $C002 and the original instruction (JSR $FFD2) is | Control will pass to the Freeze Monitor at address $C002 and the original instruction (JSR $FFD2) is restored. | ||
restored. | |||
You can explicitly clear a Freeze or Break point by typing RF or RZ at the address. | You can explicitly clear a Freeze or Break point by typing RF or RZ at the address. | ||
''A Break point may also be referred to as a Zero Point. The use of CF, CB, and SB interfered with the | ''A Break point may also be referred to as a Zero Point. The use of CF, CB, and SB interfered with the opcodes CLI, CLV, CLD, CLC, and SBC, and were changed therefore.'' | ||
opcodes CLI, CLV, CLD, CLC, and SBC, and were changed therefore.'' | |||
Freeze and Break points act exactly as if you had pressed the freeze button, but you can precisely | Freeze and Break points act exactly as if you had pressed the freeze button, but you can precisely control the point at which the program is frozen. Breaks pass through the IRQ vector at $FFFE and the | ||
control the point at which the program is frozen. Breaks pass through the IRQ vector at $FFFE and the | |||
break vector at $0316, so they are not suitable for programs which modify these vectors. | break vector at $0316, so they are not suitable for programs which modify these vectors. | ||
Freeze points don't use these vectors, so they are particularly useful for programs (e.g. most games) which | Freeze points don't use these vectors, so they are particularly useful for programs (e.g. most games) which switch out the kernal ROM. However, because they use three bytes of code, you need to be careful not to place a Freeze at a point where program control may hit the second or third bytes of the freeze instruction, or you will crash the machine. The I/O ROM ($D000) must also be switched in. | ||
switch out the kernal ROM. However, because they use three bytes of code, you need to be careful not to | |||
place a Freeze at a point where program control may hit the second or third bytes of the freeze instruction, | |||
or you will crash the machine. The I/O ROM ($D000) must also be switched in. | |||
Freeze points can be set only from the Freeze Monitor. You can directly place a freeze instruction (JSR $ | Freeze points can be set only from the Freeze Monitor. You can directly place a freeze instruction (JSR $DED3) using either the Monitor (in which case it will act as a subroutine, calling the Freeze Monitor and returning to the next instruction), or you can call the freezer from a Basic program with SYS 57043. On restart, the program will continue. | ||
using either the Monitor (in which case it will act as a subroutine, calling the Freeze Monitor and returning to | |||
the next instruction), or you can call the freezer from a Basic program with SYS | |||
will continue. | |||
Remember - if you find that a program will not load when the cartridge is plugged in - switch the computer off and on, and select NORMAL RESET instead of configuring the memory, before loading the program. | |||
Remember - if you find that a program will not load when the cartridge is plugged in - switch the computer | |||
off and on, and select NORMAL RESET instead of configuring the memory, before loading the program. | |||
---- | ---- | ||
=Miscellaneous Tips= | =Miscellaneous Tips= | ||
Here are some under-documented functions and things to know. | Here are some under-documented functions and things to know. | ||
Line 1,049: | Line 959: | ||
Switch to double sided mode with the following. | Switch to double sided mode with the following. | ||
@U0>M1 or OPEN 15,8,15,"U0>M1":CLOSE 15 | @U0>M1 or OPEN 15,8,15,"U0>M1":CLOSE 15 | ||
In this mode, both sides of the disk are used, giving twice the storage | In this mode, both sides of the disk are used, giving twice the storage space when the disk is formatted. To switch to single sided (1541) mode: | ||
space when the disk is formatted. To switch to single sided (1541) mode: | |||
@U0>M0 or OPEN 15,8,15,"U0>M0":CLOSE 15 | @U0>M0 or OPEN 15,8,15,"U0>M0":CLOSE 15 | ||
The drive powers up in 1541 mode when connected to a 64, so enter the command mentioned before if you wish to use double sided mode. | |||
The drive powers up in 1541 mode when connected to a 64, so enter the command | |||
mentioned before if you wish to use double sided mode. | |||
NOTE: Side two of a double-sided disk cannot be read by a 1541 drive. | NOTE: Side two of a double-sided disk cannot be read by a 1541 drive. | ||
==1581 Drive Notes== | ==1581 Drive Notes== | ||
Some samples of this drive are not very happy when working with a 64 or 128 in 64 mode. If you find that the system hangs when reading the directory or error channel you should press STOP/RESTORE and enter the following commands: | |||
Some samples of this drive are not very happy when working with a 64 | |||
or 128 in 64 mode. If you find that the system hangs when reading the | |||
directory or error channel you should press STOP/RESTORE and enter the | |||
following commands: | |||
@U0>B0 | @U0>B0 | ||
@U0>B0 or OPEN 15,8,15,"U0>B0":PRINT#15,"U0>B0":CLOSE 15 | @U0>B0 or OPEN 15,8,15,"U0>B0":PRINT#15,"U0>B0":CLOSE 15 | ||
NOTE: The same command is entered twice. It is only necessary with early | NOTE: The same command is entered twice. It is only necessary with early samples of the drive and should be entered each time you switch on the drive or reset the system. | ||
''Burning a new drive rom for the 1581 usually fixes this problem. Sometimes replacing the controller is needed, but getting these is hard. Also the 1581 JiffyDOS works fine with the CyberpunX Replay Fastloader.'' | |||
==FASTLOAD Trickery== | |||
If your filename in save was "*" the program will be named "". | If your filename in save was "*" the program will be named "". | ||
To get rid of it again, use @s: without name as well. | To get rid of it again, use @s: without name as well. | ||
@R:*=filename will rename the file to "". | @R:*=filename will rename the file to "". | ||
You should only do this to the first program on disk, to be able | You should only do this to the first program on disk, to be able to load it back using ":*" as filename ... | ||
to load it back using ":*" as filename ... | |||
=Appendix A= | =Appendix A= | ||
==Programming Tips== | ==Programming Tips== | ||
Many people know this: | Many people know this: | ||
Line 1,138: | Line 994: | ||
jmp $fce2 | jmp $fce2 | ||
This routine will take you straight to the powerup menu of | This routine will take you straight to the powerup menu of the cart and is a rather nice way to quit your programs. | ||
the cart and is a rather nice way to quit your programs. | ''LDA #$08'' will take you straight to the Fastload Toolkit. If no Replay is present, a normal Reset will be performed. | ||
''LDA #$08'' will take you straight to the Fastload Toolkit. | |||
If no Replay is present, a normal Reset will be performed. | |||
We have been looking around in the sources to find useful routines but none were found we would recommend. | We have been looking around in the sources to find useful routines but none were found we would recommend. '''It is not appreciated to use cartridge ROM routines as they are moving targets!''' | ||
'''It is not appreciated to use cartridge ROM routines as they are moving | |||
==Utilising the Retro Replay RAM== | ==Utilising the Retro Replay RAM== | ||
First a short note about the RAM Configuration. While being | First a short note about the RAM Configuration. While being in Basic Toolkit the first bank of the cartridge is usually switched in. RAM sits from $8000 - $9fff ''under/over'' the actual Cart Bank. | ||
in Basic Toolkit the first bank of the cartridge is usually switched | When using the Disk Turbo the RAM will be used for buffering data. The same goes for most freezer operations, but still it's rather simple to use the additional RAM and I really hope some people come up with new interesting programs using the ram. | ||
in. RAM sits from $8000 - $9fff 'under/over' the actual Cart Bank. | |||
When using the Disk Turbo the RAM will be used for buffering data. | |||
The same goes for most freezer operations, but still it's rather simple | |||
to use the additional RAM and I really hope some people come up with | |||
new interesting programs using the ram. | |||
sei | sei | ||
Line 1,169: | Line 1,017: | ||
THAT'S IT ! Simple, hm ??? Now tell me again programming RR is hard. :) | THAT'S IT ! Simple, hm ??? Now tell me again programming RR is hard. :) | ||
WELL, a good idea is turn the screen off or wait for $d012 to be in the upper | WELL, a good idea is turn the screen off or wait for $d012 to be in the upper or lower border though. | ||
or lower border though. | |||
---- | |||
=Apendix C= | =Apendix C= | ||
==Writing own extensions== | ==Writing own extensions== | ||
When writing parameter extensions for the freezer you may want to access areas, which are currently backed up into the internal RAM. Therefore a (longish) routine is already installed in memory when being in Freeze-Mode, which does the address translation for you and gets the correct byte. | |||
To check it out yourself, enter the monitor from the Freeze Menu and hit '''*''' to switch the RAM/ROM Config. Now you can disassemble the routine at '''$02a7'''. | |||
That routine should be used on any accesses to ordinary RAM from $0000 to $1500 by your Parameter Extension. | |||
Zeropage $8e/$8f has to have the address you are looking for, Akku needs to have the value you want to write, Y-Register needs to be $00. JSR $02a7 and off you go. | |||
That routine should be used on any accesses to ordinary RAM from $0000 to | |||
$1500 by your Parameter Extension. | |||
Zeropage $8e/$8f has to have the address you are looking for, Akku needs to have | |||
the value you want to write, Y-Register needs to be $00. JSR $02a7 and off | |||
For reading a byte from the area mentioned before, JSR $02b3 does the trick. | For reading a byte from the area mentioned before, JSR $02b3 does the trick. | ||
In | In short: | ||
JSR $02A7 works like STA ($8E),Y | |||
JSR $02b3 works like LDA ($8E),Y | |||
In case you have code that is slowed down too much by these routines, just use $23 (or $20) on $de00 to turn the RAM on and $00 on $de00 to switch back to Bank 0 of the cart (Freezer-Bank). Please keep in mind, that you have to know more precisely what you are looking for when directly using $de00. (See [[#Appendix B|Appendix B]] for more info.) | |||
The user-area for your extension programs is from $0a00 to $1500. | |||
'''ATTENTION'''! Programs exceeding $1500 will kill the memory of the frozen program from $1500 to the end of the extension. | |||
Hey, your extension filename needs to start with '''E.''' to have the loader recognize it. :) | Hey, your extension filename needs to start with '''E.''' to have the loader recognize it. :) | ||
A simple RTS is enough to return to the freezer menu, but if you trashed the stack a JMP ($0334) | |||
may help aswell. Don't forget to re-enable Bank0 by writing $00 to $de00. | A simple RTS is enough to return to the freezer menu, but if you trashed the stack a JMP ($0334) may help aswell. Don't forget to re-enable Bank0 by writing $00 to $de00. | ||
As for the rest, you may do about anything you like. Just be aware that trashing the memory | As for the rest, you may do about anything you like. Just be aware that trashing the memory really affects the frozen RAM and that anything below $1500 needs to be accessed using the $02a7/$02b3 | ||
really affects the frozen RAM and that anything below $1500 needs to be accessed using the $02a7/$02b3 | |||
routines. | routines. | ||
'''Action Replay''' hardware has one write-only I/O register at $de00-$deff. ''The ONE register is $de00.'' | |||
Its' bits are as follows: | |||
Bit 7 - unused | Bit 7 - unused | ||
Line 1,286: | Line 1,116: | ||
This results in the values $00, $08, $10 and $18 for Banks 0,1,2 and 3. | This results in the values $00, $08, $10 and $18 for Banks 0, 1, 2 and 3. | ||
$80, $88, $90, $98 are used for Banks 4,5,6 and 7 on the new 64kb ROMs. | $80, $88, $90, $98 are used for Banks 4, 5, 6 and 7 on the new 64kb ROMs. | ||
$0A in $de00 will take you to a safe basic environment. | $0A in $de00 will take you to a safe basic environment. | ||
---- | ---- | ||
=Appendix D= | =Appendix D= | ||
==Memory Mapping== | ==Memory Mapping== | ||
The newly introduced bits on the Retro Replay hardware allow some new fancy things and allow more compatibility with already existing hardware, but the experts should know about some things. | |||
$de00/$df00 are the memory pages where a cartridge can have a memory page mapped in (IO1 and IO2). Bit 6 of $de01 sets the page which is used to map in the IO-Page. | |||
Since this register is write once (except for bit 0), the cartridge reset routine usually sets this bit to its correct value. | |||
Whenever a REU-compatible memory map is used, $de10 to $deff will be used to map in a mirror of $9e10 to $9eff. $dfxx is free for REU then. | |||
The default for the RR hardware is to run with the IO area mapped to $df00-$dfff. This is ''Action Replay'' compatible behaviour and the mirror comes from $9f00 to $9fff then. | |||
$de00/$df00 are the memory pages where a cartridge can have a memory page mapped in. | The SilverSurfer serial interface uses registers from $de02 to $de0f when plugged in and activated. Therefore the routines in the IO areas have been shortened | ||
Bit 6 of $de01 sets the page which is used to map in the IO-Page. | |||
Since this register is write once (except for bit 0), the cartridge reset routine usually | |||
sets this bit to its correct value. | |||
Whenever a REU-compatible memory map is used, $de10 to $deff will be used to map in a mirror of | |||
$9e10 to $9eff. $dfxx is free for REU then. | |||
The default for the RR hardware is to run with the IO area mapped to $df00-$dfff. This is | |||
Action Replay compatible behaviour and the mirror comes from $9f00 to $9fff then. | |||
The SilverSurfer serial interface uses registers from $de02 to $de0f when plugged in and | |||
activated. Therefore the routines in the IO areas | |||
as much as possible and will require further optimizations aswell. | as much as possible and will require further optimizations aswell. | ||
The '''RR-RAM''' is something special. Setting bit 5 of $de00 activates the RAM of your RR hardware, | The '''RR-RAM''' is something special. Setting bit 5 of $de00 activates the RAM of your RR hardware, just like on AR hardware. While trying to use the banking bits 3 and 4 along with bit 5 has no effect | ||
just like on AR hardware. While trying to use the banking bits 3 and 4 along with bit 5 has no effect | on plain AR hardware, the new hardware will map in one of the four available 8kb RAM banks. Just like the ROM banks, the RAM is mapped in from $8000 to $9fff. | ||
on plain AR hardware, the new hardware will map in one of the four available 8kb RAM banks. | |||
Just like the ROM banks, the RAM is mapped in from $8000 to $9fff. | |||
Bit 1 of $de01 allows you to select a more flexible RAM banking. If the AllowBank bit is not set, the $de02-$deff or $dfxx area will always mirror from bank 0 of the RAM, so the older cartridge images will work. With the bit set, the RR will use the selected RAM bank to map in the IO area. | |||
We will currently keep this bit unset, since this gives the advantage that the upper 3 RAM banks can be used completely and not every time $100 hexbytes have to be wasted/fragmented around $9e00/$9f00. | |||
'''PLEASE NOTE''' that you should ONLY use the set/clear freeze and breakpoint commands from the monitor with their tokens! | |||
I know many people writing the JSR $ded3 manually, but since the adress will change, I recommend to keep this in mind! | |||
---- | |||
Latest revision as of 12:42, 10 July 2021
May 2021
Work is still in progress here!
|
IGNORE - this is for an upcoming release *g*
WARNING! Toying with SD2IEC and alike will easily reveal that a kernal SAVE fallback is (naturally) saving ROM content :)
- Cartridge FAQ may resolve conversion and usage questions.
- Retro Replay Flashing was completely removed from the standard manual and is available separately.
Intro
This manual for the CyberpunX Replay is WORK IN PROGRESS FOR 3.99 and initially based on Action Replay MK6 Manual Project64.txt.
The CyberpunX Replay is based on resources by Count Zero of the Action Replay MK5 ROM. A Changelog is available and points out future plans.
Thanks AND Credits
- DocBacardi
- Ninja
- Checky
- groepaz
- Danzig
- Copyfault
- Fungus
- tlr
- graham
- dw
- many more
- and all other cart lovers
Startup Menu
Although only F1, F3, F5 and F7 are displayed, there are more options
The screen looks like this:
F1 - CONFIGURE MEMORY F3 - NORMAL RESET F5 - UTILITIES F7 - INSTALL FASTLOAD
The complete key setup is:
F1 - Configure Memory - Fills RAM with $BD and does a normal reset F2 - Configure Memory - Fills RAM with $00 and does a normal reset F3 - Normal Reset F4 - Unused F5 - Utilities F6 (or '0') - Configure Memory - Fills RAM with $00 and jumps to fastload F7 - Install Fastload F8 (or 'B') - Configure Memory - Fills RAM with $BD and jumps to fastload
Please note, that the keys B and 0(zero) are presets only and can be changed.
NORMAL RESET switches the cartridge off, making it invisible to the system.
CONFIGURE MEMORY fills memory with a single byte value before resetting. This makes the Backup Compaction System more efficient. You should select this option before loading a program to be backed up.
Utilities for a menu driven approach on several provided functions.
Install Fastload enters the extended BASIC mode also know as 'TOOLKIT'. Usually a fastloader is enabled here if you don't disable it in favor of a custom kernal.
During a reset the following keys also have an effect:
- CTRL for NORMAL RESET
- Commodore - Install Fastload C128 owners using a non-reset-patched original Retro Replay may want to change this to Run/Stop-
Making Backups
A Backup is a complete, working copy of any program. CyberpunX Replay makes backups by taking a 'snapshot' of the whole of the computers memory, together with all graphics and timing information, which is then saved in compacted form to disk.
Preparing To Make A Backup
Have a blank disk ready for saving the backup. If a disk is new it needs to be formatted (see #THE UTILITIES MENU). Select CONFIGURE MEMORY from the Startup Menu.
The Backup Process
Load the program you wish to copy. When the program has loaded and is running, it may be frozen at any time by pressing the Freeze Button. Select BACKUP from the Freeze Menu. The border will flash for 10-20 seconds while the compactor is operating, after which the program is ready to save.
Saving To Disk
Backups can be saved to disk in different styles:
1. TURBO - Single file using the CyberpunX Replay Standard Turbo. 2. STANDARD - Uses the normal kernal routines, or FAST DOS parallel routines if available. Programs over 202 blocks are saved in two parts.
Select the desired option and enter the filename of your choice (up to 15 characters). Press RETURN to start saving. If the drive fails to respond switch it off / on and try again. This is not usually necessary, but may be important if the original was a commercial disk program.
All being well, your backup is now complete. You may now save again with a different style, restart the program, or exit as required. If there is insufficient space on the disk, you will receive the message "DISK FULL". Insert a fresh, formatted disk and try again. On average 3 backups will fit on one disk side.
The Devicechange (F1) was altered here to accept recognized drives (by the internal cart routine) at any device between 8 and 30. This affects the Freeze Menu and the Utilities Menu. If your exotic hardware is not properly recognized and therefore skipped, visit me sometime with that particular device. :)
Loading Your Backups
LOADING FROM THE DIRECTORY WITH FASTLOAD
1. Press F3 or $ (string) to display the Disk Directory (press STOP if a long directory scrolls the screen or CBM or CTRL to slow down scrolling). 2. Move the cursor over the name of the program you wish to load. 3. Press F1 and the program will load and run.
LOADING WITHOUT THE CARTRIDGE PRESENT
If you saved your backup with the TURBO or STANDARD option, you will be able to load your backup in again using standard kernal routines whenever the program is below 202 blocks. Larger backups HAVE to be saved in two parts using the STANDARD save option on the freeze menu to retrieve them on a standard 64.
Trouble Shooting
- PROGRAM WILL NOT SAVE TO DISK.
- Try switching the drive off and on before starting to save. If you get "DRIVE NOT READY" it probably means that the disk is unformatted. Format the disk and try again.
- "DISK FULL" means that there is insufficient free space for the program. Use a fresh disk.
- Other error messages may indicate a faulty disk.
Switching the drive off/on will re-enable the drive saving in some cases when IRQ or Fast-Loaders kept the serial bus busy.
- PROGRAM TO BE COPIED WILL NOT LOAD
Switch the computer off and on and select NORMAL RESET from the Startup Menu before loading the program. A few programs will not load if a disk drive is present. Switch the drive off and switch on after freezing the program.
Graphics Facilities
The Sprite Killer
SPRITEKILLER is a menu option on the freeze menu usually found under K. You may disable collisions between two sprites or collisions between sprites and background data or both. When restarting the program you will find that when two sprites collide nothing happens. You can then sail through the whole program without losing a life.
Results will vary from program to program. Shapes which appear to be sprites may actually be user defined characters, or the programmer may be using coordinate information rather than the VIC system to detect collisions. In such cases the Spritekiller will have no effect. In general, it is more effective on older programs.
Note for the interested:
The routine is looking for LDX/LDY/LDA $d01e/$d01f and replaces it by either LDA/LDX/LDY #$00 and NOP. Easy pattern searching.
We haven't found a single AR version having this option completely right. All found cart versions (except for ours, hehe) are hunting for both collision types even when wanting just a single one.
The Char/Sprite Editor
For the 3.99 release series the original VIEW SPRITES option with some small improvements was re-added to the ROM. Enjoy. A proper editor is planned for v4.x :)
Saveland
Saveland allows you to save Charsets, ScreenRam, ColorRam, Hires Bitmaps and Memory Areas as well as Koala pictures.
Keep in mind these limitations as they are not displayed on the menu:
- Saving a charset won't work when having a Koala Pic frozen.
- Attempting to save the character ROM will result in the RAM beneath it being saved. ($1000, $9000)
- The Color RAM is saved uncleaned. Will clean it in the future and probably add the option to save it packed.
- Saving memory from $0000 to $ffff will also include the last byte at $ffff.
Further testing on all options is needed.
Printer Dump
This option is gone, only printing in BASIC and stuff still works.
@P* and @P** still work of course (See CENTRONICS PRINTER INTERFACE.) (FIXME)
Text Editor
This allows you to edit a frozen text based screen. You can use all the normal screen editing keys, such as the CURSOR keys, INSERT, DELETE, etc., plus some extra ones:
R/S exits the editor CTRL-I inserts a line CTRL-D deletes a line F3/F4 changes the border colour F5/F6 changes the background colour. F7 Toggles the Position Display On and Off
Return and Shift-Return act normal now. No more screen scrolling on them as well.
You can change the text colour in the normal way - hold down the CTRL or CBM key and press keys 1-8.
The editor works with text based screens only - you cannot get useful results on a bitmapped screen. Also, if the frozen program uses a different character set, the display characters may not correspond with those printed on the keyboard, so a little experimentation may be necessary - try pressing SHIFT and CBM together to change characters.
Text searching is more easily achieved via the monitor. Enter the monitor and type I (RETURN). This displays memory in the form of screen codes. You can scan through the whole of the memory looking for text strings - to change any text simply type over it and RETURN. Make sure you don't type over non-text areas.
You can also display ASCII codes by typing J (RETURN). Type X to leave the monitor. Refer to MACHINE CODE MONITOR for more details.
Pokes & Parameters
How to Enter
Computer magazines used to publish Pokes which can be entered into programs to add features such as infinite lives to game programs. These usually required the machine to be reset.
To reset the machine press the RESET button and select NORMAL RESET from the startup Menu.
In addition, the cartridge allows you to enter pokes after a program has been frozen. Select POKES, enter the required poke or pokes (one at a time), and press RUN/STOP or just RETURN. The program can then be restarted using F3.
It is possible to enter decimal and hexadecimal notations in mixed order here. You need to enter a leading string ($) for the hexadecimal numbers, of course.
Examples:
POKE $f,255 POKE 1024,$4e POKE $fce,$ea POKE 1,0
Pokefinder is offering an excessive list of pokes for various games.
POKEFINDER
This is an automatic infinite lives finder for games. Until now finding pokes was a difficult long-winded procedure requiring specialized knowledge. Using Pokefinder, you can generate that elusive poke, even if you don't understand a word of machine code!
Just follow this procedure:
1) Load up and run your game. When play starts note how many lives you begin with and press the Freeze Button. 2) Select POKEFINDER. You will be asked 'HOW MANY LIVES NOW?' - enter the number of lives you started with. Pokefinder will now analyze the memory and display a list of possible pokes. Usually there will be many of these, so you will be prompted to 'LOSE A LIFE AND REFREEZE'. 3) Restart the game and continue to play until you lose a life. Make sure that you lose ONE LIFE ONLY. Wait for any "death sequence" to complete. When play resumes, press the Freeze Button. 4) Select POKEFINDER again. You will get one of three messages: a) LOSE A LIFE AND REFREEZE - go back to 3 above. b) ABORTED - Pokefinder has failed. c) INSTALLED - the poke (or pokes) have been found and entered into the program. Write down the displayed poke(s) for future use. If Pokefinder fails it may be because the programmer used an unusual method of counting the number of lives remaining. However it can be that you got the starting number of lives wrong or accidentally lost more than one life between passes - so its worth going through the procedure again in case you made a mistake the first time. Tests show a success rate of over 80% - very high for this type of program. Some multiload programs need a different poke for each level in which case you should repeat the above procedure after each Load.
If the border starts to flash while searching for codes, there is a buffer overflow.
Searching for screencodes was added which should increase the probability of finding valid codes just a little. Additionally values between 1 and 255 work now, so there's an even higher chance to find time trainers and the like. Previous AR carts only used the very last digit entered at the prompt as a search value.
If the usual search fails, the experienced poke hunter searches for the last digit on lives/timer/energy. Another reason for not finding a valid code may be hex/dec flag usage. In this case letting the game value drop below ten and retry from there on may lead to a final success.
Parameters
The parameter option allows you to load enhancement programs from disk, which can fulfill actions the normal CyberpunX Replay software is not able to.
The options to load from tape using "T." as prefix and loading original parameter files to backup protected games have been removed. We do not endorse the pirating of commercial software and neither should you!
The only parameters currently accepted have to start with "E." as a prefix. You can find additional information on programming your own extension in the coding appendix and hopefully more soon at Extension Programming.
See Extensions for already available extensions!
Utilities Menu
The Utilities Menu is accessed from the Startup Menu. Some of the utilities can also be called from Fastload (see FASTLOAD).
The Devicechange (F1) was altered here to accept recognized drives (by the internal cart routine) at any device between 8 and 30. This affects the Freeze Menu and the Utilities Menu. If your exotic hardware is not properly recognized and therefore skipped, let us know. :)
Formatting A Disk
When a disk is new it needs to be formatted before if can store any programs. When you select this option you will be asked to enter the disk NAME, which can be any name up to 16 characters in length, and the ID number which can be any two characters. Press RETURN and the disk will be formatted at high speed.
The directory of the disk will be displayed. Occasionally, fast formats do not "work" first time. If the directory does not show 664 BLOCKS FREE, try again and everything should be OK. If a disk consistently fails to format, a faulty disk is indicated.
NOTE: Formatting a disk destroys any previous information which may have been on the disk. Be certain that you have the correct disk inserted before selecting this option.
Disk File Copier
The Filecopier will handle Program, Sequential and User files up to 247 blocks in length. The utility can be used with one or two drives. The MULTI OUTPUT option allows several copies to be taken from each pass. The REPLACE FILES option will scratch possibly already existing files with the name of the target file before writing.
Having selected your options, press SPACE and each file in the directory will be displayed in turn. Press Y if you want to copy that file, otherwise press N and it will be ignored. Files which cannot be handled (e.g. Relative Files), will be skipped. Press S to start copying, else copying will begin when you reach the end of the directory.
At the end of the directory, the selected files will be loaded. Several passes may be necessary, depending on the length and number of files selected. You will be prompted to swap disks when necessary. The SOURCE DISK is the disk which is being loaded FROM and the TARGET DISK is the disk which is being saved TO. The Target Disk(s) need to be formatted in advance.
NOTE: The File Copier cannot copy the old Action Replay Loader and has a maximum of 32 files which can be copied at once currently.
Disk Backup Copier
The Disk Copier is for the 1541 (and compatibles) only. You can use the copier with one or two 1541 drives. With a single drive you will be prompted to insert the Source and Destination Disks in turn.
BAM COPY - If selected, only the occupied tracks will be copied. This can save a lot of time when copying partially filled disks.
IGNORE ERRORS - if selected, the written data will not be checked. Otherwise, the written data will be verified against memory - this takes longer but gives greater security for important data.
NOTE: If you have any difficulty in using the disk copier with the 1570 or 1571 drives, enter the following disk command: @U0>M0 <RETURN> to force the drive into 1541 mode.
NOTE: Any deleted Warp files on the disk may cause spurious error reports. Also, it is possible that valid Warp files will also cause errors.
Fastload and BASIC
FASTLOAD is the turbo and utilities function of CyberpunX Replay. Operating in the BASIC environment, numerous extra commands and facilities are available. To install, select INSTALL FASTLOAD from the Startup Menu, or hold down the CBM key when you power up or press the Reset Button.
changelog entry:
- Compatiblity fixes for SD2IEC devices
- /$ %$ and other load commands were changed on Beta 2 introducing an incompatibilty with these newish devices. Reverted to e.g. fix that infamous filebrowser (fb64.prg)
- JiffyDOS is used for LOAD/VERIFY, Directory, Change Device as fall back for IEC-Devices supporting it - FROM CART ROM - No C64/C128 Jiffy Kernal required!
There is of course more to come, e.g. SAVE, ahem :) - AND all the @-commands need testing. Esp. SCRATCH is prone to crash but ALL need to be tested put on a table, compared ... NEEDS to be worth it for the sheer amount of space this code eats!
On normal detection of a drive the standard track loader using the Replay RAM will be used (or the "slow loader" whenever "@K-" was used to enable it.) Failed detection should lead to JiffyDOS fall back which also allows loading under I/O and kernal from SD2IEC/UIEC and such.
Disk Turbo
The CyberpunX Replay disk turbo uses standard GCR format, so it works with all your existing programs without special conversion. It will load a 202 block program in around 9 seconds and works with all drives from the 1541 upwards (including the 1581 and the 1571 in two-sided mode).
With the advent of SD2IEC, 1541U sd-card-DOS and other devices usually having a file browser coming with it we changed a few things and added JiffyDOS support to the cartridge routines which do not require a C64 Kernal change.
Some other standard routines were changed to the Jiffy replacements speeding up directory display or change device handling - REPORT PROBLEMS! :)
The Disk Turbo can be switched out with the command OFF completely. Load and Save will then operate using the standard Kernal calls. Type ON to re-enable the Disk Turbo.
The Disk Turbo now has 'three modes which can be switched off and on with the commands @K-, @KJ and @K+.
@KJ switches the turbo mode to JiffyDOS compatible cartridge routines to support JD enabled devices @K- switches the turbo mode to the "freeze loader" which supports most 5.25" and 3.5" drives (NOT IEC emulators such as SD2IEC though) @K+ re-enables the Replay RAM supported GCR trackloader again
All loaders will load under IO and kernal. The JiffyDOS mode has the same "advantages" over the trackloader as the "freeze mode loader":
a) The Replay RAM is kept so previously loaded freezer extensions stay in RAM ('CyberpunX Replay' always keeps the extension RAM). b) Programs can sometimes be loaded from bad disks using this mode. c) PAL/NTSC compatibility.
The "freeze mode loader" is faster than the JD routines, so keeping them for the moment. Especially since not everybody can switch to a JiffyDOS drive rom. :)
Standard GCR track loader was changed to load splatfiles as well. Shown as *PRG in directories. Also USR files are handled like DEL now to skip directory art.
Note: 40 tracks formatting and saving is not supported but nothing loading off track 36-40 is fine whenever using the track loader and a standard drive ROM. (JiffyDOS drive roms fail).
NOTE: Some commercial programs may override the Disk Turbo - see Turbolinker(link)
Ninja/The Dreams reported functionality of the Disk Turbo on FD drives as well. Also CMD HD devices shouldn't cause major trouble. The saver doesn't work for FD drives though (TEST ME!).
*FIXME* document behaviour better - re-test freezer loader handling
WARP*25 Disk Turbo
WARP*25 was removed completely to gain space. The Datel program WARP 25 will still allow you to deal with WARP files.
Turbolinker
When you load and run a commercial program with Fastload, you will often find that the cartridge Disk Turbo System is disabled for any subsequent Load/Save operations. This can be remedied by the TURBOLINKER.
Select TURBOLINKER from the freeze menu and select the device to be linked. Then restart the program. Loads and Saves will now be redirected to that device. Note that if the program incorporates it's own turbo system, or does not use the Kernal Load/Save commands, then the TURBOLINKER will not work.
Basically the load/save vectors are set to the cartridge routines and therefore allow programs to use the cartridge even after $FD15 was called and the kernel defaults are set.
Single Stroke Commands
A number of single stroke commands are available from Fastload:
FUNCTION KEYS
F1 LOAD the first file on the disk to its' absolute address and run it if it's at basic start. (LOAD "0:*",8,1) F2 LOAD the first file on the disk to the Basic program area without running it. (LOAD "0:*",8) F3 Display disk directory without corrupting memory F4 Toggle available drives F5 LIST F6 Freeze Menu F7 RUN F8 MON See here
There have been some complaints about this F-key setup, but this is the original Action Replay V5 setup. Future versions may allow configuration. We'll see.
Note: For drive toggle, a Jiffydos compatible routine will search for the next available drive on the bus. Tested in monitor and freezemode. Be careful on a busy drive chain when IRQ or fast loaders keep the serial bus for themselves. JiffyDOS supplies drive checking up to drive #30, and so do we. (Bug reports welcome.)
EASY LOAD/SAVE COMMANDS
/PROGNAME equals to LOAD "PROGNAME",8,1 ^PROGNAME equals to LOAD "PROGNAME",8 & RUN (Arrow Up) %PROGNAME equals to LOAD "PROGNAME",8,1 & RUN &PROGNAME equivalent to VERIFY "PROGNAME",8,1 {POUND_SIGN}PROGNAME equals to SAVE "PROGNAME",8
Loading with these commands will only set the BASIC end pointers if the program loads to the start of Basic ($0801). Also, the Filename does not corrupt the Basic String area ($9FF0-$9FFF usually). Very long files can be saved with the {POUND_SIGN} command where the normal SAVE command would give an ?OUT OF MEMORY ERROR.
LOADING FROM THE DIRECTORY
If you display the directory and then move the cursor onto a line containing an entry, you can load that program simply by pressing F1 to load and run or F2 to load without running. This is the most convenient way of loading a program.
ACCESSING THE ERROR CHANNEL
Instead of using OPEN 15,8,15 "COMMANDSTRING":CLOSE 15, you may use the @ key to send disk commands and read the error channel:
@ - reads the error channel of the current device. @(device) - Switches to (device) and displays the status. @#(device) - Stupidly writes (device) to 186/$ba witout status message. (This option is used by the F4 toggle, but the F4 device toggle previously scans the devices from current up to #30 to ensure a drive is present at the selected address.) @I - initialize the drive @V - validate (cannot be used on Warp*25 disks) @R:NEW=OLD - rename a file. @N:NAME - clear the directory of a previously used disk. @N:NAME,ID - format a new disk. @$ or $ - display directory. @S:NAME - scratch (delete) a program from the disk. @H:NAME,ID - a new command not available in the normal DOS. This changes the name and ID of the disk without clearing the directory. Initialize was added here to re-read the drive buffer, so the next hit on F3 will really show you a new header on the dir. NOTE: @s:name1,name2,name3,names* works to scratch several files at once.
@K-, @KJ and @K+ control the fastload-mode as already explained at #Disk Turbo.
@=8 to @=30 will change the current device to the given device number (Softwire drives).
This is a sort of drive toggle, like some old copy programs provide it. Use the logical turn-off/on drive sequence to avoid device number collisions. This command should work fine with 1541 and 1581 drives, as the required Zeropage adresses on the drive memory are used the same way. I am not sure about FD drives, as I found no documentation about them so far. It WILL fail with e.g. SD2IEC devices.
Hints:
- If you use a two drive system, the second drive can be accessed by reading its error channel, e.g. @9. Subsequent single stroke commands will be directed to device 9.
- If a filename contains leading or trailing spaces, it should be enclosed in quotes, e.g. " PROGNAME".
You may also use: @(device)(command) to change to the device and immediately execute the command (e.g. @8$ or @9N:TEST,ID).
Consult your disk drive manual for further information about the error channel.
ARE YOU SURE? has been removed - so be careful again on scratch and format.
SWAP Screen
Pressing CBM and F1 together allows you to switch between different copies of the normal screen area ($0400-$0800). Our main intention was to save some output of e.g. the monitor to another screen to not always have to re-search the memory or keep adresses in mind for examining routines. You may find different usages for this option though. :) These areas are kept untouched (as far as possible) and may even serve you as a reset-proof ramdisk.
Extended Basic Commands
A number of extra basic commands are provided, which operate in direct mode. The commands may be abbreviated by typing just the first three characters.
Hex ($), binary (%) and octal (&)
numbers can be included in basic expressions now, e.g. SYS 49152 could be entered as SYS $C000.
MONITOR
or MON will start the machine code monitor.
APPEND
or APP differs from MERGE in that the new program is tagged onto the end of the previous one. It also occurs at turbo speed, e.g.:
APP "PROGNAME",8
loads the program starting at the end of the previous one. For APPEND to be useful, the program to be appended should have line numbers greater than the existing program.
AUTO
or AUT provides automatic line numbering as you type in a program, e.g.:
AUTO 1000,10
starts automatic line numbering at line 1000 and increments in steps of 10. To turn AUTO off, press RETURN against a blank line. If you subsequently want to continue automatic numbering type AUTO on its own and numbering will continue from the last line number which was automatically displayed.
BACKUP
or BAC will start the Whole Disk Backup
BOOT
will load a machine code file and jump to the first address loaded. E.G. You have a program which you would normally load with
LOAD "PROGNAME",8,1
followed by a SYS number. BOOT will perform the same function . NOTE that BOOT will only work when the program is started by SYSing to the first address loaded. Syntax:
BOOT "PROGNAME",8.
COPY
or COP will start the Disk Filecopier.
DELETE
or DEL will delete a block of program lines. Syntax is like LIST except that the first line to be deleted must be specified e.g. DEL 1000-2000 will delete lines 1000 to 2000 inclusive. DEL 1000- will delete from line 1000 to the end of the program.
FIND
or FIN will perform a search on the basic program currently in ram and when a line contains matches to the given string, it'll be returned as result.
Examples: FIND REM FIND 20 FIND POKE53282 FIND LIVES
Exceptions apply like this: the given string will be tokenized and whenever it contains a basic keyword, that will be converted as well. So you will probably not find the string "MONKEY" since it has ON in it. Putting the string into quotes won't help either, since they will be searched for as well. Also note that FIND needs a SPACE right after the command.
LINESAVE
or LIN will save to disk a section of a basic program e.g.:
LIN "PROGNAME",8,1000-2000
will save program lines from 1000 to 2000 inclusive. Lines saved in this way may be loaded back as separate basic programs, or MERGEd into other programs.
LIST
basic command output was patched to properly display control characters and allow breaking simple LIST protections. (E.g. REM SHIFT+L breaks the original BASIC V2 listing output)
MERGE
or MER loads a basic program from disk and combines it with a program in memory if two lines have the same number, the new line replaces the existing line. A program may also be merged with new line numbers e.g.:
MERGE "PROGNAME",8
merges a program with the program in memory.
MERGE "PROGNAME",8,1000,10
will renumber the lines before they are merged, starting with line 1000 and incrementing in steps of 10 GOTO & GOSUB statements will NOT be renumbered. Merging into a long program is a lengthy process, so be patient.
OFF / ON
switches the disk turbo routines off and on.
OLD
will recover a basic program which has just been NEWed.
PLIST / SLIST
will list a basic program directly from disk to a CBM printer (device 4) or the screen without overwriting the program in memory. Syntax:
PLIST"PROGNAME",8 SLIST"PROGNAME",8
This command can also be used to print the directory using
PLIST"$",8
PLIST/SLIST won't work with machine code and sequential files.
ZAP
will reset the computer and disable the cartridge, just like Reset and holding the CTRL Key. Locations $0000-$07ff will be corrupted but $0800 - $0803 is restored to enable running of machine language programs with a SYS header. (Those infamous KILL CARTRIDGE things can be tried by loading with turbo speed, ZAP and then RUN - give it a try!). Basic programs won't have the pointers set correctly though.
TASS
or TAS simply copies a version of Turbo Assembler Macro (REU or non-REU depending on used ROM) to RAM $8000-$ce00 and starts it.
Centronics Printer Interface
(FIXME)
CyberpunX Replay can drive a Centronics printer connected to the parallel port. If a parallel device is connected and active, any output to the printer (device 4) will automatically be sent to the parallel port. Note that you need a suitable connecting cable before you can use a parallel printer. The interface will normally perform any necessary character translation, including most graphic characters, but you can also send untranslated characters or escape codes e.g. to change style and formatting.
To print a Basic program enter:
OPEN 4,4:CMD4:LIST
When printing is complete enter
PRINT#4:CLOSE 4
To send special printer codes and untranslated characters you need to open a special channel (secondary channel 9). Here is an example:
10 OPEN 4,4 : REM OPEN A NORMAL CHANNEL TO THE PRINTER 20 OPEN 9,4,9 : REM OPEN A COMMAND CHANNEL 30 PRINT#9,CHR$(27)+CHR$(87)+CHR$(1);: REM EXPANDED PRINT ON 40 PRINT#4,"THE QUICK BROWN FOX"
50 PRINT#9,CHR$(27)+CHR$(87)+CHR$(0);: REM EXPANDED PRINT OFF 60 PRINT#4,"THE QUICK BROWN FOX" 70 CLOSE 4:CLOSE 9: REM CLOSE PRINTER CHANNELS
This short example should print "THE QUICK BROWN FOX" in double width characters and again in normal size characters. Note the semicolon (;) at the end of the command string - this prevents a carriage return from being sent at the end of the command string. Refer to your printer manual for details of other special commands. Most, but not all commands begin with the escape character CHR$(27). The interface prints according to the screen mode - you switch between "Business" and "Graphics" modes by pressing SHIFT & CBM together.
If you find that everything gets printed on the same line, you need to set a special DIP Switch on your printer to make the paper move down at the end of each line (a Linefeed). Again, refer to your printer manual. If your printer cannot do this, you can send a special command to CyberpunX Replay which forces a linefeed with each carriage return:
@PLF - causes a linefeed to be sent with every carriage return.
You can also print characters direction with @P, e.g.
@P"THE QUICK BROWN FOX" @P 27,87,1 "THE QUICK BROWN FOX" 27,87,0 "THE QUICK BROWN FOX"
The second example does the same as the Basic program listed above. Note how you can mix command
sequences and strings on the same line.
The @P command works in Direct mode, or in the Machine Code Monitor, but not from within a program.
@P* - dumps the entire text content of the screen. @P** - works in the Freeze Monitor, it dumps the frozen screen.
Hope all of these printer commands still work. Someone test and let me know!
The CENTRONICS interface emulates channel 4 & 5 serial printers. If you have both serial & centronics printers the first has higher priority (use ONLINE on printer if necessary). Without secondary addr your printer emulates MPS801 characters, but with secondary address 9 on CENTRONICS native(raw) chars will be printed.
Machine Code Monitor
CyberpunX Replay includes a powerful extended Machine Code Monitor. To call the Monitor from Fastload, enter MON or press F8. The Monitor is also available from the Freeze Menu. In this mode all of the memory including the screen, stack and zero page may be examined in its condition at the point at which the program was frozen.
All 64K of memory remains unaffected by the Freeze Monitor. Any alterations made will be incorporated into the program when it is restarted or saved. A working knowledge of 6502 assembly language and Hex notation is required by the user, if the Monitor is to be used effectively. Some of the Monitor instructions can cause the system to crash if the user is not fully aware of what is going on.
Command Summary
A - Assemble B - Execute a Basic command C - Compare memory D - Disassemble F - Fill memory G - Go. Execute program as per register display H - Hunt for byte/text-sequence IO - Displays I/O registers (freeze mode only) I - Interpret memory as CBM codes I* - Interpret memory as CBM codes J - Interpret memory as ASCII codes. Former I function L - Load M - Display memory in Hex N - Number conversion P - (prefix). Direct output to the printer (device 4) R - Display registers at entry or freeze time S - Save T - Transfer memory U - User function V - Verify W - Watch Freeze/BreakPoints X - Exit to Basic or Freeze Menu * - Toggle RAM/ROM modes @ - Read error channel or send disk command @(dev) - Changes device and display status @#(dev)- Only changes device $ - Display directory
Special disk related commands only available in MON:
@*8 - Access drive memory (device 8) @*9 - Access drive memory (device 9) @* - Return access to computer memory @ME - Execute memory in disk drive @BR - Read a disk sector into computer memory @BW - Write a sector from computer memory to disk
Note: Whenever using one of the commands to edit memory locations, just go over the line, edit as needed and hit
- RETURN to accept the changes
- CBM+Return accept the changes, keep you in editmode and present the next editable line to you
- SHIFT+RETURN leaves editmode without accepting changes
Command Description
Important Notes:
When an end address is specified it should be exclusive. The end address is one byte greater than the last address to be operated on, e.g.:
.S"PROGNAME",8,C000,D000 saves up to but not including D000.
Usually all numbers you enter after a command are interpreted as hex. (An exception are drive numbers which are always decimal). You can also force the commands to deal with decimal numbers by using a leading plus (+) sign though you have to enter the numbers in high/low order and only 0-255 are accepted then.
Examples: M +0+186 - start hexdump at $00ba I +32+0 - start asciidump at $2000
A trailing hyphen (-) will scroll the output until you abort it with RUN/STOP or start controlling it using the F-keys.
Examples: M 1000 - - hexdump from $1000 to xxx I 3000 - - asciidump from $3000 to xxx
EXAMINING MEMORY
Memory may be examined in Hex/ASCII, Disassembly, or Interpreted as ASCII or screen codes:
.D C000 D000 - disassemble from $C000 to $D000 .M C000 D000 - display memory from $C000 to $D000 .I C000 D000 - interpret Screen Codes from $C000 to $D000 .D C000 - disassemble one instruction at $C000 .M C000- - display memory from $C000 onwards .D - disassemble from the current address onwards .I - interpret Screen Codes from the current address .I* - interpret Screen Codes from the current address .J - interpret ASCII from the current address
J acts as former plain I now and displays memory in ASCII format.
The display can be controlled in two ways:
a) Function keys F5 and F7 cause continual scrolling up or down respectively. Set for fast scanning through memory. Any other key will stop or start the display. F5 and F7 change the direction of the scroll. STOP or CURSOR DOWN returns to the input prompt.
b) Cursor Up and Cursor Down will scroll the display by one line at the top or bottom of the screen and return to input prompt. Best for editing. Memory may be altered - type over any byte, code or mnemonic and press RETURN. A question mark indicates an error.
BANK SWITCHING
On entry, the Monitor is in RAM mode - all system ROMs are switched out during memory access. To access the ROMs and I/O devices, use the * command, which toggles between modes.
In normal Monitor mode this also enables the cart ROM mirroring. I 8000 will show you a dump of that area. (Usually bank 1 as that is where the monitor and toolkit routines mainly work.)
In FREEZE Monitor mode this command also enables mirroring of $0000 to $09ff of the Cartridge RAM (!).
Hint to abuse * in Freeze Mode:
* ; Switch RAM-ROM ON @BR (track)(sector) 09 ; Loads a block from disk into the Replay RAM @BW (track)(sector) 09 ; Saves the modded block, but this way none of the normal RAM gets corrupted and flawlessly restarting the frozen program is possible.
ASSEMBLY
.A C000 LDA #$01
Assemble an instruction in standard 6502 mnemonics at $C000. The next memory address will be displayed ready for the next instruction.
Before you had to enter the $ all the time to assemble properly: the monitor now assumes Hex all the time.
LDA 01 will turn into LDA $01 LDA 1000,X will turn into LDA $1000,X LDA (FE),Y will turn into LDA ($FE),Y
REGISTER DISPLAY
.R
The program counter, A, X & Y registers, location $01 and the stack pointer are displayed in Hex. The Status register is displayed in Binary. Alter registers by typing over the relevant byte or flag (and hitting return on that line).
FILL MEMORY
.F C000 D000 AA
Fill memory from $C000 to $D000 with the byte $AA.
Now supports pattern fill as well.
.F C000 D000 "foobar!!!" .F C000 D000 ee 20 d0
HUNT MEMORY
.H C000 D000 01 02 03 .H C000 D000 "STRING" .H C000 D000 8D 2? d0 .H C000 D000 20 ?? 10
Hunt through memory for a sequence of bytes or an ASCII string. If any occurrence is detected, the address will be displayed.
Wildcard hunt added. Hunt is using a certain priority to search memory. Wildcard hunt as well as ordinary pattern hunt are only performed when no stacking is done. In this example, only the string search will be performed:
H C000 D000 01 02 03 "TEST"
In general, command stacking only works on a few locations, so it's a good idea to avoid it. Only on the disk command Scratch, filename stacking is a good idea sometimes.
COMPARE
.C C000 D000 E000
Compare the area of memory from $C000 to $D000 with memory starting at $E000. If there is any discrepancy, the memory locations will be displayed together with the bytes at those locations. With optimized and colored output now.
TRANSFER MEMORY
.T C000 D000 E000
Move memory from $C000 to $D000 to the memory starting at $E000. This is an intelligent transfer - memory areas may overlap and may be moved either up or down in memory.
GO
.G C000
Load registers as per the register display and start executing the machine code program starting at $C000. The program may end with either a BRK or an RTS instruction. A plain .G will use the register display of ADDR as the start address.
NUMBER CONVERSION
.N $C000 .N 49152 .N %10101010 .N $C000+$FF .N $FF-1+$4000 .N $FF00/(2 * $AA)
Displays the result of an expression in HEX, DECIMAL and BINARY. If the expression is a single byte value, a PETASCII character is displayed.
OUTPUT TO PRINTER
.PM C000 D000 .PH C000 D000 "STRING"
P is used as a prefix to another command. Memory display will be directed to the printer (device 4). Hold STOP to quit.
EXECUTE A BASIC COMMAND
.BPRINT 8*256 .BPRINT "TEST" .BPLIST SHOULD work ? I have no printer :)
EXECUTE A USER FUNCTION
.U <start> <end> <list_of_opcodes>
Using this function, you can change a memory area to your own needs.
Basically, the list of opcodes is a small subroutine which will be accessed for every byte in that memory area. The original byte comes in the accumulator and the modified value has also to be in the accu. You don't have to specify an RTS or other return code.
So, this routine will invert the memory from $1000 to $1fff (49 FF = EOR #$FF):
.U 1000 2000 49 FF
This routine will shift the high-nybbles into the low-nybbles (4A = LSR A):
.U 1000 2000 4A 4A 4A 4A
Before each call of the subroutine, the carry-flag is cleared. The X-Register will be set to 0 before the very first call and can then be used freely. Y-register must be 0 on exit, better don't touch it!
Using the X-Register you can easily watch a charset, for example (8A E8 = TXA; INX):
.U 0400 0500 8A E8
As you can see, this is a powerful option giving you a lot of possibilities. But really think twice before pressing enter, a wrong opcode might lead to a serious crash and/or loss of data, of course! Ninja added this nice function on very early 3.8 ROMs already - blame Count Zero for the documentation!
LOAD, SAVE, VERIFY
(FIXME)
.L"PROGNAME" .L"PROGNAME",8,C000 .S"PROGNAME",8,C000,D000 .S"PROGNAME",8,C000,D000,E000 .V"PROGNAME"
Load, Save, Verify. If a load address is specified, the program will be loaded to that location, otherwise it will be loaded to the address from which it was saved. Save requires a start and end address, which should be one byte after the last address to be saved. If an additional address is added to the save addresses, this will be saved as the reload address of the program (disk only). All disk I/O uses RAM locations.
NOTE: You cannot load and save memory below $0800 if the Monitor was entered from the Freeze Menu.
It is possible to save that area using the Memory Saver in freezer's Saveland now. Remember that the ending address is exclusive. You may save address $FFFF by using $0000 as the ending address.
.S"NAME",8,0800,0000
NOTE: Tape accesses are avoided by the monitor now.
I/O REGISTERS
.IO
Displays the I/O registers $DC00-$DC0F,$DD00-$DD0F & $D000-$D02E. Any alternations will be incorporated on Restart or Backup. This command only works if the Monitor was called from the Freeze Menu.
WATCH FREEZE/BREAK-POINTS
.W
Displays the memory locations of the Freeze- and Break-Points and only works in freeze mode monitor. Freezepoints are displayed in white color, Breakpoints in gray color. Disassembling freezepoints will show you the obligatory JSR $Dxxx. Having it set using the SF command and restarting will restart at the location where the $Dxxx was hit. When setting it manually in a program with the assemble command the next command will be executed after restart.
Disk Monitor Functions
In monitor mode all the usual disk command options work as normal. This includes device changing using @(device) and @#(device). Output for the error channel using @ was changed a little to save display space. The monitor mode also has some additional functions, described below.
Access drive memory
@* (read device) (write device)
Device 0 indicates that the "device" is computer RAM. If no write device is specified, the write device will be set to the read device number. If no parameters are specified, then the monitor reverts to its default (read and write to computer RAM).
Examples: @*8 Read and write to device 8. @*89 Read from device 8, write to device 9. @*80 Read from device 8, write to computer RAM. @*08 Read from computer RAM, write to device 8. @* Return to default.
All the Monitor's memory access commands can be used with drive memory. Memory can be transferred between devices by setting up the required parameters before using the T command.
As this is a real hardcore hack option, we decided to not mess with the line parsing AGAIN and limit this to devices 8 and 9. Devices 10-30 are not possible here.
Other Disk Commands
@ME (address) - executes a program in drive memory. @BR (TRACK) (SECTOR) (MEMORY PAGE). @BW (TRACK) (SECTOR) (MEMORY PAGE).
These are block read and write commands. If no memory page is specified, then page $CF (=$CF00) will be used.
@BR 12 01 40 - Read track 18, sector 1 to page $4000. @BW 11 00 40 - Write page $40 to track 17, sector 0. @BR +18,+1,40 - same as the first example.
You can specify decimal notation for the track and sector numbers by prefixing with the + character. Separate the parameters with a comma when using decimals.
Take care when writing a disk block - if you accidentally specify the wrong parameters, you cand easily trash the disk! These routines should work fine on devices 8-30.
Freeze & Break Points
Please read Appendix B as well about different cartridge RAM configurations.
From the Freeze Monitor, you can set explicit Freeze and Break points in a program. Up to five Freeze or Break points can be set, which are cleared when program control passes to the Monitor. Following are the Freeze and Break instructions:
SF - Set Freeze Point SZ - Set Break Point RF - Remove Freeze Point (formerly CF) RZ - Remove Break Point (formerly CB)
To set a Freeze or Break point, disassemble the required part of the program, and type the command at the address at which the program should be interrupted.
.> C000 A9 41 LDA #$41 .> C002 20 D2 FF JSR $FFD2 .> C005 60 RTS
.> C002 SF D2 FF JSR $FFD2 RETURN ;Modify location $C002 .> C002 20 D3 DF JSR $DFD3 ;Freeze Point is set
Control will pass to the Freeze Monitor at address $C002 and the original instruction (JSR $FFD2) is restored. You can explicitly clear a Freeze or Break point by typing RF or RZ at the address.
A Break point may also be referred to as a Zero Point. The use of CF, CB, and SB interfered with the opcodes CLI, CLV, CLD, CLC, and SBC, and were changed therefore.
Freeze and Break points act exactly as if you had pressed the freeze button, but you can precisely control the point at which the program is frozen. Breaks pass through the IRQ vector at $FFFE and the break vector at $0316, so they are not suitable for programs which modify these vectors.
Freeze points don't use these vectors, so they are particularly useful for programs (e.g. most games) which switch out the kernal ROM. However, because they use three bytes of code, you need to be careful not to place a Freeze at a point where program control may hit the second or third bytes of the freeze instruction, or you will crash the machine. The I/O ROM ($D000) must also be switched in.
Freeze points can be set only from the Freeze Monitor. You can directly place a freeze instruction (JSR $DED3) using either the Monitor (in which case it will act as a subroutine, calling the Freeze Monitor and returning to the next instruction), or you can call the freezer from a Basic program with SYS 57043. On restart, the program will continue.
Remember - if you find that a program will not load when the cartridge is plugged in - switch the computer off and on, and select NORMAL RESET instead of configuring the memory, before loading the program.
Miscellaneous Tips
Here are some under-documented functions and things to know.
1571 Drive Notes
Switch to double sided mode with the following.
@U0>M1 or OPEN 15,8,15,"U0>M1":CLOSE 15
In this mode, both sides of the disk are used, giving twice the storage space when the disk is formatted. To switch to single sided (1541) mode:
@U0>M0 or OPEN 15,8,15,"U0>M0":CLOSE 15
The drive powers up in 1541 mode when connected to a 64, so enter the command mentioned before if you wish to use double sided mode. NOTE: Side two of a double-sided disk cannot be read by a 1541 drive.
1581 Drive Notes
Some samples of this drive are not very happy when working with a 64 or 128 in 64 mode. If you find that the system hangs when reading the directory or error channel you should press STOP/RESTORE and enter the following commands:
@U0>B0 @U0>B0 or OPEN 15,8,15,"U0>B0":PRINT#15,"U0>B0":CLOSE 15
NOTE: The same command is entered twice. It is only necessary with early samples of the drive and should be entered each time you switch on the drive or reset the system.
Burning a new drive rom for the 1581 usually fixes this problem. Sometimes replacing the controller is needed, but getting these is hard. Also the 1581 JiffyDOS works fine with the CyberpunX Replay Fastloader.
FASTLOAD Trickery
If your filename in save was "*" the program will be named "". To get rid of it again, use @s: without name as well. @R:*=filename will rename the file to "". You should only do this to the first program on disk, to be able to load it back using ":*" as filename ...
Appendix A
Programming Tips
Many people know this:
sei lda #$00 sta $de00 jmp $fce2
This routine will take you straight to the powerup menu of the cart and is a rather nice way to quit your programs. LDA #$08 will take you straight to the Fastload Toolkit. If no Replay is present, a normal Reset will be performed.
We have been looking around in the sources to find useful routines but none were found we would recommend. It is not appreciated to use cartridge ROM routines as they are moving targets!
Utilising the Retro Replay RAM
First a short note about the RAM Configuration. While being in Basic Toolkit the first bank of the cartridge is usually switched in. RAM sits from $8000 - $9fff under/over the actual Cart Bank. When using the Disk Turbo the RAM will be used for buffering data. The same goes for most freezer operations, but still it's rather simple to use the additional RAM and I really hope some people come up with new interesting programs using the ram.
sei lda #$23 sta $de00 ; turns RAM on at $8000, ROM Bank 0 at $e000 ; use LDA #$20 to only turn on RAM at $8000 ... do your stuff here ... lda #$0a sta $de00 ; back to first bank cli rts
THAT'S IT ! Simple, hm ??? Now tell me again programming RR is hard. :) WELL, a good idea is turn the screen off or wait for $d012 to be in the upper or lower border though.
Apendix C
Writing own extensions
When writing parameter extensions for the freezer you may want to access areas, which are currently backed up into the internal RAM. Therefore a (longish) routine is already installed in memory when being in Freeze-Mode, which does the address translation for you and gets the correct byte.
To check it out yourself, enter the monitor from the Freeze Menu and hit * to switch the RAM/ROM Config. Now you can disassemble the routine at $02a7.
That routine should be used on any accesses to ordinary RAM from $0000 to $1500 by your Parameter Extension. Zeropage $8e/$8f has to have the address you are looking for, Akku needs to have the value you want to write, Y-Register needs to be $00. JSR $02a7 and off you go. For reading a byte from the area mentioned before, JSR $02b3 does the trick.
In short:
JSR $02A7 works like STA ($8E),Y JSR $02b3 works like LDA ($8E),Y
In case you have code that is slowed down too much by these routines, just use $23 (or $20) on $de00 to turn the RAM on and $00 on $de00 to switch back to Bank 0 of the cart (Freezer-Bank). Please keep in mind, that you have to know more precisely what you are looking for when directly using $de00. (See Appendix B for more info.)
The user-area for your extension programs is from $0a00 to $1500.
ATTENTION! Programs exceeding $1500 will kill the memory of the frozen program from $1500 to the end of the extension.
Hey, your extension filename needs to start with E. to have the loader recognize it. :)
A simple RTS is enough to return to the freezer menu, but if you trashed the stack a JMP ($0334) may help aswell. Don't forget to re-enable Bank0 by writing $00 to $de00. As for the rest, you may do about anything you like. Just be aware that trashing the memory really affects the frozen RAM and that anything below $1500 needs to be accessed using the $02a7/$02b3 routines.
Action Replay hardware has one write-only I/O register at $de00-$deff. The ONE register is $de00.
Its' bits are as follows:
Bit 7 - unused Bit 6 - Resets FREEZE-mode (turns back to normal mode) Bit 5 - 1=enable RAM at ROML ($8000) & I/O2 ($DF00, =$9F00-$9FFF) Bit 4 - ROM bank selector high (A14) Bit 3 - ROM bank selector low (A13) Bit 2 - 1=disable cartridge (turn off the $de00 register) Bit 1 - 1=-EXROM high Bit 0 - 1=-GAME low
Retro Replay hardware has a compatible but heavily extended register-set.
$de00 write: This register is reset to $00 on a hard reset if not in flash mode. If in flash mode, it is set to $02 in order to prevent the computer from starting the normal cartridge. Bit 7 - controls bank-address 15 for ROM banking Bit 6 - must be set once to "1" after a successful freeze in order to set the correct memory map and enable Bits 0 and 1 of this register. Otherwise no effect. Bit 5 - switches between ROM and RAM: 0=ROM, 1=RAM Bit 4 - controls bank-address 14 for ROM and RAM banking Bit 3 - controls bank-address 13 for ROM and RAM banking Bit 2 - Setting this bit will disable further write accesses to all registers & reset the c64 memory map to standard, as if there is no cartridge installed at all. Bit 1 controls the EXROM line: A 0 will assert it, a 1 will deassert it. Bit 0 controls the GAME line: A 1 asserts the line, a 0 will deassert it.
$de01 write: Extended control register. If not in Flash mode, this register can only be written to once. If in Flash mode, the REUcomp bit cannot be set, but the register will not be disabled by the first write. Bit 5 is always set to 0 if not in flash mode. Bit 7 - bank-address 15 for ROM (mirror of $de00) Bit 6 - REU compatibility bit. 0=standard memory map 1=REU compatible memory map Bit 5 - bank-address 16 for ROM (only in flash mode) Bit 4 - bank-address 14 for RAM and ROM (mirror of $de00) Bit 3 - bank-address 13 for RAM and ROM (mirror of $de00) Bit 2 - NoFreeze (1 disables Freeze function) Bit 1 - AllowBank (1 allows banking of RAM in $df00/$de02 area) Bit 0 - enable accessory connector (SilverSurfer).
$de00 read or $de01 read: Bit 7 - feedback of banking bit 15 Bit 6 - 1=REU compatible memory map active Bit 5 - feedback of banking bit 16 Bit 4 - feedback of banking bit 14 Bit 3 - feedback of banking bit 13 Bit 2 - 1=Freeze button pressed Bit 1 - feedback of AllowBank bit Bit 0 - 1=Flashmode active (jumper set)
To disable the cart:
sei
lda #$14
sta $de00
jsr $e453
cli
rts
should work pretty well.
This results in the values $00, $08, $10 and $18 for Banks 0, 1, 2 and 3.
$80, $88, $90, $98 are used for Banks 4, 5, 6 and 7 on the new 64kb ROMs.
$0A in $de00 will take you to a safe basic environment.
Appendix D
Memory Mapping
The newly introduced bits on the Retro Replay hardware allow some new fancy things and allow more compatibility with already existing hardware, but the experts should know about some things.
$de00/$df00 are the memory pages where a cartridge can have a memory page mapped in (IO1 and IO2). Bit 6 of $de01 sets the page which is used to map in the IO-Page. Since this register is write once (except for bit 0), the cartridge reset routine usually sets this bit to its correct value. Whenever a REU-compatible memory map is used, $de10 to $deff will be used to map in a mirror of $9e10 to $9eff. $dfxx is free for REU then. The default for the RR hardware is to run with the IO area mapped to $df00-$dfff. This is Action Replay compatible behaviour and the mirror comes from $9f00 to $9fff then. The SilverSurfer serial interface uses registers from $de02 to $de0f when plugged in and activated. Therefore the routines in the IO areas have been shortened as much as possible and will require further optimizations aswell.
The RR-RAM is something special. Setting bit 5 of $de00 activates the RAM of your RR hardware, just like on AR hardware. While trying to use the banking bits 3 and 4 along with bit 5 has no effect on plain AR hardware, the new hardware will map in one of the four available 8kb RAM banks. Just like the ROM banks, the RAM is mapped in from $8000 to $9fff.
Bit 1 of $de01 allows you to select a more flexible RAM banking. If the AllowBank bit is not set, the $de02-$deff or $dfxx area will always mirror from bank 0 of the RAM, so the older cartridge images will work. With the bit set, the RR will use the selected RAM bank to map in the IO area.
We will currently keep this bit unset, since this gives the advantage that the upper 3 RAM banks can be used completely and not every time $100 hexbytes have to be wasted/fragmented around $9e00/$9f00.
PLEASE NOTE that you should ONLY use the set/clear freeze and breakpoint commands from the monitor with their tokens!
I know many people writing the JSR $ded3 manually, but since the adress will change, I recommend to keep this in mind!