Commit Graph

15 Commits

Author SHA1 Message Date
Remy Starshade
aee632642d Add Voltage Selection Module 2022-11-12 14:13:22 -05:00
Vincent Pelletier
c82815f0d5 SFM.ino, SNES.ino: Rework compiler warnings resolution
I am not sure why I changed some variables from 16 bit types to 8 bit types
when the warnings being resolved were only about signedness.
Fixes: a555f21 ("All: Resolve all compiler and linker warnings")
2022-11-01 07:53:35 +00: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
fbaed78eb5 SFM.ino: Get rid of write-only global variables
These variables are set but never read. Removing them removes a non-trivial
amount of code, which I am not comfortable deleting: it contains knowledge
about cart data structure, even though it is currently not being used for
anything. So comment it out until someone who know this architecture better
comes around.

Frees 146 bytes of program space and 16 bytes of global ram space.
2022-10-29 09:46:00 +00:00
sanni
a8a981e137 Auto format 2022-10-28 15:02:51 +02:00
Vincent Pelletier
3c3b399d6a SFM.ino: Move all menu variables from globals to locals.
Saves about 100 bytes of program memory and 80 bytes of global ram.
2022-10-28 05:29:44 +00:00
Vincent Pelletier
3632b06980 SFM.ino: Factorise single-game gamecode retrieval.
Frees 220 bytes of code and 16 bytes of ram.
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
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
2a409bd848 Update SNES database to 20220812 2022-08-22 17:49:19 +02:00
sanni
0e56a3451a V9.2 Alpha: Adds Coleco- and Intellivision (thx to skaman) 2022-07-23 11:16:37 +02:00