mist: cabin/viewer, split out the number sprites for common use

This commit is contained in:
Vince Weaver 2020-07-14 00:03:01 -04:00
parent 7bc824067a
commit 2ef17c2948
6 changed files with 269 additions and 144 deletions

View File

@ -216,6 +216,7 @@ viewer.o: viewer.s zp.inc hardware.inc common_defines.inc \
common_routines.inc \
common_sprites.inc \
page_sprites.inc \
number_sprites.inc \
leveldata_viewer.inc \
viewer_controls.s \
keyboard.s \
@ -276,7 +277,8 @@ cabin.o: cabin.s zp.inc hardware.inc common_defines.inc \
draw_pointer.s \
link_book_channel.s \
marker_switch.s \
cabin_boiler_puzzle.s
cabin_boiler_puzzle.s \
number_sprites.inc
ca65 -o cabin.o cabin.s -l cabin.lst
@ -391,8 +393,25 @@ graphics_ship/ship_graphics.inc:
####
clean:
rm -f *~ *.o *.lst HELLO HELLO_DISK2 \
rm -f *~ *.o *.lst HELLO HELLO_DISK2 \
LOADER MIST_TITLE \
MIST OCTAGON VIEWER DENTIST \
MECHE SELENA SHIP STONEY CHANNEL ARBOR NIBEL \
GENERATOR
cd graphics_title && make clean
cd graphics_mist && make clean
cd graphics_octagon && make clean
cd books && make clean
cd graphics_viewer && make clean
cd graphics_meche && make clean
cd graphics_selena && make clean
cd graphics_cabin && make clean
cd graphics_channel && make clean
cd graphics_stoney && make clean
cd graphics_dentist && make clean
cd graphics_generator && make clean
cd graphics_arbor && make clean
cd graphics_nibel && make clean
cd graphics_dni && make clean
cd graphics_ship && make clean

View File

@ -242,6 +242,7 @@ exit_to_mist:
; level graphics
.include "graphics_cabin/cabin_graphics.inc"
.include "number_sprites.inc"
; puzzles
.include "marker_switch.s"

View File

@ -4,3 +4,125 @@ goto_safe:
lda #CABIN_SAFE
sta LOCATION
jmp change_location
control_panel_pressed:
lda CURSOR_Y
cmp #26 ; blt
bcc panel_inc
cmp #30 ; blt
bcc panel_dec
panel_latch:
lda VIEWER_CHANNEL
sta VIEWER_LATCHED ; latch value into pool state
lda #VIEWER_POOL
sta LOCATION
lda #DIRECTION_W
sta DIRECTION
jmp change_location
panel_inc:
lda CURSOR_X
cmp #18
bcs right_arrow_pressed
; 19-23 left arrow
lda VIEWER_CHANNEL
and #$f0
cmp #$90
bcs done_panel_press ; bge
lda VIEWER_CHANNEL
clc
adc #$10
sta VIEWER_CHANNEL
rts
right_arrow_pressed:
; 13-17 right arrow
lda VIEWER_CHANNEL
and #$f
cmp #9
bcs done_panel_press ; bge
inc VIEWER_CHANNEL
rts
panel_dec:
lda CURSOR_X
cmp #18
bcs right_arrow_pressed_dec
; 19-23 left arrow
lda VIEWER_CHANNEL
and #$f0
beq done_panel_press
lda VIEWER_CHANNEL
sec
sbc #$10
sta VIEWER_CHANNEL
rts
right_arrow_pressed_dec:
; 13-17 right arrow
lda VIEWER_CHANNEL
and #$f
beq done_panel_press
dec VIEWER_CHANNEL
done_panel_press:
rts
display_panel_code:
; ones digit
lda VIEWER_CHANNEL
and #$f
asl
tay
lda number_sprites,Y
sta INL
lda number_sprites+1,Y
sta INH
lda #21
sta XPOS
lda #8
sta YPOS
jsr put_sprite_crop
; tens digit
lda VIEWER_CHANNEL
and #$f0
lsr
lsr
lsr
tay
lda number_sprites,Y
sta INL
lda number_sprites+1,Y
sta INH
lda #15
sta XPOS
lda #8
sta YPOS
jsr put_sprite_crop
rts

124
mist/number_sprites.inc Normal file
View File

