Does anyone have a sample of any disc swapping in KOS' 1.3.x API? I wanted to use it in Wolf4SDL; I don't have a Dreamcast (or emulator that supports disc swapping [open\close]) to test it on).
DoomDC by BlackAura has somewhere to start, I just haven't gotten around to it.
Disc Swap API etc.
- emptythought
- DC Developer
- Posts: 2015
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Wed Jan 30, 2002 9:14 am
- Location: UNITED STATES NRN
- Has thanked: 0
- Been thanked: 0
- Contact:
-
- DCEmu Fast Newbie
- Posts: 18
- Joined: Sun Feb 28, 2010 9:29 pm
- Has thanked: 0
- Been thanked: 0
Re: Disc Swap API etc.
the program won't shut off when the eject button is pressed prematurely ... it sits there ... so a "Insert Disc and Press Start" method should work... (you can probably do a test for the correct files)
-
- DC Developer
- Posts: 9951
- Joined: Sun Dec 30, 2001 9:02 am
- Has thanked: 0
- Been thanked: 1 time
Re: Disc Swap API etc.
KOS handles disc swapping mostly automatically. If the disc has been changed, the file system will be reinitialized as soon as you try to open a new file handle.
You can also spin down the disc by calling cdrom_spin_down, and you can check the drive's status using cdrom_get_status, like so:
I don't remember off-hand how to detect if there's actually a disc in the drive. I think the status passes through CD_STATUS_SCANNING, and then settles on CD_STATUS_STANDBY, so you could probably wait for that.
Those constants are all defined in kos/kernel/arch/dreamcast/include/dc/cdrom.h
You can also spin down the disc by calling cdrom_spin_down, and you can check the drive's status using cdrom_get_status, like so:
Code: Select all
int status, disc_type;
if(cdrom_get_status(&status, &disc_type) != -1) {
switch(status) {
case CD_STATUS_OPEN:
// Drive door is open
break;
case CD_STATUS_NO_DISC:
// Drive door is closed, no disc is inserted
break;
}
}
Those constants are all defined in kos/kernel/arch/dreamcast/include/dc/cdrom.h