Commit Graph

85 Commits

Author SHA1 Message Date
smesgr9000
5b43a162b8 reuse common strings, remove duplicate 2024-05-30 08:00:13 +02:00
smesgr9000
363d18b542 add common function to open create folder, print message and open file. Remove duplicate code 2024-05-26 22:20:47 +02:00
smesgr9000
41182a7eb0 add option to clear display and remove duplicate code 2024-05-25 14:25:35 +02:00
smesgr9000
6abe29fcd9 remove duplicate code to print saving and increment of folder id 2024-05-25 14:07:08 +02:00
smesgr9000
9f0aa09197 remove duplicate code to create folder 2024-05-12 15:37:11 +02:00
smesgr9000
74352c6e31 define "File doesn't exist" in OSCR.cpp/h 2024-05-11 23:32:06 +02:00
smesgr9000
ab03ab879c pass onyl 16bit parameter where only 16bit address is used 2024-05-11 23:18:31 +02:00
smesgr9000
9e2ef3580c reuse print instructions function, more efficiant read code 2024-05-10 19:13:19 +02:00
Ancyker
e61ac414d8 Code optimization, cleanup, and stylization
* Reduced PROGMEM / DRAM usage slightly (Using defaults w/HW5: Before -> 214,668 bytes / 5,757 bytes; After -> 213,414 bytes / 5,751 bytes)
  * Optimized some menu options and calls
  * Added more string constants and implemented them where found.
* Fixed some stylization
  * Constants should always be uppercase.
  * Features should use the `ENABLE_<feature name>` format.
  * Options for features should use the `OPTION_<feature name>_<option name>` format.
  * Added ENUMs for more clarity and better type checking.
  * Moved some defines over to `constexpr` and `const` types. These are preferred over preprocessor constants when not intended for use with `#if` and other preprocessor language.
2024-03-02 11:26:35 -05:00
Ancyker
2cf7f5dbe7 Cleanup voltage requests
The `setVoltage()` function should be called even when `ENABLE_VSELECT` is disabled because `ENABLE_3V3FIX` also uses it. There is no resource cost to do this as when both options are disabled the compiler will optimize this function out. This just "future proofs" the code so if that function ever does more it doesn't need updated everywhere. This applies to `setup_FlashVoltage()` as well.

The changes to OSCR.cpp are just for code formatting and additional comments to clarify this.
2023-06-26 15:25:54 -04:00
sanni
dee54dd30e Move automatic voltage selection from menu to setup functions 2023-06-26 12:04:00 +02:00
Lesserkuma
d1bfd53593 [GBA] Fixed reading 32 MB carts that use EEPROM saves 2023-06-17 14:24:17 +02:00
Lesserkuma
4c3e618f6e [GBA] Corrected ROM name length 2023-06-17 14:20:57 +02:00
Ancyker
010b7e7525 Firmware Updater support, 3.3V Fix, and more
Lots of changes/additions.

Added:
* Firmware Updater support: Supports the Firmware Updater app (release to follow soon). Enabled by default, can be disabled in the config.
* 3.3V Fix (3V3FIX): Enable if you have stability issues when using 3.3V, works best with VSELECT. Disabled by default, can be enabled in the config.
* `DynamicClockSerial`: Class that extends and modifies HardwareSerial to be compatible with a dynamically changing clock speed. Used through the `ClockedSerial` object/variable.
* `OSCR.cpp` & `OSCR.h`: New files for storing globals. Only contains these new additions for now. More code cleanup to come.

Changed:
* Moved configuration flags to `Config.h` and documented them better.
* Removed `vselect()` function. Now uses `setVoltage()` with the params `VOLTS_SET_3V3` and `VOLTS_SET_5V`.

Known Issues:
* Rarely the LCD backlight turns white when using 3V3FIX. Resetting fixes it. Doesn't affect functionality/usability; it's just weird.
2023-03-29 21:05:01 -04:00
sanni
58e8cc1a3b Fix error when dumping GBA ROM for a second time 2023-02-16 11:32:55 +01:00
Remy Starshade
aee632642d Add Voltage Selection Module 2022-11-12 14:13:22 -05:00
sanni
cc17c70e30 Fix reading/writing 4MB HiROM
HiROM starts at bank 192 and has 64 banks so byte variable currBank overflows.
2022-10-31 15:41:29 +01:00
Vincent Pelletier
f07f6f9025 All: Replace print_Error(*, boolean) calls with print_{,Fatal}Error(*)
Also, make print_FatalError(*) independent from print_Error(*).
Also, factorise common parts of print_Error(*).

