dos33fsprogs/games/peasant/intro.s
Vince Weaver aaeab984bf peasant: rename graphics directory
needless churn is fun
2021-10-12 21:18:40 -04:00

221 lines
3.1 KiB
ArmAsm

; Peasant's Quest Intro Sequence
; by Vince `deater` Weaver vince@deater.net
; with apologies to everyone
.include "hardware.inc"
.include "zp.inc"
.include "qload.inc"
.include "music.inc"
peasant_quest_intro:
lda #0
sta ESC_PRESSED
jsr hgr_make_tables
jsr hgr2
;*******************************
; restart music, only drum loop
;******************************
lda SOUND_STATUS
and #SOUND_MOCKINGBOARD
beq mockingboard_notfound
; hack! modify the PT3 file to ignore the latter half
lda #$ff ; end after 4 patterns
sta PT3_LOC+$C9+$4
lda #$0 ; set LOOP to 0
sta PT3_LOC+$66
jsr pt3_init_song
cli
mockingboard_notfound:
;************************
; Cottage
;************************
jsr cottage
lda ESC_PRESSED
bne escape_handler
;************************
; Lake West
;************************
jsr lake_west
lda ESC_PRESSED
bne escape_handler
;************************
; Lake East
;************************
jsr lake_east
lda ESC_PRESSED
bne escape_handler
;************************
; River
;************************
jsr river
lda ESC_PRESSED
bne escape_handler
;************************
; Knight
;************************
jsr knight
;************************
; Start actual game
;************************
jsr draw_peasant
; wait a bit
lda #10
jsr wait_a_bit
escape_handler:
;==========================
; disable music
lda SOUND_STATUS
and #SOUND_MOCKINGBOARD
beq mockingboard_notfound2
sei ; turn off music
jsr clear_ay_both ; clear AY state
jsr mockingboard_disable_interrupt
mockingboard_notfound2:
;=============================
; start new game
;=============================
start_new_game:
lda #LOAD_PEASANT2
sta WHICH_LOAD
;=========================
; init peasant position
; draw at 18,108
lda #18
sta PEASANT_X
lda #108
sta PEASANT_Y
lda #PEASANT_DIR_RIGHT
sta PEASANT_DIR
lda #0
sta PEASANT_XADD
sta PEASANT_YADD
lda #0
sta SCORE_HUNDREDS
lda #$00
sta SCORE_TENSONES
lda #4
sta MAP_X
lda #1
sta MAP_Y
lda #$00
sta INVENTORY_1
sta INVENTORY_2
lda #INV3_SHIRT
sta INVENTORY_3
; 1100 1011
lda #$00
sta INVENTORY_1_GONE
; 0001 1101
lda #$00
sta INVENTORY_2_GONE
;
lda #$0
sta INVENTORY_3_GONE
rts
;.include "decompress_fast_v2.s"
.include "wait_keypress.s"
.include "intro_cottage.s"
.include "intro_lake_w.s"
.include "intro_lake_e.s"
.include "intro_river.s"
.include "intro_knight.s"
.include "draw_peasant.s"
;.include "hgr_font.s"
;.include "draw_box.s"
;.include "hgr_rectangle.s"
;.include "hgr_1x28_sprite.s"
;.include "hgr_partial_save.s"
;.include "hgr_input.s"
;.include "hgr_tables.s"
;.include "hgr_text_box.s"
;.include "hgr_hgr2.s"
.include "hgr_1x5_sprite.s"
.include "gr_copy.s"
.include "wait.s"
.include "wait_a_bit.s"
.include "graphics_peasantry/graphics_intro.inc"
.include "graphics_peasantry/priority_intro.inc"
skip_text:
.byte 0,2,"ESC Skips",0
;===================
; print title
intro_print_title:
lda #<peasant_text
sta OUTL
lda #>peasant_text
sta OUTH
jsr hgr_put_string
lda #<skip_text
sta OUTL
lda #>skip_text
sta OUTH
jmp hgr_put_string ; tail call