Work in progress, slideshow with music

This commit is contained in:
alpine9000
2016-03-22 19:10:17 +11:00
parent d8bc803344
commit 45fe98db34
7 changed files with 4336 additions and 38 deletions
+7 -7
View File
@@ -1,5 +1,6 @@
EXAMPLE_NAME=slideshow
SECONDS_WAIT=10
INTERLACE=1
HAM_MODE=1
@@ -9,18 +10,17 @@ OBJS=out/init.o out/utils.o out/trackloader.o out/image.o
IMAGES=mr.png mr2.png mr3.png mr4.png mr5.png mr6.png mr7.png mr8.png
USERSTACK_ADDRESS=7fffc
BASE_ADDRESS=10000
DECOMPRESS_ADDRESS=10000
USERSTACK_ADDRESS=7fffc # userstack used by bootblock
BASE_ADDRESS=10000 # if you change this you must also change link.script
#--use-palette=palettes/$*.pal
VASM_EXTRA_ARGS=-DSECONDS_WAIT=$(SECONDS_WAIT) -DINTERLACE=$(INTERLACE) -DHAM_MODE=$(HAM_MODE)
ifeq ($(HAM_MODE),1)
VASM_EXTRA_ARGS=-DINTERLACE=$(INTERLACE) -DHAM_MODE=$(HAM_MODE)
IMAGECON_ARGS= --dither --ham
IMAGEDATA=$(addprefix out/, $(IMAGES:.png=-ham.bin))
else
VASM_EXTRA_ARGS=-DINTERLACE=$(INTERLACE) -DHAM_MODE=$(HAM_MODE)
IMAGECON_ARGS=--colors 32 --quantize
IMAGEDATA=$(addprefix out/, $(IMAGES:.png=.bin))
endif
@@ -34,8 +34,8 @@ else
FLAGS=--height=256
endif
#-M
LINK_COMMANDLINE=vlink -T link.script -brawbin1 $< $(OBJS) -o $@
#SYMBOL_INFO=-M
LINK_COMMANDLINE=vlink -T link.script -brawbin1 $< $(OBJS) $(SYMBOL_INFO) -o $@
include ../shared/base.mk
out/%.sized.png: ../assets/%.png
+91
View File
@@ -0,0 +1,91 @@
P61mode =1 ;Try other modes ONLY IF there are no Fxx commands >= 20.
;(f.ex., P61.new_ditty only works with P61mode=1)
;; --- options common to all P61modes ---
usecode=$200B55E;CHANGE! to the USE hexcode from P61con for a big
;CPU-time gain! (See module usecodes at end of source)
;Multiple songs, single playroutine? Just "OR" the
;usecodes together!
;...STOP! Have you changed it yet!? ;)
;You will LOSE RASTERTIME AND FEATURES if you don't.
P61pl=usecode&$400000
split4=0 ;Great time gain, but INCOMPATIBLE with F03, F02, and F01
;speeds in the song! That's the ONLY reason it's default 0.
;So ==> PLEASE try split4=1 in ANY mode!
;Overrides splitchans to decrunch 1 chan/frame.
;See ;@@ note for P61_SetPosition.
splitchans=1 ;#channels to be split off to be decrunched at "playtime frame"
;0=use normal "decrunch all channels in the same frame"
;Experiment to find minimum rastertime, but it should be 1 or 2
;for 3-4 channels songs and 0 or 1 with less channels.
visuctrs=1 ;enables visualizers in this example: P61_visuctr0..3.w
;containing #frames (#lev6ints if cia=1) elapsed since last
;instrument triggered. (0=triggered this frame.)
;Easy alternative to E8x or 1Fx sync commands.
asmonereport =0 ;ONLY for printing a settings report on assembly. Use
;if you get problems (only works in AsmOne/AsmPro, tho)
p61system=0 ;1=system-friendly. Use for DOS/Workbench programs.
p61exec =0 ;0 if execbase is destroyed, such as in a trackmo.
p61fade =0 ;enable channel volume fading from your demo
channels=4 ;<4 for game sound effects in the higher channels. Incompatible
; with splitchans/split4.
playflag=0 ;1=enable music on/off capability (at run-time). .If 0, you can
;still do this by just, you know, not calling P61_Music...
;It's a convenience function to "pause" music in CIA mode.
p61bigjtab=0 ;1 to waste 480b and save max 56 cycles on 68000.
opt020 =0 ;1=enable optimizations for 020+. Please be 68000 compatible!
;splitchans will already give MUCH bigger gains, and you can
;try the MAXOPTI mode.
p61jump =0 ;0 to leave out P61_SetPosition (size gain)
;1 if you need to force-start at a given position fex in a game
C =0 ;If you happen to have some $dffxxx value in a6, you can
;change this to $xxx to not have to load it before P61_Music.
clraudxdat=0 ;enable smoother start of quiet sounds. probably not needed.
optjmp =1 ;0=safety check for jump beyond end of song. Clear it if you
;play unknown P61 songs with erroneous Bxx/Dxx commands in them
oscillo =0 ;1 to get a sample window (ptr, size) to read and display for
;oscilloscope type effects (beta, noshorts=1, pad instruments)
;IMPORTANT: see ;@@ note about chipmem dc.w buffer.
quietstart=0 ;attempt to avoid the very first click in some modules
;IMPORTANT: see ;@@ note about chipmem dc.w buffer.
use1Fx=0 ;Optional extra effect-sync trigger (*). If your module is free
;from E commands, and you add E8x to sync stuff, this will
;change the usecode to include a whole code block for all E
;commands. You can avoid this by only using 1Fx. (You can
;also use this as an extra sync command if E8x is not enough,
;of course.)
;(*) Slideup values>116 causes bugs in Protracker, and E8 causes extra-code
;for all E-commands, so I used this. It's only faster if your song contains 0
;E-commands, so it's only useful to a few, I guess. Bit of cyclemania. :)
;Just like E8x, you will get the trigger after the P61_Music call, 1 frame
;BEFORE it's heard. This is good, because it allows double-buffered graphics
;or effects running at < 50 fps to show the trigger synced properly.
+35 -10
View File
@@ -1,6 +1,7 @@
include "includes.i"
xref LoadNextImage
xref LoadModule
LoadNextImage:
movem.l d0-a6,-(sp)
@@ -30,9 +31,9 @@ LoadImage:
move.l nextbitplane,a1 ; decompress into offscreen bitplanesp(1/2)
move.l (a1),a1
movem.l d0-a6,-(sp)
bsr doynaxdepack ; decompress data
movem.l (sp)+,d0-a6
;a0 = Input buffer to be decompressed. Must be 16-bit aligned!
;a1 = Output buffer. Points to the end of the data at exit
jsr Depack
jsr WaitVerticalBlank ; avoid tearing when we show the new image
jsr (a2) ; install new color palette
@@ -117,12 +118,12 @@ imageLookupTable: ; configure slideshow here
dc.l InstallColorPalette6
dc.l imageData6
dc.l endImageData6-imageData6
if INTERLACE==0
dc.l InstallColorPalette7
dc.l imageData7
dc.l endImageData7-imageData7
if INTERLACE==0
dc.l InstallColorPalette8
dc.l imageData8
dc.l endImageData8-imageData8
@@ -133,6 +134,27 @@ imageIndex:
dc.l 0
nextbitplane:
dc.l bitplanesp1
LoadModule:
;; a0 - destination address
;; a1 - start address
;; d0 - size
movem.l d0-a6,-(sp)
lea endCode,a0
lea compressedModule,a1
move.l #endCompressedModule,d0
sub.l #compressedModule,d0
jsr DoLoadImage
;a0 = input buffer to be decompressed. Must be 16-bit aligned!
;a1 = output buffer. Points to the end of the data at exit
lea endCode,a0
lea Module1,a1
move.l (a1),a1
jsr Depack
movem.l (sp)+,d0-a6
rts
InstallColorPalette:
include "out/mr-palette.s"
@@ -158,9 +180,6 @@ InstallColorPalette7:
InstallColorPalette8:
include "out/mr8-palette.s"
rts
;; this is one FAST decompression routine!
include "../tools/external/doynamite68k/depacker_doynax.asm"
section .photo ; data in this section will not be loaded by the bootloader
cnop 0,512 ; each image must be aligned to a sector boundary
@@ -217,6 +236,7 @@ imageData6:
endif
endImageData6:
if INTERLACE==0
cnop 0,512 ; each image must be aligned to a sector boundary
imageData7:
if HAM_MODE==1
@@ -226,7 +246,6 @@ imageData7:
endif
endImageData7:
if INTERLACE==0
cnop 0,512 ; each image must be aligned to a sector boundary
imageData8:
if HAM_MODE==1
@@ -235,4 +254,10 @@ imageData8:
incbin "out/mr8.lz"
endif
endImageData8:
endif; INTERLACE==0
endif; INTERLACE==0
cnop 0,512
compressedModule:
incbin "../assets/P61.breath_of_life.lz"
endCompressedModule:
+4 -4
View File
@@ -7,11 +7,11 @@
;; custom chip base globally in a6
Init:
movem.l d0-a6,-(sp)
move #$7ff,DMACON(a6) ; disable all dma
move #$7fff,INTENA(a6) ; disable all interrupts
;; move #$7ff,DMACON(a6) ; disable all dma
;; move #$7fff,INTENA(a6) ; disable all interrupts
lea Level3InterruptHandler,a3
move.l a3,LVL3_INT_VECTOR
;; lea Level3InterruptHandler,a3
;; move.l a3,LVL3_INT_VECTOR
;; set up playfield
move.w #(RASTER_Y_START<<8)|RASTER_X_START,DIWSTRT(a6)
+50 -13
View File
@@ -1,6 +1,6 @@
include "includes.i"
xref InstallColorPalette
include "P6112-Options.i"
xref PokeBitplanePointers
xref Level3InterruptHandler
xref copperList
@@ -8,7 +8,7 @@
xref bitplanesp1
xref bitplanesp2
xref bitplanesp3
xref Module1
byteMap:
dc.l Entry
@@ -17,24 +17,46 @@ byteMap:
Entry:
move.l userstack,a7
lea CUSTOM,a6
move #$7ff,DMACON(a6) ; disable all dma
move #$7fff,INTENA(a6) ; disable all interrupts
jsr LoadNextImage
jsr Init
move.w d0,COLOR00(a6) ; black screen
jsr LoadModule
lea Level3InterruptHandler,a3
move.l a3,LVL3_INT_VECTOR
;; initialise P61
lea Module1,a0
move.l (a0),a0
sub.l a1,a1
sub.l a2,a2
moveq #0,d0
jsr P61_Init
move.w #(INTF_SETCLR|INTF_VERTB|INTF_INTEN),INTENA(a6)
move.l #50*10,d0
.loop:
jsr WaitVerticalBlank
dbra d0,.loop
jsr LoadNextImage
jsr Init
.mainLoop:
jsr WaitVerticalBlank
if 0
cmp.l #50*5,counter
cmp.l #50*SECONDS_WAIT,counter
bne .updateCounter
jsr LoadNextImage
move.l #0,counter
else
jsr LoadNextImage
endif
bra .done
.updateCounter:
add.l #1,counter
.done:
bra .mainLoop
counter:
@@ -50,6 +72,10 @@ Level3InterruptHandler:
.verticalBlank:
move.w #INTF_VERTB,INTREQ(a6) ; clear interrupt bit
movem.l d0-a6,-(sp)
;; jsr P61_Music ; and call the playroutine manually.
movem.l (sp)+,d0-a6
if INTERLACE==1
btst #VPOSRLOFBIT,VPOSR(a6)
beq.s .lof
@@ -61,6 +87,8 @@ Level3InterruptHandler:
move.l a0,COP1LC(a6)
.done
endif ; INTERLACE==1
.checkCopper:
move.w INTREQR(a6),d0
and.w #INTF_COPER,d0
@@ -91,6 +119,10 @@ PokeBitplanePointers:
movem.l (sp)+,d0-a6
rts
Playrtn:
include "../shared/P6112-Play.i"
if INTERLACE==1
copperListAlternate:
;; bitplane pointers must be first else poking addresses will be incorrect
@@ -125,8 +157,11 @@ copperList:
dc.w BPL6PTH,0
dc.l $fffffffe
;; Module1:
;; incbin "../assets/P61.sowhat-intro" ;usecode $9410
align 4
bitplanesp1:
dc.l endCode
bitplanesp2:
@@ -134,4 +169,6 @@ bitplanesp2:
bitplanesp3:
dc.l endCode+(512*2)+(2*IMAGESIZE)
userstack:
dc.l endCode+(512*3)+(3*IMAGESIZE)+$1000
dc.l endCode+(512*3)+(3*IMAGESIZE)+$1000
Module1:
dc.l endCode+(512*3)+(3*IMAGESIZE)+$1000+4
+14 -4
View File
@@ -1,5 +1,6 @@
xref WaitVerticalBlank
xref WaitRaster
xref Depack
WaitVerticalBlank:
movem.l d0-a6,-(sp)
@@ -9,9 +10,7 @@ WaitVerticalBlank:
bne.b .loop
movem.l (sp)+,d0-a6
rts
WaitRaster: ;wait for rasterline d0.w. Modifies d0-d2/a0.
movem.l d0-a6,-(sp)
move.l #$1ff00,d2
@@ -23,4 +22,15 @@ WaitRaster: ;wait for rasterline d0.w. Modifies d0-d2/a0.
cmp.l d1,d0
bne.s .wr
movem.l (sp)+,d0-a6
rts
rts
Depack:
;a0 = input buffer to be decompressed. Must be 16-bit aligned!
;a1 = output buffer. Points to the end of the data at exit
movem.l d0-a6,-(sp)
bsr doynaxdepack ; decompress data
movem.l (sp)+,d0-a6
rts
;; this is one FAST decompression routine!
include "../tools/external/doynamite68k/depacker_doynax.asm"
+4135
View File
File diff suppressed because it is too large Load Diff