Commit Graph

1536 Commits

Author SHA1 Message Date
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
d81f2c0509 NES.ino: Simplify CRC functions.
It seems crc32EEP only exists because the actual number of bytes read from
file were not checked, hence falling back to smaller reads.
Instead, always read up to the full available buffer, adding to the CRC
only as many bytes as were actually read.
Also, move some related variables to local scope.
Overall, this saves about 50 bytes of code and 80 bytes of global ram.
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
d7bbc59607 N64.ino: Remove unused function
This does not save any space as the linker noticed it wasn't used.
Also, point the (commented-out) only caller to the equivalent libc
function.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
b3eb3dd928 GBS.ino: Move gbSmartGames from globals to a local.
Saves 120 bytes of global ram space.
Also, factorise code reading a single entry. This saves about 60 bytes of
code space.
2022-10-28 05:29:20 +00:00
Vincent Pelletier
ae2e90a6cd PCE.ino: Skip strcpy to menuOptionspceCart
Values can be directly composed/initialised in menuOptionspceCart, avoiding
the need to strcpy to it.
This saves about 100 bytes of ram by dropping a few global char arrays.
Re-duplicates "Reset" string initialiser, but this should not be a big
deal.
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
fc8df6e1b5 Merge branch 'master' of https://github.com/sanni/cartreader 2022-10-27 23:43:53 +02:00
sanni
5357dea659 Print checksum and header CRC32 when searching database 2022-10-27 23:43:46 +02:00
sanni
948cfc4285
Fix Brain Lord checksum and header CRC32 2022-10-27 23:38:20 +02:00
sanni
1a081eb6f6
Merge pull request #592 from PsyK0p4T/master
Use sg1000.txt database
2022-10-27 22:30:51 +02:00
PsyK0p4T
ce436e8a77
Use sg1000.txt database
Use sg1000.txt database to verify/rename SG-1000 dumps
2022-10-27 22:25:34 +02:00
sanni
91523269f4
Change Brain Lord to 24 banks 2022-10-27 18:58:00 +02:00
sanni
47b02e38a9
Merge pull request #591 from PsyK0p4T/master
Update gba.txt
2022-10-27 18:13:38 +02:00
sanni
d65a887690
Merge pull request #590 from nsx0r/patch-24
added NES mappers 240 and 246 and 255
2022-10-27 18:12:36 +02:00
sanni
b2ae4abcbc
Add SG-1000 no-intro database (20221022-024211) 2022-10-27 18:12:10 +02:00
nsx0r
2f9ff59343
added mapper 255 (same as 225)
added mapper 255 (same as 225)
2022-10-27 16:56:46 +02:00
PsyK0p4T
60470c5155
Update gba.txt 2022-10-27 16:56:16 +02:00
nsx0r
6435a64df8
added NES mappers 240 and 246
added NES mappers 240 and 246
2022-10-27 16:17:49 +02:00
sanni
3f83dcec55
Merge pull request #589 from nsx0r/master
more NES mappers fixes
2022-10-26 21:58:35 +02:00
sanni
e106488453
Merge pull request #585 from BacteriaMage/master
fix superfx sram size detection
2022-10-26 09:50:31 +02:00
BacteriaMage
ab5f94af85 fix superfx sram size detection
The header offsets were wrong so the size wasn't correctly computed and generally ended up defaulting to 32KB. Stunt Race FX, at least, uses 64KB and so only half the save data was being read.
2022-10-25 19:54:40 -05:00
nsx0r
cc6494857f
PRG 97 = 180 -> merged code
PRG 97 = 180 -> merged code
2022-10-25 19:59:52 +02:00
nsx0r
9506005c6b
fixed NES mapper 200
fixed NES mapper 200
2022-10-25 12:28:38 +02:00
nsx0r
6590f7e583
added 2 missing mapper labels
added 2 missing mapper labels
2022-10-25 09:33:22 +02:00
sanni
9cabf64a0e
Merge pull request #583 from nsx0r/patch-21
fixed NES mapper 203
2022-10-24 16:36:50 +02:00
sanni
012f73437a
Merge pull request #582 from nsx0r/patch-20
added NES mapper 202
2022-10-24 16:36:40 +02:00
nsx0r
afe7440ead
fixed NES mapper 203
fixed NES mapper 203
2022-10-24 15:04:51 +02:00
nsx0r
cda710940c
added NES mapper 202
added NES mapper 202
2022-10-24 14:50:33 +02:00
sanni
820fceef29
Merge pull request #581 from nsx0r/patch-19
added 8 more NES mappers
2022-10-23 20:58:25 +02:00
nsx0r
3396aeb532
added 8 more NES mappers
added NES mappers 58 + 200 + 201 + 203 + 213 + 225 + 229 + 232
2022-10-23 20:57:34 +02:00
sanni
b686017fab
Merge pull request #576 from nsx0r/patch-18
Added NES mapper 60
2022-10-22 11:01:53 +02:00
nsx0r
707b314a7a
Added NES mapper 60
Added NES mapper 60 for reset-based NROM-128 4-in-1 multicarts.
Tested working on 7 different NES carts.
2022-10-22 09:01:18 +02:00
sanni
3b0a046d79
Merge pull request #573 from nsx0r/patch-17
added NES mapper 242
2022-10-21 00:54:35 +02:00
nsx0r
7264477bc1
added NES mapper 242
added NES mapper 242, tested working with "1992" 190-in-1 multicart (ET-113 PCB), both on FC and NES
2022-10-21 00:43:45 +02:00
sanni
c659aee96e
Merge pull request #572 from nsx0r/patch-16
Added NES mapper 235
2022-10-20 14:04:07 +02:00
nsx0r
c2648157c9
Added NES mapper 235
Added NES mapper 235, tested working with Golden Game 260-in-1 (GS-2018 PCB)
2022-10-20 14:01:23 +02:00
sanni
9c74fd8847
Merge pull request #571 from nsx0r/patch-15
added NES mapper 62
2022-10-19 14:45:20 +02:00
nsx0r
84da646ac9
added NES mapper 62
added NES mapper 62, tested working with a multicart using K-1017P PCB
also expanded max PRG size for these big multicarts
2022-10-19 14:43:42 +02:00
sanni
7cd5734aa5
Merge pull request #570 from nsx0r/patch-14
added NES mapper 15
2022-10-19 11:36:02 +02:00
nsx0r
8064397836
added NES mapper 15
added NES mapper 15, tested working with 2 carts using a K-1030P PCB
2022-10-19 11:08:13 +02:00