From c76af7faf8d0ba88a46b5fad1824921735366bce Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 22 Sep 2024 06:40:21 -0400 Subject: [PATCH] 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. --- system/system.s | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/system/system.s b/system/system.s index e746532..8bbf8ba 100644 --- a/system/system.s +++ b/system/system.s @@ -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