Comments (5)
There is another warning about an uninitialised variable in one of the functions called from there: writeFlashBuffer_N64
.
In that case it is a bit clearer that this should not be an issue: the variable would be uninitialised if bufferSize
is 0, which seem unlikely to happen (...if the caller takes care to never provide 0, but the caller has bigger issues).
from cartreader.
You can initialize them to a value of zero if it removes the warning. In the case that they are needed they get new values anyway in the two switch cases.
from cartreader.
Do they ? The switch
blocks are only for the case where cartSize == 0
(the else
branch). The only lines outside of that branch which touch these variables are:
void flashRepro_N64() {
unsigned long sectorSize;
byte bufferSize;
// ...
} else if (bufferSize == 0) {
writeFlashrom_N64(sectorSize);
} else {
writeFlashBuffer_N64(sectorSize, bufferSize);
}
Also, setting to zero will cause another issue in EDIT: this is incorrect, the code will go to writeFlashBuffer_N64
.writeFlashrom_N64
if bufferSize
is zero. But there it will cause an infinite loop:
void writeFlashrom_N64(unsigned long sectorSize) {
// ...
for (unsigned long currSector = 0; currSector < fileSize; currSector += sectorSize) {
sectorSize
is zero, so the increment is zero, so currSector
will never reach fileSize
.
So I think there is more to fix here, but I do not know enough to tell exactly how it should be fixed.
from cartreader.
I see, maybe like this:
// ...
} else if ((bufferSize == 0) && (sectorSize != 0)) {
writeFlashrom_N64(sectorSize);
}
else if (sectorSize != 0) {
writeFlashBuffer_N64(sectorSize, bufferSize);
}
else {
print_Error(F("sectorSize not set"), true);
}
from cartreader.
Thanks, applied.
from cartreader.
Related Issues (20)
- N64 Reflashing a N64 Repro Clock Generator not found HOT 3
- Handling of GAME and EXROM lines of C64 cartridges is wrong HOT 9
- Dumping Sega Cards with the Retron 3-in-1 adapter HOT 3
- Unable to dump 64MB GBA carts HOT 8
- Support for Atari 7800 Bankset Bankswitch (needs adapter update) HOT 11
- Reading 256KBit Saves from ExHirom Repro Cart HOT 2
- SNES/SFC - Yuyu no Quiz de GO!GO! ROM Bank issue? HOT 5
- Atari 2600 menu broken HOT 25
- Atari 2600 F6 mapper issue HOT 5
- GB dumping to root of SD card HOT 3
- Transfer Pak support? HOT 1
- BOM missing? HOT 6
- Updating HW3-Alter results in black screen
- N64 saves HOT 4
- N64 Carts show "Gamepak Error" when trying to read HOT 6
- purpose of snes.ino "boolean altconf"? HOT 2
- "Sketch too big" with all modules enabled HOT 8
- Unable to flash SF NP Memory casettes in 13.4 HOT 2
- 13.5 ignores LCD color in config.txt HOT 1
- U1 is missing on the Schematic HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cartreader.