SNES.ino: Restore code with side-effects

This code was removed as part of
  a555f21 ("All: Resolve all compiler and linker warnings")
because it was filling a 1kB buffer which was never read from.
While I expect reading values from PINC should be invisible from the
cartridge's perspective, writing to PORTL, PORTF and PORTK is definitely
visible.
I have currently no way of testing if this code is required, so in doubt
restore the parts which have effects visible from the cartridge.
This commit is contained in:
Vincent Pelletier 2022-11-01 07:52:51 +00:00
parent c82815f0d5
commit 90303b45c0

View File

@ -699,6 +699,24 @@ void readHiRomBanks(unsigned int start, unsigned int total, FsFile* file) {
void getCartInfo_SNES() {
boolean manualConfig = 0;
//Prime SA1 cartridge
PORTL = 192;
for (uint16_t currByte = 0; currByte < 1024; currByte++) {
PORTF = currByte & 0xFF;
PORTK = currByte >> 8;
// Wait for the Byte to appear on the data bus
// Arduino running at 16Mhz -> one nop = 62.5ns
// slowRom is good for 200ns, fastRom is <= 120ns; S-CPU best case read speed: 3.57MHz / 280ns
// let's be conservative and use 6 x 62.5 = 375ns
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
}
// Print start page
if (checkcart_SNES() == 0) {
// Checksum either corrupt or 0000