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
;;; Set to specific machine type; used for insertion point blinking
;;; and double-click timing.
;;; Set to specific machine type; used for double-click timing.
;;; //e - $96
;;; //c - $FA
;;; IIgs - $FD

View File

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