assemble bootloader during build

This commit is contained in:
4am 2021-08-13 20:53:38 -04:00
parent b16224f32d
commit 7af414d20e
3 changed files with 202 additions and 18 deletions

View File

@ -54,9 +54,9 @@ dsk: asm
for f in res/TITLE.HGR/* res/TITLE.DHGR/*; do rsync --ignore-existing res/GAMEHELP/STANDARD build/GAMEHELP/$$(basename $$f); done
bin/buildfileinfo.sh build/GAMEHELP "04" "8000" >>build/log
$(CADIUS) ADDFOLDER build/"$(DISK)" "/$(VOLUME)/GAMEHELP" "build/GAMEHELP" >>build/log
bin/changebootloader.sh build/"$(DISK)" res/proboothd
bin/changebootloader.sh build/"$(DISK)" build/proboothd
asm: asmlauncher asmfx asmprelaunch
asm: asmlauncher asmfx asmprelaunch asmproboot
asmlauncher: md
$(ACME) -DBUILDNUMBER=`git rev-list --count HEAD` src/4cade.a 2>build/relbase.log
@ -70,8 +70,8 @@ asmprelaunch: md
for f in src/prelaunch/*.a; do grep "^\!to" $${f} >/dev/null && $(ACME) $${f} >> build/log; done
for f in res/TITLE.HGR/* res/TITLE.DHGR/*; do rsync --ignore-existing build/PRELAUNCH/STANDARD build/PRELAUNCH/$$(basename $$f); done
chd: dsk
chdman createhd -c none -i build/"$(DISK)" -o build/"$(DISK)".chd >>build/log
asmproboot: md
$(ACME) -r build/proboothd.lst src/proboothd/proboothd.a >> build/log
compress: md
for f in res/ACTION.HGR.UNCOMPRESSED/*; do o=res/ACTION.HGR/$$(basename $$f); [ -f "$$o" ] || ${EXOMIZER} "$$f"@0x4000 -o "$$o" >>build/log; done

Binary file not shown.

View File

@ -2,7 +2,7 @@
;minimal open/read binary file in ProDOS filesystem
;copyright (c) Peter Ferrie 2016-2019
!cpu 6502
!to "proboothd",plain
!to "build/proboothd",plain
*=$800
;zpage usage, arbitrary selection except for the "ProDOS constant" ones
@ -34,7 +34,11 @@
sta $c000
sta $c002
sta $c004
jsr $fb2f
lda $c000
cmp #$d3
bne +
jsr seasons
+ jsr $fb2f
jsr $fc58
jsr $fe84
jsr $fe89
@ -42,19 +46,15 @@
; print title
ldy #9
- lda TOTAL-1,y
ora #$80
sta $04B7-1,y
dey
bne -
ldy #11
- lda REPLAY-1,y
ora #$80
sta $0536-1,y
- lda TOTAL-1, y
sta $04B6-1, y
lda REPLAY-1, y
sta $0536-1, y
dey
bne -
pla
sta unit
tax
; X = boot slot x16
; Y = 0
@ -177,18 +177,202 @@ retcall pla
inx
txa
pha
rts
- rts
fakeMLI_e
; Interactive Seasons demo
; based on Apple II Seasons -=DESiRE=- 128B Demo for Outline 2020
; based on the code in Hellmood's 64B x86 demo 'Autumn'
; by deater (Vince Weaver)
; adapted by 4am for use within this bootloader
; /!\ While demo is running, press 1-4 to change color palettes
; or Esc to quit demo and continue the boot
HGR2 = $F3D8 ; Set full-screen hi-res mode using page 2 ($4000)
HPLOT0 = $F457 ; Plot point, (Y,X) = Horizontal, (A=Vertical)
HCOLOR = $F6EC ; Set color in X, must be 0..7
seasons:
bit $c010
jsr HGR2
ldx #(copy_seasons_e-copy_seasons)
- lda copy_seasons-1, x
sta $30, x
dex
bne -
jmp seasons_forever
copy_seasons:
; HGR ROM routines use
; $1C mask for color
; $26/$27 address for plot
; $30 color value * 17
; $E0/$E1 X coord of last hplot
; so code starts at $31 and must end before $E0
!pseudopc $31 {
EBP1 !byte 0
EBP2 !byte 0
EBP3 !byte 0
EBP4 !byte 0
color_lookup_lookup:
!byte <color_lookup
!byte <color_lookup2
!byte <color_lookup3
!byte <color_lookup4
color_lookup:
; qkumba ora2 white/blue/purple
!byte $02,$03,$02,$03, $06,$07,$06,$07
color_lookup2:
; better mixed orange/green/white
!byte $01,$03,$03,$03, $05,$05,$07,$07
color_lookup3:
; blue and purple palette
!byte $02,$02,$03,$06, $06,$06,$02,$07
color_lookup4:
; colorful palette
!byte $01,$01,$02,$03, $05,$05,$06,$07
seasons_forever:
; save old Xcoord value to X/Y for later
XCOORDL=*+1
ldx #0 ; 2
XCOORDH=*+1
ldy #0 ; 2
; 16-bit subtraction x=x-y
; need to set carry before subtraction on 6502
txa ; 1 (xcoordl in X)
sec ; 1
sbc <YCOORDL ; 2
sta <XCOORDL ; 2
tya ; 1 (xcoordh in Y)
YCOORDH=*+1
sbc #0 ; 2
; 16-bit arithmetic shift right of X
; 6502 has no asr instruction
; cmp #$80 sets carry if high bit set
cmp #$80 ; 2 ; XCOORDH still in A from before
ror ; 1
sta <XCOORDH ; 2
ror <XCOORDL ; 2
; 16-bit add, ycoord=ycoord+oldx
clc ; 1
txa ; 1
YCOORDL=*+1
adc #0 ; 2
sta <YCOORDL ; 2
tya ; 1
adc <YCOORDH ; 2
; 16-bit arithmetic shift right of y-coord
cmp #$80 ; 2 ; YCOORDH still in A from before
ror ; 1
sta <YCOORDH ; 2
ror <YCOORDL ; 2
; 32 bit rotate of low bit shifted out of Y-coordinate
ror <EBP1 ; 2
ror <EBP2 ; 2
ror <EBP3 ; 2
ror <EBP4 ; 2
; branch if carry set
bcs label_11f ; 2
; 16-bit increment of color
inc <COLORL ; 2
bne no_oflo ; 2
inc <COLORH ; 2
no_oflo:
; 16-bit add of X-coord by 0x80
; this keeps the drawing roughly to the 280x192 screen
; carry should still be clear (inc doesn't set it)
lda <XCOORDL ; 2
adc #$80 ; 2
sta <XCOORDL ; 2
bcc no_oflo2 ; 2
inc <XCOORDH ; 2
no_oflo2:
; 16-bit negate of Y-coord
sec ; 1
lda #0 ; 2
sbc <YCOORDL ; 2
sta <YCOORDL ; 2
lda #0 ; 2
sbc <YCOORDH ; 2
sta <YCOORDH ; 2
label_11f:
; 16-bit shift of color
; 2nd is a rotate as asl doesn't shift in carry
COLORL=*+1
lda #0 ; 2
asl ; 1 ; shl %ax
rol <COLORH ; 2
COLORH=*+1
eor #0 ; 2
sta <COLORL ; 2
; get color mapping
and #7 ; 2
tay ; 1
color_addr=*+1
ldx <color_lookup, y ; 2
; if ycoord negative, loop
lda <YCOORDH ; 2
bmi seasons_forever ; 2
; if top bits of xcoord, loop
lda <XCOORDH ; 2
and #$f0 ; 2
bne seasons_forever ; 2
put_pixel:
; actually set the color
jsr HCOLOR ; 3 ; color is in X
; set up parameters for HPLOT ROM call
ldx <XCOORDL ; 2 ; x coord in (y:x)
ldy <XCOORDH ; 2
lda <YCOORDL ; 2 ; y coord in A
jsr HPLOT0 ; 3
lda $c000
- bpl seasons_forever
cmp #$9b
beq +
and #3
tax
lda <color_lookup_lookup, x
sta <color_addr
bpl - ; always branches
+ rts
}
copy_seasons_e
filename
!byte filename_e - filename_b
filename_b
!text "LAUNCHER.SYSTEM" ;your start-up file, file is max 40kb
filename_e
TOTAL
!text "T O T A L"
!byte $A0,$D4,$A0,$CF,$A0,$D4,$A0,$C1,$A0,$CC,$A0
REPLAY
!text "R E P L A Y"
!byte $D2,$A0,$C5,$A0,$D0,$A0,$CC,$A0,$C1,$A0,$D9
*=$9f8
!byte $D3,$C1,$CE,$A0,$C9,$CE,$C3,$AE