diff options
author | PsyK0p4T <[email protected]> | 2021-08-19 21:09:19 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-19 21:09:19 +0200 |
commit | edc238599f0fd2ed9573ba4973cdceb1d9e13455 (patch) | |
tree | 06595a1cc4c405f8f35260efbb5684638a38d90b /Cart_Reader/NGP.ino | |
parent | a6f3e8c90b5aadbc08e48a52c05f86ef53bba35a (diff) | |
download | cartreader-edc238599f0fd2ed9573ba4973cdceb1d9e13455.tar.gz cartreader-edc238599f0fd2ed9573ba4973cdceb1d9e13455.zip |
Update NGP.ino
Small improvments
Diffstat (limited to 'Cart_Reader/NGP.ino')
-rw-r--r-- | Cart_Reader/NGP.ino | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/Cart_Reader/NGP.ino b/Cart_Reader/NGP.ino index 3f26cfa..d908c49 100644 --- a/Cart_Reader/NGP.ino +++ b/Cart_Reader/NGP.ino @@ -42,18 +42,13 @@ void setup_NGP() { PORTH |= ((1 << 0) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6)); + println_Msg(F("Initializing...")); + display_Update(); + if (getCartInfo_NGP()) printCartInfo_NGP(); - else { - println_Msg(F("NeoGeo Pocket")); - println_Msg(F("")); - println_Msg(F("")); - println_Msg(F("Cartridge read error")); - println_Msg(F("")); - println_Msg(F("Press Button...")); - display_Update(); - wait(); - } + else + print_Error(F("Cartridge read error"), true); } void ngpMenu() { @@ -99,14 +94,15 @@ bool getCartInfo_NGP() { *(tmp + 0) = deviceID; *(tmp + 1) = manufacturerID; + // select rom size depending of the chip IDs switch (romSize) { + case 0x98ab: cartSize = 524288; break; // 4 Mbits Toshiba + case 0x204c: cartSize = 524288; break; // 4 Mbits STMicroelectronics ? + case 0x982c: cartSize = 1048576; break; // 8 Mbits Toshiba + case 0xec2c: cartSize = 1048576; break; // 8 Mbits Samsung + case 0x982f: cartSize = 2097152; break; // 16 Mbits Toshiba + case 0xec2f: cartSize = 2097152; break; // 16 Mbits Samsung case 0xffff: return false; break; // detection error (no cart inserted or hw problem) - case 0x98ab: cartSize = 524288; break; // 4 Mbits - Toshiba - case 0x204c: cartSize = 524288; break; // 4 Mbits - STMicroelectronics ? - case 0x982c: cartSize = 1048576; break; // 8 Mbits - Toshiba - case 0xec2c: cartSize = 1048576; break; // 8 Mbits - Samsung - case 0x982f: cartSize = 2097152; break; // 16 Mbits - Toshiba - case 0xec2f: cartSize = 2097152; break; // 16 Mbits - Samsung } // reset to read mode |