mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Fixed problems with the startup code (Greg King): Interrupts must be hooked
before calling initlib because initlib calls contructors and may install drivers, which enable hardware interrupts. Similar for donelib. See also R3897 and R3951 where this change was done for other platforms. git-svn-id: svn://svn.cc65.org/cc65/trunk@3954 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
81c7457e04
commit
d352b85c87
@ -425,16 +425,16 @@ ccopy2: lda __VIDRAM_START__,y
|
||||
lda ExecReg
|
||||
sta IndReg
|
||||
|
||||
; Call module constructors, enable chained IRQs afterwards.
|
||||
; Activate chained interrupt handlers, then enable interrupts.
|
||||
|
||||
jsr initlib
|
||||
lda #.lobyte(__INTERRUPTOR_COUNT__*2)
|
||||
sta irqcount
|
||||
|
||||
; Enable interrupts
|
||||
|
||||
cli
|
||||
|
||||
; Call module constructors.
|
||||
|
||||
jsr initlib
|
||||
|
||||
; Push arguments and call main()
|
||||
|
||||
jsr callmain
|
||||
@ -443,9 +443,9 @@ ccopy2: lda __VIDRAM_START__,y
|
||||
; point for the break vector.
|
||||
|
||||
_exit: pha ; Save the return code on stack
|
||||
jsr donelib ; Run module destructors
|
||||
lda #$00
|
||||
sta irqcount ; Disable custom irq handlers
|
||||
jsr donelib ; Run module destructors
|
||||
|
||||
; Address the system bank
|
||||
|
||||
|
@ -346,16 +346,16 @@ Z4: jmp Init
|
||||
|
||||
.segment "PAGE2"
|
||||
|
||||
; Call module constructors, enable chained IRQs afterwards.
|
||||
; Activate chained interrupt handlers, then enable interrupts.
|
||||
|
||||
Init: jsr initlib
|
||||
lda #.lobyte(__INTERRUPTOR_COUNT__*2)
|
||||
Init: lda #.lobyte(__INTERRUPTOR_COUNT__*2)
|
||||
sta irqcount
|
||||
|
||||
; Enable interrupts
|
||||
|
||||
cli
|
||||
|
||||
; Call module constructors.
|
||||
|
||||
jsr initlib
|
||||
|
||||
; Push arguments and call main()
|
||||
|
||||
jsr callmain
|
||||
@ -364,9 +364,9 @@ Init: jsr initlib
|
||||
; point for the break vector.
|
||||
|
||||
_exit: pha ; Save the return code
|
||||
jsr donelib ; Run module destructors
|
||||
lda #$00
|
||||
sta irqcount ; Disable custom irq handlers
|
||||
jsr donelib ; Run module destructors
|
||||
|
||||
; Address the system bank
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user