@asman, post #25
@68k_tester, post #33
move.l 4.w,a6 moveq #0,d0 lea (gfx_name,pc),a1 jsr (-552,a6) move.l d0,(gfx_base) ; tutaj wklej lub wywołaj przykładzik lea $dff000,a5 move.l (gfx_base,pc),a1 move.l ($26,a1),($80,a5) move.l #4.w,a6 jsr (-414,a6) rts
; Startup-Code for ASM-ONE ; ; Author: Asman ; ;important labels ; keystab incdir "include:" include "hardware/cia.i" include "hardware/custom.i" include "hardware/dmabits.i" include "hardware/intbits.i" _custom equ $dff000 _ciaa equ $bfe001 _ciab equ $bfd000 SECTION startup,code startupcode RSRESET .gfxbase rs.l 1 .oldview rs.l 1 .intena rs.w 1 .dmacon rs.w 1 .vbr rs.l 1 .intvertb rs.l 1 .intports rs.l 1 .SIZEOF rs.b 0 ;=== exec === .OpenLibrary = -552 .CloseLibrary = -414 .Forbid = -132 .Permit = -138 .Supervisor = -30 ;=== graphics === .LoadView = -222 .WaitTOF = -270 .OwnBlitter = -456 .DisownBlitter = -462 .gb_ActiView = $22 .gb_copinit = $26 .AFB_68010 = 0 .AttnFlags = $128 movem.l d0-a6,-(sp) lea (.store,pc),a4 ;open graphics library move.l 4.w,a6 moveq #0,d0 lea (.gfxname,pc),a1 jsr (.OpenLibrary,a6) move.l d0,(.gfxbase,a4) beq.w .errexit move.l d0,a6 ;get blitter jsr (.OwnBlitter,a6) ;save old view move.l (.gb_ActiView,a6),(.oldview,a4) ;reset display sub.l a1,a1 jsr (.LoadView,a6) jsr (.WaitTOF,a6) jsr (.WaitTOF,a6) ;multitaskig off move.l 4.w,a6 jsr (.Forbid,a6) ;get vbr moveq #0,d0 move.l 4.w,a6 btst.b #.AFB_68010,.AttnFlags+1(a6) beq .mc68000 lea (.movectrap,pc),a5 jsr (.Supervisor,a6) .mc68000 move.l d0,(.vbr,a4) lea _custom,a5 ;Check AGA move.w (deniseid,a5),d0 cmpi.b #$f8,d0 ;AGA ? bne.b .no moveq #0,d0 ;Reset to ECS move.w d0,(bplcon3,a5) move.w d0,(fmode,a5) .no ;store move.w (intenar,a5),d0 or.w #$c000,d0 move.w d0,(.intena,a4) move.w (dmaconr,a5),d0 or.w #$8000,d0 move.w d0,(.dmacon,a4) ;stop int & dma move.w #$7fff,(intena,a5) move.w #$7fff,(dmacon,a5) move.w #$7fff,(intreq,a5) ;store int pointers move.l (.vbr,a4),a0 move.l ($6c,a0),(.intvertb,a4) move.l ($68,a0),(.intports,a4) ;set the interrupt vector pea (.PORTS,pc) move.l (sp)+,($68,a0) ;allow interrupts from the keyboard move.b #CIAICRF_SETCLR|CIAICRF_SP,(ciaicr+_ciaa) ;clear all ciaa-interrupts tst.b (ciaicr+_ciaa) ;set input mode and.b #~(CIACRAF_SPMODE),(ciacra+_ciaa) ;clear ports interrupt move.w #INTF_PORTS,(intreq+_custom) ;allow ports interrupt move.w #INTF_SETCLR|INTF_INTEN|INTF_PORTS,(intena+_custom) movem.l (sp)+,d0-a6 ;############### bsr start ;############### ;resore system movem.l d0-a6,-(sp) lea (.store,pc),a4 lea _custom,a5 ;stop int & dma move.w #$7fff,(intena,a5) move.w #$7fff,(dmacon,a5) move.w #$7fff,(intreq,a5) ;restore ints pointers move.l (.vbr,a4),a0 move.l (.intvertb,a4),($6c,a0) move.l (.intports,a4),($68,a0) ;restore move.w (.dmacon,a4),(dmacon,a5) move.w (.intena,a4),(intena,a5) ;multitasking on move.l 4.w,a6 jsr (.Permit,a6) ;load old view move.l (.gfxbase,a4),a6 move.l (.oldview,a4),a1 jsr (.LoadView,a6) move.l (.gb_copinit,a6),($80,a5) ; restore system clist ;blitter jsr (.DisownBlitter,a6) ;close graphics library move.l 4.w,a6 move.l (.gfxbase,a4),a1 jsr (.CloseLibrary,a6) movem.l (sp)+,d0-a6 rts .errexit moveq #-1,d0 rts .movectrap movec vbr,d0 rte .PORTS: movem.l d0-d1/a0-a1,-(a7) lea (_custom),a0 lea (_ciaa),a1 ;check if keyboard has caused interrupt btst #INTB_PORTS,(intreqr+1,a0) beq .end btst #CIAICRB_SP,(ciaicr,a1) beq .end ;read keycode move.b (ciasdr,a1),d0 ;set output mode (handshake) or.b #CIACRAF_SPMODE,(ciacra,a1) ;calculate rawkeycode not.b d0 ror.b #1,d0 ;store key in keystab movem.l a0,-(sp) moveq #1,d1 lea (keystab,pc),a0 and.w #$ff,d0 move.b d1,(a0,d0.w) movem.l (sp)+,a0 ;wait for handshake moveq #3-1,d1 .wait1 move.b (vhposr,a0),d0 .wait2 cmp.b (vhposr,a0),d0 beq .wait2 dbf d1,.wait1 ;set input mode and.b #~(CIACRAF_SPMODE),(ciacra,a1) .end move.w #INTF_PORTS,(intreq,a0) tst.w (intreqr,a0) movem.l (a7)+,d0-d1/a0-a1 rte .gfxname dc.b "graphics.library",0 EVEN .store ds.b .SIZEOF keystab: ds.b $100
INCLUDE startupcode.i
INCLUDE startup.i start: ; ustawienie copperlisty lea $dff000,a5 move.l #cp,($80,a5) move.w #0,($88,a5) ; czekamy na lewy klawisz myszki .lmb btst #6,$bfe001 bne .lmb rts SECTION gfxdata,DATA_C cp: dc.l $01000000 ; wyłączenie bitplanów dc.l $01800000 ; ustawienie czarnego koloru tła dc.l $fffffffe ; koniec copperlisty dc.l $fffffffe ; stary agnus potrzebuje jeszcze raz koniec start:
loop: ;tutaj co się dzieje typu czekanie na ramke i inne rzeczy lea (keystab,pc),a0 tst.b ($45,a0) bne exit ; bra loop exit: rts
@68k_tester, post #33
@qwerty4000, post #41
@qwerty4000, post #41
@asman, post #39
@qwerty4000, post #44
@qwerty4000, post #44
@68k_tester, post #46
@selur, post #30
@68k_tester, post #46
@Don_Adan, post #51
@asman, post #55
@HOŁDYS, post #59