From 59b863b09ad2f8e2d5647e3fccf9b33a627c30a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Israelson?= <57065102+israpps@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:28:00 -0300 Subject: [PATCH 1/5] add console ID for namco system 246 Rack C EEPROM model is `SYSTEM246` --- main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/main.c b/main.c index 127cb50..1aac7ae 100644 --- a/main.c +++ b/main.c @@ -1216,6 +1216,7 @@ void checkUnsupportedVersion() else if (ModelId == 0xd48f) sprintf(RealModelName, "PX300-1"); else if (ModelId == 0xd490) sprintf(RealModelName, "PX300-2"); else if (ModelId == 0xd491) sprintf(RealModelName, "SCPH-90010 CR"); // SM3 + else if (ModelId == 0x9000) sprintf(RealModelName, "SYSTEM246 C"); // clang-format on else { From 7519211f7958f196d6e7a547ab7a0404b362c2ce Mon Sep 17 00:00:00 2001 From: Matias Israelson <57065102+israpps@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:27:26 -0300 Subject: [PATCH 2/5] simplify `binaries.h` --- binaries.h | 319 ++++++++++++++--------------------------------------- 1 file changed, 83 insertions(+), 236 deletions(-) diff --git a/binaries.h b/binaries.h index 7aa1495..9f49c8e 100644 --- a/binaries.h +++ b/binaries.h @@ -16,239 +16,86 @@ #include -extern uint8_t iomanX; -extern u32 size_iomanX; - -extern uint8_t fileXio; -extern u32 size_fileXio; - -extern uint8_t freesio2; -extern u32 size_freesio2; - -extern uint8_t freepad; -extern u32 size_freepad; - -extern uint8_t mcman; -extern u32 size_mcman; - -extern uint8_t mcserv; -extern u32 size_mcserv; - -extern uint8_t USBD; -extern u32 size_USBD; - -extern uint8_t USBHDFSD; -extern u32 size_USBHDFSD; - -extern uint8_t MECHAPROXY_irx; -extern u32 size_MECHAPROXY_irx; - -extern uint8_t IndieFlower; -extern u32 size_IndieFlower; - -extern uint8_t MASSWATCHER_irx; -extern u32 size_MASSWATCHER_irx; - -extern uint8_t pwr50k; -extern u32 size_pwr50k; - -extern uint8_t pwr70k; -extern u32 size_pwr70k; - -extern uint8_t pwr90k; -extern u32 size_pwr90k; - -extern uint8_t pwrpsx1; -extern u32 size_pwrpsx1; - -extern uint8_t pwrpsx2; -extern u32 size_pwrpsx2; - -extern uint8_t pwrtvcombo; -extern u32 size_pwrtvcombo; - -extern uint8_t frame_001; -extern u32 size_frame_001; - -extern uint8_t frame_002; -extern u32 size_frame_002; - -extern uint8_t frame_003; -extern u32 size_frame_003; - -extern uint8_t frame_004; -extern u32 size_frame_004; - -extern uint8_t frame_005; -extern u32 size_frame_005; - -extern uint8_t frame_006; -extern u32 size_frame_006; - -extern uint8_t frame_007; -extern u32 size_frame_007; - -extern uint8_t frame_008; -extern u32 size_frame_008; - -extern uint8_t frame_009; -extern u32 size_frame_009; - -extern uint8_t frame_010; -extern u32 size_frame_010; - -extern uint8_t frame_011; -extern u32 size_frame_011; - -extern uint8_t frame_012; -extern u32 size_frame_012; - -extern uint8_t frame_013; -extern u32 size_frame_013; - -extern uint8_t frame_014; -extern u32 size_frame_014; - -extern uint8_t frame_015; -extern u32 size_frame_015; - -extern uint8_t frame_016; -extern u32 size_frame_016; - -extern uint8_t frame_017; -extern u32 size_frame_017; - -extern uint8_t frame_018; -extern u32 size_frame_018; - -extern uint8_t frame_019; -extern u32 size_frame_019; - -extern uint8_t frame_020; -extern u32 size_frame_020; - -extern uint8_t frame_021; -extern u32 size_frame_021; - -extern uint8_t frame_022; -extern u32 size_frame_022; - -extern uint8_t frame_023; -extern u32 size_frame_023; - -extern uint8_t frame_024; -extern u32 size_frame_024; - -extern uint8_t frame_025; -extern u32 size_frame_025; - -extern uint8_t frame_026; -extern u32 size_frame_026; - -extern uint8_t frame_027; -extern u32 size_frame_027; - -extern uint8_t frame_028; -extern u32 size_frame_028; - -extern uint8_t frame_029; -extern u32 size_frame_029; - -extern uint8_t frame_030; -extern u32 size_frame_030; - -extern uint8_t frame_031; -extern u32 size_frame_031; - -extern uint8_t frame_032; -extern u32 size_frame_032; - -extern uint8_t frame_033; -extern u32 size_frame_033; - -extern uint8_t frame_034; -extern u32 size_frame_034; - -extern uint8_t frame_035; -extern u32 size_frame_035; - -extern uint8_t frame_036; -extern u32 size_frame_036; - -extern uint8_t frame_037; -extern u32 size_frame_037; - -extern uint8_t frame_038; -extern u32 size_frame_038; - -extern uint8_t frame_039; -extern u32 size_frame_039; - -extern uint8_t frame_040; -extern u32 size_frame_040; - -extern uint8_t frame_041; -extern u32 size_frame_041; - -extern uint8_t frame_042; -extern u32 size_frame_042; - -extern uint8_t frame_043; -extern u32 size_frame_043; - -extern uint8_t frame_044; -extern u32 size_frame_044; - -extern uint8_t frame_045; -extern u32 size_frame_045; - -extern uint8_t frame_046; -extern u32 size_frame_046; - -extern uint8_t frame_047; -extern u32 size_frame_047; - -extern uint8_t frame_048; -extern u32 size_frame_048; - -extern uint8_t frame_049; -extern u32 size_frame_049; - -extern uint8_t frame_050; -extern u32 size_frame_050; - -extern uint8_t frame_051; -extern u32 size_frame_051; - -extern uint8_t frame_052; -extern u32 size_frame_052; - -extern uint8_t frame_053; -extern u32 size_frame_053; - -extern uint8_t frame_054; -extern u32 size_frame_054; - -extern uint8_t frame_055; -extern u32 size_frame_055; - -extern uint8_t frame_056; -extern u32 size_frame_056; - -extern uint8_t frame_057; -extern u32 size_frame_057; - -extern uint8_t frame_058; -extern u32 size_frame_058; - -extern uint8_t frame_059; -extern u32 size_frame_059; - -extern uint8_t frame_060; -extern u32 size_frame_060; - -extern uint8_t frame_061; -extern u32 size_frame_061; - -extern uint8_t frame_062; -extern u32 size_frame_062; +#define BIN2C_EXTERN(x) \ + extern uint8_t x; \ + extern u32 size_##x + +BIN2C_EXTERN(iomanX); +BIN2C_EXTERN(fileXio); +BIN2C_EXTERN(freesio2); +BIN2C_EXTERN(freepad); +BIN2C_EXTERN(mcman); +BIN2C_EXTERN(mcserv); +BIN2C_EXTERN(USBD); +BIN2C_EXTERN(USBHDFSD); +BIN2C_EXTERN(MECHAPROXY_irx); +BIN2C_EXTERN(IndieFlower); +BIN2C_EXTERN(MASSWATCHER_irx); +BIN2C_EXTERN(pwr50k); +BIN2C_EXTERN(pwr70k); +BIN2C_EXTERN(pwr90k); +BIN2C_EXTERN(pwrpsx1); +BIN2C_EXTERN(pwrpsx2); +BIN2C_EXTERN(pwrtvcombo); +BIN2C_EXTERN(frame_001); +BIN2C_EXTERN(frame_002); +BIN2C_EXTERN(frame_003); +BIN2C_EXTERN(frame_004); +BIN2C_EXTERN(frame_005); +BIN2C_EXTERN(frame_006); +BIN2C_EXTERN(frame_007); +BIN2C_EXTERN(frame_008); +BIN2C_EXTERN(frame_009); +BIN2C_EXTERN(frame_010); +BIN2C_EXTERN(frame_011); +BIN2C_EXTERN(frame_012); +BIN2C_EXTERN(frame_013); +BIN2C_EXTERN(frame_014); +BIN2C_EXTERN(frame_015); +BIN2C_EXTERN(frame_016); +BIN2C_EXTERN(frame_017); +BIN2C_EXTERN(frame_018); +BIN2C_EXTERN(frame_019); +BIN2C_EXTERN(frame_020); +BIN2C_EXTERN(frame_021); +BIN2C_EXTERN(frame_022); +BIN2C_EXTERN(frame_023); +BIN2C_EXTERN(frame_024); +BIN2C_EXTERN(frame_025); +BIN2C_EXTERN(frame_026); +BIN2C_EXTERN(frame_027); +BIN2C_EXTERN(frame_028); +BIN2C_EXTERN(frame_029); +BIN2C_EXTERN(frame_030); +BIN2C_EXTERN(frame_031); +BIN2C_EXTERN(frame_032); +BIN2C_EXTERN(frame_033); +BIN2C_EXTERN(frame_034); +BIN2C_EXTERN(frame_035); +BIN2C_EXTERN(frame_036); +BIN2C_EXTERN(frame_037); +BIN2C_EXTERN(frame_038); +BIN2C_EXTERN(frame_039); +BIN2C_EXTERN(frame_040); +BIN2C_EXTERN(frame_041); +BIN2C_EXTERN(frame_042); +BIN2C_EXTERN(frame_043); +BIN2C_EXTERN(frame_044); +BIN2C_EXTERN(frame_045); +BIN2C_EXTERN(frame_046); +BIN2C_EXTERN(frame_047); +BIN2C_EXTERN(frame_048); +BIN2C_EXTERN(frame_049); +BIN2C_EXTERN(frame_050); +BIN2C_EXTERN(frame_051); +BIN2C_EXTERN(frame_052); +BIN2C_EXTERN(frame_053); +BIN2C_EXTERN(frame_054); +BIN2C_EXTERN(frame_055); +BIN2C_EXTERN(frame_056); +BIN2C_EXTERN(frame_057); +BIN2C_EXTERN(frame_058); +BIN2C_EXTERN(frame_059); +BIN2C_EXTERN(frame_060); +BIN2C_EXTERN(frame_061); +BIN2C_EXTERN(frame_062); From 7ec16e9230f2c6990c04ab8836f5531f558d1457 Mon Sep 17 00:00:00 2001 From: Matias Israelson <57065102+israpps@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:35:45 -0300 Subject: [PATCH 3/5] refactor console ID detection code --- .gitignore | 1 + consoleident.c | 272 +++++++++++++++++++++++++++++++++++++++++++++++++ consoleident.h | 44 ++++++++ main.c | 269 ++---------------------------------------------- 4 files changed, 323 insertions(+), 263 deletions(-) create mode 100644 consoleident.c create mode 100644 consoleident.h diff --git a/.gitignore b/.gitignore index 0c48542..d1f8caf 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ !.github !.editorconfig !.clang-format +*_irx.c diff --git a/consoleident.c b/consoleident.c new file mode 100644 index 0000000..2dfbe4f --- /dev/null +++ b/consoleident.c @@ -0,0 +1,272 @@ +#include "consoleident.h" +#include + +#define arraysizeof(a) (sizeof(a) / sizeof(a[0])) + +static const console_record_t DB[] = { + {0xd200, "DTL-H10000", DEX|PCMCIA|PROTOKERNEL, BLACK}, + {0xd201, "SCPH-10000", PCMCIA|PROTOKERNEL, BLACK}, + {0xd202, "SCPH-15000/18000", PCMCIA, BLACK}, + {0xd203, "SCPH-30001", 0, BLACK}, + {0xd204, "SCPH-30002/R", 0, BLACK}, + {0xd205, "SCPH-30003/R", 0, BLACK}, + {0xd206, "SCPH-30004/R", 0, BLACK}, + {0xd207, "DTL-H30001", DEX, BLACK}, + {0xd208, "DTL-H30002", DEX, BLACK}, + {0xd209, "COH-H30000", COH, METAL}, + {0xd20a, "SCPH-18000", 0, BLACK}, + {0xd20b, "COH-H31000", COH, METAL}, + {0xd20c, "SCPH-30000", 0, BLACK}, + {0xd20d, "DTL-H30000", DEX, BLACK}, + {0xd20e, "COH-H31100", COH, METAL}, + {0xd20f, "SCPH-35001 GT", 0, BLACK}, + {0xd210, "SCPH-35002 GT", 0, BLACK}, + {0xd211, "SCPH-35003 GT", 0, BLACK}, + {0xd212, "SCPH-35004 GT", 0, BLACK}, + {0xd213, "SCPH-35000 GT", 0, BLACK}, + {0xd214, "SCPH-30001/R", 0, BLACK}, + {0xd215, "SCPH-30005 R", 0, BLACK}, + {0xd216, "SCPH-30006 R", 0, BLACK}, + {0xd217, "SCPH-39000", 0, BLACK}, + {0xd218, "SCPH-39001", 0, BLACK}, + {0xd219, "SCPH-39002", 0, BLACK}, + {0xd21a, "SCPH-39003", 0, BLACK}, + {0xd21b, "SCPH-39004", 0, BLACK}, +// {0xd21c, "SCPH-30007 R", 0, BLACK}, + {0xd21d, "SCPH-37000 L", 0, OCEAN_BLUE}, + {0xd21e, "SCPH-37000 B", 0, ZEN_BLACK}, + {0xd21f, "SCPH-39008", 0, BLACK}, + {0xd220, "SCPH-39000 TB", 0, BLUE}, + {0xd221, "SCPH-39000 RC", 0, BLACK}, + {0xd222, "SCPH-39006", 0, BLACK}, +// {0xd223, "SCPH-39005", 0, BLACK}, +// {0xd224, "SCPH-39007", 0, BLACK}, + {0xd225, "DTL-H10100", DEX|PROTOKERNEL, BLACK}, + {0xd226, "DTL-H30100", DEX, BLACK}, + {0xd227, "DTL-H30101", DEX, BLACK}, + {0xd228, "DTL-H30102", DEX, BLACK}, + {0xd229, "DTL-H30105", DEX, BLACK}, + {0xd22a, "SCPH-39000 S", 0, SATIN_SILVER}, + {0xd22b, "SCPH-39000 AQ", 0, AQUA_BLUE}, + {0xd22c, "SCPH-39000 SA", 0, PINK}, + {0xd22d, "SCPH-39010/N", 0, BLACK}, + // Deckard + // d300 = SCPH-50000, whats that? + {0xd301, "DTL-H50000", DEX, BLACK}, + {0xd302, "DTL-H50001", DEX, BLACK}, + {0xd303, "DTL-H50002", DEX, BLACK}, + {0xd304, "DTL-H50009", DEX, SATIN_SILVER}, + // d305 - d31d ?? + {0xd31e, "DTL-H70002", DEX, BLACK}, +// {0xd31f, "DTL-H70011S ???", DEX, BLACK}, +// {0xd320, "???", DEX, BLACK}, +// {0xd321, "???", DEX, BLACK}, + {0xd322, "DTL-H75000A", DEX, BLACK}, +// {0xd323, "???", DEX, BLACK}, +// {0xd324, "???", DEX, BLACK}, +// {0xd325, "???", DEX, BLACK}, + {0xd326, "DTL-H90000(a)", DEX, BLACK}, + // d327-d37f + // X-chassis + {0xd380, "DESR-7000", PSX, WHITE}, + {0xd381, "DESR-5000", PSX, WHITE}, + {0xd382, "DESR-7100", PSX, WHITE}, + {0xd383, "DESR-5100", PSX, WHITE}, + {0xd384, "DESR-5100/S", PSX, SATIN_SILVER}, + {0xd385, "DESR-7500", PSX, WHITE}, + {0xd386, "DESR-5500", PSX, WHITE}, + {0xd387, "DESR-7700", PSX, WHITE}, + {0xd388, "DESR-5700", PSX, WHITE}, + // d389 - d400 ?? + // H, I, J -chassis +// {0xd400, "SCPH-50000", 0, BLACK}, // 35: PX1, PX2, 27203531, 27203532 + {0xd401, "SCPH-50001/N", 0, BLACK}, // 37: PX7, PX8, 27203731, 27203732 + {0xd402, "SCPH-50010/N", 0, BLACK}, // ??: PU6 + {0xd403, "SCPH-50000", 0, BLACK}, // 35: 27203500, 27203502 + {0xd404, "SCPH-50000 MB/NH", 0, MIDNIGHT_BLUE}, // 39, 43, 60: 27203900, 27203902, 27204302, 27206002 + {0xd405, "SCPH-50002", 0, BLACK}, // 35: 27203591 + {0xd406, "SCPH-50003", 0, BLACK}, // 35: 227203561 + {0xd407, "SCPH-50004", 0, BLACK}, // 35: 227203551, 27203552 + {0xd408, "SCPH-50002 SS", 0, SATIN_SILVER}, // 40: 27204091, Silver Prestige Line + {0xd409, "SCPH-50003 SS", 0, SATIN_SILVER}, // 40: 27204061, Silver Prestige Line + {0xd40a, "SCPH-50004 SS", 0, SATIN_SILVER}, // 40: 27204051, 27204052, Silver Prestige Line + {0xd40b, "SCPH-50001", 0, BLACK}, // 41: PX3, PX4, 27204131, 27204132 + {0xd40c, "SCPH-50005/N", 0, BLACK},// 37: 27203725 + {0xd40d, "SCPH-50006", 0, BLACK}, // 35: 27203512, 27203518 + {0xd40e, "SCPH-50007", 0, BLACK}, // 35: 27203516 + {0xd40f, "SCPH-50008", 0, BLACK}, // 35: 27203581 +// {0xd410, "SCPH-50009", 0, BLACK}, + {0xd411, "SCPH-50000 NB", 0, BLACK}, // 45, 46, 54: 27204501, 27204502, 27204604, 27205402 + {0xd412, "SCPH-50000 TSS", 0, SATIN_SILVER}, // 40: 27204004 + {0xd413, "SCPH-55000 GU", 0, GOLD}, // 67: 27206702 + {0xd414, "SCPH-55000 GT", 0, WHITE}, // 47, 49: 27204704, 27204904 + {0xd415, "SCPH-50009 SS", 0, SATIN_SILVER}, // 37, 40: 27203720, 27204020 + {0xd416, "SCPH-50003 AQ", 0, AQUA_BLUE}, // 51: 27205161 +// {0xd417, "SCPH-55005 GT/N", 0, WHITE}, // 50: 27205025 + {0xd418, "SCPH-55006 GT", 0, WHITE}, // 47: 27204718 + {0xd419, "SCPH-55007 GT", 0, WHITE}, // 47: 27204716 + {0xd41a, "SCPH-50008 SS", 0, SATIN_SILVER}, // 40: 27204081 + {0xd41b, "SCPH-50004 AQ", 0, AQUA_BLUE}, // 51: 27205151 + {0xd41c, "SCPH-50005 SS/N", 0, SATIN_SILVER}, // 55: 27205525 + {0xd41d, "SCPH-50005 AQ/N", 0, AQUA_BLUE}, // 56: 27205625 + {0xd41e, "SCPH-50000 CW", 0, WHITE}, // 44: 27204402 + {0xd41f, "SCPH-50000 SA", 0, PINK}, // 61: 27206101 + {0xd420, "SCPH-50004 ESS", 0, SATIN_SILVER}, // 57, 62, 66: 27205751, 27206251, 27206651 Satin Silver +// {0xd421, "???", 0, UNKNOWN}, + {0xd422, "SCPH-50002 ESS", 0, SATIN_SILVER}, // 62: 27206291 Satin Silver + {0xd423, "SCPH-50003 ESS", 0, SATIN_SILVER}, // 66: 27206661 Satin Silver + {0xd424, "SCPH-50000 PW", 0, WHITE}, // 65: 27206501 + {0xd425, "SCPH-50011", 0, BLACK}, // ??: SM1 (box not found) + // K-chassis + {0xd426, "SCPH-70004", 0, BLACK}, // 63, 70: 27207051, 27207052, 27206351, 27206352 + {0xd427, "SCPH-70003", 0, BLACK}, // 63, 70: 27207061, 27207062, ????????, 27206362 + {0xd428, "SCPH-70002", 0, BLACK}, // 63, 70: 27207091, 27206392 + {0xd429, "SCPH-70011", 0, BLACK}, // 63: PK1, 27206331 + {0xd42a, "SCPH-70012", 0, BLACK}, // 63: PK2, 27206341 + {0xd42b, "SCPH-70000", 0, BLACK}, // 63, 78: 27206301, 27206302, 27207802 + {0xd42c, "SCPH-70005", 0, BLACK}, // 63: 27206325 + {0xd42d, "SCPH-70006", 0, BLACK}, // 63: 27206318 + {0xd42e, "SCPH-70007", 0, BLACK}, // 63: 27206316 + {0xd42f, "SCPH-70000 GT", 0, BLACK}, // 72: 27207202 + {0xd430, "SCPH-70008", 0, BLACK}, // 63: 27206381 + {0xd431, "SCPH-70002 SS", 0, SATIN_SILVER}, // 69: 27206991 + {0xd432, "SCPH-70003 SS", 0, SATIN_SILVER}, // 69: 27206961 + {0xd433, "SCPH-70004 SS", 0, SATIN_SILVER}, // 69: 27206951 + {0xd434, "SCPH-70008 SS", 0, SATIN_SILVER}, // 69: 27206981 + {0xd435, "SCPH-70001", 0, BLACK}, // 77: PK3, 27207731 + {0xd436, "SCPH-70010", 0, BLACK}, // sticker and box not found + {0xd437, "SCPH-70000 CW", 0, WHITE}, // 79: 27207902 + {0xd438, "SCPH-70003 SS", 0, SATIN_SILVER}, // 80: 27208063 + {0xd439, "SCPH-70004 SS", 0, SATIN_SILVER}, // 80: 27208053 + {0xd43a, "SCPH-70008 SS", 0, SATIN_SILVER}, // 80: 27208081 +// L-chassis + {0xd43b, "SCPH-75001", 0, BLACK}, // 81, 82: PK4, PK5, 27208131, 27208232 + {0xd43c, "SCPH-75002", 0, BLACK}, // 81: 27208191, ???????? + {0xd43d, "SCPH-75003", 0, BLACK}, // 81, 82: 27208161, 27208262 + {0xd43e, "SCPH-75004", 0, BLACK}, // 81, 82: 27208151, 27208252 + {0xd43f, "SCPH-75000 SSS", 0, SATIN_SILVER}, // 85: 27208501 + {0xd440, "SCPH-75002 SS", 0, SATIN_SILVER}, // 87: 27208791 + {0xd441, "SCPH-75003 SS", 0, SATIN_SILVER}, // 87: 27208761 + {0xd442, "SCPH-75004 SS", 0, SATIN_SILVER}, // 87: 27208751 + {0xd443, "SCPH-75000", 0, BLACK}, // 82: 27208202 + {0xd444, "SCPH-75000 CW", 0, WHITE}, // 83: 27208302 + {0xd445, "SCPH-75006", 0, BLACK}, // 82: 27208218 + {0xd446, "SCPH-75007", 0, BLACK}, // 82: 27208216 + {0xd447, "SCPH-75005", 0, BLACK}, // 82: 27208225 + {0xd448, "SCPH-75010", 0, BLACK}, // PK6 + {0xd449, "SCPH-75000 FF", 0, BLACK}, // 89: 27208901 + /* {0xd44a, "???", 0, UNKNOWN); + {0xd44b, "???", 0, UNKNOWN); */ + {0xd44c, "SCPH-75008", 0, BLACK}, // 82: 27208281 + {0xd44d, "SCPH-75008 SS", 0, SATIN_SILVER}, // 88: 27208881 + // M-chassis + {0xd44e, "SCPH-77001", 0, BLACK}, // 91: PK7, PK8: 27209131 + {0xd44f, "SCPH-77002", 0, BLACK}, // 91: 27209191 + {0xd450, "SCPH-77003", 0, BLACK}, // 91: 27209161 + {0xd451, "SCPH-77004", 0, BLACK}, // 91: 27209151, 27209152 + {0xd452, "SCPH-77002 SS", 0, SATIN_SILVER}, // 95: 27209591 + {0xd453, "SCPH-77003 SS", 0, SATIN_SILVER}, // 95: 27209561 + {0xd454, "SCPH-77004 SS", 0, SATIN_SILVER}, // 95, 16: 27209551, 27201651 + {0xd455, "SCPH-77000", 0, BLACK}, // 91: 27209102 + {0xd456, "SCPH-77000 CW", 0, WHITE}, // 93: 27209302 + {0xd457, "SCPH-77005", 0, BLACK},// 91: 27209125 + {0xd458, "SCPH-77006", 0, BLACK},// 91: 27209118 + {0xd459, "SCPH-77007", 0, BLACK},// 91: 27209116 + {0xd45a, "SCPH-77008", 0, BLACK},// 91: 27209181 + /* {0xd45b, "??? SCPH-77008 SS", 0, UNKNOWN}, // 95: 27209581 + {0xd45c, "??? SCPH-77010", 0, UNKNOWN}, // ??? PK9 not confirmed */ + {0xd45d, "SCPH-77001 SS", 0, SATIN_SILVER}, // PL1 + {0xd45e, "SCPH-77003 PK", 0, PINK}, // 97: 27209761 + {0xd45f, "SCPH-77004 PK", 0, PINK}, // 97: 27209751 +// {0xd460, "SCPH-77010 SS", 0, SATIN_SILVER}, // PL2 */ + {0xd461, "SCPH-77000 SS", 0, SATIN_SILVER}, // 96: 27209601 + {0xd462, "SCPH-77000 PK", 0, PINK}, // 97: 27209701 + {0xd463, "SCPH-77008 PK", 0, PINK}, // 97: 27209781 + {0xd464, "SCPH-77002 PK", 0, PINK}, // 97: 27209791 + // N-chassis + {0xd465, "SCPH-79001", 0, BLACK}, // 240, PA0, PA9: 27224031 + /* {0xd466, "SCPH-79000", 0, UNKNOWN}, // 240: 27224001 */ + {0xd467, "SCPH-79000 CW", 0, WHITE}, // 242: 27224201 + {0xd468, "SCPH-79002", 0, BLACK}, // 240: 27224091 + {0xd469, "SCPH-79001 SS", 0, SATIN_SILVER}, // 241: 27224131 + /* {0xd46a, "??? SCPH-79005, 0, UNKNOWN}, // 240: 27224025 */ + {0xd46b, "SCPH-79006", 0, BLACK}, // 240: 27224018 + /* {0xd46c, "??? SCPH-79007, 0, UNKNOWN}, // 240: 27224016 */ + {0xd46d, "SCPH-79000 SS", 0, SATIN_SILVER}, // 241: 27224101 + {0xd46e, "SCPH-79003", 0, BLACK}, // 240: 27224061 + {0xd46f, "SCPH-79004", 0, BLACK}, // 240: 27224051, 27224052 + {0xd470, "SCPH-79010", 0, BLACK}, // 240: SN0, 27224035 + {0xd471, "SCPH-79003 SS", 0, SATIN_SILVER}, // 241: 27224161 + /* {0xd472, "??? SCPH-79004 SS", 0, SATIN_SILVER}, // 241: 27224151 */ + {0xd473, "SCPH-79008", 0, BLACK}, // 240: 27224081 + {0xd474, "SCPH-79001 CW", 0, WHITE}, // PW0 + // P/R-chassis + {0xd475, "SCPH-90000", 0, BLACK}, // 244, 248: 27224401, 27224801 + {0xd476, "SCPH-90000 CW", 0, WHITE}, // 245, 249: 27224501, 27224901 + {0xd477, "SCPH-90000 SS", 0, SATIN_SILVER}, // 246: 27224601 // 4990: 27499001 + {0xd478, "SCPH-90006", 0, BLACK}, // 244: 27224418 + {0xd479, "SCPH-90006 CW", 0, WHITE}, // 245: 27224518 + /* {0xd47a, "SCPH-90006 SS", 0, SATIN_SILVER}, // 246: 27224618 // needs sticker confirmation */ + {0xd47b, "SCPH-90005", 0, BLACK}, // 244: 27224425 // 4994: 27499475 + /* {0xd47c, "SCPH-90005 CW", 0, WHITE}, // 245: 27224525 + {0xd47d, "SCPH-90005 SS, 0, SATIN_SILVER}, // 246: 27224625 */ + {0xd47e, "SCPH-90007", 0, BLACK}, // 244: 27224416 // 4245: 27424581 + {0xd47f, "SCPH-90007 CW", 0, WHITE}, // 245: 27224516 // 4246: 27424681 + /* {0xd480, "SCPH-90007 SS, 0, SATIN_SILVER}, // 246: 27224616 // 4247: 27424731 */ + {0xd481, "SCPH-90001", 0, BLACK}, // 4090: PA2, 27409054 + {0xd482, "SCPH-90001 SS", 0, SATIN_SILVER}, // 246: PA7, 27224631 // 4090, 4991: PA7, 27499104, PA8, 27409054 + {0xd483, "SCPH-90004", 0, BLACK}, // 244: 27224451 // 4993: 27499372 + {0xd484, "SCPH-90004 SS", 0, SATIN_SILVER}, // 246: 27224651 + {0xd485, "SCPH-90002", 0, BLACK}, // 244: 27224491 // 4091: 27409166 + {0xd486, "SCPH-90003", 0, BLACK}, // 244: 27224461 + /* {0xd487, "SCPH-90005 CR", 0, CINNABAR_RED}, // 247: 27224725 // 4242: 27424225 */ + {0xd488, "SCPH-90006 CR", 0, CINNABAR_RED}, // 4244: 27424428 + {0xd489, "SCPH-90007 CR", 0, CINNABAR_RED}, // 4246: 27424631 + {0xd48a, "SCPH-90010", 0, BLACK}, // 4248: SP9, 27424810 + {0xd48b, "SCPH-90000 CR", 0, CINNABAR_RED}, // 4249: 27424901 + {0xd48c, "SCPH-90008", 0, BLACK}, // 244: 27224481 // 4247: 27424784 + {0xd48d, "SCPH-90008 SS", 0, SATIN_SILVER}, // 246: 27224681 + {0xd48f, "PX300-1", PS2TV, BLACK}, + {0xd490, "PX300-2", PS2TV, BLACK}, + {0xd491, "SCPH-90010 CR", 0, CINNABAR_RED}, // SM3 + {0x9000, "SYSTEM246 C", COH, BLACK}, +// {0x????, "SYSTEM256", COH, METAL}, +// {0x????, "SYSTEM S256", COH, METAL}, +}; + +const console_record_t* ConsoleModel_GetDataByID(uint16_t ID) { + size_t records = arraysizeof(DB); + + for (size_t i = 0; i < records; i++) + { + if (ID == DB[i].id) return &DB[i]; + } + printf("end of DB reached. unknown console 0x%04u\n", ID); + return NULL; + +} + + + +static const char* console_colors[COLORCOUNT] { + "UNKNOWN", + "Black", + "White", + "Silver", + "Pink", + "Cinnabar Red", + "Blue", + "Zen black", + "Ocean Blue", + "Midnight blue", + "Sakura Pink", + "Aqua Blue", + "Gold", + "Metal", +}; + +const char* ConsoleModel_GetColorName(int color) { + if (color >= UNKNOWN && color < COLORCOUNT) return console_colors[color]; + return console_colors[UNKNOWN]; +} + diff --git a/consoleident.h b/consoleident.h new file mode 100644 index 0000000..daee4da --- /dev/null +++ b/consoleident.h @@ -0,0 +1,44 @@ +#ifndef CONSOLEIDENT_H +#define CONSOLEIDENT_H + +#include + +typedef enum CONSOLE_COLOR { + UNKNOWN = 0, + BLACK, + WHITE, + SATIN_SILVER, + PINK, + CINNABAR_RED, + BLUE, + ZEN_BLACK, + OCEAN_BLUE, + MIDNIGHT_BLUE, + SAKURA_PINK, + AQUA_BLUE, + GOLD, + METAL, // metal casing. arcade ps2 + COLORCOUNT, // ammount of colors in enum +}ConsoleColor_t; + + +typedef struct consolerecord { + uint16_t id; + const char* name; + int flags; + int color; +}console_record_t; + +#define BSH(x) (1 << x) +enum FLG { + DEX = BSH(1), + COH = BSH(2), + PCMCIA = BSH(3), + PSX = BSH(4), + PROTOKERNEL = BSH(5), + PS2TV = BSH(6), +}; +const console_record_t* ConsoleModel_GetDataByID(uint16_t ID); +const char* ConsoleModel_GetColorName(int color); + +#endif diff --git a/main.c b/main.c index 1aac7ae..ca1968c 100644 --- a/main.c +++ b/main.c @@ -38,6 +38,7 @@ #include "binaries.h" #include "ui.h" #include "mass.h" +#include "consoleident.h" static unsigned int big_size = 50, reg_size = 36; // TODO: store existing areas on nvram on boot @@ -989,275 +990,17 @@ void checkUnsupportedVersion() // ModelID whitelist IsKnownconsole = 1; sprintf(RealModelName, "???"); - // clang-format off - if (ModelId == 0xd200) sprintf(RealModelName, "DTL-H10000"); - else if (ModelId == 0xd201) sprintf(RealModelName, "SCPH-10000"); - else if (ModelId == 0xd202) sprintf(RealModelName, "SCPH-15000/18000"); - else if (ModelId == 0xd203) sprintf(RealModelName, "SCPH-30001"); - else if (ModelId == 0xd204) sprintf(RealModelName, "SCPH-30002/R"); - else if (ModelId == 0xd205) sprintf(RealModelName, "SCPH-30003/R"); - else if (ModelId == 0xd206) sprintf(RealModelName, "SCPH-30004/R"); - else if (ModelId == 0xd207) sprintf(RealModelName, "DTL-H30001"); - else if (ModelId == 0xd208) sprintf(RealModelName, "DTL-H30002"); - else if (ModelId == 0xd209) sprintf(RealModelName, "COH-H30000"); - else if (ModelId == 0xd20a) sprintf(RealModelName, "SCPH-18000"); - else if (ModelId == 0xd20b) sprintf(RealModelName, "COH-H31000"); - else if (ModelId == 0xd20c) sprintf(RealModelName, "SCPH-30000"); - else if (ModelId == 0xd20d) sprintf(RealModelName, "DTL-H30000"); - else if (ModelId == 0xd20e) sprintf(RealModelName, "COH-H31100"); - else if (ModelId == 0xd20f) sprintf(RealModelName, "SCPH-35001 GT"); - else if (ModelId == 0xd210) sprintf(RealModelName, "SCPH-35002 GT"); - else if (ModelId == 0xd211) sprintf(RealModelName, "SCPH-35003 GT"); - else if (ModelId == 0xd212) sprintf(RealModelName, "SCPH-35004 GT"); - else if (ModelId == 0xd213) sprintf(RealModelName, "SCPH-35000 GT"); - else if (ModelId == 0xd214) sprintf(RealModelName, "SCPH-30001/R"); - else if (ModelId == 0xd215) sprintf(RealModelName, "SCPH-30005 R"); - else if (ModelId == 0xd216) sprintf(RealModelName, "SCPH-30006 R"); - else if (ModelId == 0xd217) sprintf(RealModelName, "SCPH-39000"); - else if (ModelId == 0xd218) sprintf(RealModelName, "SCPH-39001"); - else if (ModelId == 0xd219) sprintf(RealModelName, "SCPH-39002"); - else if (ModelId == 0xd21a) sprintf(RealModelName, "SCPH-39003"); - else if (ModelId == 0xd21b) sprintf(RealModelName, "SCPH-39004"); - /* else if (ModelId == 0xd21c) sprintf(RealModelName, "SCPH-30007 R"); */ - else if (ModelId == 0xd21d) sprintf(RealModelName, "SCPH-37000 L"); - else if (ModelId == 0xd21e) sprintf(RealModelName, "SCPH-37000 B"); - else if (ModelId == 0xd21f) sprintf(RealModelName, "SCPH-39008"); - else if (ModelId == 0xd220) sprintf(RealModelName, "SCPH-39000 TB"); - else if (ModelId == 0xd221) sprintf(RealModelName, "SCPH-39000 RC"); - else if (ModelId == 0xd222) sprintf(RealModelName, "SCPH-39006"); - /* else if (ModelId == 0xd223) sprintf(RealModelName, "SCPH-39005"); - else if (ModelId == 0xd224) sprintf(RealModelName, "SCPH-39007"); */ - else if (ModelId == 0xd225) sprintf(RealModelName, "DTL-H10100"); - else if (ModelId == 0xd226) sprintf(RealModelName, "DTL-H30100"); - else if (ModelId == 0xd227) sprintf(RealModelName, "DTL-H30101"); - else if (ModelId == 0xd228) sprintf(RealModelName, "DTL-H30102"); - else if (ModelId == 0xd229) sprintf(RealModelName, "DTL-H30105"); - else if (ModelId == 0xd22a) sprintf(RealModelName, "SCPH-39000 S"); - else if (ModelId == 0xd22b) sprintf(RealModelName, "SCPH-39000 AQ"); - else if (ModelId == 0xd22c) sprintf(RealModelName, "SCPH-39000 SA"); - else if (ModelId == 0xd22d) sprintf(RealModelName, "SCPH-39010/N"); - // Deckard - // d300 = SCPH-50000, whats that? - else if (ModelId == 0xd301) sprintf(RealModelName, "DTL-H50000"); - else if (ModelId == 0xd302) sprintf(RealModelName, "DTL-H50001"); - else if (ModelId == 0xd303) sprintf(RealModelName, "DTL-H50002"); - else if (ModelId == 0xd304) sprintf(RealModelName, "DTL-H50009"); - // d305 - d31d ?? - else if (ModelId == 0xd31e) sprintf(RealModelName, "DTL-H70002"); - /* else if (ModelId == 0xd31f) sprintf(RealModelName, "DTL-H70011S ???"); - else if (ModelId == 0xd320) sprintf(RealModelName, "???"); - else if (ModelId == 0xd321) sprintf(RealModelName, "???"); */ - else if (ModelId == 0xd322) sprintf(RealModelName, "DTL-H75000A"); - /* else if (ModelId == 0xd323) sprintf(RealModelName, "???"); - else if (ModelId == 0xd324) sprintf(RealModelName, "???"); - else if (ModelId == 0xd325) sprintf(RealModelName, "???"); */ - else if (ModelId == 0xd326) sprintf(RealModelName, "DTL-H90000(a)"); - // d327-d37f - // X-chassis - else if (ModelId == 0xd380) sprintf(RealModelName, "DESR-7000"); - else if (ModelId == 0xd381) sprintf(RealModelName, "DESR-5000"); - else if (ModelId == 0xd382) sprintf(RealModelName, "DESR-7100"); - else if (ModelId == 0xd383) sprintf(RealModelName, "DESR-5100"); - else if (ModelId == 0xd384) sprintf(RealModelName, "DESR-5100/S"); - else if (ModelId == 0xd385) sprintf(RealModelName, "DESR-7500"); - else if (ModelId == 0xd386) sprintf(RealModelName, "DESR-5500"); - else if (ModelId == 0xd387) sprintf(RealModelName, "DESR-7700"); - else if (ModelId == 0xd388) sprintf(RealModelName, "DESR-5700"); - // d389 - d400 ?? - // H, I, J -chassis - /* else if (ModelId == 0xd400) sprintf(RealModelName, "SCPH-50001"); // 35: PX1, PX2, 27203531, 27203532 */ - else if (ModelId == 0xd401) sprintf(RealModelName, "SCPH-50001/N"); // 37: PX7, PX8, 27203731, 27203732 - else if (ModelId == 0xd402) sprintf(RealModelName, "SCPH-50010/N"); // ??: PU6 - else if (ModelId == 0xd403) sprintf(RealModelName, "SCPH-50000"); // 35: 27203500, 27203502 - else if (ModelId == 0xd404) sprintf(RealModelName, "SCPH-50000 MB/NH"); // 39, 43, 60: 27203900, 27203902, 27204302, 27206002 - else if (ModelId == 0xd405) sprintf(RealModelName, "SCPH-50002"); // 35: 27203591 - else if (ModelId == 0xd406) sprintf(RealModelName, "SCPH-50003"); // 35: 227203561 - else if (ModelId == 0xd407) sprintf(RealModelName, "SCPH-50004"); // 35: 227203551, 27203552 - else if (ModelId == 0xd408) sprintf(RealModelName, "SCPH-50002 SS"); // 40: 27204091, Silver Prestige Line - else if (ModelId == 0xd409) sprintf(RealModelName, "SCPH-50003 SS"); // 40: 27204061, Silver Prestige Line - else if (ModelId == 0xd40a) sprintf(RealModelName, "SCPH-50004 SS"); // 40: 27204051, 27204052, Silver Prestige Line - else if (ModelId == 0xd40b) sprintf(RealModelName, "SCPH-50001"); // 41: PX3, PX4, 27204131, 27204132 - else if (ModelId == 0xd40c) sprintf(RealModelName, "SCPH-50005/N"); // 37: 27203725 - else if (ModelId == 0xd40d) sprintf(RealModelName, "SCPH-50006"); // 35: 27203512, 27203518 - else if (ModelId == 0xd40e) sprintf(RealModelName, "SCPH-50007"); // 35: 27203516 - else if (ModelId == 0xd40f) sprintf(RealModelName, "SCPH-50008"); // 35: 27203581 - /* else if (ModelId == 0xd410) sprintf(RealModelName, "??? SCPH-50009 Black"); */ - else if (ModelId == 0xd411) sprintf(RealModelName, "SCPH-50000 NB"); // 45, 46, 54: 27204501, 27204502, 27204604, 27205402 - else if (ModelId == 0xd412) sprintf(RealModelName, "SCPH-50000 TSS"); // 40: 27204004 - else if (ModelId == 0xd413) sprintf(RealModelName, "SCPH-55000 GU"); // 67: 27206702 - else if (ModelId == 0xd414) sprintf(RealModelName, "SCPH-55000 GT"); // 47, 49: 27204704, 27204904 - else if (ModelId == 0xd415) sprintf(RealModelName, "SCPH-50009 SS"); // 37, 40: 27203720, 27204020 - else if (ModelId == 0xd416) sprintf(RealModelName, "SCPH-50003 AQ"); // 51: 27205161 - /* else if (ModelId == 0xd417) sprintf(RealModelName, "??? SCPH-55005 GT/N"); // 50: 27205025 */ - else if (ModelId == 0xd418) sprintf(RealModelName, "SCPH-55006 GT"); // 47: 27204718 - else if (ModelId == 0xd419) sprintf(RealModelName, "SCPH-55007 GT"); // 47: 27204716 - else if (ModelId == 0xd41a) sprintf(RealModelName, "SCPH-50008 SS"); // 40: 27204081 - else if (ModelId == 0xd41b) sprintf(RealModelName, "SCPH-50004 AQ"); // 51: 27205151 - else if (ModelId == 0xd41c) sprintf(RealModelName, "SCPH-50005 SS/N"); // 55: 27205525 - else if (ModelId == 0xd41d) sprintf(RealModelName, "SCPH-50005 AQ/N"); // 56: 27205625 - else if (ModelId == 0xd41e) sprintf(RealModelName, "SCPH-50000 CW"); // 44: 27204402 - else if (ModelId == 0xd41f) sprintf(RealModelName, "SCPH-50000 SA"); // 61: 27206101 - else if (ModelId == 0xd420) sprintf(RealModelName, "SCPH-50004 ESS"); // 57, 62, 66: 27205751, 27206251, 27206651 Satin Silver - /* else if (ModelId == 0xd421) sprintf(RealModelName, "???"); */ - else if (ModelId == 0xd422) sprintf(RealModelName, "SCPH-50002 ESS"); // 62: 27206291 Satin Silver - else if (ModelId == 0xd423) sprintf(RealModelName, "SCPH-50003 ESS"); // 66: 27206661 Satin Silver - else if (ModelId == 0xd424) sprintf(RealModelName, "SCPH-50000 PW"); // 65: 27206501 - else if (ModelId == 0xd425) sprintf(RealModelName, "SCPH-50011"); // ??: SM1 (box not found) - // K-chassis - else if (ModelId == 0xd426) sprintf(RealModelName, "SCPH-70004"); // 63, 70: 27207051, 27207052, 27206351, 27206352 - else if (ModelId == 0xd427) sprintf(RealModelName, "SCPH-70003"); // 63, 70: 27207061, 27207062, ????????, 27206362 - else if (ModelId == 0xd428) sprintf(RealModelName, "SCPH-70002"); // 63, 70: 27207091, 27206392 - else if (ModelId == 0xd429) sprintf(RealModelName, "SCPH-70011"); // 63: PK1, 27206331 - else if (ModelId == 0xd42a) sprintf(RealModelName, "SCPH-70012"); // 63: PK2, 27206341 - else if (ModelId == 0xd42b) sprintf(RealModelName, "SCPH-70000"); // 63, 78: 27206301, 27206302, 27207802 - else if (ModelId == 0xd42c) sprintf(RealModelName, "SCPH-70005"); // 63: 27206325 - else if (ModelId == 0xd42d) sprintf(RealModelName, "SCPH-70006"); // 63: 27206318 - else if (ModelId == 0xd42e) sprintf(RealModelName, "SCPH-70007"); // 63: 27206316 - else if (ModelId == 0xd42f) sprintf(RealModelName, "SCPH-70000 GT"); // 72: 27207202 - else if (ModelId == 0xd430) sprintf(RealModelName, "SCPH-70008"); // 63: 27206381 - else if (ModelId == 0xd431) sprintf(RealModelName, "SCPH-70002 SS"); // 69: 27206991 - else if (ModelId == 0xd432) sprintf(RealModelName, "SCPH-70003 SS"); // 69: 27206961 - else if (ModelId == 0xd433) sprintf(RealModelName, "SCPH-70004 SS"); // 69: 27206951 - else if (ModelId == 0xd434) sprintf(RealModelName, "SCPH-70008 SS"); // 69: 27206981 - else if (ModelId == 0xd435) sprintf(RealModelName, "SCPH-70001"); // 77: PK3, 27207731 - else if (ModelId == 0xd436) sprintf(RealModelName, "SCPH-70010"); // sticker and box not found - else if (ModelId == 0xd437) sprintf(RealModelName, "SCPH-70000 CW"); // 79: 27207902 - else if (ModelId == 0xd438) sprintf(RealModelName, "SCPH-70003 SS"); // 80: 27208063 - else if (ModelId == 0xd439) sprintf(RealModelName, "SCPH-70004 SS"); // 80: 27208053 - else if (ModelId == 0xd43a) sprintf(RealModelName, "SCPH-70008 SS"); // 80: 27208081 - // L-chassis - else if (ModelId == 0xd43b) sprintf(RealModelName, "SCPH-75001"); // 81, 82: PK4, PK5, 27208131, 27208232 - else if (ModelId == 0xd43c) sprintf(RealModelName, "SCPH-75002"); // 81: 27208191, ???????? - else if (ModelId == 0xd43d) sprintf(RealModelName, "SCPH-75003"); // 81, 82: 27208161, 27208262 - else if (ModelId == 0xd43e) sprintf(RealModelName, "SCPH-75004"); // 81, 82: 27208151, 27208252 - else if (ModelId == 0xd43f) sprintf(RealModelName, "SCPH-75000 SSS"); // 85: 27208501 - else if (ModelId == 0xd440) sprintf(RealModelName, "SCPH-75002 SS"); // 87: 27208791 - else if (ModelId == 0xd441) sprintf(RealModelName, "SCPH-75003 SS"); // 87: 27208761 - else if (ModelId == 0xd442) sprintf(RealModelName, "SCPH-75004 SS"); // 87: 27208751 - else if (ModelId == 0xd443) sprintf(RealModelName, "SCPH-75000"); // 82: 27208202 - else if (ModelId == 0xd444) sprintf(RealModelName, "SCPH-75000 CW"); // 83: 27208302 - else if (ModelId == 0xd445) sprintf(RealModelName, "SCPH-75006"); // 82: 27208218 - else if (ModelId == 0xd446) sprintf(RealModelName, "SCPH-75007"); // 82: 27208216 - else if (ModelId == 0xd447) sprintf(RealModelName, "SCPH-75005"); // 82: 27208225 - else if (ModelId == 0xd448) sprintf(RealModelName, "SCPH-75010"); // PK6 - else if (ModelId == 0xd449) sprintf(RealModelName, "SCPH-75000 FF"); // 89: 27208901 - /* else if (ModelId == 0xd44a) sprintf(RealModelName, "???"); - else if (ModelId == 0xd44b) sprintf(RealModelName, "???"); */ - else if (ModelId == 0xd44c) sprintf(RealModelName, "SCPH-75008"); // 82: 27208281 - else if (ModelId == 0xd44d) sprintf(RealModelName, "SCPH-75008 SS"); // 88: 27208881 - // M-chassis - else if (ModelId == 0xd44e) sprintf(RealModelName, "SCPH-77001"); // 91: PK7, PK8: 27209131 - else if (ModelId == 0xd44f) sprintf(RealModelName, "SCPH-77002"); // 91: 27209191 - else if (ModelId == 0xd450) sprintf(RealModelName, "SCPH-77003"); // 91: 27209161 - else if (ModelId == 0xd451) sprintf(RealModelName, "SCPH-77004"); // 91: 27209151, 27209152 - else if (ModelId == 0xd452) sprintf(RealModelName, "SCPH-77002 SS"); // 95: 27209591 - else if (ModelId == 0xd453) sprintf(RealModelName, "SCPH-77003 SS"); // 95: 27209561 - else if (ModelId == 0xd454) sprintf(RealModelName, "SCPH-77004 SS"); // 95, 16: 27209551, 27201651 - else if (ModelId == 0xd455) sprintf(RealModelName, "SCPH-77000"); // 91: 27209102 - else if (ModelId == 0xd456) sprintf(RealModelName, "SCPH-77000 CW"); // 93: 27209302 - else if (ModelId == 0xd457) sprintf(RealModelName, "SCPH-77005"); // 91: 27209125 - else if (ModelId == 0xd458) sprintf(RealModelName, "SCPH-77006"); // 91: 27209118 - else if (ModelId == 0xd459) sprintf(RealModelName, "SCPH-77007"); // 91: 27209116 - else if (ModelId == 0xd45a) sprintf(RealModelName, "SCPH-77008"); // 91: 27209181 - /* else if (ModelId == 0xd45b) sprintf(RealModelName, "??? SCPH-77008 SS"); // 95: 27209581 - else if (ModelId == 0xd45c) sprintf(RealModelName, "??? SCPH-77010"); // ??? PK9 not confirmed */ - else if (ModelId == 0xd45d) sprintf(RealModelName, "SCPH-77001 SS"); // PL1 - else if (ModelId == 0xd45e) sprintf(RealModelName, "SCPH-77003 PK"); // 97: 27209761 - else if (ModelId == 0xd45f) sprintf(RealModelName, "SCPH-77004 PK"); // 97: 27209751 - /* else if (ModelId == 0xd460) sprintf(RealModelName, "??? SCPH-77010 SS"); // PL2 */ - else if (ModelId == 0xd461) sprintf(RealModelName, "SCPH-77000 SS"); // 96: 27209601 - else if (ModelId == 0xd462) sprintf(RealModelName, "SCPH-77000 PK"); // 97: 27209701 - else if (ModelId == 0xd463) sprintf(RealModelName, "SCPH-77008 PK"); // 97: 27209781 - else if (ModelId == 0xd464) sprintf(RealModelName, "SCPH-77002 PK"); // 97: 27209791 - // N-chassis - else if (ModelId == 0xd465) sprintf(RealModelName, "SCPH-79001"); // 240, PA0, PA9: 27224031 - /* else if (ModelId == 0xd466) sprintf(RealModelName, "??? SCPH-79000"); // 240: 27224001 */ - else if (ModelId == 0xd467) sprintf(RealModelName, "SCPH-79000 CW"); // 242: 27224201 - else if (ModelId == 0xd468) sprintf(RealModelName, "SCPH-79002"); // 240: 27224091 - else if (ModelId == 0xd469) sprintf(RealModelName, "SCPH-79001 SS"); // 241: 27224131 - /* else if (ModelId == 0xd46a) sprintf(RealModelName, "??? SCPH-79005"); // 240: 27224025 */ - else if (ModelId == 0xd46b) sprintf(RealModelName, "SCPH-79006"); // 240: 27224018 - /* else if (ModelId == 0xd46c) sprintf(RealModelName, "??? SCPH-79007"); // 240: 27224016 */ - else if (ModelId == 0xd46d) sprintf(RealModelName, "SCPH-79000 SS"); // 241: 27224101 - else if (ModelId == 0xd46e) sprintf(RealModelName, "SCPH-79003"); // 240: 27224061 - else if (ModelId == 0xd46f) sprintf(RealModelName, "SCPH-79004"); // 240: 27224051, 27224052 - else if (ModelId == 0xd470) sprintf(RealModelName, "SCPH-79010"); // 240: SN0, 27224035 - else if (ModelId == 0xd471) sprintf(RealModelName, "SCPH-79003 SS"); // 241: 27224161 - /* else if (ModelId == 0xd472) sprintf(RealModelName, "??? SCPH-79004 SS"); // 241: 27224151 */ - else if (ModelId == 0xd473) sprintf(RealModelName, "SCPH-79008"); // 240: 27224081 - else if (ModelId == 0xd474) sprintf(RealModelName, "SCPH-79001 CW"); // PW0 - // P/R-chassis - else if (ModelId == 0xd475) sprintf(RealModelName, "SCPH-90000"); // 244, 248: 27224401, 27224801 - else if (ModelId == 0xd476) sprintf(RealModelName, "SCPH-90000 CW"); // 245, 249: 27224501, 27224901 - else if (ModelId == 0xd477) sprintf(RealModelName, "SCPH-90000 SS"); // 246: 27224601 // 4990: 27499001 - else if (ModelId == 0xd478) sprintf(RealModelName, "SCPH-90006"); // 244: 27224418 - else if (ModelId == 0xd479) sprintf(RealModelName, "SCPH-90006 CW"); // 245: 27224518 - /* else if (ModelId == 0xd47a) sprintf(RealModelName, "SCPH-90006 SS"); // 246: 27224618 // needs sticker confirmation */ - else if (ModelId == 0xd47b) sprintf(RealModelName, "SCPH-90005"); // 244: 27224425 // 4994: 27499475 - /* else if (ModelId == 0xd47c) sprintf(RealModelName, "??? SCPH-90005 CW"); // 245: 27224525 - else if (ModelId == 0xd47d) sprintf(RealModelName, "??? SCPH-90005 SS"); // 246: 27224625 */ - else if (ModelId == 0xd47e) sprintf(RealModelName, "SCPH-90007"); // 244: 27224416 // 4245: 27424581 - else if (ModelId == 0xd47f) sprintf(RealModelName, "SCPH-90007 CW"); // 245: 27224516 // 4246: 27424681 - /* else if (ModelId == 0xd480) sprintf(RealModelName, "??? SCPH-90007 SS"); // 246: 27224616 // 4247: 27424731 */ - else if (ModelId == 0xd481) sprintf(RealModelName, "SCPH-90001"); // 4090: PA2, 27409054 - else if (ModelId == 0xd482) sprintf(RealModelName, "SCPH-90001 SS"); // 246: PA7, 27224631 // 4090, 4991: PA7, 27499104, PA8, 27409054 - else if (ModelId == 0xd483) sprintf(RealModelName, "SCPH-90004"); // 244: 27224451 // 4993: 27499372 - else if (ModelId == 0xd484) sprintf(RealModelName, "SCPH-90004 SS"); // 246: 27224651 - else if (ModelId == 0xd485) sprintf(RealModelName, "SCPH-90002"); // 244: 27224491 // 4091: 27409166 - else if (ModelId == 0xd486) sprintf(RealModelName, "SCPH-90003"); // 244: 27224461 - /* else if (ModelId == 0xd487) sprintf(RealModelName, "??? SCPH-90005 CR"); // 247: 27224725 // 4242: 27424225 */ - else if (ModelId == 0xd488) sprintf(RealModelName, "SCPH-90006 CR"); // 4244: 27424428 - else if (ModelId == 0xd489) sprintf(RealModelName, "SCPH-90007 CR"); // 4246: 27424631 - else if (ModelId == 0xd48a) sprintf(RealModelName, "SCPH-90010"); // 4248: SP9, 27424810 - else if (ModelId == 0xd48b) sprintf(RealModelName, "SCPH-90000 CR"); // 4249: 27424901 - else if (ModelId == 0xd48c) sprintf(RealModelName, "SCPH-90008"); // 244: 27224481 // 4247: 27424784 - else if (ModelId == 0xd48d) sprintf(RealModelName, "SCPH-90008 SS"); // 246: 27224681 - /* else if (ModelId == 0xd48e) sprintf(RealModelName, "???"); */ - else if (ModelId == 0xd48f) sprintf(RealModelName, "PX300-1"); - else if (ModelId == 0xd490) sprintf(RealModelName, "PX300-2"); - else if (ModelId == 0xd491) sprintf(RealModelName, "SCPH-90010 CR"); // SM3 - else if (ModelId == 0x9000) sprintf(RealModelName, "SYSTEM246 C"); - // clang-format on - else + console_record_t* T = ConsoleModel_GetDataByID(ModelId); + if (!T) { errorTextures = ui_printf(8, 8 + big_size + big_size / 2 + 5 * (reg_size + 4), reg_size, 0xFFFFFF, "Model ID unknown, please report!\n"); IsKnownconsole = 0; + } else { + sprintf(RealModelName, T->name); } modelnameTextures = ui_printf(8, 8 + big_size + big_size / 2 + 2 * (reg_size + 4), reg_size, 0xFFFFFF, "Real Model Name: %s\n", RealModelName); - sprintf(color, "Black"); - if ((ModelId >= 0xd380 && ModelId <= 0xd388 && ModelId != 0xd384) || - (ModelId == 0xd414) || (ModelId == 0xd418) || (ModelId == 0xd419) || - (ModelId == 0xd41e) || (ModelId == 0xd424) || (ModelId == 0xd437) || - (ModelId == 0xd444) || (ModelId == 0xd456) || (ModelId == 0xd474) || /* (ModelId == 0xd47c) || */ - (ModelId == 0xd476) || (ModelId == 0xd479) || (ModelId == 0xd47f)) - sprintf(color, "White"); - else if ((ModelId == 0xd408) || (ModelId == 0xd409) || (ModelId == 0xd40a) || - (ModelId == 0xd412) || (ModelId == 0xd415) || (ModelId == 0xd41a) || /* (ModelId == 0xd417) || */ - (ModelId == 0xd41c) || (ModelId == 0xd420) || (ModelId == 0xd422) || /* (ModelId == 0xd421) || */ - (ModelId == 0xd423) || (ModelId == 0xd431) || (ModelId == 0xd432) || - (ModelId == 0xd433) || (ModelId == 0xd434) || (ModelId == 0xd437) || - (ModelId == 0xd438) || (ModelId == 0xd439) || (ModelId == 0xd43a) || - (ModelId == 0xd43f) || (ModelId == 0xd440) || (ModelId == 0xd441) || /* (ModelId == 0xd44a) || (ModelId == 0xd44b) || */ - (ModelId == 0xd442) || (ModelId == 0xd44d) || (ModelId == 0xd452) || - (ModelId == 0xd453) || (ModelId == 0xd454) || (ModelId == 0xd45d) || /* (ModelId == 0xd45c) || */ - (ModelId == 0xd461) || (ModelId == 0xd469) || (ModelId == 0xd46d) || /* (ModelId == 0xd460) || */ - (ModelId == 0xd471) || (ModelId == 0xd477) || (ModelId == 0xd47a) || /* (ModelId == 0xd472) || */ - (ModelId == 0xd482) || (ModelId == 0xd484) || (ModelId == 0xd48d) || /* (ModelId == 0xd47d) || (ModelId == 0xd480) || */ - (ModelId == 0xd384) || (ModelId == 0xd304) || (ModelId == 0xd22a)) - sprintf(color, "Satin Silver"); - else if ((ModelId == 0xd41f) || (ModelId == 0xd45e) || (ModelId == 0xd45f) || - (ModelId == 0xd462) || (ModelId == 0xd464) || (ModelId == 0xd22c)) - sprintf(color, "Pink"); - else if ((ModelId == 0xd404) || (ModelId == 0xd41b) || (ModelId == 0xd41d) || - (ModelId == 0xd21d) || (ModelId == 0xd220) || (ModelId == 0xd22b) || - (ModelId == 0xd463)) - sprintf(color, "Blue"); - else if ((ModelId == 0xd488) || (ModelId == 0xd489) || (ModelId == 0xd48b) || /* (ModelId == 0xd487) || */ - (ModelId == 0xd491)) - sprintf(color, "Cinnabar Red"); - else if (ModelId == 0xd413) - sprintf(color, "Gold"); + sprintf(color, ConsoleModel_GetColorName((T) ? T->color : UNKNOWN)); colorTextures = ui_printf(8, 8 + big_size + big_size / 2 + 3 * (reg_size + 4), reg_size, 0xFFFFFF, "Console color: %s\n", color); From e0dc3346b7cf7c5f6bbe05fa93f7fea7cf2c5813 Mon Sep 17 00:00:00 2001 From: Matias Israelson <57065102+israpps@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:43:29 -0300 Subject: [PATCH 4/5] clang format database --- Makefile | 2 +- consoleident.c | 301 +++++++++++++++++++++++++------------------------ 2 files changed, 153 insertions(+), 150 deletions(-) diff --git a/Makefile b/Makefile index 7b33da9..8508b47 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ IRX_DIR = irx/compiled EE_PACKED_BIN = MechaPwn_pck.elf # C File -EE_OBJS = main.o mecha.o exploit.o pad.o ui.o mass.o +EE_OBJS = main.o mecha.o exploit.o pad.o ui.o mass.o consoleident.o EE_OBJS += iomanX_irx.o fileXio_irx.o freesio2_irx.o freepad_irx.o mcman_irx.o mcsrv_irx.o USBD_irx.o USBHDFSD_irx.o IndieFlower_irx.o EE_OBJS += MECHAPROXY_irx.o MASSWATCHER_irx.o pwr50k.o pwr70k.o pwr90k.o pwrpsx1.o pwrpsx2.o pwrtvcombo.o frame_001.o frame_002.o frame_003.o frame_004.o frame_005.o frame_006.o frame_007.o frame_008.o frame_009.o frame_010.o frame_011.o frame_012.o frame_013.o frame_014.o frame_015.o frame_016.o frame_017.o frame_018.o frame_019.o frame_020.o frame_021.o frame_022.o frame_023.o frame_024.o frame_025.o frame_026.o frame_027.o frame_028.o frame_029.o frame_030.o frame_031.o frame_032.o frame_033.o frame_034.o frame_035.o frame_036.o frame_037.o frame_038.o frame_039.o frame_040.o frame_041.o frame_042.o frame_043.o frame_044.o frame_045.o frame_046.o frame_047.o frame_048.o frame_049.o frame_050.o frame_051.o frame_052.o frame_053.o frame_054.o frame_055.o frame_056.o frame_057.o frame_058.o frame_059.o frame_060.o frame_061.o frame_062.o diff --git a/consoleident.c b/consoleident.c index 2dfbe4f..db40d5c 100644 --- a/consoleident.c +++ b/consoleident.c @@ -1,8 +1,10 @@ #include "consoleident.h" #include +#include -#define arraysizeof(a) (sizeof(a) / sizeof(a[0])) +#define arraysizeof(a) (sizeof(a) / sizeof(a[0])) +// clang-format off static const console_record_t DB[] = { {0xd200, "DTL-H10000", DEX|PCMCIA|PROTOKERNEL, BLACK}, {0xd201, "SCPH-10000", PCMCIA|PROTOKERNEL, BLACK}, @@ -50,13 +52,13 @@ static const console_record_t DB[] = { {0xd22b, "SCPH-39000 AQ", 0, AQUA_BLUE}, {0xd22c, "SCPH-39000 SA", 0, PINK}, {0xd22d, "SCPH-39010/N", 0, BLACK}, - // Deckard - // d300 = SCPH-50000, whats that? +// Deckard +// d300 = SCPH-50000, whats that? {0xd301, "DTL-H50000", DEX, BLACK}, {0xd302, "DTL-H50001", DEX, BLACK}, {0xd303, "DTL-H50002", DEX, BLACK}, {0xd304, "DTL-H50009", DEX, SATIN_SILVER}, - // d305 - d31d ?? +// d305 - d31d ?? {0xd31e, "DTL-H70002", DEX, BLACK}, // {0xd31f, "DTL-H70011S ???", DEX, BLACK}, // {0xd320, "???", DEX, BLACK}, @@ -66,8 +68,8 @@ static const console_record_t DB[] = { // {0xd324, "???", DEX, BLACK}, // {0xd325, "???", DEX, BLACK}, {0xd326, "DTL-H90000(a)", DEX, BLACK}, - // d327-d37f - // X-chassis +// d327-d37f +// X-chassis {0xd380, "DESR-7000", PSX, WHITE}, {0xd381, "DESR-5000", PSX, WHITE}, {0xd382, "DESR-7100", PSX, WHITE}, @@ -77,178 +79,178 @@ static const console_record_t DB[] = { {0xd386, "DESR-5500", PSX, WHITE}, {0xd387, "DESR-7700", PSX, WHITE}, {0xd388, "DESR-5700", PSX, WHITE}, - // d389 - d400 ?? - // H, I, J -chassis -// {0xd400, "SCPH-50000", 0, BLACK}, // 35: PX1, PX2, 27203531, 27203532 - {0xd401, "SCPH-50001/N", 0, BLACK}, // 37: PX7, PX8, 27203731, 27203732 - {0xd402, "SCPH-50010/N", 0, BLACK}, // ??: PU6 - {0xd403, "SCPH-50000", 0, BLACK}, // 35: 27203500, 27203502 +// d389 - d400 ?? +// H, I, J -chassis +// {0xd400, "SCPH-50000", 0, BLACK}, // 35: PX1, PX2, 27203531, 27203532 + {0xd401, "SCPH-50001/N", 0, BLACK}, // 37: PX7, PX8, 27203731, 27203732 + {0xd402, "SCPH-50010/N", 0, BLACK}, // ??: PU6 + {0xd403, "SCPH-50000", 0, BLACK}, // 35: 27203500, 27203502 {0xd404, "SCPH-50000 MB/NH", 0, MIDNIGHT_BLUE}, // 39, 43, 60: 27203900, 27203902, 27204302, 27206002 - {0xd405, "SCPH-50002", 0, BLACK}, // 35: 27203591 - {0xd406, "SCPH-50003", 0, BLACK}, // 35: 227203561 - {0xd407, "SCPH-50004", 0, BLACK}, // 35: 227203551, 27203552 - {0xd408, "SCPH-50002 SS", 0, SATIN_SILVER}, // 40: 27204091, Silver Prestige Line - {0xd409, "SCPH-50003 SS", 0, SATIN_SILVER}, // 40: 27204061, Silver Prestige Line - {0xd40a, "SCPH-50004 SS", 0, SATIN_SILVER}, // 40: 27204051, 27204052, Silver Prestige Line - {0xd40b, "SCPH-50001", 0, BLACK}, // 41: PX3, PX4, 27204131, 27204132 - {0xd40c, "SCPH-50005/N", 0, BLACK},// 37: 27203725 - {0xd40d, "SCPH-50006", 0, BLACK}, // 35: 27203512, 27203518 - {0xd40e, "SCPH-50007", 0, BLACK}, // 35: 27203516 - {0xd40f, "SCPH-50008", 0, BLACK}, // 35: 27203581 + {0xd405, "SCPH-50002", 0, BLACK}, // 35: 27203591 + {0xd406, "SCPH-50003", 0, BLACK}, // 35: 227203561 + {0xd407, "SCPH-50004", 0, BLACK}, // 35: 227203551, 27203552 + {0xd408, "SCPH-50002 SS", 0, SATIN_SILVER}, // 40: 27204091, Silver Prestige Line + {0xd409, "SCPH-50003 SS", 0, SATIN_SILVER}, // 40: 27204061, Silver Prestige Line + {0xd40a, "SCPH-50004 SS", 0, SATIN_SILVER}, // 40: 27204051, 27204052, Silver Prestige Line + {0xd40b, "SCPH-50001", 0, BLACK}, // 41: PX3, PX4, 27204131, 27204132 + {0xd40c, "SCPH-50005/N", 0, BLACK}, // 37: 27203725 + {0xd40d, "SCPH-50006", 0, BLACK}, // 35: 27203512, 27203518 + {0xd40e, "SCPH-50007", 0, BLACK}, // 35: 27203516 + {0xd40f, "SCPH-50008", 0, BLACK}, // 35: 27203581 // {0xd410, "SCPH-50009", 0, BLACK}, - {0xd411, "SCPH-50000 NB", 0, BLACK}, // 45, 46, 54: 27204501, 27204502, 27204604, 27205402 - {0xd412, "SCPH-50000 TSS", 0, SATIN_SILVER}, // 40: 27204004 - {0xd413, "SCPH-55000 GU", 0, GOLD}, // 67: 27206702 - {0xd414, "SCPH-55000 GT", 0, WHITE}, // 47, 49: 27204704, 27204904 - {0xd415, "SCPH-50009 SS", 0, SATIN_SILVER}, // 37, 40: 27203720, 27204020 - {0xd416, "SCPH-50003 AQ", 0, AQUA_BLUE}, // 51: 27205161 -// {0xd417, "SCPH-55005 GT/N", 0, WHITE}, // 50: 27205025 - {0xd418, "SCPH-55006 GT", 0, WHITE}, // 47: 27204718 - {0xd419, "SCPH-55007 GT", 0, WHITE}, // 47: 27204716 - {0xd41a, "SCPH-50008 SS", 0, SATIN_SILVER}, // 40: 27204081 - {0xd41b, "SCPH-50004 AQ", 0, AQUA_BLUE}, // 51: 27205151 - {0xd41c, "SCPH-50005 SS/N", 0, SATIN_SILVER}, // 55: 27205525 - {0xd41d, "SCPH-50005 AQ/N", 0, AQUA_BLUE}, // 56: 27205625 - {0xd41e, "SCPH-50000 CW", 0, WHITE}, // 44: 27204402 - {0xd41f, "SCPH-50000 SA", 0, PINK}, // 61: 27206101 - {0xd420, "SCPH-50004 ESS", 0, SATIN_SILVER}, // 57, 62, 66: 27205751, 27206251, 27206651 Satin Silver + {0xd411, "SCPH-50000 NB", 0, BLACK}, // 45, 46, 54: 27204501, 27204502, 27204604, 27205402 + {0xd412, "SCPH-50000 TSS", 0, SATIN_SILVER}, // 40: 27204004 + {0xd413, "SCPH-55000 GU", 0, GOLD}, // 67: 27206702 + {0xd414, "SCPH-55000 GT", 0, WHITE}, // 47, 49: 27204704, 27204904 + {0xd415, "SCPH-50009 SS", 0, SATIN_SILVER}, // 37, 40: 27203720, 27204020 + {0xd416, "SCPH-50003 AQ", 0, AQUA_BLUE}, // 51: 27205161 +// {0xd417, "SCPH-55005 GT/N", 0, WHITE}, // 50: 27205025 + {0xd418, "SCPH-55006 GT", 0, WHITE}, // 47: 27204718 + {0xd419, "SCPH-55007 GT", 0, WHITE}, // 47: 27204716 + {0xd41a, "SCPH-50008 SS", 0, SATIN_SILVER}, // 40: 27204081 + {0xd41b, "SCPH-50004 AQ", 0, AQUA_BLUE}, // 51: 27205151 + {0xd41c, "SCPH-50005 SS/N", 0, SATIN_SILVER}, // 55: 27205525 + {0xd41d, "SCPH-50005 AQ/N", 0, AQUA_BLUE}, // 56: 27205625 + {0xd41e, "SCPH-50000 CW", 0, WHITE}, // 44: 27204402 + {0xd41f, "SCPH-50000 SA", 0, PINK}, // 61: 27206101 + {0xd420, "SCPH-50004 ESS", 0, SATIN_SILVER}, // 57, 62, 66: 27205751, 27206251, 27206651 Satin Silver // {0xd421, "???", 0, UNKNOWN}, - {0xd422, "SCPH-50002 ESS", 0, SATIN_SILVER}, // 62: 27206291 Satin Silver - {0xd423, "SCPH-50003 ESS", 0, SATIN_SILVER}, // 66: 27206661 Satin Silver - {0xd424, "SCPH-50000 PW", 0, WHITE}, // 65: 27206501 - {0xd425, "SCPH-50011", 0, BLACK}, // ??: SM1 (box not found) - // K-chassis - {0xd426, "SCPH-70004", 0, BLACK}, // 63, 70: 27207051, 27207052, 27206351, 27206352 - {0xd427, "SCPH-70003", 0, BLACK}, // 63, 70: 27207061, 27207062, ????????, 27206362 - {0xd428, "SCPH-70002", 0, BLACK}, // 63, 70: 27207091, 27206392 - {0xd429, "SCPH-70011", 0, BLACK}, // 63: PK1, 27206331 - {0xd42a, "SCPH-70012", 0, BLACK}, // 63: PK2, 27206341 - {0xd42b, "SCPH-70000", 0, BLACK}, // 63, 78: 27206301, 27206302, 27207802 - {0xd42c, "SCPH-70005", 0, BLACK}, // 63: 27206325 - {0xd42d, "SCPH-70006", 0, BLACK}, // 63: 27206318 - {0xd42e, "SCPH-70007", 0, BLACK}, // 63: 27206316 - {0xd42f, "SCPH-70000 GT", 0, BLACK}, // 72: 27207202 - {0xd430, "SCPH-70008", 0, BLACK}, // 63: 27206381 - {0xd431, "SCPH-70002 SS", 0, SATIN_SILVER}, // 69: 27206991 - {0xd432, "SCPH-70003 SS", 0, SATIN_SILVER}, // 69: 27206961 - {0xd433, "SCPH-70004 SS", 0, SATIN_SILVER}, // 69: 27206951 - {0xd434, "SCPH-70008 SS", 0, SATIN_SILVER}, // 69: 27206981 - {0xd435, "SCPH-70001", 0, BLACK}, // 77: PK3, 27207731 - {0xd436, "SCPH-70010", 0, BLACK}, // sticker and box not found - {0xd437, "SCPH-70000 CW", 0, WHITE}, // 79: 27207902 - {0xd438, "SCPH-70003 SS", 0, SATIN_SILVER}, // 80: 27208063 - {0xd439, "SCPH-70004 SS", 0, SATIN_SILVER}, // 80: 27208053 - {0xd43a, "SCPH-70008 SS", 0, SATIN_SILVER}, // 80: 27208081 + {0xd422, "SCPH-50002 ESS", 0, SATIN_SILVER}, // 62: 27206291 Satin Silver + {0xd423, "SCPH-50003 ESS", 0, SATIN_SILVER}, // 66: 27206661 Satin Silver + {0xd424, "SCPH-50000 PW", 0, WHITE}, // 65: 27206501 + {0xd425, "SCPH-50011", 0, BLACK}, // ??: SM1 (box not found) +// K-chassis + {0xd426, "SCPH-70004", 0, BLACK}, // 63, 70: 27207051, 27207052, 27206351, 27206352 + {0xd427, "SCPH-70003", 0, BLACK}, // 63, 70: 27207061, 27207062, ????????, 27206362 + {0xd428, "SCPH-70002", 0, BLACK}, // 63, 70: 27207091, 27206392 + {0xd429, "SCPH-70011", 0, BLACK}, // 63: PK1, 27206331 + {0xd42a, "SCPH-70012", 0, BLACK}, // 63: PK2, 27206341 + {0xd42b, "SCPH-70000", 0, BLACK}, // 63, 78: 27206301, 27206302, 27207802 + {0xd42c, "SCPH-70005", 0, BLACK}, // 63: 27206325 + {0xd42d, "SCPH-70006", 0, BLACK}, // 63: 27206318 + {0xd42e, "SCPH-70007", 0, BLACK}, // 63: 27206316 + {0xd42f, "SCPH-70000 GT", 0, BLACK}, // 72: 27207202 + {0xd430, "SCPH-70008", 0, BLACK}, // 63: 27206381 + {0xd431, "SCPH-70002 SS", 0, SATIN_SILVER}, // 69: 27206991 + {0xd432, "SCPH-70003 SS", 0, SATIN_SILVER}, // 69: 27206961 + {0xd433, "SCPH-70004 SS", 0, SATIN_SILVER}, // 69: 27206951 + {0xd434, "SCPH-70008 SS", 0, SATIN_SILVER}, // 69: 27206981 + {0xd435, "SCPH-70001", 0, BLACK}, // 77: PK3, 27207731 + {0xd436, "SCPH-70010", 0, BLACK}, // sticker and box not found + {0xd437, "SCPH-70000 CW", 0, WHITE}, // 79: 27207902 + {0xd438, "SCPH-70003 SS", 0, SATIN_SILVER}, // 80: 27208063 + {0xd439, "SCPH-70004 SS", 0, SATIN_SILVER}, // 80: 27208053 + {0xd43a, "SCPH-70008 SS", 0, SATIN_SILVER}, // 80: 27208081 // L-chassis - {0xd43b, "SCPH-75001", 0, BLACK}, // 81, 82: PK4, PK5, 27208131, 27208232 - {0xd43c, "SCPH-75002", 0, BLACK}, // 81: 27208191, ???????? - {0xd43d, "SCPH-75003", 0, BLACK}, // 81, 82: 27208161, 27208262 - {0xd43e, "SCPH-75004", 0, BLACK}, // 81, 82: 27208151, 27208252 + {0xd43b, "SCPH-75001", 0, BLACK}, // 81, 82: PK4, PK5, 27208131, 27208232 + {0xd43c, "SCPH-75002", 0, BLACK}, // 81: 27208191, ???????? + {0xd43d, "SCPH-75003", 0, BLACK}, // 81, 82: 27208161, 27208262 + {0xd43e, "SCPH-75004", 0, BLACK}, // 81, 82: 27208151, 27208252 {0xd43f, "SCPH-75000 SSS", 0, SATIN_SILVER}, // 85: 27208501 - {0xd440, "SCPH-75002 SS", 0, SATIN_SILVER}, // 87: 27208791 - {0xd441, "SCPH-75003 SS", 0, SATIN_SILVER}, // 87: 27208761 - {0xd442, "SCPH-75004 SS", 0, SATIN_SILVER}, // 87: 27208751 - {0xd443, "SCPH-75000", 0, BLACK}, // 82: 27208202 - {0xd444, "SCPH-75000 CW", 0, WHITE}, // 83: 27208302 - {0xd445, "SCPH-75006", 0, BLACK}, // 82: 27208218 - {0xd446, "SCPH-75007", 0, BLACK}, // 82: 27208216 - {0xd447, "SCPH-75005", 0, BLACK}, // 82: 27208225 - {0xd448, "SCPH-75010", 0, BLACK}, // PK6 - {0xd449, "SCPH-75000 FF", 0, BLACK}, // 89: 27208901 - /* {0xd44a, "???", 0, UNKNOWN); - {0xd44b, "???", 0, UNKNOWN); */ - {0xd44c, "SCPH-75008", 0, BLACK}, // 82: 27208281 - {0xd44d, "SCPH-75008 SS", 0, SATIN_SILVER}, // 88: 27208881 - // M-chassis - {0xd44e, "SCPH-77001", 0, BLACK}, // 91: PK7, PK8: 27209131 - {0xd44f, "SCPH-77002", 0, BLACK}, // 91: 27209191 - {0xd450, "SCPH-77003", 0, BLACK}, // 91: 27209161 - {0xd451, "SCPH-77004", 0, BLACK}, // 91: 27209151, 27209152 + {0xd440, "SCPH-75002 SS", 0, SATIN_SILVER}, // 87: 27208791 + {0xd441, "SCPH-75003 SS", 0, SATIN_SILVER}, // 87: 27208761 + {0xd442, "SCPH-75004 SS", 0, SATIN_SILVER}, // 87: 27208751 + {0xd443, "SCPH-75000", 0, BLACK}, // 82: 27208202 + {0xd444, "SCPH-75000 CW", 0, WHITE}, // 83: 27208302 + {0xd445, "SCPH-75006", 0, BLACK}, // 82: 27208218 + {0xd446, "SCPH-75007", 0, BLACK}, // 82: 27208216 + {0xd447, "SCPH-75005", 0, BLACK}, // 82: 27208225 + {0xd448, "SCPH-75010", 0, BLACK}, // PK6 + {0xd449, "SCPH-75000 FF", 0, BLACK}, // 89: 27208901 +// {0xd44a, "???", 0, UNKNOWN}, +// {0xd44b, "???", 0, UNKNOWN}, + {0xd44c, "SCPH-75008", 0, BLACK}, // 82: 27208281 + {0xd44d, "SCPH-75008 SS", 0, SATIN_SILVER}, // 88: 27208881 +// M-chassis + {0xd44e, "SCPH-77001", 0, BLACK}, // 91: PK7, PK8: 27209131 + {0xd44f, "SCPH-77002", 0, BLACK}, // 91: 27209191 + {0xd450, "SCPH-77003", 0, BLACK}, // 91: 27209161 + {0xd451, "SCPH-77004", 0, BLACK}, // 91: 27209151, 27209152 {0xd452, "SCPH-77002 SS", 0, SATIN_SILVER}, // 95: 27209591 {0xd453, "SCPH-77003 SS", 0, SATIN_SILVER}, // 95: 27209561 {0xd454, "SCPH-77004 SS", 0, SATIN_SILVER}, // 95, 16: 27209551, 27201651 - {0xd455, "SCPH-77000", 0, BLACK}, // 91: 27209102 - {0xd456, "SCPH-77000 CW", 0, WHITE}, // 93: 27209302 - {0xd457, "SCPH-77005", 0, BLACK},// 91: 27209125 - {0xd458, "SCPH-77006", 0, BLACK},// 91: 27209118 - {0xd459, "SCPH-77007", 0, BLACK},// 91: 27209116 - {0xd45a, "SCPH-77008", 0, BLACK},// 91: 27209181 - /* {0xd45b, "??? SCPH-77008 SS", 0, UNKNOWN}, // 95: 27209581 - {0xd45c, "??? SCPH-77010", 0, UNKNOWN}, // ??? PK9 not confirmed */ + {0xd455, "SCPH-77000", 0, BLACK}, // 91: 27209102 + {0xd456, "SCPH-77000 CW", 0, WHITE}, // 93: 27209302 + {0xd457, "SCPH-77005", 0, BLACK}, // 91: 27209125 + {0xd458, "SCPH-77006", 0, BLACK}, // 91: 27209118 + {0xd459, "SCPH-77007", 0, BLACK}, // 91: 27209116 + {0xd45a, "SCPH-77008", 0, BLACK}, // 91: 27209181 +// {0xd45b, "??? SCPH-77008 SS", 0, UNKNOWN}, // 95: 27209581 +// {0xd45c, "??? SCPH-77010", 0, UNKNOWN}, // ??? PK9 not confirmed */ {0xd45d, "SCPH-77001 SS", 0, SATIN_SILVER}, // PL1 - {0xd45e, "SCPH-77003 PK", 0, PINK}, // 97: 27209761 - {0xd45f, "SCPH-77004 PK", 0, PINK}, // 97: 27209751 -// {0xd460, "SCPH-77010 SS", 0, SATIN_SILVER}, // PL2 */ + {0xd45e, "SCPH-77003 PK", 0, PINK}, // 97: 27209761 + {0xd45f, "SCPH-77004 PK", 0, PINK}, // 97: 27209751 +// {0xd460, "SCPH-77010 SS", 0, SATIN_SILVER}, // PL2 */ {0xd461, "SCPH-77000 SS", 0, SATIN_SILVER}, // 96: 27209601 - {0xd462, "SCPH-77000 PK", 0, PINK}, // 97: 27209701 - {0xd463, "SCPH-77008 PK", 0, PINK}, // 97: 27209781 - {0xd464, "SCPH-77002 PK", 0, PINK}, // 97: 27209791 - // N-chassis - {0xd465, "SCPH-79001", 0, BLACK}, // 240, PA0, PA9: 27224031 - /* {0xd466, "SCPH-79000", 0, UNKNOWN}, // 240: 27224001 */ - {0xd467, "SCPH-79000 CW", 0, WHITE}, // 242: 27224201 - {0xd468, "SCPH-79002", 0, BLACK}, // 240: 27224091 + {0xd462, "SCPH-77000 PK", 0, PINK}, // 97: 27209701 + {0xd463, "SCPH-77008 PK", 0, PINK}, // 97: 27209781 + {0xd464, "SCPH-77002 PK", 0, PINK}, // 97: 27209791 +// N-chassis + {0xd465, "SCPH-79001", 0, BLACK}, // 240, PA0, PA9: 27224031 +// {0xd466, "SCPH-79000", 0, UNKNOWN}, // 240: 27224001 */ + {0xd467, "SCPH-79000 CW", 0, WHITE}, // 242: 27224201 + {0xd468, "SCPH-79002", 0, BLACK}, // 240: 27224091 {0xd469, "SCPH-79001 SS", 0, SATIN_SILVER}, // 241: 27224131 - /* {0xd46a, "??? SCPH-79005, 0, UNKNOWN}, // 240: 27224025 */ - {0xd46b, "SCPH-79006", 0, BLACK}, // 240: 27224018 - /* {0xd46c, "??? SCPH-79007, 0, UNKNOWN}, // 240: 27224016 */ +// {0xd46a, "??? SCPH-79005, 0, UNKNOWN}, // 240: 27224025 */ + {0xd46b, "SCPH-79006", 0, BLACK}, // 240: 27224018 +// {0xd46c, "??? SCPH-79007, 0, UNKNOWN}, // 240: 27224016 */ {0xd46d, "SCPH-79000 SS", 0, SATIN_SILVER}, // 241: 27224101 - {0xd46e, "SCPH-79003", 0, BLACK}, // 240: 27224061 - {0xd46f, "SCPH-79004", 0, BLACK}, // 240: 27224051, 27224052 - {0xd470, "SCPH-79010", 0, BLACK}, // 240: SN0, 27224035 + {0xd46e, "SCPH-79003", 0, BLACK}, // 240: 27224061 + {0xd46f, "SCPH-79004", 0, BLACK}, // 240: 27224051, 27224052 + {0xd470, "SCPH-79010", 0, BLACK}, // 240: SN0, 27224035 {0xd471, "SCPH-79003 SS", 0, SATIN_SILVER}, // 241: 27224161 - /* {0xd472, "??? SCPH-79004 SS", 0, SATIN_SILVER}, // 241: 27224151 */ - {0xd473, "SCPH-79008", 0, BLACK}, // 240: 27224081 - {0xd474, "SCPH-79001 CW", 0, WHITE}, // PW0 - // P/R-chassis - {0xd475, "SCPH-90000", 0, BLACK}, // 244, 248: 27224401, 27224801 - {0xd476, "SCPH-90000 CW", 0, WHITE}, // 245, 249: 27224501, 27224901 +// {0xd472, "SCPH-79004 SS", 0, SATIN_SILVER}, // 241: 27224151 */ + {0xd473, "SCPH-79008", 0, BLACK}, // 240: 27224081 + {0xd474, "SCPH-79001 CW", 0, WHITE}, // PW0 +// P/R-chassis + {0xd475, "SCPH-90000", 0, BLACK}, // 244, 248: 27224401, 27224801 + {0xd476, "SCPH-90000 CW", 0, WHITE}, // 245, 249: 27224501, 27224901 {0xd477, "SCPH-90000 SS", 0, SATIN_SILVER}, // 246: 27224601 // 4990: 27499001 - {0xd478, "SCPH-90006", 0, BLACK}, // 244: 27224418 - {0xd479, "SCPH-90006 CW", 0, WHITE}, // 245: 27224518 - /* {0xd47a, "SCPH-90006 SS", 0, SATIN_SILVER}, // 246: 27224618 // needs sticker confirmation */ - {0xd47b, "SCPH-90005", 0, BLACK}, // 244: 27224425 // 4994: 27499475 - /* {0xd47c, "SCPH-90005 CW", 0, WHITE}, // 245: 27224525 - {0xd47d, "SCPH-90005 SS, 0, SATIN_SILVER}, // 246: 27224625 */ - {0xd47e, "SCPH-90007", 0, BLACK}, // 244: 27224416 // 4245: 27424581 - {0xd47f, "SCPH-90007 CW", 0, WHITE}, // 245: 27224516 // 4246: 27424681 - /* {0xd480, "SCPH-90007 SS, 0, SATIN_SILVER}, // 246: 27224616 // 4247: 27424731 */ - {0xd481, "SCPH-90001", 0, BLACK}, // 4090: PA2, 27409054 + {0xd478, "SCPH-90006", 0, BLACK}, // 244: 27224418 + {0xd479, "SCPH-90006 CW", 0, WHITE}, // 245: 27224518 +// {0xd47a, "SCPH-90006 SS", 0, SATIN_SILVER}, // 246: 27224618 // needs sticker confirmation + {0xd47b, "SCPH-90005", 0, BLACK}, // 244: 27224425 // 4994: 27499475 +// {0xd47c, "SCPH-90005 CW", 0, WHITE}, // 245: 27224525 +// {0xd47d, "SCPH-90005 SS, 0, SATIN_SILVER}, // 246: 27224625 + {0xd47e, "SCPH-90007", 0, BLACK}, // 244: 27224416 // 4245: 27424581 + {0xd47f, "SCPH-90007 CW", 0, WHITE}, // 245: 27224516 // 4246: 27424681 +// {0xd480, "SCPH-90007 SS, 0, SATIN_SILVER}, // 246: 27224616 // 4247: 27424731 + {0xd481, "SCPH-90001", 0, BLACK}, // 4090: PA2, 27409054 {0xd482, "SCPH-90001 SS", 0, SATIN_SILVER}, // 246: PA7, 27224631 // 4090, 4991: PA7, 27499104, PA8, 27409054 - {0xd483, "SCPH-90004", 0, BLACK}, // 244: 27224451 // 4993: 27499372 + {0xd483, "SCPH-90004", 0, BLACK}, // 244: 27224451 // 4993: 27499372 {0xd484, "SCPH-90004 SS", 0, SATIN_SILVER}, // 246: 27224651 - {0xd485, "SCPH-90002", 0, BLACK}, // 244: 27224491 // 4091: 27409166 - {0xd486, "SCPH-90003", 0, BLACK}, // 244: 27224461 - /* {0xd487, "SCPH-90005 CR", 0, CINNABAR_RED}, // 247: 27224725 // 4242: 27424225 */ - {0xd488, "SCPH-90006 CR", 0, CINNABAR_RED}, // 4244: 27424428 - {0xd489, "SCPH-90007 CR", 0, CINNABAR_RED}, // 4246: 27424631 - {0xd48a, "SCPH-90010", 0, BLACK}, // 4248: SP9, 27424810 - {0xd48b, "SCPH-90000 CR", 0, CINNABAR_RED}, // 4249: 27424901 + {0xd485, "SCPH-90002", 0, BLACK}, // 244: 27224491 // 4091: 27409166 + {0xd486, "SCPH-90003", 0, BLACK}, // 244: 27224461 +// {0xd487, "SCPH-90005 CR", 0, CINNABAR_RED}, // 247: 27224725 // 4242: 27424225 + {0xd488, "SCPH-90006 CR", 0, CINNABAR_RED}, // 4244: 27424428 + {0xd489, "SCPH-90007 CR", 0, CINNABAR_RED}, // 4246: 27424631 + {0xd48a, "SCPH-90010", 0, BLACK}, // 4248: SP9, 27424810 + {0xd48b, "SCPH-90000 CR", 0, CINNABAR_RED}, // 4249: 27424901 {0xd48c, "SCPH-90008", 0, BLACK}, // 244: 27224481 // 4247: 27424784 - {0xd48d, "SCPH-90008 SS", 0, SATIN_SILVER}, // 246: 27224681 + {0xd48d, "SCPH-90008 SS", 0, SATIN_SILVER}, // 246: 27224681 {0xd48f, "PX300-1", PS2TV, BLACK}, {0xd490, "PX300-2", PS2TV, BLACK}, - {0xd491, "SCPH-90010 CR", 0, CINNABAR_RED}, // SM3 + {0xd491, "SCPH-90010 CR", 0, CINNABAR_RED}, // SM3 {0x9000, "SYSTEM246 C", COH, BLACK}, // {0x????, "SYSTEM256", COH, METAL}, // {0x????, "SYSTEM S256", COH, METAL}, }; +// clang-format on -const console_record_t* ConsoleModel_GetDataByID(uint16_t ID) { +const console_record_t *ConsoleModel_GetDataByID(uint16_t ID) +{ size_t records = arraysizeof(DB); for (size_t i = 0; i < records; i++) { - if (ID == DB[i].id) return &DB[i]; + if (ID == DB[i].id) + return &DB[i]; } printf("end of DB reached. unknown console 0x%04u\n", ID); return NULL; - } - - -static const char* console_colors[COLORCOUNT] { +static const char *console_colors[COLORCOUNT] = { "UNKNOWN", "Black", "White", @@ -262,11 +264,12 @@ static const char* console_colors[COLORCOUNT] { "Sakura Pink", "Aqua Blue", "Gold", - "Metal", + "Metal", }; -const char* ConsoleModel_GetColorName(int color) { - if (color >= UNKNOWN && color < COLORCOUNT) return console_colors[color]; +const char *ConsoleModel_GetColorName(int color) +{ + if (color >= UNKNOWN && color < COLORCOUNT) + return console_colors[color]; return console_colors[UNKNOWN]; } - From 8ec11fbdd5e3d6b479e2c6e6c7fe7b11e6f17f7d Mon Sep 17 00:00:00 2001 From: Matias Israelson <57065102+israpps@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:52:15 -0300 Subject: [PATCH 5/5] simplify frame object file listing --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8508b47..5b77aa7 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ EE_PACKED_BIN = MechaPwn_pck.elf # C File EE_OBJS = main.o mecha.o exploit.o pad.o ui.o mass.o consoleident.o EE_OBJS += iomanX_irx.o fileXio_irx.o freesio2_irx.o freepad_irx.o mcman_irx.o mcsrv_irx.o USBD_irx.o USBHDFSD_irx.o IndieFlower_irx.o -EE_OBJS += MECHAPROXY_irx.o MASSWATCHER_irx.o pwr50k.o pwr70k.o pwr90k.o pwrpsx1.o pwrpsx2.o pwrtvcombo.o frame_001.o frame_002.o frame_003.o frame_004.o frame_005.o frame_006.o frame_007.o frame_008.o frame_009.o frame_010.o frame_011.o frame_012.o frame_013.o frame_014.o frame_015.o frame_016.o frame_017.o frame_018.o frame_019.o frame_020.o frame_021.o frame_022.o frame_023.o frame_024.o frame_025.o frame_026.o frame_027.o frame_028.o frame_029.o frame_030.o frame_031.o frame_032.o frame_033.o frame_034.o frame_035.o frame_036.o frame_037.o frame_038.o frame_039.o frame_040.o frame_041.o frame_042.o frame_043.o frame_044.o frame_045.o frame_046.o frame_047.o frame_048.o frame_049.o frame_050.o frame_051.o frame_052.o frame_053.o frame_054.o frame_055.o frame_056.o frame_057.o frame_058.o frame_059.o frame_060.o frame_061.o frame_062.o +EE_OBJS += MECHAPROXY_irx.o MASSWATCHER_irx.o pwr50k.o pwr70k.o pwr90k.o pwrpsx1.o pwrpsx2.o pwrtvcombo.o $(addprefix frame_, 001.o 002.o 003.o 004.o 005.o 006.o 007.o 008.o 009.o 010.o 011.o 012.o 013.o 014.o 015.o 016.o 017.o 018.o 019.o 020.o 021.o 022.o 023.o 024.o 025.o 026.o 027.o 028.o 029.o 030.o 031.o 032.o 033.o 034.o 035.o 036.o 037.o 038.o 039.o 040.o 041.o 042.o 043.o 044.o 045.o 046.o 047.o 048.o 049.o 050.o 051.o 052.o 053.o 054.o 055.o 056.o 057.o 058.o 059.o 060.o 061.o 062.o) EE_INCS = -I$(PS2SDK)/ports/include -I$(PS2SDK)/sbv/include -I$(PS2SDK)/common/include -I./irx/source/mechaproxy/include/ -I./irx/source/masswatcher/include/ -I$(PS2SDK)/ports/include/freetype2 -I$(GSKIT)/include EE_LDFLAGS = -L$(PS2SDK)/sbv/lib -L$(PS2SDK)/ports/lib -L$(GSKIT)/lib