From 2f73df9016a55bd3b15c2fda209c77739516457b Mon Sep 17 00:00:00 2001 From: alpine9000 Date: Sun, 15 May 2016 16:22:47 +1000 Subject: [PATCH] credits --- 028.bs/Makefile | 2 +- 028.bs/blitmtext.s | 38 ++++++++++- 028.bs/credits.s | 157 +++++++++++++++++++++++++++++++++++++++++++++ 028.bs/game1.s | 2 +- 028.bs/menu.s | 9 ++- 5 files changed, 203 insertions(+), 5 deletions(-) create mode 100644 028.bs/credits.s diff --git a/028.bs/Makefile b/028.bs/Makefile index 6f0d637..d514879 100644 --- a/028.bs/Makefile +++ b/028.bs/Makefile @@ -12,7 +12,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/blitmtext85.o out/blittext.o out/music.o out/P6112-Play.o out/splash.o out/background.o out/sound.o out/trackloader.o out/disk.o out/counter.o out/map.o out/message.o out/menu.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/blitmtext85.o out/blittext.o out/music.o out/P6112-Play.o out/splash.o out/background.o out/sound.o out/trackloader.o out/disk.o out/counter.o out/map.o out/message.o out/menu.o out/credits.o IMAGES=foreground.png \ background.png \ diff --git a/028.bs/blitmtext.s b/028.bs/blitmtext.s index aed8135..babbc25 100644 --- a/028.bs/blitmtext.s +++ b/028.bs/blitmtext.s @@ -1,6 +1,7 @@ include "includes.i" xdef DrawMaskedText8 - + xdef DrawWSMaskedText8 + BLIT_LF_MINTERM equ $ca ; cookie cut BLIT_WIDTH_WORDS equ 2 ; blit 2 words to allow shifting BLIT_WIDTH_BYTES equ 4 @@ -44,6 +45,41 @@ DrawMaskedText8: movem.l (sp)+,d0-d7/a0-a4 rts +DrawWSMaskedText8: + ;; a0 - bitplane + ;; a1 - text + ;; d0 - xpos + ;; d1 - ypos + movem.l d0-d7/a0-a4,-(sp) + WaitBlitter + + ;; blitter config that is shared for every character + move.w #BC0F_SRCA|BC0F_SRCB|BC0F_SRCC|BC0F_DEST|BLIT_LF_MINTERM,d6 ; BLTCON0 value (masked version) + move.w #FONTMAP_WIDTH_BYTES-BLIT_WIDTH_BYTES,BLTAMOD(a6) ; A modulo (only used for masked version) + move.w #FONTMAP_WIDTH_BYTES-BLIT_WIDTH_BYTES,BLTBMOD(a6) ; B modulo + move.w #BITPLANE_WIDTH_BYTES-BLIT_WIDTH_BYTES,BLTCMOD(a6) ; C modulo + move.w #BITPLANE_WIDTH_BYTES-BLIT_WIDTH_BYTES,BLTDMOD(a6) ; D modulo + mulu.w #BITPLANE_WIDTH_BYTES*_SCREEN_BIT_DEPTH,d1 ; ypos bytes + move.w #$0000,BLTALWM(a6) ; mask out extra word used for shifting + move.w #$ffff,BLTADAT(a6) ; preload source mask so only BLTA?WM mask is used + move.l a1,a3 ; character pointer + move.l #font,a5 ; font pointer + move.l #fontMask,d7 ; font mask pointer + move.w #FONTMAP_WIDTH_BYTES*_SCREEN_BIT_DEPTH*FONT_HEIGHT,d3 ; bytes per font line +.loop: + clr.l d2 + move.b (a3)+,d2 ; get next character + cmp.b #0,d2 ; 0 terminates the string + beq .done + move.l a0,a4 ; bitplane pointer + bsr DrawChar8 ; draw it + add.l #FONT_WIDTH,d0 ; increment the x position + bra .loop +.done: + movem.l (sp)+,d0-d7/a0-a4 + rts + + DrawChar8: ;; kills d2,d4,d5,a1,a2,a4 ;; d0 - xpos diff --git a/028.bs/credits.s b/028.bs/credits.s new file mode 100644 index 0000000..101430d --- /dev/null +++ b/028.bs/credits.s @@ -0,0 +1,157 @@ + include "includes.i" + xdef Credits + +CREDITS_COLOR_DEPTH equ 4 + +FillColor: + ;; kills a0,d2,d3,d5,d5 + ;; a0 - bitplane + ;; d0 - color# + ;; d1 - height + ;; d2 - ypos + + movem.l d2-d5/a0,-(sp) + mulu.w #BITPLANE_WIDTH_BYTES*CREDITS_COLOR_DEPTH,d2 + add.l d2,a0 + move.b #0,d3 ; bitplane # +.loop: + move.w d1,d4 + btst d3,d0 ; is the color's bit set in this plane? + beq .zero + move.w #BC0F_DEST|$FF,d5 ; yes ? all ones + bra .doblit +.zero + move.w #BC0F_DEST|$0,d5 ; no ? all zeros +.doblit + WaitBlitter + + move.w #0,BLTCON1(A6) + move.w d5,BLTCON0(A6) + move.w #BITPLANE_WIDTH_BYTES*(CREDITS_COLOR_DEPTH-1),BLTDMOD(a6) + move.l a0,BLTDPTH(a6) + + lsl.w #6,d4 + ori.w #BITPLANE_WIDTH_WORDS,d4 + move.w d4,BLTSIZE(a6) + add.b #1,d3 + add.w #BITPLANE_WIDTH_BYTES,a0 + cmp.b #CREDITS_COLOR_DEPTH,d3 ; all planes for a single line done ? + bne .loop ; no ? do the next plane + + movem.l (sp)+,d2-d5/a0 + rts + +Credits: + + lea foregroundBitplanes1,a0 + move.l #0,d0 + move.l #256,d1 + move.l #0,d2 + jsr FillColor + + bsr RenderText + + jsr WaitVerticalBlank + ;; poke bitplane pointers + lea foregroundBitplanes1,a1 + lea copperListBplPtr(pc),a2 + moveq #CREDITS_COLOR_DEPTH-1,d0 +.bitplaneloop: + move.l a1,d1 + move.w d1,2(a2) + swap d1 + move.w d1,6(a2) + lea BITPLANE_WIDTH_BYTES(a1),a1 ; bit plane data is interleaved + addq #8,a2 + dbra d0,.bitplaneloop + + move.w #(RASTER_X_START/2-SCREEN_RES)-8,DDFSTRT(a6) + move.w #(RASTER_X_START/2-SCREEN_RES)+(8*((SCREEN_WIDTH/16)-1)),DDFSTOP(a6) + + 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 #BITPLANE_WIDTH_BYTES*CREDITS_COLOR_DEPTH-SCREEN_WIDTH_BYTES-2,BPL1MOD(a6) + move.w #BITPLANE_WIDTH_BYTES*CREDITS_COLOR_DEPTH-SCREEN_WIDTH_BYTES-2,BPL2MOD(a6) + + move.w #(CREDITS_COLOR_DEPTH<<12)|$200,BPLCON0(a6) + move.w #0,BPLCON1(a6) + + move.w #0,COLOR00(a6) + move.w #$F00,COLOR06(a6) + + ;; install copper list, then enable dma + lea copperList(pc),a0 + move.l a0,COP1LC(a6) + + jsr WaitForJoystick + + rts + + +RenderText: + lea credits,a1 + + move.w #80,d0 + move.w #20,d1 +.loop: + cmp.b #0,(a1) + beq .done + lea foregroundBitplanes1,a0 + jsr DrawWSMaskedText8 +.findNull: + cmp.b #0,(a1)+ + bne .findNull + add.w #10,d1 + bra .loop +.done: + rts + + +credits: + dc.b " BLOCKY SKIES " + dc.b 0 + dc.b " ------------ " + dc.b 0 + dc.b " " + dc.b 0 + dc.b "GAME DESIGN - NOBODY" + dc.b 0 + dc.b "GRAPHICS - NOBODY" + dc.b 0 + dc.b "MUSIC - SOMEBODY" + dc.b 0 + dc.b "CODE - ALPINE9000" + dc.b 0 + dc.b "TRACKLOADER - PHOTON/SCOOPEX" + dc.b 0 + dc.b " " + dc.b 0 + dc.b " " + dc.b 0 + dc.b " THANKS " + dc.b 0 + dc.b " ------" + dc.b 0 + dc.b "WIN-UAE - TONI WILEN" + dc.b 0 + dc.b "FS-UAE - FrodeSolheim" + dc.b 0 + dc.b "VASM/VLINK - PHX/Volker" + align 4 +copperList: +copperListBplPtr: + dc.w BPL1PTL,0 + dc.w BPL1PTH,0 + dc.w BPL2PTL,0 + dc.w BPL2PTH,0 + dc.w BPL3PTL,0 + dc.w BPL3PTH,0 + dc.w BPL4PTL,0 + dc.w BPL4PTH,0 + dc.w BPL5PTL,0 + dc.w BPL5PTH,0 + dc.w BPL6PTL,0 + dc.w BPL6PTH,0 + dc.l $fffffffe + \ No newline at end of file diff --git a/028.bs/game1.s b/028.bs/game1.s index b6eb39e..0d10f06 100644 --- a/028.bs/game1.s +++ b/028.bs/game1.s @@ -46,7 +46,7 @@ Entry: move.l a3,LVL3_INT_VECTOR jsr StartMusic - jsr ShowSplash + jsr ShowSplash MainMenu: jsr ShowMenu diff --git a/028.bs/menu.s b/028.bs/menu.s index 22671bf..b4793e5 100644 --- a/028.bs/menu.s +++ b/028.bs/menu.s @@ -8,6 +8,7 @@ SPLASH_SCREEN_WIDTH_BYTES equ 40 PLAY_COPPER_WORD equ $bad1 MUSIC_COPPER_WORD equ PLAY_COPPER_WORD+$2000 DIFFICULTY_COPPER_WORD equ PLAY_COPPER_WORD+$1000 +CREDITS_COPPER_WORD equ PLAY_COPPER_WORD+$3000 MENU_SELECTED_TOP_COLOR equ $be0 ;$e71 MENU_SELECTED_BOTTOM_COLOR equ $9d4 ;$fe7 @@ -136,7 +137,6 @@ ToggleMusic: ToggleDifficulty: add.l #4,nextLevelInstaller cmp.l #levelInstallers+8,nextLevelInstaller - bra RefreshDifficulty ble RefreshDifficulty move.l #levelInstallers,nextLevelInstaller RefreshDifficulty: @@ -169,7 +169,9 @@ ButtonPressed: cmp.w #MUSIC_COPPER_WORD,selectedStartPtr beq .musicButton cmp.w #DIFFICULTY_COPPER_WORD,selectedStartPtr - beq .difficultyButton + beq .difficultyButton + cmp.w #CREDITS_COPPER_WORD,selectedStartPtr + beq .creditsButton bra .done .difficultyButton: bsr ToggleDifficulty @@ -177,6 +179,9 @@ ButtonPressed: .musicButton: bsr ToggleMusic bra .done +.creditsButton: + jsr Credits + bra ShowMenu .done: bra _ProcessJoystick .playButton: