From a19e00d30404db47463e3e99bc6fa4d66c822592 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Thu, 3 Jul 2025 21:49:31 +0200 Subject: [PATCH] disable the basic interrupt before main(), fixes #2764 --- libsrc/c128/crt0.s | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/libsrc/c128/crt0.s b/libsrc/c128/crt0.s index f6a55778c..d6853c1bb 100644 --- a/libsrc/c128/crt0.s +++ b/libsrc/c128/crt0.s @@ -65,6 +65,15 @@ L1: lda c_sp,x jsr initlib +; Disable the BASIC part of the IRQ handler. It would usually (once per frame) +; copy the VIC shadow register, move sprites, play music. This would only get +; in the way, so we turn it off. + + lda INIT_STATUS + sta initsave + and #$fe + sta INIT_STATUS + ; Set the bank for the file name to our execution bank. We must do this ; *after* calling the constructors because some of them might depend on ; the original value of this register. @@ -89,6 +98,11 @@ L2: lda zpsave,x dex bpl L2 +; Enable the BASIC interrupt again + + lda initsave + sta INIT_STATUS + ; Place the program return code into BASIC's status variable. pla @@ -116,5 +130,6 @@ zpsave: .res zpspace .bss -spsave: .res 1 -mmusave:.res 1 +spsave: .res 1 +mmusave: .res 1 +initsave: .res 1