Skip to content

Commit de3a2b6

Browse files
committed
ioman: Replace 'drive' with 'dev'
1 parent 217c969 commit de3a2b6

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

src/iop/hle/ioman.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,36 @@ static inline int ioman_allocate_file(FILE* file) {
2828
return -1;
2929
}
3030

31-
static inline int ioman_get_drive(std::string path) {
31+
static inline int ioman_get_device(std::string path) {
3232
auto p = path.find_first_of(':');
3333

3434
if (p == std::string::npos)
3535
return 0;
3636

37-
std::string drive = path.substr(0, p);
38-
39-
if (drive == "rom0") {
40-
return IOMAN_DRIVE_ROM0;
41-
} else if (drive == "rom1") {
42-
return IOMAN_DRIVE_ROM1;
43-
} else if (drive == "cdrom0") {
44-
return IOMAN_DRIVE_CDROM0;
45-
} else if (drive == "host") {
46-
return IOMAN_DRIVE_HOST;
47-
} else if (drive == "host0") {
48-
return IOMAN_DRIVE_HOST;
49-
} else if (drive == "mc0") {
50-
return IOMAN_DRIVE_MC0;
51-
} else if (drive == "mc1") {
52-
return IOMAN_DRIVE_MC1;
53-
} else if (drive == "mass") {
54-
return IOMAN_DRIVE_MASS;
37+
std::string device = path.substr(0, p);
38+
39+
if (device == "rom0") {
40+
return IOMAN_DEV_ROM0;
41+
} else if (device == "rom1") {
42+
return IOMAN_DEV_ROM1;
43+
} else if (device == "cdrom0") {
44+
return IOMAN_DEV_CDROM0;
45+
} else if (device == "host") {
46+
return IOMAN_DEV_HOST;
47+
} else if (device == "host0") {
48+
return IOMAN_DEV_HOST;
49+
} else if (device == "mc0") {
50+
return IOMAN_DEV_MC0;
51+
} else if (device == "mc1") {
52+
return IOMAN_DEV_MC1;
53+
} else if (device == "mass") {
54+
return IOMAN_DEV_MASS;
5555
}
5656

57-
// To-do: There's probably some ATA/DEV9/HDD drive
57+
// To-do: There's probably some ATA/DEV9/HDD device
5858
// but I have no idea how it's used
5959

60-
return IOMAN_DRIVE_UNKNOWN;
60+
return IOMAN_DEV_UNKNOWN;
6161
}
6262

6363
extern "C" int ioman_open(struct iop_state* iop) {
@@ -74,10 +74,10 @@ extern "C" int ioman_open(struct iop_state* iop) {
7474

7575
std::string path(buf);
7676

77-
int drive = ioman_get_drive(path);
77+
int device = ioman_get_device(path);
7878

7979
// Only hook host files
80-
if (drive != IOMAN_DRIVE_HOST && drive != IOMAN_DRIVE_MASS)
80+
if (device != IOMAN_DEV_HOST && device != IOMAN_DEV_MASS)
8181
return 0;
8282

8383
// printf("path=%s\n", path.c_str());

src/iop/hle/ioman.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "../iop.h"
55
#include "../iop_export.h"
66

7-
#define IOMAN_DRIVE_UNKNOWN 0
7+
#define IOMAN_DEV_UNKNOWN 0
88

99
// BIOS ROM
1010
// DVD ROM
@@ -13,13 +13,13 @@
1313
// Memory card slot 1
1414
// Memory card slot 2
1515
// USB drive
16-
#define IOMAN_DRIVE_ROM0 1
17-
#define IOMAN_DRIVE_ROM1 2
18-
#define IOMAN_DRIVE_CDROM0 3
19-
#define IOMAN_DRIVE_HOST 4
20-
#define IOMAN_DRIVE_MC0 5
21-
#define IOMAN_DRIVE_MC1 6
22-
#define IOMAN_DRIVE_MASS 7
16+
#define IOMAN_DEV_ROM0 1
17+
#define IOMAN_DEV_ROM1 2
18+
#define IOMAN_DEV_CDROM0 3
19+
#define IOMAN_DEV_HOST 4
20+
#define IOMAN_DEV_MC0 5
21+
#define IOMAN_DEV_MC1 6
22+
#define IOMAN_DEV_MASS 7
2323

2424
#ifdef __cplusplus
2525
extern "C" {

0 commit comments

Comments
 (0)