; 6809dasm file for Vectrex bios calls
; date 06/29/2019

;; since we're not disassembling the bios along with the cartridge code,
;; we only need 'label' entries.

;; examples

; label ffff whatever ; comment

;; I/O space
; label c000 COLOR_REGISTERS
; label c804 WIDGET_PIA_DATAA


; however for the cartridge contents that we *are* disassembling, we
; can add comments and data, eg:

; commentline 0 Stargate

; comment 000c label from f608

; data 065e-080B
; ascii 2b40-2b6f

; data fffa-fffb
; comment fffA SWI vector

label C800 Vec_Snd_Shadow
label C80F Vec_Btn_State

label C810 Vec_Prev_Btns
label C811 Vec_Buttons
label C812 Vec_Button_1_1
label C813 Vec_Button_1_2
label C814 Vec_Button_1_3
label C815 Vec_Button_1_4
label C816 Vec_Button_2_1
label C817 Vec_Button_2_2
label C818 Vec_Button_2_3
label C819 Vec_Button_2_4
label C81A Vec_Joy_Resltn
label C81B Vec_Joy_1_X
label C81C Vec_Joy_1_Y
label C81D Vec_Joy_2_X
label C81E Vec_Joy_2_Y
label C81F Vec_Joy_Mux
label C81F Vec_Joy_Mux_1_X
label C820 Vec_Joy_Mux_1_Y
label C821 Vec_Joy_Mux_2_X
label C822 Vec_Joy_Mux_2_Y
label C823 Vec_Misc_Count
label C824 Vec_0Ref_Enable
label C825 Vec_Loop_Count
label C827 Vec_Brightness
label C828 Vec_Dot_Dwell
label C829 Vec_Pattern
label C82A Vec_Text_HW
label C82A Vec_Text_Height
label C82B Vec_Text_Width
label C82C Vec_Str_Ptr
label C82E Vec_Counters
label C82E Vec_Counter_1
label C82F Vec_Counter_2
label C830 Vec_Counter_3
label C831 Vec_Counter_4
label C832 Vec_Counter_5
label C833 Vec_Counter_6
label C834 Vec_RiseRun_Tmp
label C836 Vec_Angle
label C837 Vec_Run_Index
label C839 CopyRStartup
; Pointer to copyright string during startup
label C839 Vec_Rise_Index
label C83B HighScoreColdStartFlag
;High score cold-start flag (=0 if valid)
label C83B Vec_RiseRun_Len
label C83C Vec_temp
;temp byte
label C83D Vec_Rfrsh
label C83D Vec_Rfrsh_lo
label C83E Vec_Rfrsh_hi
label C83F Vec_Music_Work
label C842 Vec_Music_Wk_A
label C843 Vec_reg9
;        register 9
label C844 Vec_reg8
;        register 8
label C845 Vec_Music_Wk_7
label C846 Vec_Music_Wk_6
label C847 Vec_Music_Wk_5
label C848 Vec_reg4
;        register 4
label C849 Vec_reg3
;        register 3
label C84A Vec_reg2
;        register 2
label C84B Vec_Music_Wk_1
label C84C Vec_reg0
;        register 0
label C84D Vec_Freq_Table
label C84F Vec_Max_Players
label C850 Vec_Max_Games
label C84F Vec_ADSR_Table
label C851 Vec_Twang_Table
label C853 Vec_Music_Ptr
label C853 Vec_Expl_ChanA
label C854 Vec_Expl_Chans
label C855 Vec_Music_Chan
label C856 Vec_Music_Flag
label C857 Vec_Duration
label C858 Vec_Music_Twang
label C858 Vec_Expl_1
label C859 Vec_Expl_2
label C85A Vec_Expl_3
label C85B Vec_Expl_4
label C85C Vec_Expl_Chan
label C85D Vec_Expl_ChanB
label C85E Vec_ADSR_Timers
label C861 Vec_Music_Freq
label C85E Vec_ScratchScore0
;Scratch 'score' storage for Display_Option (7 bytes)
label C867 Vec_Expl_Flag
;               $C868...$C876   ;Unused?
label C877 Vec_Expl_Timer
;                       $C878   ;Unused?
label C879 Vec_Num_Players
label C87A Vec_Num_Game
label C87B Vec_Seed_Ptr
label C87D Vec_Random_Seed
;                               ;
;    $C880 - $CBEA is user RAM  ;
;                               ;
label CBEA Vec_Default_Stk
label CBEB Vec_High_Score
label CBF2 Vec_SWI3_Vector
label CBF2 Vec_SWI2_Vector
label CBF5 Vec_FIRQ_Vector
label CBF8 Vec_IRQ_Vector
label CBFB Vec_SWI_Vector
label CBFB Vec_NMI_Vector
label CBFE Vec_Cold_Flag
                                ;
