CALL CHDSK
This page was last modified 19:27, 26 May 2023 by Mars2000you. Based on work by Gdx.

Contents

Effect

Mounts (inserts) the specified disk image (DSK file) to the virtual diskdrive of the MSX1/MSX2 computer emulated in a MSX turbo R with the rMSX emulator and/or activates a specified disk number.

Notes:

  • The real disk drive of the MSX turbo R can also be used with a real disk
  • Programs on disk can usually be started with one of the following instructions:
    • RUN"AUTOEXEC.BAS" when there is an autoexecutable BASIC loader
    • CALL SYSTEM for many disks with a visible or hidden MSX-DOS loader
  • However, it's generally more easy to use the CALL RESET instruction after insertion of the disk(s) + activation of a specific disk for games on multiple disks

Syntaxes

  • CALL CHDSK [("<Device>:\<Path>\<Filename.DSK>")] to mount disk image for current disk number. If parameter is not given or it is empty real disk drive will be used
  • CALL CHDSK ("<Device>:\<Path>\<Filename.DSK>"),<DiskNumber> to mount disk image to specified disk number (without activation)
  • CALL CHDSK (<DiskNumber>),("<Device>:\<Path>\<Filename.DSK>")] to activate specified disk number and optionally mount disk image to it

Notes:

  • Character backslash (\) serves as a separator between the folders and the file name in MSX-DOS2. You don't have to put it after the colon of the device name.
  • Character backslash is replaced by the character yen (¥) on Japanese MSX or the character won (₩) on Korean MSX.
  • Parameters can not end with a comma alone.

Parameters

<Device> is the name for used device (see table below).

If you don't specify the drive, the instruction will be applied to the currently active drive (by default, it's drive A:)

Device type Device name Remark
Disk drive A, B, C, D, E, F, G, H A floppy disk interface can control until 2 drives.


<Path> is used to specify the location in folders of the DSK file to insert. Each folder name in path are separate by a backslash (\). This parameter is only available in version 2 of Disk BASIC.

Dot (.) represents the current working directory, Dot Dot (..) represents the directory before the current (one level up).

<Filename.DSK> is the name of the DSK file to insert in the emulated MSX1 or MSX2 computer.

<DiskNumber> is an integer between 0 and 9

Examples

_CHDSK ("A:\GAMES\DSK\ANDOROGY.DSK")

A loader for Aleste 2 with activation of the first game disk (0 = demo disk, 1 and 2 = game disks)

10 _CHDIR("A:\GAMES\DSK\")
20 FOR D=1 TO 3
30 N$="ALESTE2"+HEX$(D)
40 _CHDSK(N$+".DSK",D-1)
50 NEXT D
60 _CHDSK(1)
70 _RESET

Related to

CALL CHDIR, CALL FILES, CALL RESET, FILES

Compatibility

RMSX BASIC