mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-03 18:29:53 +00:00
448 lines
7.0 KiB
ArmAsm
448 lines
7.0 KiB
ArmAsm
; Riven HGR Title Screen
|
|
|
|
; by deater (Vince Weaver) <vince@deater.net>
|
|
|
|
; Zero Page
|
|
.include "zp.inc"
|
|
.include "hardware.inc"
|
|
.include "common_defines.inc"
|
|
.include "qload.inc"
|
|
|
|
.if DISK=00
|
|
.include "disk00_files/disk00_defines.inc"
|
|
.endif
|
|
|
|
.if DISK=01
|
|
.include "disk01_files/disk01_defines.inc"
|
|
.endif
|
|
|
|
.if DISK=39
|
|
.include "disk39_files/disk39_defines.inc"
|
|
.endif
|
|
|
|
.if DISK=40
|
|
.include "disk40_files/disk40_defines.inc"
|
|
.endif
|
|
|
|
.if DISK=41
|
|
.include "disk41_files/disk41_defines.inc"
|
|
.endif
|
|
|
|
.if DISK=43
|
|
.include "disk43_files/disk43_defines.inc"
|
|
.endif
|
|
|
|
|
|
riven_title:
|
|
|
|
|
|
;===========================
|
|
; print the title message that used to be
|
|
; in hello.bas
|
|
|
|
|
|
;===================
|
|
; init screen
|
|
;===================
|
|
|
|
jsr TEXT
|
|
jsr HOME
|
|
bit KEYRESET
|
|
|
|
; set disk#
|
|
|
|
lda #48+(DISK/10)
|
|
sta title_text+28
|
|
lda #48+(DISK-((DISK/10)*10))
|
|
sta title_text+29
|
|
|
|
|
|
|
|
; clear text screen
|
|
|
|
; jsr clear_all
|
|
|
|
lda #0
|
|
sta DRAW_PAGE
|
|
|
|
; print non-inverse
|
|
|
|
jsr set_normal
|
|
|
|
; print messages
|
|
lda #<title_text
|
|
sta OUTL
|
|
lda #>title_text
|
|
sta OUTH
|
|
|
|
; print the text
|
|
|
|
jsr move_and_print_list
|
|
|
|
loader_start:
|
|
|
|
jsr hardware_detect
|
|
|
|
lda #<model_string
|
|
sta OUTL
|
|
lda #>model_string
|
|
sta OUTH
|
|
|
|
lda APPLEII_MODEL
|
|
sta model_string+17
|
|
|
|
cmp #'g'
|
|
bne go_print
|
|
|
|
lda #'s'
|
|
sta model_string+18
|
|
|
|
go_print:
|
|
|
|
ldy #0
|
|
print_model:
|
|
lda (OUTL),Y
|
|
beq print_model_done
|
|
ora #$80
|
|
sta $7d0,Y
|
|
iny
|
|
jmp print_model
|
|
print_model_done:
|
|
|
|
;===========================
|
|
; patch lowercase printing
|
|
;===========================
|
|
; urgh, II,+ patch, e/c/gs no? there are other
|
|
; corner cases we're going to miss here
|
|
|
|
lda APPLEII_MODEL
|
|
cmp #'+'
|
|
beq patch_uppercase
|
|
cmp #' '
|
|
bne no_patch_uppercase
|
|
|
|
patch_uppercase:
|
|
jsr force_uppercase
|
|
no_patch_uppercase:
|
|
|
|
;==========================
|
|
; wait a bit
|
|
;==========================
|
|
|
|
|
|
ldx #50
|
|
jsr wait_a_bit
|
|
|
|
|
|
;==========================
|
|
; start graphics
|
|
;==========================
|
|
|
|
|
|
bit SET_GR
|
|
bit PAGE1
|
|
bit HIRES
|
|
bit FULLGR
|
|
|
|
;===================
|
|
; machine workarounds
|
|
;===================
|
|
; mostly IIgs
|
|
;===================
|
|
; thanks to 4am who provided this code from Total Replay
|
|
|
|
lda ROM_MACHINEID
|
|
cmp #$06
|
|
bne not_a_iigs
|
|
sec
|
|
jsr $FE1F ; check for IIgs
|
|
bcs not_a_iigs
|
|
|
|
; gr/text page2 handling broken on early IIgs models
|
|
; this enables the workaround
|
|
|
|
jsr ROM_TEXT2COPY ; set alternate display mode on IIgs
|
|
cli ; enable VBL interrupts
|
|
|
|
; also set background color to black instead of blue
|
|
lda NEWVIDEO
|
|
and #%00011111 ; bit 7 = 0 -> IIgs Apple II-compat video modes
|
|
; bit 6 = 0 -> IIgs 128K memory map same as IIe
|
|
; bit 5 = 0 -> IIgs DHGR is color, not mono
|
|
; bits 0-4 unchanged
|
|
sta NEWVIDEO
|
|
lda #$F0
|
|
sta TBCOLOR ; white text on black background
|
|
lda #$00
|
|
sta CLOCKCTL ; black border
|
|
sta CLOCKCTL ; set twice for VidHD
|
|
|
|
not_a_iigs:
|
|
|
|
;===================
|
|
; Load hires graphics
|
|
;===================
|
|
reload_everything:
|
|
|
|
lda #<riven_title_image
|
|
sta ZX0_src
|
|
lda #>riven_title_image
|
|
sta ZX0_src+1
|
|
|
|
lda #$20 ; decompress to hgr page1
|
|
|
|
jsr full_decomp
|
|
|
|
;===================================
|
|
; detect if we have a language card
|
|
; and load sound into it if possible
|
|
;===================================
|
|
|
|
lda #0
|
|
sta SOUND_STATUS ; clear out, sound enabled
|
|
|
|
jsr detect_language_card
|
|
bcs no_language_card
|
|
|
|
; update sound status
|
|
lda SOUND_STATUS
|
|
ora #SOUND_IN_LC
|
|
sta SOUND_STATUS
|
|
|
|
; load sounds into LC
|
|
|
|
; read ram, write ram, use $d000 bank1
|
|
; bit $C08B
|
|
; bit $C08B
|
|
|
|
; lda #<linking_noise_compressed
|
|
; sta getsrc_smc+1
|
|
; lda #>linking_noise_compressed
|
|
; sta getsrc_smc+2
|
|
|
|
; lda #$D0 ; decompress to $D000
|
|
|
|
; jsr decompress_lzsa2_fast
|
|
|
|
;blah:
|
|
|
|
; read rom, nowrite, use $d000 bank1
|
|
; bit $C08A
|
|
|
|
no_language_card:
|
|
|
|
;===================================
|
|
; Setup Mockingboard
|
|
;===================================
|
|
; lda #0
|
|
; sta DONE_PLAYING
|
|
; sta LOOP
|
|
|
|
; detect mockingboard
|
|
; jsr mockingboard_detect
|
|
|
|
; bcc mockingboard_notfound
|
|
|
|
mockingboard_found:
|
|
;; jsr mockingboard_patch ; patch to work in slots other than 4?
|
|
|
|
; lda SOUND_STATUS
|
|
; ora #SOUND_MOCKINGBOARD
|
|
; sta SOUND_STATUS
|
|
|
|
;=======================
|
|
; 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
|
|
|
|
; jmp done_setup_sound
|
|
|
|
|
|
mockingboard_notfound:
|
|
|
|
|
|
done_setup_sound:
|
|
|
|
|
|
;===================================
|
|
; init
|
|
;===================================
|
|
|
|
|
|
; clear out zero page values to 0
|
|
; clear everything from $80 .. $A0?
|
|
|
|
; lda #0
|
|
; ldx #$20
|
|
;clear_loop:
|
|
; sta $80,X
|
|
; dex
|
|
; bpl clear_loop
|
|
|
|
lda #0
|
|
sta LEVEL_OVER
|
|
sta BEACH_ANIMALS_SEEN
|
|
|
|
; init hi-res graphics
|
|
|
|
lda #$20
|
|
sta HGR_PAGE
|
|
jsr hgr_make_tables
|
|
|
|
|
|
; lda #0
|
|
; sta JOYSTICK_ENABLED
|
|
; sta UPDATE_POINTER
|
|
; sta HOLDING_ITEM
|
|
; sta HOLDING_PAGE
|
|
|
|
lda #20
|
|
sta CURSOR_X
|
|
sta CURSOR_Y
|
|
|
|
;===================================
|
|
; Do Intro Sequence
|
|
;===================================
|
|
|
|
; wait a bit at LOAD screen
|
|
|
|
ldx #100
|
|
jsr wait_a_bit
|
|
|
|
.if DISK=00
|
|
|
|
|
|
; lda #LOAD_CAPTURED
|
|
; lda #LOAD_CHO
|
|
|
|
lda #LOAD_CYAN
|
|
sta WHICH_LOAD ; assume CYAN opener
|
|
|
|
lda #0 ; not needed...
|
|
sta LOCATION
|
|
|
|
lda #DIRECTION_N
|
|
sta DIRECTION
|
|
.endif
|
|
|
|
.if DISK=01
|
|
lda #LOAD_ARRIVAL
|
|
sta WHICH_LOAD ; assume new game (dome island)
|
|
|
|
lda #RIVEN_ARRIVAL
|
|
sta LOCATION
|
|
|
|
lda #DIRECTION_N
|
|
sta DIRECTION
|
|
.endif
|
|
|
|
.if DISK=39
|
|
lda #LOAD_OUTSIDE
|
|
sta WHICH_LOAD ; assume new game (dome island)
|
|
|
|
lda #RIVEN_MAGLEV1
|
|
sta LOCATION
|
|
|
|
lda #DIRECTION_N
|
|
sta DIRECTION
|
|
.endif
|
|
|
|
.if DISK=40
|
|
lda #LOAD_MAGLEV
|
|
sta WHICH_LOAD ; sitting in maglev
|
|
|
|
lda #RIVEN_INSEAT
|
|
sta LOCATION
|
|
|
|
lda #DIRECTION_W
|
|
sta DIRECTION
|
|
.endif
|
|
|
|
.if DISK=41
|
|
lda #LOAD_TUNNEL2
|
|
sta WHICH_LOAD ; south in tunnel
|
|
|
|
lda #RIVEN_TUNNEL5
|
|
sta LOCATION
|
|
|
|
lda #DIRECTION_S
|
|
sta DIRECTION
|
|
.endif
|
|
|
|
|
|
.if DISK=43
|
|
lda #LOAD_CART
|
|
sta WHICH_LOAD
|
|
|
|
lda #RIVEN_OUTSIDE_CART
|
|
sta LOCATION
|
|
|
|
lda #DIRECTION_S
|
|
sta DIRECTION
|
|
.endif
|
|
|
|
|
|
rts
|
|
|
|
;==========================
|
|
; includes
|
|
;==========================
|
|
|
|
.include "hgr_tables.s"
|
|
|
|
.include "hardware_detect.s"
|
|
|
|
.include "lc_detect.s"
|
|
|
|
model_string:
|
|
.byte "DETECTED APPLE II",0,0,0
|
|
|
|
|
|
|
|
|
|
riven_title_image:
|
|
.incbin "graphics_title/riven_title.hgr.zx02"
|
|
|
|
;01234567890123456789012345678901234567890
|
|
title_text:
|
|
.byte 0, 0,"LOADING RIVEN SUBSET DISK 00 V0.06",0
|
|
;
|
|
;
|
|
|
|
;
|
|
.byte 0, 3,"CREDITS:",0
|
|
.byte 0, 4,"+ APPLE II PORT: VINCE 'DEATER' WEAVER",0
|
|
.byte 0, 5,"+ DISK CODE : QKUMBA",0
|
|
.byte 0, 6,"+ ZX02 CODE : DMSC",0
|
|
.byte 0, 7,"+ IIPIX : K. KENNAWAY",0
|
|
.byte 0, 8,"+ SOUND : O. SCHMIDT",0
|
|
|
|
.byte 12,10,"** DISCLAIMER **",0
|
|
.byte 0,12,"THIS PRODUCT CONTAINS TRADEMARKS AND/OR",0
|
|
.byte 7,13,"COPYRIGHTED WORKS OF CYAN.",0
|
|
.byte 6,14,"ALL RIGHTS RESERVED BY CYAN.",0
|
|
.byte 0,15,"THIS PRODUCT IS NOT OFFICIAL AND IS NOT",0
|
|
.byte 11,16,"ENDORSED BY CYAN.",0
|
|
|
|
;
|
|
.byte 8,18, "______",0
|
|
.byte 6,19, "A \/\/\/ SOFTWARE PRODUCTION",0
|
|
;
|
|
.byte 3,21, "HTTP://WWW.DEATER.NET/WEAVE/VMWPROD",0,$FF
|
|
|