added first CPU specific optimizations
This commit is contained in:
1 parent
5b2c28b281
commit
55e2512fe2
12 files changed
+198
-7
No files matched your search
@@ -11,10 +11,16 @@ return_from_interrupt:
|
||||
|
||||
// Restore registers and return
|
||||
// Sequence according to Compute's Mapping the 64 p73
|
||||
|
||||
#if CONFIG_CPU_MOS_6502
|
||||
pla
|
||||
tay
|
||||
pla
|
||||
tax
|
||||
#else
|
||||
ply
|
||||
plx
|
||||
#endif
|
||||
pla
|
||||
rti
|
||||
|
||||
@@ -6,10 +6,15 @@ default_nmi_handler:
|
||||
|
||||
// Save registers, sequence according to Compute's Mapping the Commodore 64, page 73
|
||||
pha
|
||||
#if CONFIG_CPU_MOS_6502
|
||||
txa
|
||||
pha
|
||||
tya
|
||||
pha
|
||||
#else
|
||||
phx
|
||||
phy
|
||||
#endif
|
||||
|
||||
// XXX: RS-232 support is not implemented
|
||||
|
||||
|
||||
@@ -10,12 +10,19 @@ irq_handler:
|
||||
|
||||
// Save registers, sequence according to Compute's Mapping the Commodore 64, page 73
|
||||
pha
|
||||
#if CONFIG_CPU_MOS_6502
|
||||
txa
|
||||
pha
|
||||
tya
|
||||
pha
|
||||
#else
|
||||
phx
|
||||
phy
|
||||
#endif
|
||||
|
||||
cld // clear decimal flag, to prevent possible problems
|
||||
#if CONFIG_CPU_MOS_6502 && CONFIG_BCD_SAFE_INTERRUPTS
|
||||
cld // clear decimal flag to allow using it without disabling interrupts
|
||||
#endif
|
||||
|
||||
// Check if caused by BRK
|
||||
tsx
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
nmi_handler:
|
||||
|
||||
sei // don't allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt
|
||||
cld // clear decimal flag, to prevent possible problems
|
||||
|
||||
#if CONFIG_CPU_MOS_6502 && CONFIG_BCD_SAFE_INTERRUPTS
|
||||
cld // clear decimal flag to allow using it without disabling interrupts
|
||||
#endif
|
||||
|
||||
// Call interrupt routine (only if initialised)
|
||||
pha
|
||||
|
||||
Reference in new issue
Block a user