Skip to content

Commit

Permalink
Critical bug fixes
Browse files Browse the repository at this point in the history
1. Turns out VBCC does maths a little differently and ROM2 reading was
   completely broken for both CLI and GUI
2. Turns out KS1.3 is really picky on path formation, so fix that
  • Loading branch information
LinuxJedi committed Feb 25, 2021
1 parent a62ef89 commit 6993a04
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ Logic/_xmsgs/
Logic/FLASH_KICKSTART.tim
Logic/FLASH_KICKSTART.tspec
*.zip
*.lha
*.adf
*.uaem
.info
Binary file modified Software/FK
Binary file not shown.
Binary file modified Software/FlashKickstart
Binary file not shown.
8 changes: 5 additions & 3 deletions Software/FlashKickstart.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ int main(int argc, char **argv)
/* Check if application has been started with correct parameters */
if (argc <= 1)
{
printf("FlashKickstart v3.2\n");
printf("FlashKickstart v3.3\n");
printf("usage: FlashKickstart <option> <filename>\n");
printf(" -i\tFLASH CHIP INFO\n");
printf(" -e\tERASE\n");
Expand Down Expand Up @@ -286,7 +286,8 @@ int main(int argc, char **argv)
}
if ((ULONG)myCD->cd_BoardSize > 512*1024)
{
if (getRomInfo((UBYTE*)(myCD->cd_BoardAddr + (512 * 1024)), &rInfo))
ULONG romAddr = (ULONG)myCD->cd_BoardAddr + (512 * 1024);
if (getRomInfo((UBYTE*)romAddr, &rInfo))
{
printf("Failed to get Flash ROM 2 info\n");
}
Expand Down Expand Up @@ -356,7 +357,8 @@ int main(int argc, char **argv)
}
if ((ULONG)myCD->cd_BoardSize > 512*1024)
{
if (getRomInfo((UBYTE*)(myCD->cd_BoardAddr + (512 * 1024)), &rInfo))
ULONG romAddr = (ULONG)myCD->cd_BoardAddr + (512 * 1024);
if (getRomInfo((UBYTE*)romAddr, &rInfo))
{
printf("Failed to get Flash ROM 2 info\n");
}
Expand Down
1 change: 0 additions & 1 deletion Software/create_adf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ xdftool fk.adf write libs13
xdftool fk.adf write libs20
xdftool fk.adf write libs13.info
xdftool fk.adf write libs20.info

23 changes: 18 additions & 5 deletions Software/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static void WriteRomText(const char *text, UBYTE *buffer, struct Window *window,
static char *GetFile()
{
struct rtFileRequester *filereq;
char filename[34];
char filename[128];
char *fullpath = malloc(256 * sizeof(char));
FILE *romFile;
struct romInfo romInfo;
Expand All @@ -300,13 +300,25 @@ static char *GetFile()
rtEZRequest("Out of memory!", "Oh no!", NULL, NULL);
}

snprintf(fullpath, 255, "%s/%s", filereq->Dir, filename);
// Turns out WB doesn't like DF0:/filename.rom
if (filereq->Dir[(strlen(filereq->Dir) - 1)] == ':')
{
snprintf(fullpath, 255, "%s%s", filereq->Dir, filename);
}
else if (!strlen(filereq->Dir))
{
snprintf(fullpath, 255, "%s", filename);
}
else
{
snprintf(fullpath, 255, "%s/%s", filereq->Dir, filename);
}
romFile = fopen(fullpath, "r");

if (!romFile)
{
free(fullpath);
rtEZRequest("Could no open ROM file", "OK", NULL, NULL);
rtEZRequest("Could not open ROM file", "OK", NULL, NULL);
return NULL;
}

Expand Down Expand Up @@ -340,7 +352,8 @@ static void getRom(int romID, struct ConfigDev *myCD, struct Window *myWindow)
}
else
{
getRomInfo((UBYTE *)(myCD->cd_BoardAddr + (512 * 1024)), &rInfo);
ULONG romAddr = (ULONG)myCD->cd_BoardAddr + (512 * 1024);
getRomInfo((UBYTE *)romAddr, &rInfo);
}

displayRomInfo(&rInfo, &rtext);
Expand Down Expand Up @@ -628,7 +641,7 @@ int main()
}

case GADABOUT:
rtEZRequest("Flash Kickstart Programmer v1.3\nCreated by Andrew (LinuxJedi) Hutchings\[email protected]\nThis software is released under a GPLv3 license\n\nBased on work by Paul Raspa.",
rtEZRequest("Flash Kickstart Programmer v1.4\nCreated by Andrew (LinuxJedi) Hutchings\[email protected]\nThis software is released under a GPLv3 license\n\nBased on work by Paul Raspa.",
"Cool!", NULL, NULL);
break;

Expand Down

0 comments on commit 6993a04

Please sign in to comment.