Cleanup startup code

I'm starting to understand this stuff better. This makes it possible to
use OS-level interrupts like the keyboard in the code.
This commit is contained in:
John Bintz 2024-09-22 06:40:21 -04:00
parent 634bdd884e
commit c76af7faf8

View File

@ -131,13 +131,15 @@ _takeOverSystem:
OpenLibrary #GraphicsLibrary,#0
MOVE.L D0,GraphicsBase
MOVE.L $4,A6
CALLLIB _LVOForbid
MOVE.L D0,A6
MOVE.L gb_ActiView(A6),OldView
MOVE.L gb_copinit(A6),OldCopper
MOVE.L #0,A1
CALLLIB _LVOLoadView
CALLLIB _LVOWaitTOF
CALLLIB _LVOWaitTOF
CALLLIB _LVOOwnBlitter
CALLLIB _LVOWaitBlit
@ -148,17 +150,11 @@ _takeOverSystem:
PreserveRegister intreq
PreserveRegister adkcon
MOVE.L #0,A1
CALLLIB _LVOLoadView
CALLLIB _LVOWaitTOF
CALLLIB _LVOWaitTOF
LEA _custom,A0
; http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0036.html
MOVE.W #$7FFF,intena(A0) ; disable all interrupts
; we need VERTB to use WaitTOF
MOVE.W #INTF_SETCLR|INTF_INTEN|INTF_COPER|INTF_VERTB,intena(A0) ; enable master interrupt, copper, and VBR
; PORTS and EXTER give me access to the keyboard and mouse via OS interrupts
MOVE.W #INTF_SETCLR|INTF_INTEN|INTF_COPER|INTF_PORTS|INTF_EXTER|INTF_VERTB,intena(A0) ; enable master interrupt, copper, and VBR
MOVE.W #$7FFF,dmacon(a0)
MOVE.W #DMAF_SETCLR|DMAF_MASTER|DMAF_COPPER|DMAF_RASTER|DMAF_BLITTER|DMAF_SPRITE,dmacon(A0)
@ -214,9 +210,6 @@ _giveBackSystem:
CALLLIB _LVOWaitTOF
CALLLIB _LVOWaitBlit
CALLLIB _LVODisownBlitter
MOVE.L $4,A6
CALLLIB _LVOPermit
MOVE.L (SP)+,A6
RTS