diff --git a/028.bs/Makefile b/028.bs/Makefile index 98d283b..863d5ba 100644 --- a/028.bs/Makefile +++ b/028.bs/Makefile @@ -9,7 +9,7 @@ BASE_ADDRESS=4000 # note: this must be high enough not to conflict with MFMbufE BOOTBLOCK_ASM=alpine_bootblock.s -OBJS=out/init.o out/utils.o out/image.o out/blit.o out/joystick.o out/player.o out/items.o out/blitmtext.o out/blittext.o out/music.o out/P6112-Play.o out/splash.o out/background.o +OBJS=out/init.o out/utils.o out/image.o out/blit.o out/joystick.o out/player.o out/items.o out/blitmtext.o out/blittext.o out/music.o out/P6112-Play.o out/splash.o out/background.o out/sound.o IMAGES=foreground.png \ background.png \ @@ -164,7 +164,13 @@ out/background-map.s: background.tmx @mv background-map.s out @rm background-indexes.s -out/main.o: $(IMAGEDATA) out/background-map.s out/foreground-map.s Makefile link.script.x out/playarea_fade.s out/flags_fade.s out/panelFade.s out/tileFade.s +out/falling.raw: assets/falling.wav + sox assets/falling.wav -b 8 -c 1 -r 8000 out/falling.raw + +out/jump.raw: assets/jump.wav + sox assets/jump.wav -c 1 -r 13000 -b 8 out/jump.raw + +out/main.o: $(IMAGEDATA) out/background-map.s out/foreground-map.s Makefile link.script.x out/playarea_fade.s out/flags_fade.s out/panelFade.s out/tileFade.s out/jump.raw out/falling.raw setuptiming: $(eval VASM_EXTRA_ARGS="-DTIMING_TEST=1") diff --git a/028.bs/P6112-Options.i b/028.bs/P6112-Options.i index 957d52e..53ee3a2 100644 --- a/028.bs/P6112-Options.i +++ b/028.bs/P6112-Options.i @@ -22,7 +22,7 @@ split4=0 ;Great time gain, but INCOMPATIBLE with F03, F02, and F01 ;See ;@@ note for P61_SetPosition. -splitchans=1 ;#channels to be split off to be decrunched at "playtime frame" +splitchans=0 ;#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. @@ -41,7 +41,7 @@ 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 +channels=3 ;<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 diff --git a/028.bs/assets/falling.wav b/028.bs/assets/falling.wav new file mode 100644 index 0000000..9908463 Binary files /dev/null and b/028.bs/assets/falling.wav differ diff --git a/028.bs/assets/jump.wav b/028.bs/assets/jump.wav new file mode 100644 index 0000000..a29ae60 Binary files /dev/null and b/028.bs/assets/jump.wav differ diff --git a/028.bs/game1.s b/028.bs/game1.s index 0a9e606..1555b0e 100644 --- a/028.bs/game1.s +++ b/028.bs/game1.s @@ -1,5 +1,5 @@ include "includes.i" - + xdef BigBang xdef pathwayRenderPending @@ -44,12 +44,21 @@ Entry: move #$7fff,INTENA(a6) ; disable all interrupts lea Level3InterruptHandler,a3 - move.l a3,LVL3_INT_VECTOR + move.l a3,LVL3_INT_VECTOR + + if 0 + lea Level4InterruptHandler,a3 + move.l a3,LVL4_INT_VECTOR + endif + + + ;; move.w #(INTF_SETCLR|INTF_VERTB|INTF_INTEN),INTENA(a6) + jsr StartMusic jsr ShowSplash jsr BlueFill - + ;; d0 - fg bitplane pointer offset ;; d1 - bg bitplane pointer offset move.l #0,d0 @@ -77,8 +86,7 @@ Entry: jsr Init ; enable the playfield jsr InstallSpriteColorPalette - - move.w #(DMAF_SPRITE|DMAF_BLITTER|DMAF_SETCLR!DMAF_COPPER!DMAF_RASTER!DMAF_MASTER),DMACON(a6) + move.w #(DMAF_SPRITE|DMAF_BLITTER|DMAF_SETCLR|DMAF_COPPER|DMAF_RASTER|DMAF_MASTER),DMACON(a6) Reset: @@ -181,8 +189,12 @@ GameLoop: add.l #1,frameCount move.l frameCount,d6 move.l #FOREGROUND_SCROLL_PIXELS,foregroundScrollPixels + jsr WaitVerticalBlank + MOVE.W #2,AUD3LEN(a6) ;Set length in words + move.l #emptySound,AUD3LCH(a6) + if TIMING_TEST=1 move.l #4000,d0 .looooo: @@ -655,7 +667,16 @@ PostMissedTile: BigBang: - jsr ResetItems + jsr PlayFalling + move.l #10,d0 +.loop: + jsr WaitVerticalBlank + dbra d0,.loop + + MOVE.W #2,AUD3LEN(a6) ;Set length in words + move.l #emptySound,AUD3LCH(a6) + + jsr ResetItems move.w #0,moving move.l #0,frameCount .bigBangLoop: @@ -789,7 +810,44 @@ Level3InterruptHandler: .interruptComplete: movem.l (sp)+,d0-a6 - rte + rte + + + if 0 +Level4InterruptHandler: + movem.l d0-a6,-(sp) + lea CUSTOM,a6 +.checkVerticalBlank: + move.w INTREQR(a6),d0 + and.w #INTF_AUD0,d0 + beq .interruptComplete + + move.l #1000,d0 +.loop: + dbra d0,.loop + + move.w #INTF_AUD0,INTREQ(a6) ; clear interrupt bit + MOVE.W #2,AUD0LEN(a6) ;Set length in words + move.l #jump,AUD0LCH(a6) + move.w #INTF_AUD0,INTENA(a6) + + if 0 + move.w #DMAF_AUD0,DMACON(a6) + + lea verticalBlankCounterText,a0 + bsr IncrementCounter + + if 0 + MOVE.W #1,AUD0PER(a6) + MOVE.W #0,AUD0VOL(a6) ;Use maximum volume + MOVE.W #2,AUD0LEN(a6) ;Set length in words + endif + endif +.interruptComplete: + + movem.l (sp)+,d0-a6 + rte + endif Message: ;; a0 - bitplane @@ -1479,6 +1537,9 @@ panelFade: tileFade: include "out/tileFade.s" + align 2 +emptySound: + dc.l 0 section .bss diff --git a/028.bs/init.s b/028.bs/init.s index 3c4505a..a66524f 100644 --- a/028.bs/init.s +++ b/028.bs/init.s @@ -5,34 +5,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 - - ;; lea Level3InterruptHandler,a3 - ;; move.l a3,LVL3_INT_VECTOR ;; set up playfield move.w #(RASTER_Y_START<<8)|RASTER_X_START,DIWSTRT(a6) - move.w #((RASTER_Y_STOP-256)<<8)|(RASTER_X_STOP-256),DIWSTOP(a6) + move.w #((RASTER_Y_STOP-256)<<8)|(RASTER_X_STOP-256),DIWSTOP(a6) - ;; move.w #(RASTER_X_START/2-SCREEN_RES)-8,DDFSTRT(a6) ; -8 for extra scrolling word - ;; move.w #(RASTER_X_START/2-SCREEN_RES)+(8*((SCREEN_WIDTH/16)-1)),DDFSTOP(a6) - - ;; enabled 2x the bitplanes as 2x playfields - ;; move.w #(SCREEN_BIT_DEPTH*2<<12)|COLOR_ON|DBLPF,BPLCON0(a6) - ;; move.w #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES-2,BPL1MOD(a6) ; -2 for extra scrolling word - ;; move.w #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES-2,BPL2MOD(a6) - - - ;; setup sprites - - - - ;; install copper list, then enable dma and selected interrupts - - ;; move.w #(DMAF_SPRITE|DMAF_BLITTER|DMAF_SETCLR!DMAF_COPPER!DMAF_RASTER!DMAF_MASTER),DMACON(a6) move.w #(DMAF_BLITTER|DMAF_SETCLR!DMAF_COPPER!DMAF_RASTER!DMAF_MASTER),DMACON(a6) - ;; move.w #PF2PRI,BPLCON2(a6) - ;; move.w #(INTF_SETCLR|INTF_VERTB|INTF_INTEN),INTENA(a6) movem.l (sp)+,d0-a6 rts \ No newline at end of file diff --git a/028.bs/player.s b/028.bs/player.s index 0e14ef6..f805cfb 100644 --- a/028.bs/player.s +++ b/028.bs/player.s @@ -157,18 +157,22 @@ ProcessJoystick: cmp.b #3,joystickpos bne .notRight move.w #PLAYER_JUMP_PIXELS+PLAYER_PAUSE_PIXELS,spriteR + jsr PlaySound .notRight: cmp.b #1,joystickpos bne .notUp move.w #PLAYER_JUMP_PIXELS+PLAYER_PAUSE_PIXELS,spriteU + jsr PlaySound .notUp: cmp.b #5,joystickpos bne .notDown move.w #PLAYER_JUMP_PIXELS+PLAYER_PAUSE_PIXELS,spriteD + jsr PlaySound .notDown: cmp.b #7,joystickpos bne .notLeft move.w #PLAYER_JUMP_PIXELS+PLAYER_PAUSE_PIXELS,spriteL + jsr PlaySound .notLeft: .skip: rts diff --git a/028.bs/sound.s b/028.bs/sound.s new file mode 100644 index 0000000..96cd3fd --- /dev/null +++ b/028.bs/sound.s @@ -0,0 +1,40 @@ + include "includes.i" + xdef PlaySound + xdef PlayFalling + +PlaySound: + LEA jump(pc),a1 ;Address of data to + MOVE.L a1,AUD3LCH(a6) ;The 680x0 writes this as though it were a + MOVE.W #123,AUD3PER(a6) + MOVE.W #64,AUD3VOL(a6) ;Use maximum volume + MOVE.W #(endJump-jump)/2,AUD3LEN(a6) ;Set length in words + move.w #(DMAF_AUD3|DMAF_SETCLR),DMACON(a6) + + if 0 + move.l #1000,d0 +.loop: + dbra d0,.loop + + MOVE.W #2,AUD3LEN(a6) ;Set length in words + move.l #jump,AUD3LCH(a6) + endif + rts + + +PlayFalling: + LEA falling(pc),a1 ;Address of data to + MOVE.L a1,AUD3LCH(a6) ;The 680x0 writes this as though it were a + MOVE.W #256,AUD3PER(a6) + MOVE.W #25,AUD3VOL(a6) ;Use maximum volume + MOVE.W #(endFalling-falling)/4,AUD3LEN(a6) ;Set length in words + move.w #(DMAF_AUD3|DMAF_SETCLR),DMACON(a6) + rts + + align 4 +jump: + incbin "out/jump.raw" +endJump: + align 4 +falling: + incbin "out/falling.raw" +endFalling: \ No newline at end of file diff --git a/include/vector.i b/include/vector.i index 9249735..6420ffe 100644 --- a/include/vector.i +++ b/include/vector.i @@ -1 +1,2 @@ LVL3_INT_VECTOR equ $6c +LVL4_INT_VECTOR equ $70