User:Rhialto: Difference between revisions

From vice-emu
Jump to navigation Jump to search
(Created page with "Stub page to show I exist.")
 
No edit summary
Line 1: Line 1:
Stub page to show I exist.
Stub page to show I exist.
== Improving dual disk drive handling ==
Currently, dual disk drives live a strange half / double life. Drive 1 of unit 8 (using the terminology of Basic 4 and fortunately also mostly of the code) is using most of the data structures that would otherwise be used by device 9. So if you want 2 dual drives, they will have device numbers 8 and 10.
This madness is clearly visible in source file ''src/drive/ieee/fdc.c''.
There are 4 ''fdc_t'' structures, each of which corresponds to a drive. (Despite the name that suggests floppy disk controller). When using unit 9 or 11, or ''num_drives'' is 2, weird stuff happens in functions like ''fdc_reset()''.
My proposal here is to change all functions here that take a unit number (in particular those that also do something with a d''isk_image_t''), and change them to take a drive number too..
''static fdc_t fdc[NUM_FDC];'' will become static ''fdc_t fdc[NUM_FDC][2];'' and the drive number will be the second index.
This change will flow outwards like an oil spill, since many functions are used via pointers and need to have the same signature...

Revision as of 22:35, 16 August 2019

Stub page to show I exist.

Improving dual disk drive handling

Currently, dual disk drives live a strange half / double life. Drive 1 of unit 8 (using the terminology of Basic 4 and fortunately also mostly of the code) is using most of the data structures that would otherwise be used by device 9. So if you want 2 dual drives, they will have device numbers 8 and 10.

This madness is clearly visible in source file src/drive/ieee/fdc.c.

There are 4 fdc_t structures, each of which corresponds to a drive. (Despite the name that suggests floppy disk controller). When using unit 9 or 11, or num_drives is 2, weird stuff happens in functions like fdc_reset().

My proposal here is to change all functions here that take a unit number (in particular those that also do something with a disk_image_t), and change them to take a drive number too.. static fdc_t fdc[NUM_FDC]; will become static fdc_t fdc[NUM_FDC][2]; and the drive number will be the second index.

This change will flow outwards like an oil spill, since many functions are used via pointers and need to have the same signature...