label D000 VIA_port_b
;       0 sample/hold (0=enable  mux 1=disable mux)
;       1 mux sel 0
;       2 mux sel 1
;       3 sound BC1
;       4 sound BDIR
;       5 comparator input
;       6 external device (slot pin 35) initialized to input
;       7 /RAMP
label D001 VIA_port_a
label D002 VIA_DDR_b
label D003 VIA_DDR_a
label D004 VIA_t1_cnt_lo
label D005 VIA_t1_cnt_hi
label D006 VIA_t1_lch_lo
label D007 VIA_t1_lch_hi
label D008 VIA_t2_lo
label D009 VIA_t2_hi
label D00A VIA_shift_reg
label D00B VIA_aux_cntl
;       0 PA latch enable
;       1 PB latch enable
;       2 \                     110=output to CB2 under control of phase 2 clock
;       3  > shift register control     (110 is the only mode used by the Vectrex ROM)
;       4 /
;       5 0=t2 one shot                 1=t2 free running
;       6 0=t1 one shot                 1=t1 free running
;       7 0=t1 disable PB7 output       1=t1 enable PB7 output
label D00C VIA_cntl
;       0 CA1 control     CA1 -> SW7    0=IRQ on low 1=IRQ on high
;       1 \
;       2  > CA2 control  CA2 -> /ZERO  110=low 111=high
;       3 /
;       4 CB1 control     CB1 -> NC     0=IRQ on low 1=IRQ on high
;       5 \
;       6  > CB2 control  CB2 -> /BLANK 110=low 111=high
;       7 /
label D00D VIA_int_flags
;               bit                             cleared by
;       0 CA2 interrupt flag            reading or writing port A I/O
;       1 CA1 interrupt flag            reading or writing port A I/O
;       2 shift register interrupt flag reading or writing shift register
;       3 CB2 interrupt flag            reading or writing port B I/O
;       4 CB1 interrupt flag            reading or writing port A I/O
;       5 timer 2 interrupt flag        read t2 low or write t2 high
;       6 timer 1 interrupt flag        read t1 count low or write t1 high
;       7 IRQ status flag               write logic 0 to IER or IFR bit
label D00E VIA_int_enable
;       0 CA2 interrupt enable
;       1 CA1 interrupt enable
;       2 shift register interrupt enable
;       3 CB2 interrupt enable
;       4 CB1 interrupt enable
;       5 timer 2 interrupt enable
;       6 timer 1 interrupt enable
;       7 IER set/clear control
label D00F VIA_port_a_nohs

