Use php/sei/plp to preserve original state of the interrupt flag

This commit is contained in:
Dan Sanderson
2025-11-28 11:09:21 -08:00
parent c14f2b7252
commit 5296d394e4
2 changed files with 4 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ _cpeekcolor:
lda SCREEN_PTR
sta ptr1
php
sei
lda $D030
ora #$01
@@ -28,8 +29,8 @@ _cpeekcolor:
lda $D030
and #$FE
sta $D030
cli
tya
plp
ldx #>$0000
rts

View File

@@ -116,6 +116,7 @@ putchar:
adc #>$D000
sta ptr4 + 1
php
sei
lda $D030
ora #$01
@@ -125,6 +126,6 @@ putchar:
lda $D030
and #$FE
sta $D030
cli
plp
rts