Commit Graph

415 Commits

Author SHA1 Message Date
sanni
2e72842bb1 Fix Clock Gen Calibration Menu
Function didn't display negative calibration factors correctly.

Also added option to use the calibration factor without enabling the calibration menu to save some space.
2023-10-17 18:41:14 +02:00
sanni
c873d3cf9d
Update Cart_Reader.ino 2023-09-25 18:32:44 +02:00
PsyK0p4T
b270f0c30e
Update Cart_Reader.ino
compilation fix
2023-09-25 16:23:43 +02:00
PsyK0p4T
b2415c0287
Update Cart_Reader.ino
Add the possibility to hide Self Test from menu
2023-09-25 16:12:04 +02:00
sanni
559010079c Add support for Atari 5200/7800, C64, Vectrex (thx to skaman) 2023-09-23 00:11:08 +02:00
Ancyker
6733c9f57c Add note to self-test on HW3 that the EEP switch should be set to on.
Unable to actually test this myself because I do not have a HW3 to test on. However, looking at the schematic, if the EEP switch is set to the off position then the pin will be floating and the result of the 1K resistor test will be random.
2023-08-01 18:26:20 -04:00
sanni
63aeb335a4
Add support for DS1307 RTC module
DS1307 does not seem to have the lost lostPower function. So the time does not get set on upload and needs to be set manually as described in the [wiki](https://github.com/sanni/cartreader/wiki/Real%E2%80%90Time-Clock#setting-the-time).

In Config.h set like this:

````
#define RTC_installed
//#define DS3231
#define DS1307
````

Connect "Tiny RTC I2C module" or similar to the SDA/SCL/VCC/GND pins.
2023-07-22 15:21:02 +02:00
sanni
97eada64e7
Fix Serial Monitor menu 2023-07-19 16:32:34 +02:00
sanni
829408c655
Unify HW3 and HW5 menues 2023-07-19 15:13:06 +02:00
Ancyker
ff62f494eb Firmware Updates for RTC
Also minor edits to `setVoltage()`
2023-07-16 01:01:58 -04:00
sanni
ac03c4bede
Update Cart_Reader.ino 2023-07-13 10:31:15 +02:00
sanni
74e46f4322
Merge pull request #824 from partlyhuman/support-casio-loopy
Casio Loopy Adapter
2023-07-11 09:53:04 +02:00
Roger Braunstein
1d147828f6 PR ready? 2023-07-10 16:01:23 -07:00
Roger Braunstein
0d7b51806a Moves loopy db into loopy.ino, adds format sram option 2023-07-10 15:52:02 -07:00
Roger Braunstein
4621ad20f3 Adds internal checksumming, ID setting romname 2023-07-06 13:55:45 -07:00
Roger Braunstein
1a7be97dc1 Loopy ROM dumping working 2023-07-05 01:29:46 -07:00
sanni
34a1c6b336 Fix dumping Tactics Ogre 2023-07-04 19:58:45 +02:00
Roger Braunstein
d74ad957d8 Stubs out Loopy menu item 2023-07-02 16:08:09 -07:00
sanni
29814cb31b
Update Cart_Reader.ino 2023-07-01 16:40:01 +02:00
sanni
50b6540863 Delete old/unused NES database code 2023-06-26 17:05:10 +02:00
sanni
0489df7bd4 Revert NES CreateRAMFileInSD function to previous version 2023-06-26 15:46:47 +02:00
sanni
dee54dd30e Move automatic voltage selection from menu to setup functions 2023-06-26 12:04:00 +02:00
sanni
abe029eefc V12.6 Add MSX and Pokemon Mini modules (thx to skaman) 2023-06-25 14:09:17 +02:00
sanni
0a21d49f8a Fix error in flashrom programmer menu 2023-04-20 11:38:46 +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
190d35293c Minor fixes 2023-03-25 08:51:02 +01:00
PsyK0p4T
8c8784c1be
Update Cart_Reader.ino 2023-03-23 23:51:28 +01:00
sanni
16f4a75721 Add (3V) to NGP menu title 2023-03-19 00:18:44 +01:00
sanni
3d659e4abc Add (3V) to Wonderswan menu title 2023-03-15 10:10:07 +01:00
sanni
bc9c306c22 Add Self Test 2023-03-08 18:26:19 +01:00
PsyK0p4T
2efa1f0d48
Update Cart_Reader.ino
Fix "Intellivision" wording in LCD menu
2023-03-07 01:18:02 +01:00
sanni
b5e6ac00a5 Up version to V12.4 2023-02-23 12:04:33 +01:00
splash5
7356b5db19 Rebase code to 12.3
Reformat code
2023-02-23 13:48:11 +08:00
splash5
79f2a2b16a Add support for Super A'can flash cart 2023-02-23 12:19:00 +08:00
splash5
b57470510d Add support for SUPER A'CAN 2023-02-23 12:19:00 +08:00
sanni
e98d21f9c1 Fix adding multiple newlines to log when scrolling through NES database 2023-02-13 11:54:19 +01:00
sanni
86d0abbb0b V12.3 Enable fastcrc for HW3 by default 2023-02-10 17:11:36 +01:00
sanni
6959c055e6 Improve stability when dumping N64 with fastcrc option 2023-02-10 13:16:32 +01:00
sanni
e9d9617ad8 V12.2 2023-02-10 10:15:35 +01:00
sanni
2f71d0572e Fix SRAM overflow in N64/MD, turn LED red if CRC not found 2023-02-10 09:40:58 +01:00
sanni
16eb662c3b 6K Fairchild confirmed working (thx to skaman) 2023-02-06 09:13:41 +01:00
sanni
032000d369 Disable addons by default 2023-01-17 08:29:05 +01:00
sanni
c8bfc64009 Change 2022 to 2023 in about screen 2023-01-16 12:35:48 +01:00
sanni
248a1d9af5 V12.0: Add Atari 2600, Emerson Arcadia 2001, Fairchild Channel F, Magnavox Odyssey 2 modules (thx to skaman) 2023-01-03 19:33:34 +01:00
sanni
d977b14cf4 Fix MD Zero Wing (E) (thx to jaffa225)
More info: https://github.com/sanni/cartreader/issues/664
2022-12-20 10:31:35 +01:00
sanni
46dd333bd4 Fix NES mapper selection 2022-11-18 10:46:13 +01:00
sanni
8dcb841109
Up version number 2022-11-12 20:25:51 +01:00
Remy Starshade
aee632642d Add Voltage Selection Module 2022-11-12 14:13:22 -05:00
Vincent Pelletier
78c05c826c Cart_Reader.ino: Move definitions after all forward declarations
It seems the Arduino IDE picks the position of the first definition to
insert all auto-generated forward declarations. This fails to compile if
any of these generated forward declarations references a type included
later.
So, reorder the code a bit so the first definition happens strictly after
the last inclusion.
2022-11-05 05:04:37 +00:00
Vincent Pelletier
ab9e36e12e Cart_Reader.ino: Comment rewind_line implementation
The logic of this function is not immediately clear, so comment it
extensively.
2022-11-05 05:04:37 +00:00
Vincent Pelletier
e334edb4e5 Cart_Reader.ino: Simplify checkButton nesting
Also, fixes a compiler warning on the HW4/5 function, which could reach
the function's end without a "return" statement.
2022-11-05 05:04:37 +00:00
Vincent Pelletier
7b1e74c1fc Cart_Reader.ino: Always return a value from SERIAL_MONITOR checkButton 2022-11-05 01:24:19 +00:00
Vincent Pelletier
6de1a34cd7 Cart_Reader.ino: Catch-all condition for page 3
Makes it clear to the compiler that no other page exist, and hence
option_offset and num_answers are always initialised.
2022-11-05 01:02:18 +00:00
sanni
61cc4b034c Update Cart_Reader.ino 2022-11-02 01:20:35 +01:00
sanni
044e90f575 Update Cart_Reader.ino 2022-11-02 00:44:16 +01:00
sanni
a3b1882e88 Fix NES manual mapper selection 2022-11-02 00:32:54 +01:00
sanni
2c95299010 Turn LED off when rotary button is pressed 2022-11-01 22:50:14 +01:00
sanni
d7082a2366 Add fast scrolling through NES database
Fast scrolling skips 30 entries at once.
Also fixed lockup when browsing backwards on first database entry.
2022-11-01 22:26:53 +01: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
sanni
a3feb32e15
V11.1 2022-10-31 11:40:15 +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
0a823bf5b7 Cart_Reader.ino: Factorise missing module error.
Also, handle one such case in the HW3 main menu.
2022-10-31 08:52:19 +00:00
Vincent Pelletier
25b615f77c Cart_Reader.ino: Move print_FatalError prototypes earlier in the file
So they can be used in more places within that file.
2022-10-31 05:48:46 +00:00
Vincent Pelletier
4a2a2c69d2 Cart_Reader.ino: Deduplicate HW5 mainMenu pagination logic 2022-10-31 05:48:46 +00:00
Vincent Pelletier
a35c882662 N64.ino: Factorise JoyBus-related code
IMPORTANT: with this change, the Adafruit clock generator becomes a hard
requirement to read and write gamecart eeproms.

This is a large patch, partly because JoyBus is used a lot:
- controller
- controller pak
- gamecart eeprom
and partly because of the further simplifications it allows.

Also, implement low-level bit shift functions in assembly in order to get
complete control of the timings: there can be just a few cycles of slack.
Also, use the time waiting for the input line to go high to pack received
bits into bytes on-the-fly, as there is now plenty of time.

This saves about 2080 bytes of program space, and 369 bytes of global ram
space.
2022-10-31 05:48:46 +00:00
sanni
3826f5aa10
Update Cart_Reader.ino 2022-10-30 11:46:55 +01:00
Vincent Pelletier
133e3feda9 Cart_Reader.ino: New variants of print_Error
Tagged with noreturn so the compiler knows about the effect of
forceReset=true.
Ideally, print_Error should lose its forceReset argument so that:
- print_Error never resets
- print_FatalError always resets (and hosts the code doing so)
so the compiler is more accurately aware of the execution flow.
2022-10-29 07:16:37 +00:00
sanni
34981fdb8e Fix compile error 2022-10-28 15:09:15 +02:00
sanni
a8a981e137 Auto format 2022-10-28 15:02:51 +02:00
sanni
24c5957993 Fix CRC32 calculation 2022-10-28 12:56:38 +02:00
sanni
748b9094df V11.0 2022-10-28 10:26:04 +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
3b05046ee9 All: Factorise CRC functions.
This saves 370 bytes of program space.
2022-10-28 05:29:41 +00:00
Vincent Pelletier
337ef94b07 NES.ino: Factorise code.
Mainly, this removes a lot of the logic from selectMapping by reusing the
copy already present in getMapping. As a result, selectMapping is not
expected to be accessed from outside this module anymore.
Also, this factorises several smaller chunks of code found throughout the
module.
Also, get rid of a few easy globals along the way.
Also, move a bit more of NES-specific initialisation and menu display to
the NES.ino module.

This saves about 1490 bytes of code.
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
b84f63d1dc Cart_Reader.ino: Drop redundant display_Update call.
In this codepath, there will be a second call just after displaying the
CRC, making this call redundant.
For completeness: In the alternate codepath, the next operation does a lot
of IO, so it makes sense to refresh the screen before printing the CRC.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
daec1f3e35 Card_Reader.ino: Optimise get_line for speed
Do fewer calls to readfile->read, especially if the buffer is large enough
to fit an entire line, resulting in less call/return overhead.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
50da6b9da7 Cart_Reader.ino: Assorted cosmetic changes to compareCRC.
Shorten gamename to the number of bytes actually used in the code, more
sizeof() use.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
264d83f383 Cart_Reader.ino: Drop redundant initialisation.
`i` is initialised on the previous line, along with its declaration.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
92f8626687 Cart_Reader.ino: Drop convertPgm(const char* const [], byte, byte)
This avoids code duplication between it and
  convertPgm(const char* const [], byte)
for just 3 callers, when the callers can be easily updated to call the
latter.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
dc391541b4 Cart_Reader.ino: Simplify fileBrowser pagination.
Also, this resolves a warning about `count` being potentially used
uninitialised: when landing in the "Too many files" codepath.
With this simplification, the limit on the number of files is removed. It
is unclear whether that was intentional (maybe this was gating other
issues ?)?
2022-10-28 05:29:20 +00:00
Vincent Pelletier
dc9ee3b01e Cart_Reader.ino: make myDir a variable local to fileBrowser.
It is not used anywhere else.
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
5357dea659 Print checksum and header CRC32 when searching database 2022-10-27 23:43:46 +02:00
sanni
3bf6004e79 Fix menu navigation bug 2022-10-13 10:31:17 +02: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
26d025e82f Update Cart_Reader.ino 2022-10-09 11:38:25 +02:00
sanni
be9e384783 Update Cart_Reader.ino 2022-10-09 11:23:42 +02:00
sanni
1769d2f273 Update Cart_Reader.ino 2022-10-09 10:49:20 +02:00
sanni
21e7468dfd Fix flicker in Controller Test 2022-10-08 23:07:15 +02:00
sanni
2c009230cd Fix bugged map select screen on HW3 with new display lib 2022-10-08 18:19:31 +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
18b37c72d8 Selecting [?] now forwards to manual mapper config for NES 2022-10-07 10:15:18 +02:00
sanni
1a8d127011 Increase romName array size from 17 to 22
Crashed with Lufia II(Estpolis II) before.
2022-10-06 10:20:02 +02:00
sanni
bef9d0f5f9 Don't log manual mapper selection to file for NES/GBA 2022-10-04 20:30:53 +02:00
Lesserkuma
19e0837128 Merge branch 'master' of github.com:lesserkuma/sanni_cartreader 2022-09-28 21:33:34 +02:00
Lesserkuma
786a8586fb Merge branch 'master' 2022-09-28 19:50:58 +02:00