Frees 2336 bytes of program space and 5 bytes of global ram space.
2022-10-31 08:52:33 +00:00
Vincent Pelletier
a6f9e5e99c GBA.ino: Get rid of unused global 2022-10-29 07:16:37 +00:00
Vincent Pelletier
d4c5f6ec5b GBA.ino: Get rid of calcChecksumStr as a global
Frees 150 bytes of program space and 5 bytes of global ram space.
2022-10-29 07:16:37 +00:00
sanni
a8a981e137 Auto format 2022-10-28 15:02:51 +02:00
Vincent Pelletier
67b54a690b All: Factorise title generation from cart.
Fix out-of-bound access when first byte is not an ascii printable
character.
Reduces program space use by 480 bytes.
2022-10-28 05:29:44 +00:00
Vincent Pelletier
e4e09c7bf8 GBA.ino: Reduce gbaMenu size.
Replace switch blocks which produce one output with const tables.
Use functions instead of repeating code.
Move common initial and final statements outside of blocks.
Also, do not erase/flash second bank on dual-bank chips when the first one
had failures.
This saves about 520 bytes of code and increases ram use by 12 bytes.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
27baa2b164 All: Factorise code seeking a file back N lines
This saves 890 bytes of program space.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
0a627e5bd4 All: Use f.seekCur(x) instead of f.seekSet(f.curPosition() + x)
Saves 450 bytes of program space.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
a555f2117f All: Resolve all compiler and linker warnings
No functional change intended.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
e7ef7fd4bd All: Make flashid an integer
flashid (almost) always contains the hexadecimal representation of two
bytes, which then means it gets compares with strcmp, which in turn need
another string argument. Instead, make it an integer, removing the need to
call strcmp.
Add a separate string representation for printing purposes (maybe this can be
avoided by having the print function format it when needed ?).
The only apparent case where flashid is not an hexadecimal representation
of a pair of bytes is when N64 clears it to "CONF". Set flashid to zero
this case.
This saves about 500 bytes of program space and 200 bytes of ram.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
3fcd1a808d https://github.com/sanni/cartreader/issues/574#issuecomment-1286956251 2022-10-28 05:29:20 +00:00
sanni
4badfff458 Move to Arduino IDE 2.0.0 (different auto formatting, no code changes) 2022-10-13 09:49:03 +02:00
sanni
0ab7a18b05 V10.1 Move HW1/2/3 to same display lib as HW4/5
... bugs are to be expected :D
2022-10-08 16:23:33 +02:00
sanni
bef9d0f5f9 Don't log manual mapper selection to file for NES/GBA 2022-10-04 20:30:53 +02:00
Lesserkuma
dab124def7 Find Game Serial for Game Boy 2022-09-28 21:31:49 +02:00
Lesserkuma
786a8586fb Merge branch 'master' 2022-09-28 19:50:58 +02:00
sanni
b51a01f1f5 Fix Typo 2022-09-27 19:24:21 +02:00
sanni
b34334ea04 Update GBA database 2022-09-27 19:11:58 +02:00
Lesserkuma
6098700fdd Merge branch 'master' 2022-09-25 17:06:58 +02:00
Lesserkuma
140401161b UI improvements for GB, GBA, N64, SNES 2022-09-25 16:40:21 +02:00
sanni
6659b84d9d Add support for Benesse Pocket Challenge W Module (thx to skaman) 2022-09-25 10:36:28 +02:00
Lesserkuma
77c0daeb6a Update to displaying full ROM title on SNES, N64, GB, GBA 2022-09-24 14:36:13 +02:00
Lesserkuma
eed3324a56 Display full ROM title for GB and GBA 2022-09-23 21:55:16 +02:00
sanni
f002e40aa6 Add back option to dump headerless NES ROM 2022-08-03 12:14:32 +02:00
Lesserkuma
6fea477155 Add support for missing GBA flash save chips (Atmel AT29LV512, Macronix MX29L512, Panasonic MN63F805MNP, SANYO LE26FV10N1TS) 2022-07-24 01:00:37 +02:00
sanni
39f7a4a3c7 Break out of GBA database loop once ID is found
thx to stewartspicer
2022-07-07 23:55:33 +02:00
sanni
0a4a4d0039 Add no-intro database to NES
This is just a beta release, stuff might be broken.
2022-07-07 00:15:13 +02:00
sanni
d8d9716aa3 Add files via uplpad 2022-06-23 10:47:30 +02:00
sanni
44d853e1bb Add CRC32 and filenames to SNES database 2022-06-21 13:29:19 +02:00
sanni
311822f3c7 Add progress bar to GBA 2022-06-20 23:22:16 +02:00
sanni
fe5264b8ba Add CRC32 and filenames to GBA database 2022-06-20 22:36:53 +02:00
sanni
fac6f8eab2 Copy latest log to dump dir 2022-06-16 15:15:43 +02:00
sanni
5a3b311feb Fix Led and missing word wrap 2021-10-26 17:13:42 +02:00