Drag selection and opening

This commit is contained in:
Joshua Bell 2018-12-20 16:35:18 -08:00
parent 45cb968904
commit 7dda998e65
2 changed files with 44 additions and 38 deletions

View File

@ -132,8 +132,7 @@ DESKTOP_RELAY := $D040
;;; ============================================================ ;;; ============================================================
;;; Internals ;;; Internals
;;; Set to specific machine type; used for insertion point blinking ;;; Set to specific machine type; used for double-click timing.
;;; and double-click timing.
;;; //e - $96 ;;; //e - $96
;;; //c - $FA ;;; //c - $FA
;;; IIgs - $FD ;;; IIgs - $FD

View File

@ -1829,41 +1829,50 @@ L4DC2: ldy #1
;;; ============================================================ ;;; ============================================================
.proc cmd_open .proc cmd_open
ldx #$00 ptr := $06
ldx #0
L4DEC: cpx selected_icon_count L4DEC: cpx selected_icon_count
bne L4DF2 bne :+
rts rts
L4DF2: txa : txa
pha pha
lda selected_icon_list,x lda selected_icon_list,x
jsr icon_entry_lookup jsr icon_entry_lookup
stax $06 stax ptr
ldy #IconEntry::win_type
lda ($06),y
and #icon_entry_type_mask
bne L4E10
ldy #$00
lda ($06),y
jsr open_folder_or_volume_icon
jmp L4E14
L4E10: cmp #$40 ldy #IconEntry::win_type
bcc L4E1A lda (ptr),y
L4E14: pla and #icon_entry_type_mask
bne not_dir
ldy #0
lda (ptr),y
jsr open_folder_or_volume_icon
jmp next_file
not_dir:
cmp #%01000000 ; type <= %0100 = basic, binary, or system
bcc maybe_open_file
next_file:
pla
tax tax
inx inx
jmp L4DEC jmp L4DEC
L4E1A: sta L4E71 maybe_open_file:
sta L4E71
lda selected_icon_count lda selected_icon_count
cmp #$02 cmp #2 ; multiple files open?
bcs L4E14 bcs next_file ; don't try to invoke
pla pla
lda active_window_id lda active_window_id
jsr window_address_lookup jsr window_address_lookup
stax $06 stax $06
ldy #$00
ldy #0
lda ($06),y lda ($06),y
tay tay
L4E34: lda ($06),y L4E34: lda ($06),y
@ -3925,26 +3934,20 @@ window_id:
.endproc .endproc
;;; ============================================================ ;;; ============================================================
;;; Drag Selection
.proc L5F13_impl .proc L5F13_impl
L5F0B: .byte 0 pt1: DEFINE_POINT 0, 0
.byte 0 pt2: DEFINE_POINT 0, 0
.byte 0
.byte 0
L5F0F: .byte 0
.byte 0
.byte 0
.byte 0
start: copy16 #notpenXOR, $06 start: copy16 #notpenXOR, $06
jsr L60D5 jsr L60D5
ldx #$03 ldx #.sizeof(MGTK::Point)-1
L5F20: lda event_coords,x L5F20: lda event_coords,x
sta L5F0B,x sta pt1,x
sta L5F0F,x sta pt2,x
dex dex
bpl L5F20 bpl L5F20
@ -3963,9 +3966,9 @@ L5F3F: jsr clear_selection
jsr get_port2 jsr get_port2
jsr offset_grafport2_and_set jsr offset_grafport2_and_set
ldx #$03 ldx #$03
L5F50: lda L5F0B,x L5F50: lda pt1,x
sta rect_E230::x1,x sta rect_E230::x1,x
lda L5F0F,x lda pt2,x
sta rect_E230::x2,x sta rect_E230::x2,x
dex dex
bpl L5F50 bpl L5F50
@ -5519,11 +5522,14 @@ pathlen: .byte 0
stax ptr stax ptr
sty vol_info_path_buf sty vol_info_path_buf
L6F52: lda (ptr),y
: lda (ptr),y
sta vol_info_path_buf,y sta vol_info_path_buf,y
dey dey
bne L6F52 bne :-
jsr get_vol_free_used jsr get_vol_free_used
bne L6F8F bne L6F8F
lda L704B lda L704B
beq L6F8F beq L6F8F
@ -5959,7 +5965,8 @@ L72E2: lda $0C04
rts rts
get_vol_free_used: MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params4 get_vol_free_used:
MLI_RELAY_CALL GET_FILE_INFO, get_file_info_params4
beq :+ beq :+
rts rts