diff --git a/mist/Makefile b/mist/Makefile index 607cbc8c..485bbaea 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -203,7 +203,7 @@ selena.o: selena.s zp.inc hardware.inc common_defines.inc \ keyboard.s \ draw_pointer.s \ speaker_beeps.s \ - selena_organ_puzzle.s \ + selena_organ_puzzle.s selena_sound_puzzle.s \ gr_copy.s audio.s text_print.s decompress_fast_v2.s ca65 -o selena.o selena.s -l selena.lst diff --git a/mist/default_save.s b/mist/default_save.s index def81b04..339eb42e 100644 --- a/mist/default_save.s +++ b/mist/default_save.s @@ -41,7 +41,7 @@ ; Selena .byte LOAD_SELENA ; WHICH_LOAD = $80 .byte DIRECTION_N ; DIRECTION = $81 -.byte SELENA_WALKWAY1 ; LOCATION = $82 +.byte SELENA_ANTENNA_STEPS ; LOCATION = $82 .endif @@ -121,5 +121,17 @@ .byte $00 ; HOLDING_ITEM = $C7 .byte $00 ; BOILER_VALVE = $C8 .byte $00 ; TRUNK_STATE = $C9 +.byte $00 ; SELENA_BUTTON_STATUS = $CA +.byte $00 ; SELENA_ANTENNA1 = $CB +.byte $00 ; SELENA_ANTENNA2 = $CC +.byte $00 ; SELENA_ANTENNA3 = $CD +.byte $00 ; SELENA_ANTENNA4 = $CE +.byte $00 ; SELENA_ANTENNA5 = $CF +.byte $00 ; SELENA_LOCK1 = $D0 +.byte $00 ; SELENA_LOCK2 = $D1 +.byte $00 ; SELENA_LOCK3 = $D2 +.byte $00 ; SELENA_LOCK4 = $D3 +.byte $00 ; SELENA_LOCK5 = $D4 +.byte $00 ; SELENA_ANTENNA_ACTIVE = $D5 .endif diff --git a/mist/graphics_selena/antenna_close_w.png b/mist/graphics_selena/antenna_close_w.png index ef0f685b..bdf54cb7 100644 Binary files a/mist/graphics_selena/antenna_close_w.png and b/mist/graphics_selena/antenna_close_w.png differ diff --git a/mist/graphics_selena/antenna_scenes.png b/mist/graphics_selena/antenna_scenes.png new file mode 100644 index 00000000..20cf02e2 Binary files /dev/null and b/mist/graphics_selena/antenna_scenes.png differ diff --git a/mist/leveldata_selena.inc b/mist/leveldata_selena.inc index 2623d61c..68a1f464 100644 --- a/mist/leveldata_selena.inc +++ b/mist/leveldata_selena.inc @@ -781,7 +781,7 @@ location42: .byte $ff ; north exit_dir .byte $ff ; south exit_dir .byte DIRECTION_S ; east exit_dir - .byte DIRECTION_W ; west exit_dir + .byte DIRECTION_W|DIRECTION_SPLIT ; west exit_dir .word $0000 ; north bg .word $0000 ; south bg .word antenna_e_lzsa ; east bg diff --git a/mist/link_book_mist_dock.s b/mist/link_book_mist_dock.s index 9e3f7377..39835c3a 100644 --- a/mist/link_book_mist_dock.s +++ b/mist/link_book_mist_dock.s @@ -8,8 +8,10 @@ mist_link_book: and #SOUND_MOCKINGBOARD beq skip_turn_off_music - sei + sei ; disable interrupts + jsr clear_ay_both + skip_turn_off_music: ; clear screen diff --git a/mist/playthrough_save.inc b/mist/playthrough_save.inc index 7746175d..facb5beb 100644 --- a/mist/playthrough_save.inc +++ b/mist/playthrough_save.inc @@ -94,3 +94,16 @@ .byte $00 ; BOILER_VALVE = $C8 .byte $00 ; TRUNK_STATE = $C9 +.byte $00 ; SELENA_BUTTON_STATUS = $CA +.byte $00 ; SELENA_ANTENNA1 = $CB +.byte $00 ; SELENA_ANTENNA2 = $CC +.byte $00 ; SELENA_ANTENNA3 = $CD +.byte $00 ; SELENA_ANTENNA4 = $CE +.byte $00 ; SELENA_ANTENNA5 = $CF +.byte $00 ; SELENA_LOCK1 = $D0 +.byte $00 ; SELENA_LOCK2 = $D1 +.byte $00 ; SELENA_LOCK3 = $D2 +.byte $00 ; SELENA_LOCK4 = $D3 +.byte $00 ; SELENA_LOCK5 = $D4 +.byte $00 ; SELENA_ANTENNA_ACTIVE = $D5 + diff --git a/mist/selena.s b/mist/selena.s index b5e37398..d06a6230 100644 --- a/mist/selena.s +++ b/mist/selena.s @@ -97,54 +97,29 @@ game_loop: ;==================================== lda LOCATION + cmp #SELENA_CONTROLS beq controls_animation + cmp #SELENA_BOOK_OPEN beq mist_book_animation + cmp #SELENA_WATER beq fg_draw_blue_page + cmp #SELENA_CRYSTAL_CLOSE beq fg_draw_red_page + cmp #SELENA_ANTENNA_CLOSE + beq fg_draw_antenna_panel + jmp nothing_special mist_book_animation: - ; handle animated linking book - - lda ANIMATE_FRAME - cmp #6 - bcc mist_book_good ; blt - - lda #0 - sta ANIMATE_FRAME - -mist_book_good: - - asl - tay - lda mist_movie,Y - sta INL - lda mist_movie+1,Y - sta INH - - lda #24 - sta XPOS - lda #12 - sta YPOS - - jsr put_sprite_crop - - lda FRAMEL - and #$f - bne done_animate_mist_book - - inc ANIMATE_FRAME - -done_animate_mist_book: + jsr draw_mist_animation jmp nothing_special - controls_animation: ldy #LOCATION_SPECIAL_EXIT @@ -207,6 +182,12 @@ fg_draw_red_page: jsr draw_red_page jmp nothing_special +fg_draw_antenna_panel: + jsr draw_antenna_panel + + jmp nothing_special + + nothing_special: ;==================================== @@ -334,6 +315,47 @@ no_draw_page: rts + ;=============================== + ; draw mist book animation + ;=============================== + +draw_mist_animation: + ; handle animated linking book + + lda ANIMATE_FRAME + cmp #6 + bcc mist_book_good ; blt + + lda #0 + sta ANIMATE_FRAME + +mist_book_good: + + asl + tay + lda mist_movie,Y + sta INL + lda mist_movie+1,Y + sta INH + + lda #24 + sta XPOS + lda #12 + sta YPOS + + jsr put_sprite_crop + + lda FRAMEL + and #$f + bne done_animate_mist_book + + inc ANIMATE_FRAME + +done_animate_mist_book: + jmp nothing_special + + + ;============================== ; tunnel actions tunnel_main_down: @@ -378,7 +400,7 @@ keypad_press: ; puzzles .include "selena_organ_puzzle.s" - + .include "selena_sound_puzzle.s" ; linking books .include "link_book_mist.s" diff --git a/mist/selena_sound_puzzle.s b/mist/selena_sound_puzzle.s new file mode 100644 index 00000000..5f80e759 --- /dev/null +++ b/mist/selena_sound_puzzle.s @@ -0,0 +1,320 @@ + +; the sounds + +; click button, it goes in, background of yellow/black glows + +; #1 switch in forest, drips in pool -- running water +; #2 switch, chasm with fire -- fire noise +; #3 switch, by clocks, -- ticking and ringing +; #4 switch, crystals -- flute +; #5 switch, entrance to tunnel -- wind + +; the puzzle in the panel +; line up pointer with dish +; buttons blink when close to point proper dir +; when source selected, only makes noise from that source + +; on display, display is degrees wide (217->187 = 30 degrees, so 12 images?) + +; #1 pool -- 153.4 +; #2 chasm -- 130.3 +; #3 clock -- 55.6 +; #4 crystals -- 15.0 +; #5 tunnel -- 212.2 + +; press sum button, goes to each in turn (on display and numbers, not yellow) +; 15, 153, 212, 130, 55 +; crystals, pool, tunnel, chasm, clock + + +; variables +; SELENA_BUTTON_STATUS (bitmask) +; SELENA_ANTENNA_ACTIVE 0..4 +; SELENA_ANTENNA1-5 (value 0..11 for each) +; SELENA_LOCK1-5 +; SELENA_SUB ???? + + +draw_antenna_panel: + + ; draw lit button + + lda SELENA_ANTENNA_ACTIVE + tay + + lda antenna_icon_xs,Y + sta XPOS + lda #34 + sta YPOS + tya + asl + tay + lda antenna_icons,Y + sta INL + lda antenna_icons+1,Y + sta INH + + jsr put_sprite_crop + + ; draw screen + + lda SELENA_ANTENNA_ACTIVE + tay + lda SELENA_ANTENNA1,Y + tay + + lda antenna_display_ys,Y + sta YPOS + lda #15 + sta XPOS + tya + asl + tay + lda antenna_display,Y + sta INL + lda antenna_display+1,Y + sta INH + + jsr put_sprite_crop + + + + ; print angle + + ; line 21 is at #$650 + + lda #$50 + sta OUTL + lda #$7 + clc + adc DRAW_PAGE + sta OUTH + ldy #17 + + lda SELENA_ANTENNA_ACTIVE + asl + asl ; multiply by 4 + tax + + lda antenna_angles,X + ora #$80 + sta (OUTL),Y + iny + lda antenna_angles+1,X + ora #$80 + sta (OUTL),Y + iny + lda antenna_angles+2,X + ora #$80 + sta (OUTL),Y + iny + iny ; skip decimal point + lda antenna_angles+3,X + ora #$80 + sta (OUTL),Y + + ; draw sound effect text + + +antenna_default_sound: + + lda #sound0_static + +antenna_print_sound: + sta OUTH + + jsr move_and_print + + rts + + + + +sound_names: + +sound0_static: + .byte 16,21,"[STATIC]",0 + +sound1_water: + .byte 12,21,"[RUNNING WATER]",0 + +sound2_flame: + .byte 13,21,"[ROARING FIRE]",0 + +sound3_clocks: + .byte 12,21,"[CLOCK TICKING]",0 + +sound4_crystals: + .byte 10,21,"[FLUTE-LIKE WHISTLE]",0 + +sound5_tunnel: + .byte 13,21,"[RUSHING WIND]",0 + + +antenna_angles: + .byte "0000" ; 0 = 0 + .byte "0150" ; 1 = 30 15.0 crystal + .byte "0556" ; 2 = 60 55.6 clock + .byte "0900" ; 3 = 90 + .byte "1303" ; 4 = 120 130.3 chasm + .byte "1534" ; 5 = 150 153.4 pool + .byte "1800" ; 6 = 180 + .byte "2122" ; 7 = 210 212.2 tunnel + .byte "2400" ; 8 = 240 + .byte "2700" ; 9 = 270 + .byte "3000" ; 10 = 300 + .byte "3300" ; 11 = 330 + +antenna_icon_xs: + .byte 8,13,18,23,27 + +antenna_icons: + .word icon_water_sprite + .word icon_flame_sprite + .word icon_clock_sprite + .word icon_crystal_sprite + .word icon_tunnel_sprite + +icon_water_sprite: + .byte 4,3 + .byte $dd,$dd,$d0,$dd + .byte $dd,$dd,$d0,$dd + .byte $0d,$d0,$0d,$d0 + +icon_flame_sprite: + .byte 4,3 + .byte $dd,$dd,$d0,$dd + .byte $d0,$0d,$dd,$d0 + .byte $dd,$dd,$d0,$0d + +icon_clock_sprite: + .byte 4,3 + .byte $d0,$dd,$0d,$dd + .byte $00,$dd,$dd,$0d + .byte $00,$d0,$dd,$0d + +icon_crystal_sprite: + .byte 3,3 + .byte $dd,$0d,$dd + .byte $dd,$00,$dd + .byte $dd,$d0,$dd + +icon_tunnel_sprite: + .byte 4,3 + .byte $d0,$0d,$dd,$0d + .byte $dd,$00,$00,$dd + .byte $0d,$00,$00,$0d + +antenna_display_ys: + .byte 4+6, 0+6, 0+6 + .byte 4+6, 2+6, 6+6 + .byte 10+6, 2+6, 8+6 + .byte 10+6,10+6,10+6 + +antenna_display: + .word antenna_display0_sprite + .word antenna_display1_sprite + .word antenna_display2_sprite + .word antenna_display3_sprite + .word antenna_display4_sprite + .word antenna_display5_sprite + .word antenna_display6_sprite + .word antenna_display7_sprite + .word antenna_display8_sprite + .word antenna_display9_sprite + .word antenna_display10_sprite + .word antenna_display11_sprite + +antenna_display0_sprite: + .byte 9,5 + .byte $66,$66,$66,$66,$66,$66,$56,$66,$66 + .byte $66,$b6,$66,$66,$66,$66,$55,$56,$86 + .byte $66,$bb,$66,$66,$99,$56,$85,$88,$88 + .byte $66,$bb,$55,$66,$85,$88,$88,$88,$88 + .byte $86,$8b,$85,$88,$88,$88,$88,$88,$88 + + +antenna_display1_sprite: + .byte 9,7 + .byte $66,$66,$66,$66,$66,$bb,$66,$66,$66 + .byte $66,$66,$66,$66,$66,$bb,$66,$66,$66 + .byte $86,$66,$66,$33,$56,$bb,$66,$66,$bb + .byte $88,$86,$56,$55,$55,$bb,$66,$66,$bb + .byte $88,$55,$55,$55,$55,$bb,$66,$66,$5b + .byte $55,$55,$55,$55,$55,$55,$66,$66,$55 + .byte $55,$55,$55,$85,$88,$65,$66,$66,$65 + +antenna_display2_sprite: + .byte 9,7 + .byte $66,$66,$66,$55,$55,$66,$56,$55,$66 + .byte $66,$66,$66,$44,$45,$66,$77,$77,$66 + .byte $66,$66,$66,$44,$44,$66,$55,$57,$66 + .byte $66,$66,$66,$44,$44,$66,$55,$55,$66 + .byte $66,$56,$66,$44,$d4,$77,$55,$55,$56 + .byte $56,$88,$86,$44,$11,$77,$55,$55,$55 + .byte $88,$88,$88,$87,$71,$87,$88,$88,$88 + +antenna_display3_sprite: + .byte 9,5 + .byte $56,$66,$66,$66,$66,$66,$66,$66,$66 + .byte $55,$57,$76,$66,$66,$66,$66,$66,$66 + .byte $55,$55,$57,$66,$77,$66,$66,$86,$66 + .byte $85,$55,$55,$57,$55,$57,$56,$88,$88 + .byte $88,$88,$85,$85,$85,$88,$85,$55,$55 + +antenna_display4_sprite: + .byte 9,6 + .byte $66,$66,$66,$66,$96,$96,$96,$66,$66 + .byte $66,$66,$66,$66,$59,$56,$59,$66,$66 + .byte $11,$11,$11,$11,$11,$44,$94,$91,$11 + .byte $11,$11,$11,$11,$11,$54,$44,$99,$11 + .byte $11,$88,$88,$11,$11,$55,$54,$54,$51 + .byte $81,$88,$88,$88,$85,$85,$85,$85,$85 + +antenna_display5_sprite: + .byte 9,4 + .byte $11,$66,$66,$66,$66,$66,$66,$66,$66 + .byte $11,$66,$66,$88,$88,$88,$88,$86,$66 + .byte $51,$55,$86,$88,$88,$88,$88,$88,$88 + .byte $85,$88,$88,$88,$88,$88,$88,$88,$88 + +antenna_display6_sprite: + .byte 9,2 + .byte $88,$66,$66,$66,$66,$66,$66,$66,$66 + .byte $88,$88,$66,$66,$66,$66,$66,$66,$66 + +antenna_display7_sprite: + .byte 9,6 + .byte $66,$66,$36,$66,$56,$66,$66,$66,$66 + .byte $66,$66,$3b,$66,$55,$66,$66,$66,$66 + .byte $66,$56,$53,$56,$44,$66,$66,$66,$66 + .byte $88,$88,$88,$88,$88,$88,$88,$88,$88 + .byte $88,$88,$88,$88,$88,$88,$88,$88,$88 + .byte $88,$88,$88,$88,$88,$88,$88,$88,$88 + +antenna_display8_sprite: + .byte 9,3 + .byte $88,$88,$88,$88,$88,$88,$55,$86,$58 + .byte $88,$88,$88,$88,$88,$88,$55,$55,$55 + .byte $88,$88,$88,$88,$88,$58,$55,$55,$55 + +antenna_display9_sprite: + .byte 9,2 + .byte $86,$66,$66,$66,$66,$66,$66,$66,$66 + .byte $88,$86,$86,$86,$66,$66,$66,$86,$88 + +antenna_display10_sprite: + .byte 9,2 + .byte $86,$86,$66,$66,$66,$66,$66,$66,$66 + .byte $88,$88,$88,$88,$88,$88,$86,$86,$86 + +antenna_display11_sprite: + .byte 9,2 + .byte $55,$86,$86,$86,$86,$86,$86,$86,$66 + .byte $88,$88,$88,$88,$88,$88,$88,$88,$88 + + + + diff --git a/mist/zp.inc b/mist/zp.inc index a79145c0..b0e3704d 100644 --- a/mist/zp.inc +++ b/mist/zp.inc @@ -64,7 +64,9 @@ ENVELOPE_SHAPE = $7D PATTERN_L = $7E PATTERN_H = $7F -; note: rest are up at $d0 +; note 70-7f also used by disk code + +; note: rest are up at $f0 ; We have to save/restore the following values ; when loading/storing from disk @@ -238,23 +240,34 @@ TRUNK_STATE = $C9 ; trunk state in stonsehip TRUNK_KEY_TAKEN = $04 TRUNK_HATCH_OPEN = $08 -END_OF_SAVE = $CA +SELENA_BUTTON_STATUS = $CA + SELENA_BUTTON1 = $01 + SELENA_BUTTON2 = $02 + SELENA_BUTTON3 = $04 + SELENA_BUTTON4 = $08 + SELENA_BUTTON5 = $10 + + +SELENA_ANTENNA1 = $CB +SELENA_ANTENNA2 = $CC +SELENA_ANTENNA3 = $CD +SELENA_ANTENNA4 = $CE +SELENA_ANTENNA5 = $CF + +SELENA_LOCK1 = $D0 +SELENA_LOCK2 = $D1 +SELENA_LOCK3 = $D2 +SELENA_LOCK4 = $D3 +SELENA_LOCK5 = $D4 + +SELENA_ANTENNA_ACTIVE = $D5 + +END_OF_SAVE = $D6 ; done game puzzle state -; rest of pt3_player -ORNAMENT_L = $D0 -ORNAMENT_H = $D1 -SAMPLE_L = $D2 -SAMPLE_H = $D3 -LOOP = $D4 -MB_VALUE = $D5 -MB_ADDR_L = $D6 -MB_ADDR_H = $D7 -DONE_PLAYING = $D8 -DONE_SONG = $D9 -PT3_TEMP = $DA + JOYSTICK_ENABLED= $DD @@ -273,14 +286,25 @@ LONG_FRAME = $E4 DISP_PAGE = $ED ; ALL DRAW_PAGE = $EE ; ALL +; rest of pt3_player +PT3_TEMP = $EF +ORNAMENT_L = $F0 +ORNAMENT_H = $F1 +SAMPLE_L = $F2 +SAMPLE_H = $F3 +LOOP = $F4 +MB_VALUE = $F5 +MB_ADDR_L = $F6 +MB_ADDR_H = $F7 +DONE_PLAYING = $F8 +DONE_SONG = $F9 -TINL = $F0 -TINH = $F1 -BINL = $F2 -BINH = $F3 +;TINL = $F0 +;TINH = $F1 +;BINL = $F2 +;BINH = $F3 +;SCROLL_COUNT = $F9 - -SCROLL_COUNT = $F9 TEMP = $FA TEMPY = $FB INL = $FC