Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Get cluster information" function call, improvements to EMUFILE #35

Merged
merged 8 commits into from Jul 10, 2020

Conversation

Konamiman
Copy link
Owner

@Konamiman Konamiman commented Oct 8, 2019

This pull request adds a new function call, GETCLUS (code 7Eh), that allows to retrieve information about a given cluster in a FAT12 or FAT16 drive. The information returned is:

  • FAT sector number that contains the entry for the cluster
  • Offset in the FAT sector where the entry for the cluster is located
  • First data sector number the cluster refers to
  • Value of the FAT entry for the cluster
  • Size of a cluster in sectors for the drive
  • Flags indicating:
    • The type of FAT (FAT12 or FAT16)
    • Whether the FAT entry for the cluster is an odd entry (FAT12 only)
    • Whether the the cluster is the last one of a file, or is an unused cluster

A new tool is added, CONCLUS: it checks the FAT chain of a given file using the new function, and tells whether the file is stored across consecutive sectors in the disk or not.

Also the EMUFILE tool is updated to use this new function in order to check if disk image files are stored across consecutive sectors in the disk.

As a bonus, there's another improvement to EMUFILE: now the "set" command accepts a directory name as parameter instead of a file name. When a directory name is supplied, a file with the same name and .EMU extension will be used. For example, EMUFILE SET \DSKS\GAME is equivalent to EMUFILE SET \DSKS\GAME\GAME.EMU if \DSKS\GAME is a directory.

- Add the appropriate entry points in the kernel
- Add the function skeleton, for now it only checks if the drive exists
- Add the entry point in NEXTOR.SYS (and step it up to v2.11)
(to do: fill FAT sector number and offset)
- Use a dedicated buffer, instead of TMP_FCB, for intermediate data
- Add an explicit flag for FAT12 drives
- Return .NDOS if the drive is neither FAT12 nor FAT16
- Add a flag for unused clusters
- Always return the real value of the cluster (not FFFFH always when it's
  the last cluster in the file)
A new error code is defined (.ICLUS, B0h), it will be returned
when the cluster number supplied to GETCLUS is invalid;
the "valid cluster number" flag has been removed.

Also, some missing Japanese error messages have been added.
- It uses the new GETCLUS function to check the FAT chain of
  disk image files  when createing an .EMU file.
- It now accepts a directory as paramneter for "set", then it
  searches a file with the same name and .EMU extension
  inside the directory.
@Konamiman Konamiman added this to the v2.1.0 final milestone Oct 8, 2019
@Konamiman Konamiman self-assigned this Oct 8, 2019
@Konamiman Konamiman mentioned this pull request Oct 8, 2019
@Konamiman Konamiman added the enhancement New feature or request label Oct 8, 2019
@Konamiman Konamiman changed the title "Get cluster information" function call, and improvements to EMUFILE "Get cluster information" function call, improvements to EMUFILE Jul 10, 2020
@Konamiman Konamiman merged commit 02773df into v2.1.0-final Jul 10, 2020
@Konamiman Konamiman deleted the get_cluster_info_function_call branch July 10, 2020 07:45
Konamiman added a commit that referenced this pull request Jul 27, 2020
* Add UNAPI RAM Helper compatible mapper support routines (#34)
* "Get cluster information" function call, and improvements to EMUFILE (#35)
* Cleanup/fix C tools compilation (#36)
* Post-RC1 fixes and changes (#61)
* Fix: using bad address of emulation work area in disk emulation mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant