-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Nextor-2.1-alpha-2.txt
198 lines (106 loc) · 11.7 KB
/
Nextor-2.1-alpha-2.txt
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
Nextor 2.1 Alpha 2
------------------
By Konamiman, 3/2015
http://www.konamiman.com#nextor
1. WHAT'S NEW IN ALPHA 2
Nextor 2.1 Alpha 1 hasincluded everything that Nextor 2.0 has plus one new feature: the ability to mount disk image files on drive letters. When a disk image file is mounted, you can access its contained files and directories by using regular MSX-DOS/MSX BASIC commands and tools. This feature is explained in section 2.
Furthermore, Nextor 2.1 Alpha 2 adds yet a new feature: the ability to boot the computer in disk emulation mode, using disk image files as if they were real floppy disks. You can now play your favourite MSX-DOS 2 incompatible games with Nextor! This feature is explained in section 3.
2. MOUNTING FILES
2.1. HOW TO MOUNT A FILE
Files are mounted either by using the updated MAPDRV.COM tool from the COMMAND2.COM prompt, or the CALL MAPDRV command from the BASIC prompt.
The syntax for MAPDRV.COM is:
MAPDRV <drive> <file> [/ro]
For example, to mount file TOOLS.DSK on drive G: do
MAPDRV G: TOOLS.DSK
Adding "/ro" will cause the file to be mounted in read-only mode, that is, trying to write to the mounted drive will cause a "Write protected disk" error.
The syntax for CALL MAPDRV is:
CALL MAPDRV(<drive>, <file> [,0|1])
For example, again to mount file TOOLS.DSK on drive G: do
CALL MAPDRV("G:", "TOOLS.DSK")
Adding ",1" after the file name will cause the file to be mounted in read-only mode.
NOTE: If the disk image file has the read-only attribute set, it will ALWAYS be mounted in read-only mode, even if no "/ro" / ",1" modifier is specified.
To unmount the file, simply set a different mapping on the drive where the file is mounted (in the previous examples it would be G:). You can set a normal partition mapping, or just leave the drive unmapped:
MAPDRV <drive> U
CALL MAPDRV(<drive>, -1)
2.2. RULES AND RESTRICTIONS
To be mountable a disk image file must have a size of at least 512 bytes and at most 32 MBytes. The file is expected to contain a proper FAT filesystem already, it is not possible to apply the FORMAT command on a mounted drive.
Also, the following restrictions apply:
- The file cannot contain partitions, the contained filesystem is expected to start right at the beginning of the file.
- It is not possible to mount a file on the drive where the file itself is located:
MAPDRV A: A:TOOLS.DSK --> Error
- It is not possible to mount the same file in two drives at the same time:
MAPDRV B: TOOLS.DSK
MAPDRV C: TOOLS.DSK --> Error
- It is not possible to do a recursive file mount (mounting a file that is itself inside a mounted disk image file):
MAPDRV B: TOOLS.DSK
MAPDRV C: B:FILE.DSK --> Error
- It is not possible to alter the mapping state of a drive if it contains one or more files that are currently mounted:
MAPDRV B: A:TOOLS.DSK
MAPDRV A: U --> Error
- It is not possible to open or to alter (rename, move, delete, overwrite, change attributes) a mounted file:
MAPDRV B: TOOLS.DSK
TYPE TOOLS.DSK --> Error
ECHO HELLO > TOOLS.DSK --> Error (see "known bugs" below)
REN TOOLS.DSK X.DSK --> Error
MOVE TOOLS.DSK SOMEDIR\ --> Error
DEL TOOLS.DSK --> Error
ATTRIB +R TOOLS.DSK --> Error
2.3. CHANGES IN FUNCTION CALLS
The _MAPDRV function call (7Ch) has been expanded to allow mounting files. The input parameters to mount a file are:
B = 3
HL = Path to filename or FIB
D = 0 for default mount (write allowed unless the file has the read-only attribute set)
1 to force read-only mount
The _GDLI function call (79h) now returns the following information in the data buffer for drives where a file is mounted:
+0: 3
+1: Drive where the mounted file is located (0 = A:, etc)
+2: Flags: 1 if the file is mounted in read-only mode, 0 otherwise
+3: 0 (reserved for more flags)
+4: Filename in printable format (up to 12 characters, plus a terminating zero)
Please refer to the Nextor Progrmmers Reference for more details on these function calls.
2.4. NEW ERROR CODES
Two new error codes have been introduced:
- "File is mounted" (.FMNT, DOS error code B2h, BASIC error code 80)
This error appears when trying to open or alter a mounted file, or when trying to perform any other non allowed operation involving a mounted file (see "Rules and restrictions")
- "Bad file size" (.BFSZ, DOS error code B1h, BASIC error code 81)
This error appears when trying to mount a file that is smaller than 512 bytes or larger than 32 MBytes.
2.5. KNOWN BUGS
Trying to overwrite a mounted file via the "Create file handle" function call (_CREATE, 44h), for example by executing a "ECHO HELLO > TOOLS.DSK" command, will actually succeeed and the file will be overwritten; a "File is mounted" error should be returned instead.
3. DISK EMULATION MODE
3.1. HOW TO ENTER AND EXIT DISK EMULATION MODE
Nextor will boot in disk emulation mode if it finds a file named NEXT_DSK.DAT in the root directory of a primary partition in a device controlled by the primary Nextor controller. This file contains information about the disk image files to be used for the emulation.
The NEXT_DSK.DAT file is created by using the supplied EMUFILE.COM tool. Most times it's as easy as doing just "EMUFILE file1.dsk file2.dsk file3.dsk" (or "EMUFILE game\*.dsk", or just "EMUFILE game\"). There are additional options, run the program without parameters to get more information.
To disable the disk emulation mode (that is, to boot normally even if a NEXT_DSK.DAT file exists), keep the 0 (zero) key pressed while the computer boots. You will have to manually delete or rename the NEXT_DSK.DAT file to prevent the disk emulation mode to be entered again in the next system boot.
3.2. SWITCHING THE EMULATED FILE
Up to 32 disk image files can be specified for an emulation session, but only one of them is active at a given time. In order to switch to a different file, you must press the appropriate key while the computer is trying to read the file; this will emulate a disk change. The keys are 1-9 for the first nine image files, then A-W for the rest, in alphabetical order.
For example, assume that you are playing a two disks game. You boot with disk 1 and at some point the game asks you to insert disk 2 and press space key. Just press 2 (they key assigned to the second image file) and the space key at the same time and you're good to go.
Alternatively, you can also press the GRAPH key when the computer is trying to read the file. The caps led will lit and the computer will freeze until you release GRAPH and press the appropriate file key. This is useful when having to directly press an alphanumeric key while disk access is performed is a problem (for example, you are in the BASIC prompt and you want to trigger a file change when executing a FILES command: the pressed key would be added to "FILES" causing a Syntax Error).
3.3. RULES AND RESTRICTIONS
The following rules and restrictions apply to the disk emulation mode:
- The primary controller must be a Nextor kernel with a device-based driver.
- The NEXT_DSK.DAT file and all the disk image files must be placed in devices controlled by the primary controller (but they can be in different partitions and even in different devices).
- The NEXT_DSK.DAT file stores information about absolute device sectors, therefore it will be unusable if the disk image files are moved and file renames will have no effect. It is recommended to generate the file immediately before using it.
- The disk image files must have a size of at least 512 bytes and at most 32 MBytes, must not contain partitions (the contained filesystem is expected to start right at the beginning of the file), and must contain a proper FAT12 filesystem (the FORMAT command will not work in disk emulation mode).
- The disk image files must not be fragmented, that is, their contents must be placed across consecutive sectors in the device.
- Disk emulation mode is always started in DOS 1 mode and in Z80 mode. If you want to start a game in R800 mode, do the following: keep pressed GRAPH and 2 while the computer boots, and when the caps led lits, release both keys and press 1.
- All Nextor controllers but the primary one will be disabled when disk emulation mode is entered. MSX-DOS kernels (such as the internal floppy disk drive) will not, but you can force them to disable themselves by pressing SHIFT while booting; this is useful to free some memory.
- If you are using a NEXTOR.DAT file to alter the device mappings priority, Nextor needs the NEXT_DSK.DAT to be found before NEXTOR.DAT in order to start emulation mode. This means that NEXT_DSK.DAT must be placed either 1. In the same partition of NEXTOR.DAT (relative position in the root directory is irrelevant); 2. In a primary partition with a smaller number in the same device; or 3. In a device with a smaller device number.
3.4. HOW TO FREE SOME MEMORY
Some games will not work "out of the box" because they assume that only the floppy disk drive is present in the system, but now there are drives allocated for both Nextor and the floppy drive, and thus the amount of free memory is smaller. You can do the following in order to increase the amount of memory available for games:
- Press SHIFT while booting to disable the internal floppy disk drive (and any other MSX-DOS kernel, for that matter).
- Press 5 while booting to force Nextor to allocate only one drive for itself (useful only if you have more than one device connected to your Nextor controller). If your emulation session has five or more disk images, do the following instead: press GRAPH+5 until the caps led lits, then release both keys and press 1.
3.5. KNOWN BUGS
The current version of the EMUFILE.COM tool does not verify that the disk image files are not fragmented.
If you have more than one device in the primary Nextor controller (for example, for the MegaFlashROM SCC+ SD this means two SD cards, or one or two cards plus the ROM disk), Nextor will allocate one dummy drive letter for each extra device. MSX-DOS devices (if any) will then have drive letters assigned after these. For example, if you have three devices, A: is where the emulated disk image file is mounted, B: and C: are dummy, and D: is the internal floppy disk drive. These dummy drives will NOT have memory allocated for FAT buffers.
4. OTHER USEFUL INFORMATION
WARNING: This is alpha software. It has not been thoroughly tested and could be buggy. Please backup your data before using it.
WARNING: After mounting a file do not extract or swap the medium where the file is contained. The behavior of Nextor if this is done is undefined and you could lose data.
Starting at version 2.1 alpha 2, the following changes apply to the boot keys:
- CTRL: Enable the virtual second floppy disk drive. Not pressing the key will disable it. That is, the meaning of the CTRL key for floppy disk drives is reversed relative to how MSX-DOS works.
- 5: Force Nextor kernels to allocate only one drive for themselves, regardless of the number of devices attached (this behavior was attached to the CTRL key in previous versions). This prevents the dummy drives problem mentioned in the previous section.
The caps lock led will lit when the disk image files are accessed in floppy disk emulation mode.
The CALL MAPDRV command does not work in disk emulation mode, this is by design.
The updated DRVINFO.COM tool and the CALL DRVINFO command will display the file name and the containing drive for drives where a file is mounted:
Drive G: is assigned to:
File TOOLS.DSK on drive A: (read-only)
The easiest way to create empty disk image files is to use the NestorDiskImageCreator tool available at Konamiman's MSX site (http://konamiman.com/msx/megascsi/ndicreat.lzh).