1
0
mirror of https://frontier.innolan.net/github/AmigaExamples.git synced 2025-12-08 07:52:38 +00:00

New naming scheme

This commit is contained in:
alpine9000
2016-02-26 15:38:32 +11:00
parent 78ba46877a
commit 981855a699
11 changed files with 0 additions and 0 deletions

3
000.trackdisk/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
out/
bin/
*~

34
000.trackdisk/Makefile Normal file
View File

@ -0,0 +1,34 @@
MAKEADF=../tools/makeadf
FLOPPY=bin/test.adf
all: bin out $(MAKEADF) $(FLOPPY)
gdrive: all
cp $(FLOPPY) ~/Google\ Drive
bin:
mkdir bin
out:
mkdir out
$(MAKEADF): ../tools/makeadf.c
gcc ../tools/makeadf.c -o $(MAKEADF)
$(FLOPPY): out/bootblock.bin
$(MAKEADF) out/bootblock.bin > $(FLOPPY)
out/bootblock.bin: out/bootblock.o
vlink -brawbin1 $< -o $@
out/bootblock.o: bootblock.s out/main.bin
vc -c $< -o $@
out/main.o: main.s
vc -c $< -o $@
out/main.bin: out/main.o
vlink -brawbin1 $< -o $@
clean:
rm -rf out bin

6
000.trackdisk/README.md Normal file
View File

@ -0,0 +1,6 @@
trackdisk.device
================
Create a bootable adf file that loads a simple program using trackdisk.device.
The program has two simple copper lists and switches between them each vertical blank interrupt

30
000.trackdisk/bootblock.s Normal file
View File

@ -0,0 +1,30 @@
include exec/io.i
include lvo/exec_lib.i
bootblock:
dc.b "DOS",0
dc.l 0
dc.l 880
bootEntry:
;; a6 = Exec base
;; a1 = trackdisk.device I/O request pointer
lea $70000,a5 ; main.s entry point
;; Load the progam from the floppy using trackdisk.device
move.l #mainEnd-mainStart,IO_LENGTH(a1)
move.l a5,IO_DATA(a1)
move.l #mainStart-bootblock,IO_OFFSET(a1)
jsr _LVODoIO(a6)
jmp (a5) ; -> main.s entry point
;; Pad the remainder of the bootblock
cnop 0,1024
mainStart:
incbin "out/main.bin"
cnop 0,512
mainEnd:
end

120
000.trackdisk/main.s Normal file
View File

@ -0,0 +1,120 @@
include ../include/registers.i
include hardware/dmabits.i
include hardware/intbits.i
LEVEL_3_INTERRUPT_VECTOR equ $6c
entry:
lea level3InterruptHandler(pc),a3
move.l a3,LEVEL_3_INTERRUPT_VECTOR
lea CUSTOM,a1
lea copper1(pc),a0
move.l a0,cop1lc(a1)
move.w COPJMP1(a1),d0
move.w #(DMAF_SETCLR!DMAF_COPPER!DMAF_RASTER!DMAF_MASTER),dmacon(a1)
.mainLoop:
bra.b .mainLoop
level3InterruptHandler:
movem.l d0-a6,-(sp)
.checkVerticalBlank:
lea CUSTOM,a5
move.w INTREQR(a5),d0
and.w #INTF_VERTB,d0
beq.s .checkCopper
.verticalBlank:
move.w #INTF_VERTB,INTREQ(a5) ; Clear interrupt bit
lea.l CUSTOM,a5
lea.l counter(pc),a3
move.l (a3),d1
cmpi.l #1,d1
beq.s .installCopper2
.installCopper1:
lea copper1(pc),a0
addi.l #1,d1
bra.s .loadCopper
.installCopper2:
lea copper2(pc),a0
move.l #0,d1
.loadCopper:
move.l a0,COP1LC(a5)
move.l d1,(a3)
.checkCopper:
lea CUSTOM,a5
move.w INTREQR(a5),d0
and.w #INTF_COPER,d0
beq.s .interruptComplete
.copperInterrupt:
move.w #INTF_COPER,INTREQ(a5) ; Clear interrupt bit
.interruptComplete:
movem.l (sp)+,d0-a6
rte
counter:
dc.l 0
copper1:
;;
;; Set up pointers to two bitplanes
;;
DC.W BPL1PTH,$0002 ;Move $0002 into register $0E0 (BPL1PTH)
DC.W BPL1PTL,$1000 ;Move $1000 into register $0E2 (BPL1PTL)
DC.W BPL2PTH,$0002 ;Move $0002 into register $0E4 (BPL2PTH)
DC.W BPL2PTL,$5000 ;Move $5000 into register $0E6 (BPL2PTL)
;;
;; Load color registers
;;
DC.W COLOR00,$0FFF ;Move white into register $180 (COLOR00)
DC.W COLOR01,$0F00 ;Move red into register $182 (COLOR01)
DC.W COLOR02,$00F0 ;Move green into register $184 (COLOR02)
DC.W COLOR03,$000F ;Move blue into register $186 (COLOR03)
;;
;; Specify 2 Lores bitplanes
;;
DC.W BPLCON0,$2200 ;2 lores planes, coloron
;;
;; Wait for line 150
;;
DC.W $9601,$FF00 ;Wait for line 150, ignore horiz. position
;;
;; Change color registers mid-display
;;
DC.W COLOR00,$0000 ;Move black into register $0180 (COLOR00)
DC.W COLOR01,$0FF0 ;Move yellow into register $0182 (COLOR01)
DC.W COLOR02,$00FF ;Move cyan into register $0184 (COLOR02)
DC.W COLOR03,$0F0F ;Move magenta into register $0186 (COLOR03)
;;
;; End Copper list by waiting for the impossible
;;
DC.W $FFFF,$FFFE ;Wait for line 255, H = 254 (never happens)
copper2:
;;
;; Set up pointers to two bitplanes
;;
DC.W BPL1PTH,$0002 ;Move $0002 into register $0E0 (BPL1PTH)
DC.W BPL1PTL,$1000 ;Move $1000 into register $0E2 (BPL1PTL)
DC.W BPL2PTH,$0002 ;Move $0002 into register $0E4 (BPL2PTH)
DC.W BPL2PTL,$5000 ;Move $5000 into register $0E6 (BPL2PTL)
;;
;; Load color registers
;;
DC.W COLOR00,$0F00 ;Move red imto register $180 (COLOR00)
DC.W COLOR01,$0FFF ;Move white into register $182 (COLOR01)
DC.W COLOR02,$00F0 ;Move green into register $184 (COLOR02)
DC.W COLOR03,$000F ;Move blue into register $186 (COLOR03)
;;
;; Specify 2 Lores bitplanes
;;
DC.W BPLCON0,$2200 ;2 lores planes, coloron
;;
;; End Copper list by waiting for the impossible
;;
DC.W $FFFF,$FFFE ;Wait for line 255, H = 254 (never happens)