Skip to content

Commit

Permalink
Merge pull request #8 from LinuxJedi/fix-256k
Browse files Browse the repository at this point in the history
Fix 256K ROM flashing
  • Loading branch information
LinuxJedi authored Apr 5, 2021
2 parents bdf18fa + 3fefe2d commit 078a515
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Binary file modified Software/FlashKickstart
Binary file not shown.
16 changes: 10 additions & 6 deletions Software/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,7 @@ static void eraseFlashLoop(int romID, ULONG baseAddress)
}
}

static tFlashCommandStatus programFlashLoop(ULONG fileSize, ULONG baseAddress,
char *romFile)
static tFlashCommandStatus programFlashLoop(ULONG baseAddress, char *romFile)
{
tFlashCommandStatus flashCommandStatus = flashIdle;
ULONG currentWordIndex = 0;
Expand Down Expand Up @@ -504,8 +503,7 @@ static void flashRom(int romID, struct ConfigDev *myCD, struct Window *myWindow)
if (readFileOK == readFileProgram)
{
tFlashCommandStatus programFlashStatus = flashIdle;
ULONG baseAddress = (fileSize == KICKSTART_256K) ? ((ULONG)myCD->cd_BoardAddr +
KICKSTART_256K) : (ULONG)myCD->cd_BoardAddr;
ULONG baseAddress = (ULONG)myCD->cd_BoardAddr;

if (romID == 2)
{
Expand All @@ -517,7 +515,13 @@ static void flashRom(int romID, struct ConfigDev *myCD, struct Window *myWindow)
WriteRomText("Flashing...", FlashROM1_buf, myWindow, &FlashROM1);
}

programFlashStatus = programFlashLoop(fileSize, baseAddress, romFile);
programFlashStatus = programFlashLoop(baseAddress, romFile);

if (fileSize == KICKSTART_256K)
{
baseAddress += KICKSTART_256K;
programFlashStatus = programFlashLoop(baseAddress, romFile);
}

if (programFlashStatus != flashOK)
{
Expand Down Expand Up @@ -723,7 +727,7 @@ int main()
sprintf(bVersion, "0x%08X", (unsigned)myCD->cd_Rom.er_SerialNumber);
}

rtEZRequest("Flash Kickstart Programmer v1.5\n"
rtEZRequest("Flash Kickstart Programmer v1.6\n"
"Created by Andrew (LinuxJedi) Hutchings\n"
"andrew@linuxjedi.co.uk\n"
"This software is released under a GPLv3 license\n\n"
Expand Down

0 comments on commit 078a515

Please sign in to comment.