;adolig_47.asm Start: MOVE.L #Copper_List, $dff080 MOVE.L #0, $dff088 Wait_Mouse_Button: BTST.B #6, $bfe001 BNE Wait_Mouse_Button RTS Copper_List: DC.L $01000000 DC.L $01800000 DC.L $4001fffe DC.L $01800fff DC.L $4101fffe DC.L $01800000 DC.L $fffffffe
@vojo, post #1
@vojo, post #1
@juen, post #2
DMACONR EQU $dff002 ADKCONR EQU $dff010 INTENAR EQU $dff01c INTREQR EQU $dff01e DMACON EQU $dff096 ADKCON EQU $dff09e INTENA EQU $dff09a INTREQ EQU $dff09c init: ; own blitter, wait for blitter AND finally forbid multitasking! ; all this just to be able to exit gracely ; store data in hardwareregisters ORed with $8000 (bit 15 is a write-set bit when ; values are written back into the system) move.w DMACONR,d0 or.w #$8000,d0 move.w d0,olddmareq move.w INTENAR,d0 or.w #$8000,d0 move.w d0,oldintena move.w INTREQR,d0 or.w #$8000,d0 move.w d0,oldintreq move.w ADKCONR,d0 or.w #$8000,d0 move.w d0,oldadkcon move.l $4,a6 move.l #gfxname,a1 moveq #0,d0 jsr -408(a6) ; oldOpenLibrary offset=-408 ... ;would OpenLibrary be better? offset=-552 move.l d0,gfxbase move.l d0,a6 move.l 34(a6),oldview move.l 38(a6),oldcopper move.l #0,a1 jsr -222(a6) ; LoadView jsr -270(a6) ; WaitTOF jsr -270(a6) ; WaitTOF jsr -456(a6) ; OwnBlitter jsr -228(a6) ; WaitBlit move.l $4,a6 jsr -132(a6) ; Forbid Start: MOVE.L #Copper_List, $dff080 MOVE.L #0, $dff088 Wait_Mouse_Button: BTST.B #6, $bfe001 BNE Wait_Mouse_Button exit: ; exit gracely - reverse everything done in init move.w #$7fff,DMACON move.w olddmareq,DMACON move.w #$7fff,INTENA move.w oldintena,INTENA move.w #$7fff,INTREQ move.w oldintreq,INTREQ move.w #$7fff,ADKCON move.w oldadkcon,ADKCON move.l oldcopper,$dff080 move.l gfxbase,a6 move.l oldview,a1 jsr -222(a6) ; LoadView jsr -270(a6) ; WaitTOF jsr -270(a6) ; WaitTOF jsr -228(a6) ; WaitBlit jsr -462(a6) ; DisownBlitter move.l $4,a6 jsr -138(a6) ; Permit RTS oldview: dc.l 0 oldcopper: dc.l 0 gfxbase: dc.l 0 olddmareq: dc.w 0 oldintreq: dc.w 0 oldintena: dc.w 0 oldadkcon: dc.w 0 gfxname: dc.b 'graphics.library',0 even Copper_List: DC.L $01000000 DC.L $01800000 DC.L $4001fffe DC.L $01800fff DC.L $4101fffe DC.L $01800000 DC.L $fffffffe
@vojo, post #4
OldOpenLibrary: moveq #0,d0 jmp -552(a6)
move.l #0,$dff088
move.w d0,$dff088
copper: dc.w $0180, 0 dc.w $80 dc.w copper2 - wyższe 16 bitów dc.w $82 dc.w copper2 - niskie 16 bitów dc.w $ffff,$fffe copper2: dc.w $0180, $0fff dc.w $080 dc.w copper - wyższe 16 bitów dc.w $082 dc.w copper - niższe 16 bitów dc.w $ffff,$fffe
@asman, post #5
Jeśli używasz Asm-One to masz do tego odpowiednią opcję w preferencjach 'Safety'.
@vojo, post #7
@vojo, post #7
program: move.l #copper3,d0 lea copper2,a0 move.w d0,6(a0) swap d0 move.w d0,2(a0) move.w #$7fff,$dff096 move.w #$7fff,$dff09a move.w #$7fff,$dff09c move.l #copper1,$dff080 move.l #copper2,$dff084 move.l #0,$dff088 move.w #$8280,$dff096 lmb: btst #6,$bfe001 bne lmb rts SECTION gfx,DATA_C copper1: dc.w $0180,$0a00 dc.w $ffff,$fffe copper2: dc.w $0080,0 dc.w $0082,0 dc.w $0180,$0505 dc.w $ffff,$fffe copper3: dc.w $0180,$0050 dc.w $ffff,$fffe
@vojo, post #9