mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2026-09-12 14:31:57 +00:00
New naming scheme
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
out/
|
||||
bin/
|
||||
*~
|
||||
@@ -0,0 +1,38 @@
|
||||
MAKEADF=../tools/makeadf
|
||||
FLOPPY=bin/image.adf
|
||||
IMAGE_DATA=out/image-copper.s out/image-data.bin
|
||||
|
||||
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: image.s $(IMAGE_DATA)
|
||||
vc -c $< -o $@
|
||||
|
||||
out/main.bin: out/main.o
|
||||
vlink -brawbin1 $< -o $@
|
||||
|
||||
$(IMAGE_DATA): images/hello.png ../tools/bitplanify.py
|
||||
../tools/bitplanify.py images/hello.png --copper $(IMAGE_DATA)
|
||||
|
||||
clean:
|
||||
rm -rf out bin
|
||||
@@ -0,0 +1,6 @@
|
||||
Display a simple image
|
||||
======================
|
||||
|
||||
Building on trackdisk.device, we now display a simple color image
|
||||
|
||||
Image display code and conversion tools from https://github.com/vilcans/amiga-startup
|
||||
@@ -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
|
||||
@@ -0,0 +1,69 @@
|
||||
include ../include/registers.i
|
||||
include hardware/dmabits.i
|
||||
include hardware/intbits.i
|
||||
|
||||
LVL3_INT_VECTOR equ $6c
|
||||
SCREEN_WIDTH_BYTES equ (320/8)
|
||||
SCREEN_BIT_DEPTH equ 4
|
||||
|
||||
|
||||
entry:
|
||||
lea level3InterruptHandler(pc),a3
|
||||
move.l a3,LVL3_INT_VECTOR
|
||||
|
||||
lea CUSTOM,a1
|
||||
|
||||
;; install copper list and enable DMA
|
||||
lea copper(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
|
||||
|
||||
.resetBitplanePointers:
|
||||
lea bitplanes,a1
|
||||
lea $dff0e0,a2
|
||||
moveq #SCREEN_BIT_DEPTH,d0
|
||||
.bitplaneloop:
|
||||
move.l a1,(a2)
|
||||
lea SCREEN_WIDTH_BYTES(a1),a1 ; Bit plane data is interleaved
|
||||
addq #4,a2
|
||||
dbra d0,.bitplaneloop
|
||||
|
||||
.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
|
||||
|
||||
copper:
|
||||
dc.w BPLCON0,(SCREEN_BIT_DEPTH<<12)|$200 ; Set color depth and enable COLOR
|
||||
dc.w BPL1MOD,SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES
|
||||
dc.w BPL2MOD,SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES
|
||||
|
||||
include "out/image-copper.s"
|
||||
|
||||
dc.l $fffffffe
|
||||
bitplanes:
|
||||
incbin "out/image-data.bin"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user