diff --git a/games/sb/TODO b/games/sb/TODO index 6ea303c7..8c2c2bf2 100644 --- a/games/sb/TODO +++ b/games/sb/TODO @@ -10,8 +10,17 @@ Duck: Rat: + Exit back to main title -Asplode: -+ Lots +Strongbadzone: ++ Get audio ++ Draw Your Head A Splode ++ Create sprites for ball (24 of them?) ++ Ball movement logic. Is actually just 2D ++ Check bounds on person ++ Sprites for shield positions ++ Sprites with mask? ++ Animate side walls ++ Move head + Cliff: + Lots diff --git a/games/sb/asplode.s b/games/sb/asplode.s index 61e408a3..ddc37125 100644 --- a/games/sb/asplode.s +++ b/games/sb/asplode.s @@ -93,11 +93,47 @@ load_background: sta STRONGBAD_X sta PLAYER_X + lda #1 + sta STRONGBAD_DIR + ;========================== ; main loop ;=========================== main_loop: + inc FRAME + + + ;=========================== + ; move head + ;=========================== + + lda FRAME + and #$3 + bne no_move_head + + lda STRONGBAD_X + cmp #22 + bcs reverse_head_dir + cmp #12 + bcs no_reverse_head_dir +reverse_head_dir: + lda STRONGBAD_DIR + eor #$FF + sta STRONGBAD_DIR + inc STRONGBAD_DIR + +no_reverse_head_dir: + + clc + lda STRONGBAD_X + adc STRONGBAD_DIR + sta STRONGBAD_X + +no_move_head: + + + ;========================== ; draw head ;=========================== @@ -128,7 +164,9 @@ main_loop: check_keypress: lda KEYPRESS - bpl check_keypress +; bpl check_keypress + bpl done_keyboard_check + bit KEYRESET ; clear the keyboard strobe ; clear high bit @@ -153,7 +191,7 @@ check_keypress: done_keyboard_check: - jmp check_keypress + jmp main_loop move_left: dec PLAYER_X diff --git a/games/sb/asplode_graphics/sb_sprites.png b/games/sb/asplode_graphics/sb_sprites.png index b665a4e3..0f9a7c81 100644 Binary files a/games/sb/asplode_graphics/sb_sprites.png and b/games/sb/asplode_graphics/sb_sprites.png differ diff --git a/games/sb/asplode_graphics/sb_zone.png b/games/sb/asplode_graphics/sb_zone.png index 5e131b93..a8c106d3 100644 Binary files a/games/sb/asplode_graphics/sb_zone.png and b/games/sb/asplode_graphics/sb_zone.png differ diff --git a/games/sb/hgr_sprite_big.s b/games/sb/hgr_sprite_big.s index bf3a1724..e36835c0 100644 --- a/games/sb/hgr_sprite_big.s +++ b/games/sb/hgr_sprite_big.s @@ -1,6 +1,8 @@ ;=========================================== ; hgr draw sprite (only at 7-bit boundaries) ;=========================================== + ; can handle sprites bigger than a 256 byte page + ; SPRITE in INL/INH ; Location at SPRITE_X SPRITE_Y @@ -8,8 +10,15 @@ ; sprite AT INL/INH -hgr_draw_sprite: + ; orange = color5 1 101 0101 1 010 1010 + +hgr_draw_sprite: + lda SPRITE_X + ror + bcs hgr_draw_sprite_odd + +hgr_draw_sprite_even: ldy #0 lda (INL),Y ; load xsize clc @@ -89,3 +98,94 @@ sprite_ysize_smc: rts + + +hgr_draw_sprite_odd: + ldy #0 + lda (INL),Y ; load xsize + clc + adc SPRITE_X + sta osprite_width_end_smc+1 ; self modify for end of line + + iny ; load ysize + lda (INL),Y + sta osprite_ysize_smc+1 ; self modify + + ; point smc to sprite + lda INL ; 16-bit add + sta osprite_smc1+1 + lda INH + sta osprite_smc1+2 + + + ldx #0 ; X is pointer offset + stx CURRENT_ROW ; actual row + + ldx #2 + +ohgr_sprite_yloop: + + lda CURRENT_ROW ; row + + clc + adc SPRITE_Y ; add in cursor_y + + ; calc GBASL/GBASH + + tay ; get output ROW into GBASL/H + lda hposn_low,Y + sta GBASL + lda hposn_high,Y + + clc + adc DRAW_PAGE + sta GBASH + + ldy SPRITE_X + + clc + php ; store 0 carry on stack + +osprite_inner_loop: + + +osprite_smc1: + lda $f000,X ; load sprite data + + plp ; restore carry from last + rol ; rotate in carry + asl ; one more time, bit6 in carry + php ; save on stack + sec ; assume blur/orange + ror ; rotate it back down + + sta (GBASL),Y ; store to screen + + inx ; increment sprite offset + + ; if > 1 page + bne osprite_no_page_cross + inc osprite_smc1+2 + +osprite_no_page_cross: + + iny ; increment output position + + + +osprite_width_end_smc: + cpy #6 ; see if reached end of row + bne osprite_inner_loop ; if not, loop + + + plp ; restore stack + + inc CURRENT_ROW ; row + lda CURRENT_ROW ; row + +osprite_ysize_smc: + cmp #31 ; see if at end + bne ohgr_sprite_yloop ; if not, loop + + rts + diff --git a/games/sb/zp.inc b/games/sb/zp.inc index 1cec88e5..f75c227f 100644 --- a/games/sb/zp.inc +++ b/games/sb/zp.inc @@ -64,6 +64,7 @@ OLD_MENU_ITEM = $69 NOT_FIRST_TIME = $6A STRONGBAD_X = $6B PLAYER_X = $6C +STRONGBAD_DIR = $6D .if 0 REGISTER_DUMP = $70