2024-01-14 06:29:54 +00:00
|
|
|
; Trogdor
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
; by deater (Vince Weaver) <vince@deater.net>
|
|
|
|
|
|
|
|
|
2024-01-14 06:29:54 +00:00
|
|
|
trogdor_start:
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
;=====================
|
|
|
|
; initializations
|
|
|
|
;=====================
|
|
|
|
|
|
|
|
jsr hardware_detect
|
|
|
|
|
|
|
|
jsr hgr_make_tables
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta DRAW_PAGE
|
|
|
|
|
|
|
|
;==================================
|
|
|
|
; load music into the language card
|
|
|
|
; into $D000 set 1
|
|
|
|
;==================================
|
|
|
|
|
|
|
|
; read/write RAM, use $d000 bank1
|
|
|
|
bit $C083
|
|
|
|
bit $C083
|
|
|
|
|
|
|
|
lda #0 ; load MUSIC from disk
|
|
|
|
sta WHICH_LOAD
|
|
|
|
|
|
|
|
jsr load_file
|
|
|
|
|
|
|
|
|
2024-01-14 06:29:54 +00:00
|
|
|
;============================
|
|
|
|
;============================
|
|
|
|
; load title image from disk
|
|
|
|
;============================
|
|
|
|
;============================
|
|
|
|
|
|
|
|
; load from disk
|
|
|
|
|
|
|
|
bit SET_GR
|
|
|
|
bit HIRES
|
|
|
|
bit TEXTGR
|
|
|
|
bit PAGE2
|
|
|
|
|
|
|
|
lda #2 ; TITLE
|
|
|
|
sta WHICH_LOAD
|
|
|
|
jsr load_file
|
|
|
|
|
|
|
|
bit PAGE1
|
|
|
|
|
|
|
|
; decompress
|
|
|
|
|
|
|
|
lda #<$4000
|
|
|
|
sta zx_src_l+1
|
|
|
|
lda #>$4000
|
|
|
|
sta zx_src_h+1
|
|
|
|
lda #$20
|
|
|
|
jsr zx02_full_decomp
|
|
|
|
|
2024-01-11 06:25:38 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
; Print message
|
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
|
|
|
|
; print non-inverse
|
|
|
|
|
|
|
|
jsr set_normal
|
|
|
|
|
|
|
|
lda SOUND_STATUS
|
|
|
|
and #SOUND_MOCKINGBOARD
|
|
|
|
beq print_no_mock
|
|
|
|
|
|
|
|
print_mock:
|
|
|
|
lda MB_ADDR_H
|
|
|
|
and #$7
|
|
|
|
clc
|
|
|
|
adc #$B0
|
|
|
|
sta mockingboard_string+29
|
|
|
|
|
|
|
|
lda #<mockingboard_string
|
|
|
|
sta OUTL
|
|
|
|
lda #>mockingboard_string
|
|
|
|
jmp done_set_message
|
|
|
|
|
|
|
|
print_no_mock:
|
|
|
|
lda #<no_mockingboard_string
|
|
|
|
sta OUTL
|
|
|
|
lda #>no_mockingboard_string
|
|
|
|
|
|
|
|
done_set_message:
|
|
|
|
sta OUTH
|
|
|
|
|
|
|
|
; print the text
|
|
|
|
|
|
|
|
jsr move_and_print
|
|
|
|
|
2024-01-14 06:29:54 +00:00
|
|
|
; print title messages
|
2024-01-11 06:25:38 +00:00
|
|
|
|
2024-01-14 06:29:54 +00:00
|
|
|
lda #<title_string
|
|
|
|
sta OUTL
|
|
|
|
lda #>title_string
|
|
|
|
sta OUTH
|
|
|
|
|
|
|
|
; print the text
|
|
|
|
|
|
|
|
jsr move_and_print
|
|
|
|
jsr move_and_print
|
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
; wait a bit
|
2024-01-14 06:29:54 +00:00
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
; lda #50
|
|
|
|
; jsr wait_a_bit
|
2024-01-14 06:29:54 +00:00
|
|
|
|
2024-01-11 06:25:38 +00:00
|
|
|
|
2024-01-20 01:55:44 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
; Load FLAMES
|
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
load_flames:
|
|
|
|
|
|
|
|
; load from disk
|
|
|
|
|
|
|
|
lda #3 ; FLAMES
|
|
|
|
sta WHICH_LOAD
|
|
|
|
jsr load_file
|
|
|
|
|
2024-01-21 21:04:25 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
; Load COUNTRYSIDE
|
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
load_countryside:
|
|
|
|
|
|
|
|
; load from disk
|
|
|
|
|
|
|
|
lda #4 ; COUNTRYSIDE
|
|
|
|
sta WHICH_LOAD
|
|
|
|
jsr load_file
|
|
|
|
|
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
;=============================
|
|
|
|
; change to credits
|
|
|
|
;=============================
|
|
|
|
|
|
|
|
lda #<bottom_string1
|
|
|
|
sta OUTL
|
|
|
|
lda #>bottom_string1
|
|
|
|
sta OUTH
|
|
|
|
|
|
|
|
; print the text
|
|
|
|
|
|
|
|
jsr move_and_print
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-29 05:42:56 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
; Load STRONGBAD
|
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
load_strongbad:
|
|
|
|
|
|
|
|
; load from disk
|
|
|
|
|
|
|
|
lda #5 ; COUNTRYSIDE
|
|
|
|
sta WHICH_LOAD
|
|
|
|
jsr load_file
|
|
|
|
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
;=======================
|
|
|
|
;=======================
|
2024-01-14 06:29:54 +00:00
|
|
|
; Load TROGDOR
|
2024-01-11 06:25:38 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
2024-01-14 06:29:54 +00:00
|
|
|
load_trogdor:
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
; load from disk
|
|
|
|
|
2024-01-20 01:55:44 +00:00
|
|
|
lda #1 ; TROGDOR
|
2024-01-11 06:25:38 +00:00
|
|
|
sta WHICH_LOAD
|
|
|
|
jsr load_file
|
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; lda #50
|
|
|
|
; jsr wait_a_bit
|
|
|
|
|
|
|
|
|
|
|
|
;============================================
|
|
|
|
; print the "press any key"
|
|
|
|
|
|
|
|
|
|
|
|
jsr move_and_print
|
|
|
|
|
2024-01-30 03:53:37 +00:00
|
|
|
; do blue flames
|
2024-01-30 02:54:18 +00:00
|
|
|
|
2024-01-30 03:53:37 +00:00
|
|
|
bit KEYRESET
|
2024-01-30 02:54:18 +00:00
|
|
|
|
2024-01-30 03:53:37 +00:00
|
|
|
jsr flames
|
2024-01-30 02:54:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
;===================
|
|
|
|
; restart?
|
|
|
|
;===================
|
|
|
|
restart:
|
|
|
|
|
|
|
|
|
|
|
|
;==========================
|
|
|
|
; setup music
|
|
|
|
;==========================
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta DONE_PLAYING
|
2024-01-30 03:53:37 +00:00
|
|
|
sta DRAW_PAGE
|
2024-01-30 02:54:18 +00:00
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta LOOP
|
|
|
|
|
|
|
|
; patch mockingboard
|
|
|
|
|
|
|
|
lda SOUND_STATUS
|
|
|
|
beq skip_mbp1
|
|
|
|
|
|
|
|
jsr mockingboard_patch ; patch to work in slots other than 4?
|
|
|
|
|
|
|
|
skip_mbp1:
|
|
|
|
|
|
|
|
;=======================
|
|
|
|
; Set up 50Hz interrupt
|
|
|
|
;========================
|
|
|
|
|
|
|
|
jsr mockingboard_init
|
|
|
|
jsr mockingboard_setup_interrupt
|
|
|
|
|
|
|
|
;============================
|
|
|
|
; Init the Mockingboard
|
|
|
|
;============================
|
|
|
|
|
|
|
|
jsr reset_ay_both
|
|
|
|
jsr clear_ay_both
|
|
|
|
|
|
|
|
;==================
|
|
|
|
; init song
|
|
|
|
;==================
|
|
|
|
|
|
|
|
jsr pt3_init_song
|
|
|
|
|
|
|
|
dont_enable_mc:
|
|
|
|
|
|
|
|
skip_all_checks:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-11 06:25:38 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
2024-01-30 02:54:18 +00:00
|
|
|
; Run TROGDOR
|
2024-01-11 06:25:38 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
|
|
|
|
jsr $8000
|
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
|
|
|
; Print Message about Re-running
|
|
|
|
;=======================
|
|
|
|
;=======================
|
2024-01-11 06:25:38 +00:00
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
bit PAGE1 ; be sure we're on PAGE1
|
|
|
|
lda #0
|
|
|
|
sta DRAW_PAGE
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
; clear text screen
|
2024-01-30 02:54:18 +00:00
|
|
|
lda #$A0
|
|
|
|
sta clear_all_color+1
|
|
|
|
jsr clear_all
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
; switch to text/gr
|
2024-01-30 02:54:18 +00:00
|
|
|
bit TEXTGR
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
; print non-inverse
|
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
jsr set_normal
|
2024-01-11 06:25:38 +00:00
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
; print trog message
|
|
|
|
lda #<trog_message
|
|
|
|
sta OUTL
|
|
|
|
lda #>trog_message
|
|
|
|
sta OUTH
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
; print the text
|
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
jsr move_and_print
|
|
|
|
|
|
|
|
bit KEYRESET ; just to be safe
|
|
|
|
jsr wait_until_keypress
|
2024-01-11 06:25:38 +00:00
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
jsr move_and_print
|
2024-01-11 06:25:38 +00:00
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
lda #50
|
|
|
|
jsr wait_a_bit
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
forever:
|
2024-01-30 02:54:18 +00:00
|
|
|
jmp restart
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
.include "wait_keypress.s"
|
|
|
|
.include "zx02_optim.s"
|
|
|
|
|
|
|
|
.include "gs_interrupt.s"
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-14 06:29:54 +00:00
|
|
|
title_string:
|
|
|
|
.byte 1,20,"NEW FROM VIDELECTRIX: A POSSIBLY LEGAL",0
|
|
|
|
.byte 7,21,"PROGRAM FOR YOUR APPLE II!",0
|
|
|
|
|
|
|
|
|
|
|
|
bottom_string1:
|
2024-01-30 02:54:18 +00:00
|
|
|
.byte 1,23,"CODE BY DEATER, MUSIC SCORE BY TOM_FJM",0
|
2024-01-14 06:29:54 +00:00
|
|
|
bottom_string2:
|
2024-01-30 02:54:18 +00:00
|
|
|
.byte 1,23," = PRESS ANY KEY TO START = ",0
|
2024-01-14 06:29:54 +00:00
|
|
|
|
2024-01-11 06:25:38 +00:00
|
|
|
; 0123456789012345678901234567890123456789
|
|
|
|
mockingboard_string:
|
2024-01-14 06:29:54 +00:00
|
|
|
.byte 6,23,"MOCKINGBOARD DETECTED SLOT 4",0
|
2024-01-11 06:25:38 +00:00
|
|
|
|
|
|
|
no_mockingboard_string:
|
2024-01-14 06:29:54 +00:00
|
|
|
.byte 3,23,"NO MOCKINGBOARD, CONTINUING ANYWAY",0
|
2024-01-11 06:25:38 +00:00
|
|
|
|
2024-01-30 02:54:18 +00:00
|
|
|
trog_message:
|
|
|
|
.byte 11,20,"WATCH AGAIN (Y/N)?",0
|
|
|
|
|
|
|
|
trog_message2:
|
|
|
|
.byte 3,23,"TROGDOR CARES NOT FOR YOUR INPUT!!",0
|
|
|
|
|
2024-01-11 06:25:38 +00:00
|
|
|
.include "pt3_lib_mockingboard_patch.s"
|
|
|
|
|
|
|
|
.include "hardware_detect.s"
|
2024-01-30 03:53:37 +00:00
|
|
|
.include "flame.s"
|