Skip to content

Commit

Permalink
auto-detection SID/Kernal-wires
Browse files Browse the repository at this point in the history
  • Loading branch information
frntc authored Oct 14, 2020
1 parent 30a8424 commit 1e6a9c0
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion C64Side/rpimenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ __asm__ ("loop:");
__asm__ ("pla");
}

// helps Sidekick64 detect if extra wires are connected
void wireDetection()
{
__asm__ ("sta $df10"); // enable kernal replacement
__asm__ ("lda $e000"); // access kernal (Sidekick64 will notice if wire connected)
__asm__ ("sta $df11"); // disable kernal replacement

__asm__ ("lda #$00");
__asm__ ("sta $d4ff"); // some access to the SID address range
}

int main (void)
{
char key;
Expand All @@ -178,20 +189,29 @@ int main (void)
copyCharset();
updateScreen();

wireDetection();
*((char *)(0xdf01)) = 0; // dummy keypress
//updateScreen();

wireDetection();
*((char *)(0xdf01)) = 0; // dummy keypress
updateScreen();

while ( 1 )
{
// sendKeypress
key = cgetc();
if ( key == 29 && *((char *)(0x0427)) != 0 )
{
__asm__ ("lda #$0a");
__asm__ ("ldx #$28");
__asm__ ("ldx #$20");
__asm__ ("loop:");
__asm__ ("sta $d850,x");
__asm__ ("dex");
__asm__ ("bne loop");
}

wireDetection();
*((char *)(0xdf01)) = key;
updateScreen();
}
Expand Down

0 comments on commit 1e6a9c0

Please sign in to comment.