@ -0,0 +1,124 @@
number_sprites:
.word sprite_0,sprite_1,sprite_2,sprite_3,sprite_4
.word sprite_5,sprite_6,sprite_7,sprite_8,sprite_9
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_0:
.byte 3,4
.byte $AA,$0A,$AA ;
.byte $00,$AA,$00 ;
.byte $00,$AA,$00 ;
.byte $A0,$0A,$A0 ;
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_1:
.byte 3,4
.byte $AA,$0A,$AA
.byte $A0,$00,$AA
.byte $AA,$00,$AA
.byte $0A,$00,$0A
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_2:
.byte 3,4
.byte $AA,$0A,$AA
.byte $A0,$AA,$00
.byte $AA,$00,$AA
.byte $00,$0A,$0A
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_3:
.byte 3,4
.byte $AA,$0A,$AA
.byte $A0,$AA,$00
.byte $AA,$A0,$00
.byte $0A,$0A,$A0
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_4:
.byte 3,4
.byte $0A,$AA,$0A
.byte $00,$AA,$00
.byte $A0,$A0,$00
.byte $AA,$AA,$00
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..O
sprite_5:
.byte 3,4
.byte $0A,$0A,$0A
.byte $00,$AA,$AA
.byte $A0,$A0,$0A
.byte $0A,$0A,$A0
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..O
sprite_6:
.byte 3,4
.byte $AA,$0A,$0A
.byte $00,$AA,$AA
.byte $00,$A0,$0A
.byte $A0,$0A,$A0
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..O
sprite_7:
.byte 3,4
.byte $0A,$0A,$0A
.byte $AA,$AA,$00
.byte $AA,$00,$AA
.byte $00,$AA,$AA
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..O
sprite_8:
.byte 3,4
.byte $AA,$0A,$AA
.byte $00,$AA,$00
.byte $0A,$A0,$0A
.byte $A0,$0A,$A0
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..^
sprite_9:
.byte 3,4
.byte $AA,$0A,$AA
.byte $00,$AA,$00
.byte $AA,$A0,$00
.byte $0A,$0A,$A0

View File

@ -156,24 +156,9 @@ back_to_mist:
; includes
;==========================
.if 0
.include "gr_copy.s"
.include "gr_offsets.s"
.include "gr_pageflip.s"
.include "gr_putsprite_crop.s"
.include "text_print.s"
.include "gr_fast_clear.s"
.include "decompress_fast_v2.s"
.include "keyboard.s"
.include "draw_pointer.s"
.include "end_level.s"
.include "common_sprites.inc"
.include "page_sprites.inc"
.endif
; graphics
.include "graphics_viewer/viewer_graphics.inc"
.include "number_sprites.inc"
; puzzles
.include "viewer_controls.s"

View File

@ -358,132 +358,6 @@ display_panel_code:
number_sprites:
.word sprite_0,sprite_1,sprite_2,sprite_3,sprite_4
.word sprite_5,sprite_6,sprite_7,sprite_8,sprite_9
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_0:
.byte 3,4
.byte $AA,$0A,$AA ;
.byte $00,$AA,$00 ;
.byte $00,$AA,$00 ;
.byte $A0,$0A,$A0 ;
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_1:
.byte 3,4
.byte $AA,$0A,$AA
.byte $A0,$00,$AA
.byte $AA,$00,$AA
.byte $0A,$00,$0A
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_2:
.byte 3,4
.byte $AA,$0A,$AA
.byte $A0,$AA,$00
.byte $AA,$00,$AA
.byte $00,$0A,$0A
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_3:
.byte 3,4
.byte $AA,$0A,$AA
.byte $A0,$AA,$00
.byte $AA,$A0,$00
.byte $0A,$0A,$A0
; . . . . . .
; O O ^O ^ O ^ O O O
; O O O O ^O ^^O
; ^.^ .O. O.. ..^ O
sprite_4:
.byte 3,4
.byte $0A,$AA,$0A
.byte $00,$AA,$00
.byte $A0,$A0,$00
.byte $AA,$AA,$00
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..O
sprite_5:
.byte 3,4
.byte $0A,$0A,$0A
.byte $00,$AA,$AA
.byte $A0,$A0,$0A
.byte $0A,$0A,$A0
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..O
sprite_6:
.byte 3,4
.byte $AA,$0A,$0A
.byte $00,$AA,$AA
.byte $00,$A0,$0A
.byte $A0,$0A,$A0
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..O
sprite_7:
.byte 3,4
.byte $0A,$0A,$0A
.byte $AA,$AA,$00
.byte $AA,$00,$AA
.byte $00,$AA,$AA
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..O
sprite_8:
.byte 3,4
.byte $AA,$0A,$AA
.byte $00,$AA,$00
.byte $0A,$A0,$0A
.byte $A0,$0A,$A0
; ... .. ... . .
; O O O O O O O
; ^^. O^. O .^. ^O
; ..^ ^.^ O ^.^ ..^
sprite_9:
.byte 3,4
.byte $AA,$0A,$AA
.byte $00,$AA,$00
.byte $AA,$A0,$00
.byte $0A,$0A,$A0
nothing_animation:
.word empty,empty,na_frame0,na_frame1,na_frame0,empty