diff --git a/00TheFool.inc b/00TheFool.inc index 40627ed..551aa5b 100644 --- a/00TheFool.inc +++ b/00TheFool.inc @@ -26,26 +26,32 @@ def Card_Offset_functions equ @-TheFool dw .fUpdate dw .fDraw -; CARD_VARS_START: timer -; CARD_VARS_START+2: timer 2 -; CARD_VARS_START+4: animation frame for dog -; CARD_VARS_START+5: -; CARD_VARS_START+6: frame of zero -; CARD_VARS_START+7: +; CVS: timer for dog +; CVS+2: frame for dog +; CVS+3: timer for zero +; CVS+5: frame for zero +; CVS+6: timer for cloud 1 +; CVS+8: frame for cloud 1 +; CVS+9: timer for cloud 2 +; CVS+11: frame for cloud 2 .fInit: - ld a, [rLCDC] - and a, %1111_1011 - ld [rLCDC], a - ld hl, CARD_VARS_START + ld hl, CVS ld a, 0 - ld [hl+], a ; timer for dog @ +0 + ld [hl+], a ; CVS: timer for dog ld [hl+], a - ld [hl+], a ; timer for big zero @ +2 - ld [hl+], a - ld [hl+], a ; frame of dog animation - ld [hl+], a - ld [hl+], a ; frame of zero animation + ld [hl+], a ; CVS+2: frame for dog + ld [hl+], a ; CVS+3: timer for zero ld [hl+], a + ld [hl+], a ; CVS+5: frame for zero + ld [hl+], a ; CVS+6: timer for cloud 1 + ld [hl+], a + ld [hl+], a ; CVS+8: frame for cloud 1 + ld [hl+], a ; CVS+9: timer for cloud 2 + ld [hl+], a + ld [hl+], a ; CVS+11: frame for cloud 2 + ld [hl+], a ; CVS+12: timer for cloud 3 + ld [hl+], a + ld [hl+], a ; CVS+14: frame for cloud 3 ld hl, .doggie1 ld de, MY_OAM @@ -59,57 +65,137 @@ def Card_Offset_functions equ @-TheFool ; y and x in b and c ; height and width in a & %11110000 and a & %00001111 ??? that's deranged call BuildMetaSprite + + ld hl, .zero + ld de, MY_OAM + 6*4 ; we've already written six sprites for the doggie, 4 bytes each + ld bc, $100*26+41 + ld a, $22 ; two by two + call BuildMetaSprite + + + ; set up the palette for the clouds + ld hl, rOBP1 + ld [hl], %00_10_01_11 + + ld hl, .cloud1 + ; six sprites for the doggie, four for the zero, 4 bytes each + ld de, MY_OAM + 10*4 + ld bc, 73*$100 + 15 + ld a, $13 ; one by three + call BuildMetaSprite + ; set those three sprites to use OBP palette 1 + ld hl, MY_OAM + 10*4 + 3 + set 4, [hl] + ld hl, MY_OAM + 11*4 + 3 + set 4, [hl] + ld hl, MY_OAM + 12*4 + 3 + set 4, [hl] + + ld hl, .cloud2 + ; six sprites for the doggie, four for the zero, 4 bytes each + ld de, MY_OAM + 13*4 + ld bc, 84*$100 + 58 + ld a, $13 ; one by three + call BuildMetaSprite + ld hl, MY_OAM + 13*4 + 3 + set 4, [hl] + ld hl, MY_OAM + 14*4 + 3 + set 4, [hl] + ld hl, MY_OAM + 15*4 + 3 + set 4, [hl] + + ld hl, .cloud3 + ld de, MY_OAM + 16*4 + ld bc, 90*$100 + 67 + ld a, $11 + call BuildMetaSprite + ld hl, MY_OAM + 16*4+3 + set 4, [hl] + ret .fUpdate: - ld hl, CARD_VARS_START + ld hl, CVS call IncrementTimer - ld a, [CARD_VARS_START+1] + ld a, [CVS+1] ; checking the high byte of the timer cp a, 06 ; $10 00 = 1 second - jp c, .doneWithTimer1 ; if the timer is less than $0800, skip to end + jp c, .doneWithTimer1 ; if the timer is less than $0600, skip - ;otherwise reset the timer + ; if the timer is greater or equal to $0600, reset it ld a, 0 - ld [CARD_VARS_START], a - ld [CARD_VARS_START+1], a - ; and make the dog dance - - call .dogDance - + ld [CVS], a + ld [CVS+1], a + call .dogDance ; and make the dog dance .doneWithTimer1 - ld hl, CARD_VARS_START+2 + + ld hl, CVS+3 call IncrementTimer - ld a, [CARD_VARS_START+2+1] - cp a, $02 ; $10 00 = 1 second - jp c, .doneWithTimer2 ; if the timer is less than $0800, skip to end + ld a, [CVS+3+1] ; check the high byte of the zero sprite timer + cp a, $30 ; $10 00 = 1 second + jp c, .doneWithTimer2 - ;otherwise reset the timer ld a, 0 - ld [CARD_VARS_START+2], a - ld [CARD_VARS_START+2+1], a - + ld [CVS+3], a + ld [CVS+3+1], a call .zeroRotate - .doneWithTimer2 + + ld hl, CVS+6 + call IncrementTimer + + ld a, [CVS+6+1] + cp a, $20 + jp c, .doneWithTimer3 + + ld a, 0 + ld [CVS+6], a + ld [CVS+6+1], a + call .cloud1Move +.doneWithTimer3 + + ld hl, CVS+9 + call IncrementTimer + + ld a, [CVS+9+1] + cp a, $20 + jp c, .doneWithTimer4 + + ld a, 0 + ld [CVS+9], a + ld [CVS+9+1], a + call .cloud2Move +.doneWithTimer4 + + ld hl, CVS+12 + call IncrementTimer + + ld a, [CVS+12+1] + cp a, $60 + jp c, .doneWithTimer5 + + ld a, 0 + ld [CVS+12], a + ld [CVS+12+1], a + call .cloud3Move +.doneWithTimer5 ret .dogDance: - ld a, [CARD_VARS_START+4] ; dog animation frame + ld a, [CVS+2] ; dog animation frame inc a cp a, 2 jp nz, :+ ld a, 0 ; zero the frame if it was 2 : - ld [CARD_VARS_START+4], a + ld [CVS+2], a cp a, 0 jp z, .frame1 cp a, 1 jp z, .frame2 ret ; shouldn't ever hit this - .frame1 ld hl, .doggie1 ld de, MY_OAM @@ -132,13 +218,20 @@ def Card_Offset_functions equ @-TheFool ld a, $23 call BuildMetaSprite ret +.doggie1: ; tiles start at 0 + db $01, $02, $03 + db $04, $08, $06 +.doggie2: + db $01, $02, $07 + db $04, $05, $09 + .zeroRotate: ld hl, .zeroCoords - ld a, [CARD_VARS_START + 6] + ld a, [CVS+5] inc a call ArrayClampLooping - ld [CARD_VARS_START + 6], a + ld [CVS+5], a ld b, 0 ld c, a @@ -160,10 +253,113 @@ def Card_Offset_functions equ @-TheFool ; height and width in a & %11110000 and a & %00001111 ??? that's deranged call BuildMetaSprite ret - +.zero: + db $0a, $0b + db $0c, $0d .zeroCoords: ; length-prefixed list of y, x db 4, 26, 41, 27, 42, 26, 43, 25, 42 + +.cloud1Move: + ld hl, .cloud1Anim + ld a, [CVS+8] + inc a + call ArrayClampLooping + ld [CVS+8], a + ld b, 0 + ld c, a + + ld hl, .cloud1Anim+1 + add hl, bc ; add bc twice (it's a list of pairs) to jump to the bc'th element + add hl, bc ; of the list + ld b, [hl] ; load y into b + inc hl + ld c, [hl] ; load x into c + + + ld hl, .cloud1 + ; six sprites for the doggie, four for the zero, 4 bytes each + ld de, MY_OAM + 10*4 + ld a, $13 ; two by two + ; location of source tile map: hl + ; location in memory to write to: de + ; y and x in b and c (set above) + ; height and width in a & %11110000 and a & %00001111 ??? that's deranged + call BuildMetaSprite + ret +.cloud1: + db $0e, $0f, $10 +.cloud1Anim: + db 9, 73, 15, 73, 15, 73, 16, 73, 17, 73, 18, 73, 19, 73, 18, 73, 17, 73, 16, + +.cloud2Move: + ld hl, .cloud2Anim + ld a, [CVS+11] + inc a + call ArrayClampLooping + ld [CVS+11], a + + ld b, 0 + ld c, a + + ld hl, .cloud2Anim+1 + add hl, bc ; add bc twice (it's a list of pairs) to jump to the bc'th element + add hl, bc ; of the list + ld b, [hl] ; load y into b + inc hl + ld c, [hl] ; load x into c + + + ld hl, .cloud2 + ; six sprites for the doggie, four for the zero, 4 bytes each + ld de, MY_OAM + 13*4 + ld a, $13 ; two by two + ; location of source tile map: hl + ; location in memory to write to: de + ; y and x in b and c (set above) + ; height and width in a & %11110000 and a & %00001111 ??? that's deranged + call BuildMetaSprite + ret +.cloud2: + db $11, $12, $13 +.cloud2Anim: + db 4, 84, 58, 84, 59, 84, 60, 84, 59, + +.cloud3Move: + ld hl, .cloud3Anim + ld a, [CVS+14] + inc a + call ArrayClampLooping + ld [CVS+14], a + + ld b, 0 + ld c, a + + ld hl, .cloud3Anim+1 + add hl, bc ; add bc twice (it's a list of pairs) to jump to the bc'th element + add hl, bc ; of the list + ld b, [hl] ; load y into b + inc hl + ld c, [hl] ; load x into c + + + ld hl, .cloud3 + ; six sprites for the doggie, four for the zero, 4 bytes each + ld de, MY_OAM + 16*4 + ld a, $11 + ; location of source tile map: hl + ; location in memory to write to: de + ; y and x in b and c (set above) + ; height and width in a & %11110000 and a & %00001111 ??? that's deranged + call BuildMetaSprite + ret +.cloud3: + db $14 +.cloud3Anim: + db 2, 90, 66, 90, 67, + + + .fDraw: ret @@ -185,18 +381,15 @@ def Card_Offset_functions equ @-TheFool db $00,$00,$c0,$c0,$e0,$e0,$30,$30,$18,$18,$18,$18,$0c,$0c,$0c,$0c db $30,$30,$30,$30,$18,$18,$18,$18,$0c,$0c,$07,$07,$03,$03,$00,$00 db $0c,$0c,$0c,$0c,$18,$18,$18,$18,$30,$30,$e0,$e0,$c0,$c0,$00,$00 + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$07,$00,$3f + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$07,$00,$1f,$00,$ff,$00,$ff + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$00,$c0,$00,$f0,$00,$fc + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$07 + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$78,$00,$ff,$00,$ff + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$c0,$00,$f0 + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$ff .SpriteTilesEnd: -.doggie1: ; tiles start at 0 - db $01, $02, $03 - db $04, $08, $06 -.doggie2: - db $01, $02, $07 - db $04, $05, $09 - -.zero: - db $0a, $0b - db $0c, $0d .KeyArtTiles: db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 diff --git a/00thefool.aseprite b/00thefool.aseprite index 8e49e04..2d48899 100644 Binary files a/00thefool.aseprite and b/00thefool.aseprite differ diff --git a/01themagician.aseprite b/01themagician.aseprite index 7de7e09..e45f5f4 100644 Binary files a/01themagician.aseprite and b/01themagician.aseprite differ diff --git a/CardHelpers.inc b/CardHelpers.inc index 9d888a5..34fe1f2 100644 --- a/CardHelpers.inc +++ b/CardHelpers.inc @@ -155,6 +155,9 @@ LoadCardDataAsync: ret CardInit: + ld a, [rLCDC] + and a, %1111_1011 + ld [rLCDC], a call CARD_INIT - 1 ret diff --git a/SpriteTiles.asm b/SpriteTiles.asm index a9e5837..6364e08 100644 --- a/SpriteTiles.asm +++ b/SpriteTiles.asm @@ -17,6 +17,13 @@ SpriteTiles: db $00,$00,$c0,$c0,$e0,$e0,$30,$30,$18,$18,$18,$18,$0c,$0c,$0c,$0c db $30,$30,$30,$30,$18,$18,$18,$18,$0c,$0c,$07,$07,$03,$03,$00,$00 db $0c,$0c,$0c,$0c,$18,$18,$18,$18,$30,$30,$e0,$e0,$c0,$c0,$00,$00 + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$07,$00,$3f + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$07,$00,$1f,$00,$ff,$00,$ff + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$00,$c0,$00,$f0,$00,$fc + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$07 + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$78,$00,$ff,$00,$ff + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$c0,$00,$f0 + db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$ff @@ -29,12 +36,12 @@ Sprites: db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 + db $00, $0e, $0f, $10, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 + db $00, $00, $00, $00, $00, $00, $11, $12, $13, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 - db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 + db $00, $00, $00, $00, $00, $00, $00, $14, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $01, $02, $03, $01, $02, $07, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $04, $08, $06, $04, $05, $09, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 diff --git a/curve_authoring.html b/curve_authoring.html new file mode 100644 index 0000000..a3768ce --- /dev/null +++ b/curve_authoring.html @@ -0,0 +1,258 @@ + + + + curve editor for gameboy animation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ control mode +
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+

output is a length-prefixed list of y,x pairs.

+ +
+ + + \ No newline at end of file diff --git a/main.asm b/main.asm index 86aa7e3..5e0d9a3 100644 --- a/main.asm +++ b/main.asm @@ -33,6 +33,7 @@ def GLOBAL_VARS_START equ $c400 ; defined mostly in mainmenu, program-wide state def SCREEN_VARS_START equ $c500 ; per-screen variables like animation stuff def CARD_HELPER_VARS_START equ $c600 def CARD_VARS_START equ $c700 ; variables for animation of individual cards +def CVS equ CARD_VARS_START def SHUFFLED_DECK equ $c800 ; location for the shuffled deck def ZEROES equ $D000 diff --git a/source.zip b/source.zip index e1b807b..0e99221 100644 Binary files a/source.zip and b/source.zip differ