label F000 Cold_Start
label F06C Warm_Start
label F14C Init_VIA
label F164 Init_OS_RAM
label F18B Init_OS
label F192 Wait_Recal
label F1A2 Set_Refresh
label F1AA DP_to_D0
label F1AF DP_to_C8
label F1B4 Read_Btns_Mask
label F1BA Read_Btns
label F1F5 Joy_Analog
label F1F8 Joy_Digital
label F256 Sound_Byte
label F259 Sound_Byte_x
label F25B Sound_Byte_raw
label F272 Clear_Sound
label F27D Sound_Bytes
label F284 Sound_Bytes_x
label F289 Do_Sound
label F28C Do_Sound_x
label F29D Intensity_1F
label F2A1 Intensity_3F
label F2A5 Intensity_5F
label F2A9 Intensity_7F
label F2AB Intensity_a
label F2BE Dot_ix_b
label F2C1 Dot_ix
label F2C3 Dot_d
label F2C5 Dot_here
label F2D5 Dot_List
label F2DE Dot_List_Reset
label F2E6 Recalibrate
label F2F2 Moveto_x_7F
label F2FC Moveto_d_7F
label F308 Moveto_ix_FF
label F30C Moveto_ix_7F
label F30E Moveto_ix_a
label F310 Moveto_ix
label F312 Moveto_d
label F34A Reset0Ref_D0
label F34F Check0Ref
label F354 Reset0Ref
label F35B Reset_Pen
label F36B Reset0Int
label F373 Print_Str_hwyx
label F378 Print_Str_yx
label F37A Print_Str_d
label F385 Print_List_hw
label F38A Print_List
label F38C Print_List_chk
label F391 Print_Ships_x
label F393 Print_Ships
label F3AD Mov_Draw_VLc_a
label F3B1 Mov_Draw_VL_b
label F3B5 Mov_Draw_VLcs
label F3B7 Mov_Draw_VL_ab
label F3B9 Mov_Draw_VL_a
label F3BC Mov_Draw_VL
label F3BE Mov_Draw_VL_d
label F3CE Draw_VLc
label F3D2 Draw_VL_b
label F3D6 Draw_VLcs
label F3D8 Draw_VL_ab
label F3DA Draw_VL_a
label F3DD Draw_VL
label F3DF Draw_Line_d
label F404 Draw_VLp_FF
label F408 Draw_VLp_7F
label F40C Draw_VLp_scale
label F40E Draw_VLp_b
label F410 Draw_VLp
label F434 Draw_Pat_VL_a
label F437 Draw_Pat_VL
label F439 Draw_Pat_VL_d
label F46E Draw_VL_mode
label F495 Print_Str
label F511 Random_3
label F517 Random
label F533 Init_Music_Buf
label F53F Clear_x_b
label F542 Clear_C8_RAM
label F545 Clear_x_256
label F548 Clear_x_d
label F550 Clear_x_b_80
label F552 Clear_x_b_a
label F55A Dec_3_Counters
label F55E Dec_6_Counters
label F563 Dec_Counters
label F56D Delay_3
label F571 Delay_2
label F575 Delay_1
label F579 Delay_0
label F57A Delay_b
label F57D Delay_RTS
label F57E Bitmask_a
label F584 Abs_a_b
label F58B Abs_b
label F593 Rise_Run_Angle
label F5D9 Get_Rise_Idx
label F5DB Get_Run_Idx
label F5EF Get_Rise_Run
label F5FF Rise_Run_X
label F601 Rise_Run_Y
label F603 Rise_Run_Len

label F610 Rot_VL_ab
label F616 Rot_VL
label F61F Rot_VL_Mode_a
label F62B Rot_VL_Mode_dft
label F637 Rot_VL_dft

label F65B Xform_Run_a
label F65D Xform_Run
label F661 Xform_Rise_a
label F663 Xform_Rise
label F67F Move_Mem_a_1
label F683 Move_Mem_a
label F687 Init_Music_chk
label F68D Init_Music
label F692 Init_Music_x
label F7A9 Select_Game
label F84F Clear_Score
label F85E Add_Score_a
label F87C Add_Score_d
label F8B7 Strip_Zeros
label F8C7 Compare_Score
label F8D8 New_High_Score
label F8E5 Obj_Will_Hit_u
label F8F3 Obj_Will_Hit
label F8FF Obj_Hit
label F92E Explosion_Snd
label FF9F Draw_Grid_VL

label FD0D music1
label FD1D music2
label FD81 music3
label FDD3 music4
label FE38 music5
label FE76 music6
label FEC6 music7
label FEF8 music8
label FF26 music9
label FF44 musica
label FF62 musicb
label FF7A musicc
label FF8F musicd
label F9F4 Char_Table
label FBD4 Char_Table_End

