forked from MEGA65/mega65-user-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreezer.tex
251 lines (205 loc) · 12 KB
/
freezer.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
\chapter{Floppy Disks, the Freezer, and D81 Images}
\label{cha:freezer}
\phantomsection
\section{Disk Drives}
\index{Disk Drives}
The MEGA65 is compatible with a wide range of floppy disk drives, and can be configured to use them in a variety
of different ways. It includes an internal 3.5" drive, which is compatible with double density and high density
3.5" disks. But did you know you can also use 5.25" disks? By connecting a compatible IEC drive to the rear
Disk Drive/IEC Connector, you can use your MEGA65 with two or more physical floppy drives simultaneously!
There are also IEC drive emulators available, such as the SD2IEC. These devices
(and the MEGA65) use ``disk images'', which are files that represent a floppy disk, usually stored on an SD card.
By ``mounting'' a disk image file to a disk drive emulator, the MEGA65 can then use these files without realising it's
actually being emulated. As far as the MEGA65 is concerned, it's using a real drive.
This allows you to use modern media to read and write your programs, and in some cases can drastically reduce
read and write times. These files usually have the extension {\bf .d64} (named after the C64), which are files that
represent a {\it single} side of a 5.25" disk, or {\bf .d81}, which represents an entire 3.5" disk (named after the
1581 floppy disk drive).
The MEGA65 can use either real disks and drives, {\bf .d81} files, or a combination of both.
\subsection{Disk Drive Terminology}
\index{Disk Drives!Terminology}
\index{Connections!IEC}
Before you get to know how to use the various disk drives that work with the MEGA65, it's important to be aware
of some specific terminology which CBM computers and the MEGA65 use. This includes {\bf BASIC} commands (such as
{\bf LOAD} and {\bf SAVE}), and {\bf CBDOS} (Computer Based Disk Operating System), which use the following:
{\bf UNIT} is a device number in the range of 0-31.
The numbers from 0 to 11 are reserved for the following device types:
\setlength{\tabcolsep}{1mm}
\begin{center}
\begin{tabular}{|l|l|l|}
\hline
{\bf Unit} \# & {\bf Device} & {\bf Notes} \\
\hline
0 & Keyboard & Input \\
1 & Unused & Was used for Cassettes on the C64 \\
2 & Unused & Was used for RS-232 on the C64 \\
3 & Screen & Input/Output \\
4-5 & IEC Printer & Output \\
6-7 & IEC Plotter & Output \\
8-9 & CBDOS drives\footnotemark{} & Internal floppy drive, 1565\footnotemark{}, or disk image \\
10-11 & IEC drives & 1541, 1571, 1581, FD-2000 \\
\hline
\end{tabular}
\end{center}
\addtocounter{footnote}{-2}
\stepcounter{footnote}\footnotetext{IEC drives can be assigned to devices 8-9, by moving the built-in MEGA65 devices
to 10-11 first. Once the drives have been reassigned, the IEC drives can be
switched on.}
\stepcounter{footnote}\footnotetext{The 1565 was a prototype external C65 disk drive that never made it to production.}
{\bf DRIVE} is the drive number of a {\bf UNIT}:
\setlength{\tabcolsep}{1mm}
\begin{center}
\begin{tabular}{|l|l|l|}
\hline
{\bf Unit} & {\bf Drive Numbers} & {\bf Comment} \\
\hline
1541 IEC & 0 & Single drive \\
1571 IEC & 0 & Single drive \\
1581 IEC & 0 & Single drive \\
FD-2000 IEC & 0 & Single drive (CMD)\\
FD-4000 IEC & 0 & Single drive (CMD)\\
SD2IEC & 0 & Disk images\\
4040 IEEE-488 & 0,1 & Dual drive (CMD)\\
8050 IEEE-488 & 0,1 & Dual drive (CMD)\\
8250 IEEE-488 & 0,1 & Dual drive (CMD)\\
\hline
\end{tabular}
\end{center}
% thw following few paragraphs probably needs more wording. Sounds like a list of bullet points which isn't pretty.
For all single drives, the drive number is always 0.
This includes all of the well known drives with an IEC interface.
Dual disk drives (which use drive numbers 0 and 1) are usually equipped with an IEEE-488 interface, and need
an IEEE-488 to IEC converter to be used on the MEGA65.
The internal floppy controller of the MEGA65 can be used to control
two floppy drives. However, both drives must be attached to the same ribbon cable.
{\bf BASIC} commands that address files or disks include
{\bf U} for UNIT and {\bf D} for drive, which use the default values of
{\bf UNIT = 8}, and {\bf DRIVE = 0}.
\section{The Freezer}
\label{sec:freezer}
The MEGA65 {\bf FREEZER} is a tool for changing system parameters at any time,
regardless of the currently running program. It's very similar to the Freezer that many popular cartridges
for the C64 included, such as the Action Replay cartridge, and The Final cartridge. Freezers generally work by
taking over the CPU whilst leaving RAM intact. This way you can perform functions and change configuration
settings without affecting the currently running program. Once you have finished using the Freezer, CPU control
is given back to the original program.
The Freezer is invoked by pressing and holding \widekey{RESTORE} for half to one second.
The current status of the computer is frozen and the Freezer menu,
similar to the following picture is displayed. This chapter focuses on how to assign disk images and configure
the internal floppy disk drive, but the other options in the Freezer are self explanatory, or will be covered in detail in
online documentation.
\begin{center}
\includegraphics[trim= 10mm 20mm 10mm 20mm,clip,width=0.7\linewidth]{images/freezer.jpg}
\end{center}
The bottom-right part of the Freezer screen shows the current disk drive assignments.
The internal CBDOS which the MEGA65 uses supports up to two
3.5" disk drives and .d81 images, in any combination.
Drive 0 can be assigned to the internal floppy disk drive or a .d81 disk image,
whereas Drive 1 can be assigned to an external floppy disk drive (connected to the
same ribbon cable as the internal drive), or a .d81 disk image.
\index{Disk Drives!Assignment}
A typical configuration is usually one of the following:
\begin{center}
\begin{tabular}{|l|l|l|}
\hline
{\bf Drive 0 Assignment} & {\bf Drive 1 Assignment} \\
\hline
Internal floppy disk drive & Disk image \\
Disk image & Disk image \\
\hline
\end{tabular}
\end{center}
The assignment, and mounting of disk images can be performed by pressing
\megakey{0} for drive 0, or \megakey{1} for drive 1.
You may have noticed that the drive numbers here (0-1) are different to the more commonly used {\bf UNIT}
numbers (8-9), which you may be more used to. The drive numbers of 0 and 1 are used internally by CBDOS.
However, {\bf BASIC} and Kernal address these storage devices by {\bf UNIT} numbers. CBDOS emulates two single drives for
the operating system, by assigning separate unit numbers to drive 0 and drive 1.
The default assignment is:
\begin{center}
\begin{tabular}{|l|l|l|}
\hline
{\bf Assignment} & {\bf Unit/Drive} \\
\hline
Internal drive 0 (internal floppy or disk image) & UNIT 8, DRIVE 0 \\
Internal drive 1 (external floppy or disk image) & UNIT 9, DRIVE 0 \\
\hline
\end{tabular}
\end{center}
You may wish to change this unit assignment, if for example
a 1541 drive is connected to the IEC port as unit 8.
In this case, the internal drive assignment can be switched to an alternative unit
to avoid conflict. To do this, press \megakey{8} to toggle the unit assignment of drive 0
between 8 and 10, and \megakey{9} to toggle the unit assignment of drive 1, between 9 and 11.
After setting the preferences, the Freezer can be exited
with \megakey{F3}. The Freezer restores the screen and
returns to the interrupted program.
Note: The drive and unit assignments are temporary, and will be reset to their defaults
after power down or reset. For permanent settings, use the {\bf CONFIGURE}
menu. You can read more about this menu on page \pageref{configuring-chipset}.
\index{Disk Drives!D81 Images}
\label{sec:d81-images}
\section{Using D81 images}
As previously mentioned, the MEGA65 allows the use of D81 files instead of using physical disks. The MEGA65 includes a
built-in file browser, which allows you to choose which D81 file to mount. To do this, enter the Freezer menu,
then press \megakey{0} or \megakey{1}, to choose the drive to mount it to.
When you do this, the file browser will appear:
\begin{center}
\includegraphics[width=0.7\linewidth]{images/d81-file-browser.png}
\end{center}
The file browser will list all D81 images on the microSD card. The MEGA65 prioritises the external microSD card, so if you
prefer to use an image on the internal SD card, the microSD card should be removed (when doing this, the MEGA65 needs
to be reset as well).
Press the cursor keys to choose a file. If the currently selected file isn't a valid D81, the border will be red,
otherwise it will be blue, as shown above. Whilst browsing for D81 files, the list of files within the currently
selected D81 file will be shown on the right-hand side.
You may have noticed that the file browser has a \screentextwide{ - NO DISK - }, \screentextwide{ - NEW D81 IMAGE - }
and a \screentextwide{ - INTERNAL 3.5" - } entry. \screentextwide{ - NO DISK - } is used to tell
the MEGA65 that no disk is inserted, and to not try and find one when performing a disk-based operation.
\screentextwide{ - NEW D81 IMAGE - } creates a new, blank D81 image to use. When you select this option, you'll be
asked to enter the filename for the new image, which is limited to 8 characters in length.
\screentextwide{ - INTERNAL 3.5" - } is used when using a physical 3.5" disk in the internal drive. If no disk is
inserted and a disk-based operation is performed with the \screentextwide{ - INTERNAL 3.5" - } option, the MEGA65 will
try and find a disk, which could take a few seconds. Any previously mounted D81 files will be unmounted when using
these options.
When you find the D81 file you wish to mount, press \specialkey{RETURN}.
This will take you back to the Freezer menu, and the selected D81 file will be shown under the selected drive.
In the following screenshot, the \screentextwide{MEGA65.D81} file has been mounted to drive 0:
\begin{center}
\includegraphics[trim= 10mm 20mm 10mm 20mm,clip,width=0.7\linewidth]{images/freezer-chosen-d81.png}
\end{center}
Next, press \megakey{F3} to exit the Freezer menu and return to the currently running program. Alternatively,
pressing \megakey{F5} will exit the Freezer, and reset the MEGA65 as well.
Now that the file has been mounted, you can use
the {\bf DIR} command to list the files in the image, or any of the {\bf LOAD} and {\bf SAVE} commands, like you
would on a physical disk.
\subsection{Auto Booting From a Disk}
If you would like the MEGA65 to automatically perform any BASIC commands upon startup, you can create an
{\bf AUTOBOOT.C65} PRG file on your disk/image. In this file, you can write BASIC programs to do things such
as changing the {\bf BACKGROUND}, {\bf BORDER}, or {\bf FOREGROUND} colours, or even {\bf LOAD} a program.
For example, to change the background and border colours to black, and load a program called ``MYPROGRAM''
automatically, create a BASIC listing like the following, then {\bf SAVE} it:
\index{BASIC 65 Examples!BACKGROUND}
\index{BASIC 65 Examples!BORDER}
\index{BASIC 65 Examples!LOAD}
\index{BASIC 65 Examples!SAVE}
\begin{tcolorbox}[colback=black,coltext=white]
\verbatimfont{\codefont}
\begin{verbatim}
10 BACKGROUND 0
20 BORDER 0
30 LOAD "MYPROGRAM.PRG"
SAVE "AUTOBOOT.C65"
\end{verbatim}
\end{tcolorbox}
\subsection{Saving D81 file settings}
The D81 settings are temporary, and will be reset to their defaults after power down. You can change the default settings
in the {\bf CONFIGURE} menu. When opening the Configure menu, press the \megakey{F1} and \megakey{F2} keys
to reach the \screentext{CHIPSET} section, then navigate to the \screentext{F011 DISK CONTROLLER} options.
Select the \screentext{USES SDCARD DISK IMAGE} setting, then enter the name of the disk image you wish to have mounted
by default in the \screentext{DEFAULT DISK IMAGE} field. A screenshot showing these settings with
\screentext{MEGA65.D81} as the default D81 disk image is shown:
\begin{center}
\includegraphics[width=0.7\linewidth]{images/ss-m65config-2.png}
\end{center}
You can read more about the Configure menu on page \pageref{sec:configuration-utility}.