mirror of
https://github.com/mi57730/a2d.git
synced 2025-02-20 02:29:11 +00:00
disasm: block copy macros, rename pointers
This commit is contained in:
parent
8ce498d048
commit
adbd1c8fc7
@ -74,11 +74,8 @@ call_init:
|
|||||||
zp_stash := $20
|
zp_stash := $20
|
||||||
lda LCBANK1
|
lda LCBANK1
|
||||||
lda LCBANK1
|
lda LCBANK1
|
||||||
ldx #sizeof_routine
|
|
||||||
: lda routine,x
|
COPY_BYTES sizeof_routine+1, routine, zp_stash
|
||||||
sta zp_stash,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
jsr zp_stash
|
jsr zp_stash
|
||||||
|
|
||||||
;; Redraw window after event_kind_drag
|
;; Redraw window after event_kind_drag
|
||||||
@ -869,11 +866,7 @@ exit: lda LCBANK1
|
|||||||
;; Copy following routine to ZP and invoke it
|
;; Copy following routine to ZP and invoke it
|
||||||
zp_stash := $20
|
zp_stash := $20
|
||||||
|
|
||||||
ldx #sizeof_routine
|
COPY_BYTES sizeof_routine+1, routine, zp_stash
|
||||||
loop: lda routine,x
|
|
||||||
sta zp_stash,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
jmp zp_stash
|
jmp zp_stash
|
||||||
|
|
||||||
.proc routine
|
.proc routine
|
||||||
|
@ -616,11 +616,7 @@ dialog_result: .byte 0
|
|||||||
;; Copy the relay routine to the zero page
|
;; Copy the relay routine to the zero page
|
||||||
dest := $20
|
dest := $20
|
||||||
|
|
||||||
ldx #sizeof_routine
|
COPY_BYTES sizeof_routine+1, routine, dest
|
||||||
loop: lda routine,x
|
|
||||||
sta dest,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
lda dialog_result
|
lda dialog_result
|
||||||
beq skip
|
beq skip
|
||||||
|
|
||||||
|
@ -74,11 +74,7 @@ stash_stack: .byte 0
|
|||||||
dest := $20
|
dest := $20
|
||||||
|
|
||||||
;; copy following routine to $20 and call it
|
;; copy following routine to $20 and call it
|
||||||
ldx #sizeof_routine
|
COPY_BYTES sizeof_routine+1, routine, dest
|
||||||
loop: lda routine,x
|
|
||||||
sta dest,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
jsr dest
|
jsr dest
|
||||||
|
|
||||||
;; now check the window pos
|
;; now check the window pos
|
||||||
@ -739,11 +735,7 @@ destroy:
|
|||||||
DESKTOP_CALL DT_REDRAW_ICONS
|
DESKTOP_CALL DT_REDRAW_ICONS
|
||||||
|
|
||||||
target = $20 ; copy following to ZP and run it
|
target = $20 ; copy following to ZP and run it
|
||||||
ldx #sizeof_routine
|
COPY_BYTES sizeof_routine+1, routine, target
|
||||||
loop: lda routine,x
|
|
||||||
sta target,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
jmp target
|
jmp target
|
||||||
|
|
||||||
.proc routine
|
.proc routine
|
||||||
|
@ -41,11 +41,7 @@ call_main_addr := call_main_trampoline+7 ; address patched in here
|
|||||||
.scope
|
.scope
|
||||||
sta RAMWRTON
|
sta RAMWRTON
|
||||||
sta RAMRDON
|
sta RAMRDON
|
||||||
ldx #sizeof_routine
|
COPY_BYTES sizeof_routine+1, routine, call_main_trampoline
|
||||||
loop: lda routine,x
|
|
||||||
sta call_main_trampoline,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
jmp call_init
|
jmp call_init
|
||||||
.endscope
|
.endscope
|
||||||
|
|
||||||
|
@ -44,11 +44,7 @@ call_main_addr := call_main_trampoline+7 ; address patched in her
|
|||||||
.scope
|
.scope
|
||||||
sta RAMWRTON
|
sta RAMWRTON
|
||||||
sta RAMRDON
|
sta RAMRDON
|
||||||
ldx #sizeof_call_main_template
|
COPY_BYTES sizeof_call_main_template+1, call_main_template, call_main_trampoline
|
||||||
loop: lda call_main_template,x
|
|
||||||
sta call_main_trampoline,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
jmp call_init
|
jmp call_init
|
||||||
.endscope
|
.endscope
|
||||||
|
|
||||||
@ -1425,11 +1421,7 @@ base: .word 10 ; vertical text offset (to baseline)
|
|||||||
jmp endif
|
jmp endif
|
||||||
else: MGTK_CALL MGTK::DrawText, prop_str
|
else: MGTK_CALL MGTK::DrawText, prop_str
|
||||||
|
|
||||||
endif: ldx #.sizeof(MGTK::MapInfo) - 1
|
endif: COPY_STRUCT MGTK::MapInfo, default_port, winfo::port
|
||||||
loop: lda default_port,x
|
|
||||||
sta winfo::port,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
MGTK_CALL MGTK::SetPortBits, winfo::port
|
MGTK_CALL MGTK::SetPortBits, winfo::port
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
@ -1391,11 +1391,7 @@ is_dir: lda #$FF
|
|||||||
jmp show_no_space_prompt
|
jmp show_no_space_prompt
|
||||||
|
|
||||||
;; copy dates
|
;; copy dates
|
||||||
: ldx #3
|
: COPY_STRUCT DateTime, get_file_info_params2::create_date, create_params::create_date
|
||||||
: lda get_file_info_params2::create_date,x
|
|
||||||
sta create_params::create_date,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
;; create the file
|
;; create the file
|
||||||
lda create_params::storage_type
|
lda create_params::storage_type
|
||||||
@ -1592,11 +1588,7 @@ finish: MLI_CALL CLOSE, close_dstdir_params
|
|||||||
sta create_dir_params::access
|
sta create_dir_params::access
|
||||||
|
|
||||||
;; Copy dates
|
;; Copy dates
|
||||||
ldx #3
|
COPY_STRUCT DateTime, get_file_info_params2::create_date, create_dir_params::create_date
|
||||||
: lda get_file_info_params2::create_date,x
|
|
||||||
sta create_dir_params::create_date,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
;; Create it
|
;; Create it
|
||||||
lda create_dir_params::storage_type
|
lda create_dir_params::storage_type
|
||||||
@ -1741,11 +1733,7 @@ loop2: lda L320A,y
|
|||||||
.proc get_file_info_and_copy
|
.proc get_file_info_and_copy
|
||||||
MLI_CALL GET_FILE_INFO, get_file_info_params2
|
MLI_CALL GET_FILE_INFO, get_file_info_params2
|
||||||
bne fail
|
bne fail
|
||||||
ldx #$0A
|
COPY_BYTES $B, get_file_info_params2::access, get_file_info_params3::access
|
||||||
: lda get_file_info_params2::access,x
|
|
||||||
sta get_file_info_params3::access,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
fail: pla
|
fail: pla
|
||||||
|
@ -878,7 +878,7 @@ L97F6: .byte 0
|
|||||||
cpy #0
|
cpy #0
|
||||||
bne :-
|
bne :-
|
||||||
|
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
lda icon_id
|
lda icon_id
|
||||||
jsr L9EB4
|
jsr L9EB4
|
||||||
stax $06
|
stax $06
|
||||||
@ -972,11 +972,9 @@ is_drag:
|
|||||||
and #icon_entry_winid_mask
|
and #icon_entry_winid_mask
|
||||||
sta L9832
|
sta L9832
|
||||||
MGTK_CALL MGTK::InitPort, grafport
|
MGTK_CALL MGTK::InitPort, grafport
|
||||||
ldx #.sizeof(MGTK::Rect)-1
|
|
||||||
L98E3: lda grafport::cliprect,x
|
COPY_STRUCT MGTK::Rect, grafport::cliprect, L9835
|
||||||
sta L9835,x
|
|
||||||
dex
|
|
||||||
bpl L98E3
|
|
||||||
ldx highlight_count
|
ldx highlight_count
|
||||||
stx L9C74
|
stx L9C74
|
||||||
L98F2: lda highlight_count,x
|
L98F2: lda highlight_count,x
|
||||||
@ -995,7 +993,7 @@ L9909: sta L9834
|
|||||||
lda L9C74
|
lda L9C74
|
||||||
cmp highlight_count
|
cmp highlight_count
|
||||||
beq L9936
|
beq L9936
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
|
|
||||||
lda $08
|
lda $08
|
||||||
sec
|
sec
|
||||||
@ -1007,7 +1005,7 @@ L9909: sta L9834
|
|||||||
L992D: ldy #IconEntry::state
|
L992D: ldy #IconEntry::state
|
||||||
lda #$80 ; Highlighted
|
lda #$80 ; Highlighted
|
||||||
sta ($08),y
|
sta ($08),y
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
L9936: ldx #icon_poly_size-1
|
L9936: ldx #icon_poly_size-1
|
||||||
ldy #icon_poly_size-1
|
ldy #icon_poly_size-1
|
||||||
|
|
||||||
@ -1031,11 +1029,7 @@ L9954: dec L9C74
|
|||||||
ldx L9C74
|
ldx L9C74
|
||||||
jmp L98F2
|
jmp L98F2
|
||||||
|
|
||||||
L995F: ldx #7
|
L995F: COPY_BYTES 8, drag_outline_buffer+2, L9C76
|
||||||
: lda drag_outline_buffer+2,x
|
|
||||||
sta L9C76,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
copy16 #drag_outline_buffer, $08
|
copy16 #drag_outline_buffer, $08
|
||||||
L9972: ldy #2
|
L9972: ldy #2
|
||||||
@ -1127,11 +1121,8 @@ L9A20: lda findwindow_params2,x
|
|||||||
jsr L9E14
|
jsr L9E14
|
||||||
jmp L9A0E
|
jmp L9A0E
|
||||||
|
|
||||||
L9A31: ldx #3
|
L9A31: COPY_BYTES 4, findwindow_params2, L9C92
|
||||||
L9A33: lda findwindow_params2,x
|
|
||||||
sta L9C92,x
|
|
||||||
dex
|
|
||||||
bpl L9A33
|
|
||||||
lda highlight_icon_id
|
lda highlight_icon_id
|
||||||
beq L9A84
|
beq L9A84
|
||||||
lda L9831
|
lda L9831
|
||||||
@ -1245,7 +1236,7 @@ L9BD4: ora #$80
|
|||||||
|
|
||||||
L9BDC: lda L9832
|
L9BDC: lda L9832
|
||||||
beq L9BD1
|
beq L9BD1
|
||||||
L9BE1: jsr push_zp_addrs
|
L9BE1: jsr push_pointers
|
||||||
MGTK_CALL MGTK::InitPort, grafport
|
MGTK_CALL MGTK::InitPort, grafport
|
||||||
MGTK_CALL MGTK::SetPort, grafport
|
MGTK_CALL MGTK::SetPort, grafport
|
||||||
ldx highlight_count
|
ldx highlight_count
|
||||||
@ -1264,7 +1255,7 @@ L9BF3: dex
|
|||||||
tax
|
tax
|
||||||
jmp L9BF3
|
jmp L9BF3
|
||||||
|
|
||||||
L9C18: jsr pop_zp_addrs
|
L9C18: jsr pop_pointers
|
||||||
ldx highlight_count
|
ldx highlight_count
|
||||||
dex
|
dex
|
||||||
txa
|
txa
|
||||||
@ -1305,7 +1296,7 @@ L9C63: lda #0
|
|||||||
|
|
||||||
just_select: ; ???
|
just_select: ; ???
|
||||||
tay
|
tay
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
tya
|
tya
|
||||||
tax
|
tax
|
||||||
ldy #0
|
ldy #0
|
||||||
@ -1338,11 +1329,7 @@ L9C96: .word 0
|
|||||||
L9C98: .word 0
|
L9C98: .word 0
|
||||||
.byte $00,$00,$00,$00
|
.byte $00,$00,$00,$00
|
||||||
|
|
||||||
L9C9E: ldx #.sizeof(MGTK::Rect)-1
|
L9C9E: COPY_STRUCT MGTK::Rect, L9C76, L9C86
|
||||||
: lda L9C76,x
|
|
||||||
sta L9C86,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L9CAA: lda L9C76
|
L9CAA: lda L9C76
|
||||||
@ -1425,7 +1412,7 @@ L9E14: bit L9833
|
|||||||
bpl L9E1A
|
bpl L9E1A
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L9E1A: jsr push_zp_addrs
|
L9E1A: jsr push_pointers
|
||||||
MGTK_CALL MGTK::FindWindow, findwindow_params2
|
MGTK_CALL MGTK::FindWindow, findwindow_params2
|
||||||
lda findwindow_params2::which_area
|
lda findwindow_params2::which_area
|
||||||
bne L9E2B
|
bne L9E2B
|
||||||
@ -1467,7 +1454,7 @@ L9E97: MGTK_CALL MGTK::InitPort, grafport
|
|||||||
MGTK_CALL MGTK::SetPort, grafport
|
MGTK_CALL MGTK::SetPort, grafport
|
||||||
MGTK_CALL MGTK::SetPattern, checkerboard_pattern2
|
MGTK_CALL MGTK::SetPattern, checkerboard_pattern2
|
||||||
MGTK_CALL MGTK::SetPenMode, penXOR_2
|
MGTK_CALL MGTK::SetPenMode, penXOR_2
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L9EB3: .byte 0
|
L9EB3: .byte 0
|
||||||
@ -1610,7 +1597,7 @@ L9F9F: lda #$80
|
|||||||
cpy #IconEntry::iconx + 6 ; x/y/bits
|
cpy #IconEntry::iconx + 6 ; x/y/bits
|
||||||
bne :-
|
bne :-
|
||||||
|
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
copy16 paintbits_params2::mapbits, $08
|
copy16 paintbits_params2::mapbits, $08
|
||||||
ldy #11
|
ldy #11
|
||||||
: lda ($08),y
|
: lda ($08),y
|
||||||
@ -1621,7 +1608,7 @@ L9F9F: lda #$80
|
|||||||
bit L9F92
|
bit L9F92
|
||||||
bpl :+
|
bpl :+
|
||||||
jsr LA12C
|
jsr LA12C
|
||||||
: jsr pop_zp_addrs
|
: jsr pop_pointers
|
||||||
|
|
||||||
ldy #9
|
ldy #9
|
||||||
: lda ($06),y
|
: lda ($06),y
|
||||||
@ -1655,11 +1642,9 @@ L9F9F: lda #$80
|
|||||||
add16_8 paintbits_params2::viewloc::ycoord, paintbits_params2::maprect::y2, moveto_params2::ycoord
|
add16_8 paintbits_params2::viewloc::ycoord, paintbits_params2::maprect::y2, moveto_params2::ycoord
|
||||||
add16 moveto_params2::ycoord, #1, moveto_params2::ycoord
|
add16 moveto_params2::ycoord, #1, moveto_params2::ycoord
|
||||||
add16_8 moveto_params2::ycoord, font_height, moveto_params2::ycoord
|
add16_8 moveto_params2::ycoord, font_height, moveto_params2::ycoord
|
||||||
ldx #3
|
|
||||||
: lda moveto_params2,x
|
COPY_STRUCT MGTK::Point, moveto_params2, L9F94
|
||||||
sta L9F94,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
bit L9F92
|
bit L9F92
|
||||||
bvc LA097
|
bvc LA097
|
||||||
MGTK_CALL MGTK::InitPort, grafport
|
MGTK_CALL MGTK::InitPort, grafport
|
||||||
@ -1696,11 +1681,7 @@ LA0C2: MGTK_CALL MGTK::PaintBits, paintbits_params2
|
|||||||
LA0E6: MGTK_CALL MGTK::SetPenMode, penOR_2
|
LA0E6: MGTK_CALL MGTK::SetPenMode, penOR_2
|
||||||
LA0EC: MGTK_CALL MGTK::PaintRect, paintrect_params6
|
LA0EC: MGTK_CALL MGTK::PaintRect, paintrect_params6
|
||||||
|
|
||||||
LA0F2: ldx #3
|
LA0F2: COPY_STRUCT MGTK::Point, L9F94, moveto_params2
|
||||||
: lda L9F94,x
|
|
||||||
sta moveto_params2,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
MGTK_CALL MGTK::MoveTo, moveto_params2
|
MGTK_CALL MGTK::MoveTo, moveto_params2
|
||||||
bit L9F92
|
bit L9F92
|
||||||
@ -1717,11 +1698,7 @@ setbg: sta settextbg_params
|
|||||||
MGTK_CALL MGTK::ShowCursor
|
MGTK_CALL MGTK::ShowCursor
|
||||||
rts
|
rts
|
||||||
|
|
||||||
LA12C: ldx #.sizeof(paintbits_params)-1
|
LA12C: COPY_BLOCK paintbits_params2, paintbits_params
|
||||||
: lda paintbits_params2,x
|
|
||||||
sta paintbits_params,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
ldy paintbits_params::maprect::y2
|
ldy paintbits_params::maprect::y2
|
||||||
LA13A: lda paintbits_params::mapwidth
|
LA13A: lda paintbits_params::mapwidth
|
||||||
@ -1770,7 +1747,7 @@ icon_poly_size = (8 * .sizeof(MGTK::Point)) + 2
|
|||||||
entry_ptr := $6
|
entry_ptr := $6
|
||||||
bitmap_ptr := $8
|
bitmap_ptr := $8
|
||||||
|
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
|
|
||||||
;; v0 - copy from icon entry
|
;; v0 - copy from icon entry
|
||||||
ldy #IconEntry::iconx+3
|
ldy #IconEntry::iconx+3
|
||||||
@ -1889,7 +1866,7 @@ got_width:
|
|||||||
adc #0
|
adc #0
|
||||||
sta poly::v3::xcoord+1
|
sta poly::v3::xcoord+1
|
||||||
sta poly::v4::xcoord+1
|
sta poly::v4::xcoord+1
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
icon_width: .byte 0
|
icon_width: .byte 0
|
||||||
@ -1906,10 +1883,10 @@ text_width: .byte 0
|
|||||||
;; DT_REDAW_ICON params
|
;; DT_REDAW_ICON params
|
||||||
LA2A9: .byte 0
|
LA2A9: .byte 0
|
||||||
|
|
||||||
LA2AA: jsr pop_zp_addrs
|
LA2AA: jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
LA2AE: jsr push_zp_addrs
|
LA2AE: jsr push_pointers
|
||||||
ldx num_icons
|
ldx num_icons
|
||||||
dex
|
dex
|
||||||
LA2B5: bmi LA2AA
|
LA2B5: bmi LA2AA
|
||||||
@ -2023,7 +2000,7 @@ icon_num: .byte 0
|
|||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
.proc push_zp_addrs
|
.proc push_pointers
|
||||||
;; save return addr
|
;; save return addr
|
||||||
pla
|
pla
|
||||||
sta stash
|
sta stash
|
||||||
@ -2050,7 +2027,7 @@ stash: .word 0
|
|||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
.proc pop_zp_addrs
|
.proc pop_pointers
|
||||||
;; save return addr
|
;; save return addr
|
||||||
pla
|
pla
|
||||||
sta stash
|
sta stash
|
||||||
@ -2148,18 +2125,14 @@ volume:
|
|||||||
.proc erase_icon
|
.proc erase_icon
|
||||||
copy16 poly::v0::ycoord, LA3B1
|
copy16 poly::v0::ycoord, LA3B1
|
||||||
copy16 poly::v6::xcoord, LA3AF
|
copy16 poly::v6::xcoord, LA3AF
|
||||||
ldx #3
|
COPY_BLOCK poly::v4, LA3B3
|
||||||
: lda poly::v4::xcoord,x
|
|
||||||
sta LA3B3,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
MGTK_CALL MGTK::PaintPoly, poly
|
MGTK_CALL MGTK::PaintPoly, poly
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
LA446: jsr push_zp_addrs
|
LA446: jsr push_pointers
|
||||||
ldx num_icons
|
ldx num_icons
|
||||||
dex ; any icons to draw?
|
dex ; any icons to draw?
|
||||||
|
|
||||||
@ -2172,7 +2145,7 @@ LA446: jsr push_zp_addrs
|
|||||||
bpl :+
|
bpl :+
|
||||||
MGTK_CALL MGTK::InitPort, grafport
|
MGTK_CALL MGTK::InitPort, grafport
|
||||||
MGTK_CALL MGTK::SetPort, grafport4
|
MGTK_CALL MGTK::SetPort, grafport4
|
||||||
: jsr pop_zp_addrs
|
: jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
LA466: txa
|
LA466: txa
|
||||||
@ -2281,7 +2254,7 @@ LA56D: .word 0
|
|||||||
|
|
||||||
LA56F: pla
|
LA56F: pla
|
||||||
tay
|
tay
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
tya
|
tya
|
||||||
asl a
|
asl a
|
||||||
tax
|
tax
|
||||||
@ -2294,12 +2267,12 @@ LA56F: pla
|
|||||||
sub16in ($06),y, LA56B, ($06),y
|
sub16in ($06),y, LA56B, ($06),y
|
||||||
iny
|
iny
|
||||||
sub16in ($06),y, LA56D, ($06),y
|
sub16in ($06),y, LA56D, ($06),y
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
LA5CB: pla
|
LA5CB: pla
|
||||||
tay
|
tay
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
tya
|
tya
|
||||||
asl a
|
asl a
|
||||||
tax
|
tax
|
||||||
@ -2312,7 +2285,7 @@ LA5CB: pla
|
|||||||
add16in ($06),y, LA56B, ($06),y
|
add16in ($06),y, LA56B, ($06),y
|
||||||
iny
|
iny
|
||||||
add16in ($06),y, LA56D, ($06),y
|
add16in ($06),y, LA56D, ($06),y
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
@ -2415,11 +2388,9 @@ LA6C7: lda L9F93
|
|||||||
adc #0
|
adc #0
|
||||||
sta setportbits_params2::cliprect::x1+1
|
sta setportbits_params2::cliprect::x1+1
|
||||||
sta setportbits_params2::viewloc::xcoord+1
|
sta setportbits_params2::viewloc::xcoord+1
|
||||||
ldx #5
|
|
||||||
LA6E5: lda LA629,x
|
COPY_BYTES 6, LA629, setportbits_params2::cliprect::y1
|
||||||
sta setportbits_params2::cliprect::y1,x
|
|
||||||
dex
|
|
||||||
bpl LA6E5
|
|
||||||
lda setportbits_params2::cliprect::y1
|
lda setportbits_params2::cliprect::y1
|
||||||
sta setportbits_params2::viewloc::ycoord
|
sta setportbits_params2::viewloc::ycoord
|
||||||
lda setportbits_params2::cliprect::y1+1
|
lda setportbits_params2::cliprect::y1+1
|
||||||
@ -2488,7 +2459,7 @@ LA77D: lda LA6B3,x
|
|||||||
lda findwindow_params::window_id
|
lda findwindow_params::window_id
|
||||||
sta getwinport_params
|
sta getwinport_params
|
||||||
MGTK_CALL MGTK::GetWinPort, getwinport_params
|
MGTK_CALL MGTK::GetWinPort, getwinport_params
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
MGTK_CALL MGTK::GetWinPtr, findwindow_params::window_id
|
MGTK_CALL MGTK::GetWinPtr, findwindow_params::window_id
|
||||||
copy16 LA6AE, $06
|
copy16 LA6AE, $06
|
||||||
ldy #1
|
ldy #1
|
||||||
@ -2541,7 +2512,7 @@ LA833: bit LA6B1
|
|||||||
sta grafport4::cliprect::x2
|
sta grafport4::cliprect::x2
|
||||||
bcc LA846
|
bcc LA846
|
||||||
inc grafport4::cliprect::x2+1
|
inc grafport4::cliprect::x2+1
|
||||||
LA846: jsr pop_zp_addrs
|
LA846: jsr pop_pointers
|
||||||
sub16 grafport4::cliprect::x2, grafport4::cliprect::x1, LA6C3
|
sub16 grafport4::cliprect::x2, grafport4::cliprect::x1, LA6C3
|
||||||
sub16 grafport4::cliprect::y2, grafport4::cliprect::y1, LA6C5
|
sub16 grafport4::cliprect::y2, grafport4::cliprect::y1, LA6C5
|
||||||
lda LA6C3
|
lda LA6C3
|
||||||
|
@ -128,7 +128,7 @@ to:
|
|||||||
lda #$00
|
lda #$00
|
||||||
|
|
||||||
: sta flag
|
: sta flag
|
||||||
jsr desktop_main_push_zp_addrs
|
jsr desktop_main_push_pointers
|
||||||
|
|
||||||
lda cached_window_id
|
lda cached_window_id
|
||||||
asl a ; * 2
|
asl a ; * 2
|
||||||
@ -178,7 +178,7 @@ copy_from:
|
|||||||
|
|
||||||
done: sta RAMRDOFF
|
done: sta RAMRDOFF
|
||||||
sta RAMWRTOFF
|
sta RAMWRTOFF
|
||||||
jsr desktop_main_pop_zp_addrs
|
jsr desktop_main_pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
flag: .byte 0
|
flag: .byte 0
|
||||||
|
@ -261,10 +261,7 @@ L41E2: copy cached_window_id, getwinport_params2::window_id
|
|||||||
jsr get_set_port2
|
jsr get_set_port2
|
||||||
jsr cached_icons_window_to_screen
|
jsr cached_icons_window_to_screen
|
||||||
|
|
||||||
ldx #.sizeof(MGTK::Rect)-1
|
COPY_BLOCK grafport2::cliprect, rect_E230
|
||||||
: copy grafport2::cliprect,x, rect_E230,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
copy #0, L4241
|
copy #0, L4241
|
||||||
L41FE: lda L4241
|
L41FE: lda L4241
|
||||||
@ -308,10 +305,7 @@ bail: rts
|
|||||||
jsr get_port2
|
jsr get_port2
|
||||||
jsr offset_grafport2_and_set
|
jsr offset_grafport2_and_set
|
||||||
|
|
||||||
ldx #.sizeof(MGTK::Rect)-1
|
COPY_BLOCK grafport2::cliprect, rect_E230
|
||||||
: copy grafport2::cliprect,x, rect_E230,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
L4270: lda L42C3
|
L4270: lda L42C3
|
||||||
cmp selected_icon_count
|
cmp selected_icon_count
|
||||||
@ -1993,11 +1987,7 @@ L4FD4: lda #$80
|
|||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
;; Create with current date
|
;; Create with current date
|
||||||
ldx #3
|
COPY_STRUCT DateTime, DATELO, create_params::create_date
|
||||||
: lda DATELO,x
|
|
||||||
sta create_params::create_date,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
;; Create folder
|
;; Create folder
|
||||||
MLI_RELAY_CALL CREATE, create_params
|
MLI_RELAY_CALL CREATE, create_params
|
||||||
@ -2071,10 +2061,11 @@ L5098: .byte $00
|
|||||||
|
|
||||||
.proc cmd_quit_impl
|
.proc cmd_quit_impl
|
||||||
|
|
||||||
stack_data:
|
.proc stack_data
|
||||||
.addr $DEAF,$DEAD ; ???
|
.addr $DEAF,$DEAD ; ???
|
||||||
|
.endproc
|
||||||
|
|
||||||
quit_code:
|
.proc quit_code
|
||||||
;;; note that GS/OS GQUIT is called by ProDOS at $E0D000
|
;;; note that GS/OS GQUIT is called by ProDOS at $E0D000
|
||||||
;;; to quit back to GS/OS.
|
;;; to quit back to GS/OS.
|
||||||
;;; since DeskTop pre-dates GS/OS, it's likely that this does
|
;;; since DeskTop pre-dates GS/OS, it's likely that this does
|
||||||
@ -2087,25 +2078,19 @@ quit_code:
|
|||||||
xce ; enter native mode
|
xce ; enter native mode
|
||||||
jmp $E0D004 ; ProDOS 8->16 QUIT, presumably
|
jmp $E0D004 ; ProDOS 8->16 QUIT, presumably
|
||||||
.popcpu
|
.popcpu
|
||||||
|
.endproc
|
||||||
|
|
||||||
DEFINE_QUIT_PARAMS quit_params
|
DEFINE_QUIT_PARAMS quit_params
|
||||||
|
|
||||||
start:
|
start:
|
||||||
ldx #3
|
COPY_BLOCK stack_data, $0102 ; Populate stack ???
|
||||||
: lda stack_data,x
|
|
||||||
sta $0102,x ; Populate stack ???
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
;; Install new quit routine
|
;; Install new quit routine
|
||||||
sta ALTZPOFF
|
sta ALTZPOFF
|
||||||
lda LCBANK2
|
lda LCBANK2
|
||||||
lda LCBANK2
|
lda LCBANK2
|
||||||
ldx #5
|
|
||||||
: lda quit_code,x
|
COPY_BLOCK quit_code, SELECTOR
|
||||||
sta SELECTOR,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
;; Restore machine to text state
|
;; Restore machine to text state
|
||||||
sta ALTZPOFF
|
sta ALTZPOFF
|
||||||
@ -2176,6 +2161,7 @@ L5162: sta ($06),y
|
|||||||
dey
|
dey
|
||||||
cpy #$1B
|
cpy #$1B
|
||||||
bne L5162
|
bne L5162
|
||||||
|
|
||||||
ldy #$23
|
ldy #$23
|
||||||
ldx #$03
|
ldx #$03
|
||||||
L516D: lda L51EB,x
|
L516D: lda L51EB,x
|
||||||
@ -2183,8 +2169,9 @@ L516D: lda L51EB,x
|
|||||||
dey
|
dey
|
||||||
dex
|
dex
|
||||||
bpl L516D
|
bpl L516D
|
||||||
|
|
||||||
lda active_window_id
|
lda active_window_id
|
||||||
jsr L763A
|
jsr create_file_icon_ep2
|
||||||
lda active_window_id
|
lda active_window_id
|
||||||
sta getwinport_params2::window_id
|
sta getwinport_params2::window_id
|
||||||
jsr get_set_port2
|
jsr get_set_port2
|
||||||
@ -2261,6 +2248,7 @@ L523B: sta ($06),y
|
|||||||
dey
|
dey
|
||||||
cpy #$1B
|
cpy #$1B
|
||||||
bne L523B
|
bne L523B
|
||||||
|
|
||||||
ldy #$23
|
ldy #$23
|
||||||
ldx #$03
|
ldx #$03
|
||||||
L5246: lda L5263,x
|
L5246: lda L5263,x
|
||||||
@ -2268,6 +2256,7 @@ L5246: lda L5263,x
|
|||||||
dey
|
dey
|
||||||
dex
|
dex
|
||||||
bpl L5246
|
bpl L5246
|
||||||
|
|
||||||
lda #$80
|
lda #$80
|
||||||
sta L4152
|
sta L4152
|
||||||
jsr reset_grafport3
|
jsr reset_grafport3
|
||||||
@ -3436,11 +3425,7 @@ L5B1B: .byte 0
|
|||||||
sta L5B1B
|
sta L5B1B
|
||||||
|
|
||||||
;; Restore event coords (following detect_double_click)
|
;; Restore event coords (following detect_double_click)
|
||||||
ldx #3
|
COPY_STRUCT MGTK::Point, saved_event_coords, event_coords
|
||||||
: lda saved_event_coords,x
|
|
||||||
sta event_coords,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
MGTK_RELAY_CALL MGTK::FindControl, event_coords
|
MGTK_RELAY_CALL MGTK::FindControl, event_coords
|
||||||
lda findcontrol_which_ctl
|
lda findcontrol_which_ctl
|
||||||
@ -3897,12 +3882,14 @@ L5F0F: .byte 0
|
|||||||
|
|
||||||
start: copy16 #notpenXOR, $06
|
start: copy16 #notpenXOR, $06
|
||||||
jsr L60D5
|
jsr L60D5
|
||||||
|
|
||||||
ldx #$03
|
ldx #$03
|
||||||
L5F20: lda event_coords,x
|
L5F20: lda event_coords,x
|
||||||
sta L5F0B,x
|
sta L5F0B,x
|
||||||
sta L5F0F,x
|
sta L5F0F,x
|
||||||
dex
|
dex
|
||||||
bpl L5F20
|
bpl L5F20
|
||||||
|
|
||||||
jsr peek_event
|
jsr peek_event
|
||||||
lda event_kind
|
lda event_kind
|
||||||
cmp #MGTK::EventKind::drag
|
cmp #MGTK::EventKind::drag
|
||||||
@ -3981,11 +3968,9 @@ L600E: lda L60CB
|
|||||||
jmp L5F6B
|
jmp L5F6B
|
||||||
|
|
||||||
L601F: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
|
L601F: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
|
||||||
ldx #$03
|
|
||||||
L602A: lda event_coords,x
|
COPY_STRUCT MGTK::Point, event_coords, L60CF
|
||||||
sta L60CF,x
|
|
||||||
dex
|
|
||||||
bpl L602A
|
|
||||||
cmp16 event_xcoord, rect_E230::x2
|
cmp16 event_xcoord, rect_E230::x2
|
||||||
bpl L6068
|
bpl L6068
|
||||||
cmp16 event_xcoord, rect_E230::x1
|
cmp16 event_xcoord, rect_E230::x1
|
||||||
@ -4026,7 +4011,7 @@ L60D1: .word 0
|
|||||||
L60D3: .byte 0
|
L60D3: .byte 0
|
||||||
L60D4: .byte 0
|
L60D4: .byte 0
|
||||||
|
|
||||||
L60D5: jsr push_zp_addrs
|
L60D5: jsr push_pointers
|
||||||
jmp icon_ptr_window_to_screen
|
jmp icon_ptr_window_to_screen
|
||||||
.endproc
|
.endproc
|
||||||
L5F13 := L5F13_impl::start
|
L5F13 := L5F13_impl::start
|
||||||
@ -4849,11 +4834,9 @@ L6978: lda L6A35
|
|||||||
jmp L68E4
|
jmp L68E4
|
||||||
|
|
||||||
L6989: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
|
L6989: MGTK_RELAY_CALL MGTK::FrameRect, rect_E230
|
||||||
ldx #$03
|
|
||||||
L6994: lda event_coords,x
|
COPY_STRUCT MGTK::Point, event_coords, L6A39
|
||||||
sta L6A39,x
|
|
||||||
dex
|
|
||||||
bpl L6994
|
|
||||||
cmp16 event_xcoord, rect_E230::x2
|
cmp16 event_xcoord, rect_E230::x2
|
||||||
bpl L69D2
|
bpl L69D2
|
||||||
cmp16 event_xcoord, rect_E230::x1
|
cmp16 event_xcoord, rect_E230::x1
|
||||||
@ -5108,7 +5091,7 @@ L6C0E: .byte 0
|
|||||||
bmi L6C25
|
bmi L6C25
|
||||||
jmp L6CCD
|
jmp L6CCD
|
||||||
|
|
||||||
L6C25: jsr push_zp_addrs
|
L6C25: jsr push_pointers
|
||||||
lda cached_window_id
|
lda cached_window_id
|
||||||
sta getwinport_params2::window_id
|
sta getwinport_params2::window_id
|
||||||
jsr get_set_port2
|
jsr get_set_port2
|
||||||
@ -5178,7 +5161,7 @@ rloop: lda rows_done
|
|||||||
jmp rloop
|
jmp rloop
|
||||||
|
|
||||||
done: jsr reset_grafport3
|
done: jsr reset_grafport3
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
rows_done:
|
rows_done:
|
||||||
@ -5193,11 +5176,9 @@ L6CCD: lda cached_window_id
|
|||||||
jsr draw_window_header
|
jsr draw_window_header
|
||||||
L6CDE: jsr cached_icons_window_to_screen
|
L6CDE: jsr cached_icons_window_to_screen
|
||||||
jsr offset_grafport2_and_set
|
jsr offset_grafport2_and_set
|
||||||
ldx #$07
|
|
||||||
L6CE6: lda grafport2::cliprect,x
|
COPY_BLOCK grafport2::cliprect, rect_E230
|
||||||
sta rect_E230,x
|
|
||||||
dex
|
|
||||||
bpl L6CE6
|
|
||||||
ldx #$00
|
ldx #$00
|
||||||
txa
|
txa
|
||||||
pha
|
pha
|
||||||
@ -5664,12 +5645,10 @@ L70C4: .byte $00
|
|||||||
|
|
||||||
.proc start
|
.proc start
|
||||||
sta L72A7
|
sta L72A7
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
ldx #$40
|
|
||||||
L70CD: lda LE1B0,x
|
COPY_BYTES $41, LE1B0, vol_info_path_buf
|
||||||
sta vol_info_path_buf,x
|
|
||||||
dex
|
|
||||||
bpl L70CD
|
|
||||||
jsr do_open
|
jsr do_open
|
||||||
lda open_params::ref_num
|
lda open_params::ref_num
|
||||||
sta read_params::ref_num
|
sta read_params::ref_num
|
||||||
@ -5870,7 +5849,7 @@ L7293: jmp do_entry
|
|||||||
|
|
||||||
L7296: copy16 record_ptr, L485F
|
L7296: copy16 record_ptr, L485F
|
||||||
jsr do_close
|
jsr do_close
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
L72A7: .byte 0
|
L72A7: .byte 0
|
||||||
L72A8: .word 0
|
L72A8: .word 0
|
||||||
@ -5973,7 +5952,7 @@ L734A: lda LE1F1+1,x
|
|||||||
inx
|
inx
|
||||||
copy16 LE202,x, $08
|
copy16 LE202,x, $08
|
||||||
ldy #$00
|
ldy #$00
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
L73A5: lda LCBANK2
|
L73A5: lda LCBANK2
|
||||||
lda LCBANK2
|
lda LCBANK2
|
||||||
lda ($08),y
|
lda ($08),y
|
||||||
@ -5988,7 +5967,7 @@ L73A5: lda LCBANK2
|
|||||||
lda $08
|
lda $08
|
||||||
cmp L485F
|
cmp L485F
|
||||||
bne L73A5
|
bne L73A5
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
lda LE1F1
|
lda LE1F1
|
||||||
asl a
|
asl a
|
||||||
tax
|
tax
|
||||||
@ -6031,7 +6010,7 @@ L7449: .word 0
|
|||||||
ldy #$09
|
ldy #$09
|
||||||
lda ($06),y
|
lda ($06),y
|
||||||
tay
|
tay
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
lda $06
|
lda $06
|
||||||
clc
|
clc
|
||||||
adc #$09
|
adc #$09
|
||||||
@ -6052,12 +6031,12 @@ L7471: lda ($06),y
|
|||||||
lda ($08),y
|
lda ($08),y
|
||||||
and #%11011111 ; ???
|
and #%11011111 ; ???
|
||||||
sta ($08),y
|
sta ($08),y
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
ldy #IconEntry::win_type
|
ldy #IconEntry::win_type
|
||||||
lda ($06),y
|
lda ($06),y
|
||||||
and #icon_entry_winid_mask
|
and #icon_entry_winid_mask
|
||||||
bne L74D3
|
bne L74D3
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
lda cached_window_id
|
lda cached_window_id
|
||||||
jsr window_address_lookup
|
jsr window_address_lookup
|
||||||
stax $08
|
stax $08
|
||||||
@ -6094,7 +6073,7 @@ L74C8: lda ($08),y
|
|||||||
L74D3: tay
|
L74D3: tay
|
||||||
lda #$00
|
lda #$00
|
||||||
sta L7620
|
sta L7620
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
tya
|
tya
|
||||||
pha
|
pha
|
||||||
jsr window_address_lookup
|
jsr window_address_lookup
|
||||||
@ -6202,7 +6181,7 @@ L75A3: sta ($06),y
|
|||||||
sta ($06),y
|
sta ($06),y
|
||||||
ldy #$09
|
ldy #$09
|
||||||
sta ($06),y
|
sta ($06),y
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
lda icon_params2
|
lda icon_params2
|
||||||
|
|
||||||
jsr open_directory
|
jsr open_directory
|
||||||
@ -6229,20 +6208,24 @@ L75FA: ldx cached_window_id
|
|||||||
copy16 vol_kb_used, window_k_used_table,x
|
copy16 vol_kb_used, window_k_used_table,x
|
||||||
copy16 vol_kb_free, window_k_free_table,x
|
copy16 vol_kb_free, window_k_free_table,x
|
||||||
lda cached_window_id
|
lda cached_window_id
|
||||||
jsr L7635
|
jsr create_file_icon_ep1
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L7620: .byte $00
|
L7620: .byte $00
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; Icon entry construction
|
;;; File Icon Entry Construction
|
||||||
|
|
||||||
|
.proc create_file_icon
|
||||||
|
|
||||||
L7621: .byte $00 ; window_id ?
|
L7621: .byte $00 ; window_id ?
|
||||||
L7622: .addr 0 ; iconbits
|
L7622: .addr 0 ; iconbits
|
||||||
L7624: .byte $00 ; icon type
|
L7624: .byte $00 ; icon type
|
||||||
L7625: .byte $00
|
L7625: .byte $00
|
||||||
L7626: .word $34,$10
|
|
||||||
|
initial_coords: DEFINE_POINT 52,16
|
||||||
|
|
||||||
L762A: .word 0
|
L762A: .word 0
|
||||||
L762C: .word 0
|
L762C: .word 0
|
||||||
L762E: .byte $05
|
L762E: .byte $05
|
||||||
@ -6251,25 +6234,25 @@ L7630: .word 0
|
|||||||
L7632: .word 0
|
L7632: .word 0
|
||||||
L7634: .byte $00
|
L7634: .byte $00
|
||||||
|
|
||||||
.proc L7635
|
.proc ep1 ; entry point #1 ???
|
||||||
pha
|
pha
|
||||||
lda #$00
|
lda #0
|
||||||
beq L7647
|
beq L7647
|
||||||
L763A: pha
|
|
||||||
|
ep2: pha ; entry point #2 ???
|
||||||
ldx cached_window_id
|
ldx cached_window_id
|
||||||
dex
|
dex
|
||||||
lda LEC26,x
|
lda LEC26,x
|
||||||
sta icon_params2
|
sta icon_params2
|
||||||
lda #$80
|
lda #$80
|
||||||
|
|
||||||
L7647: sta L7634
|
L7647: sta L7634
|
||||||
pla
|
pla
|
||||||
sta L7621
|
sta L7621
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
ldx #$03
|
|
||||||
L7653: lda L7626,x
|
COPY_STRUCT MGTK::Point, initial_coords, L762A
|
||||||
sta L762A,x
|
|
||||||
dex
|
|
||||||
bpl L7653
|
|
||||||
lda #$00
|
lda #$00
|
||||||
sta L762F
|
sta L762F
|
||||||
sta L7625
|
sta L7625
|
||||||
@ -6312,7 +6295,7 @@ L76AA: lda L7625
|
|||||||
|
|
||||||
L76BB: bit L7634
|
L76BB: bit L7634
|
||||||
bpl :+
|
bpl :+
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
: jsr L7B6B
|
: jsr L7B6B
|
||||||
@ -6365,14 +6348,13 @@ L7744: ldy #$22
|
|||||||
lda icon_params2
|
lda icon_params2
|
||||||
ldx L7621
|
ldx L7621
|
||||||
jsr animate_window_open
|
jsr animate_window_open
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L7764: .byte $00,$00,$00
|
L7764: .byte $00,$00,$00
|
||||||
L7767: .byte $14
|
L7767: .byte $14
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
L763A := L7635::L763A
|
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; Create icon
|
;;; Create icon
|
||||||
@ -6487,7 +6469,7 @@ L7826: copy16 L762C, L7632
|
|||||||
cmp L762E
|
cmp L762E
|
||||||
bne L7862
|
bne L7862
|
||||||
add16 L762C, #32, L762C
|
add16 L762C, #32, L762C
|
||||||
copy16 L7626, L762A
|
copy16 initial_coords, L762A
|
||||||
lda #$00
|
lda #$00
|
||||||
sta L762F
|
sta L762F
|
||||||
jmp L7870
|
jmp L7870
|
||||||
@ -6521,7 +6503,7 @@ L7870: lda cached_window_id
|
|||||||
ptr := $6
|
ptr := $6
|
||||||
|
|
||||||
sta file_type
|
sta file_type
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
|
|
||||||
;; Find index of file type
|
;; Find index of file type
|
||||||
copy16 type_table_addr, ptr
|
copy16 type_table_addr, ptr
|
||||||
@ -6548,13 +6530,17 @@ found:
|
|||||||
;; Look up icon definition
|
;; Look up icon definition
|
||||||
copy16 type_icons_addr, ptr
|
copy16 type_icons_addr, ptr
|
||||||
copy16in (ptr),y, L7622
|
copy16in (ptr),y, L7622
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
file_type:
|
file_type:
|
||||||
.byte 0
|
.byte 0
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
.endproc
|
||||||
|
create_file_icon_ep2 := create_file_icon::ep1::ep2
|
||||||
|
create_file_icon_ep1 := create_file_icon::ep1
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; Draw header (items/k in disk/k available/lines)
|
;;; Draw header (items/k in disk/k available/lines)
|
||||||
|
|
||||||
@ -7660,11 +7646,9 @@ loop: lda LEC43,x
|
|||||||
.proc prepare_col_type
|
.proc prepare_col_type
|
||||||
lda LEC53
|
lda LEC53
|
||||||
jsr L8707
|
jsr L8707
|
||||||
ldx #4
|
|
||||||
loop: lda LDFC5,x
|
COPY_BYTES 5, LDFC5, text_buffer2::data-1
|
||||||
sta text_buffer2::data-1,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -7949,7 +7933,7 @@ L84D0: .byte 0
|
|||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
.proc L84D1
|
.proc L84D1
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
bit L5B1B
|
bit L5B1B
|
||||||
bmi L84DC
|
bmi L84DC
|
||||||
jsr cached_icons_window_to_screen
|
jsr cached_icons_window_to_screen
|
||||||
@ -8028,7 +8012,7 @@ L85E4: lda grafport2::cliprect::x1,x
|
|||||||
dey
|
dey
|
||||||
dex
|
dex
|
||||||
bpl L85E4
|
bpl L85E4
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L85F1: .byte 0
|
L85F1: .byte 0
|
||||||
@ -8389,7 +8373,7 @@ check_alpha:
|
|||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; Pushes two words from $6/$8 to stack
|
;;; Pushes two words from $6/$8 to stack
|
||||||
|
|
||||||
.proc push_zp_addrs
|
.proc push_pointers
|
||||||
ptr := $6
|
ptr := $6
|
||||||
|
|
||||||
pla ; stash return address
|
pla ; stash return address
|
||||||
@ -8416,7 +8400,7 @@ addr: .addr 0
|
|||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; Pops two words from stack to $6/$8
|
;;; Pops two words from stack to $6/$8
|
||||||
|
|
||||||
.proc pop_zp_addrs
|
.proc pop_pointers
|
||||||
ptr := $6
|
ptr := $6
|
||||||
|
|
||||||
pla ; stash return address
|
pla ; stash return address
|
||||||
@ -8449,7 +8433,7 @@ port_copy:
|
|||||||
ptr := $6
|
ptr := $6
|
||||||
|
|
||||||
tay
|
tay
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
tya
|
tya
|
||||||
jsr window_lookup
|
jsr window_lookup
|
||||||
stax ptr
|
stax ptr
|
||||||
@ -8461,7 +8445,7 @@ port_copy:
|
|||||||
inx
|
inx
|
||||||
cpx #.sizeof(MGTK::GrafPort)
|
cpx #.sizeof(MGTK::GrafPort)
|
||||||
bne :-
|
bne :-
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -8469,7 +8453,7 @@ port_copy:
|
|||||||
ptr := $6
|
ptr := $6
|
||||||
|
|
||||||
tay
|
tay
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
tya
|
tya
|
||||||
jsr window_lookup
|
jsr window_lookup
|
||||||
stax ptr
|
stax ptr
|
||||||
@ -8481,7 +8465,7 @@ port_copy:
|
|||||||
inx
|
inx
|
||||||
cpx #.sizeof(MGTK::GrafPort)
|
cpx #.sizeof(MGTK::GrafPort)
|
||||||
bne :-
|
bne :-
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -8494,7 +8478,7 @@ port_copy:
|
|||||||
winfo_ptr := $8
|
winfo_ptr := $8
|
||||||
|
|
||||||
tay
|
tay
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
tya
|
tya
|
||||||
jsr icon_entry_lookup
|
jsr icon_entry_lookup
|
||||||
stax entry_ptr
|
stax entry_ptr
|
||||||
@ -8537,7 +8521,7 @@ port_copy:
|
|||||||
;; icony
|
;; icony
|
||||||
sub16in (entry_ptr),y, pos_win+2, (entry_ptr),y
|
sub16in (entry_ptr),y, pos_win+2, (entry_ptr),y
|
||||||
|
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
pos_screen: .word 0, 0
|
pos_screen: .word 0, 0
|
||||||
@ -8551,7 +8535,7 @@ pos_win: .word 0, 0
|
|||||||
|
|
||||||
.proc icon_window_to_screen
|
.proc icon_window_to_screen
|
||||||
tay
|
tay
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
tya
|
tya
|
||||||
jsr icon_entry_lookup
|
jsr icon_entry_lookup
|
||||||
stax $06
|
stax $06
|
||||||
@ -8600,7 +8584,7 @@ pos_win: .word 0, 0
|
|||||||
|
|
||||||
;; icony
|
;; icony
|
||||||
add16in (entry_ptr),y, pos_win+2, (entry_ptr),y
|
add16in (entry_ptr),y, pos_win+2, (entry_ptr),y
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
|
|
||||||
pos_screen: .word 0, 0
|
pos_screen: .word 0, 0
|
||||||
@ -8656,7 +8640,7 @@ success:
|
|||||||
create_icon:
|
create_icon:
|
||||||
icon_ptr := $6
|
icon_ptr := $6
|
||||||
|
|
||||||
jsr push_zp_addrs
|
jsr push_pointers
|
||||||
jsr DESKTOP_ALLOC_ICON
|
jsr DESKTOP_ALLOC_ICON
|
||||||
ldy device_num
|
ldy device_num
|
||||||
sta device_to_icon_map,y
|
sta device_to_icon_map,y
|
||||||
@ -8772,7 +8756,7 @@ selected_device_icon:
|
|||||||
ldy #IconEntry::id
|
ldy #IconEntry::id
|
||||||
lda (icon_ptr),y
|
lda (icon_ptr),y
|
||||||
sta cached_window_icon_list,x
|
sta cached_window_icon_list,x
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
return #0
|
return #0
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -8821,14 +8805,14 @@ remove: lda cached_window_icon_list+1,x
|
|||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
L8B19: jsr push_zp_addrs
|
L8B19: jsr push_pointers
|
||||||
jmp L8B2E
|
jmp L8B2E
|
||||||
|
|
||||||
L8B1F: lda icon_params2
|
L8B1F: lda icon_params2
|
||||||
bne L8B25
|
bne L8B25
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L8B25: jsr push_zp_addrs
|
L8B25: jsr push_pointers
|
||||||
lda icon_params2
|
lda icon_params2
|
||||||
jsr L7345
|
jsr L7345
|
||||||
;; fall through
|
;; fall through
|
||||||
@ -8854,7 +8838,7 @@ skip: lda icon_params2
|
|||||||
and #(~icon_entry_open_mask)&$FF ; clear open_flag
|
and #(~icon_entry_open_mask)&$FF ; clear open_flag
|
||||||
sta ($06),y
|
sta ($06),y
|
||||||
jsr L4244
|
jsr L4244
|
||||||
jsr pop_zp_addrs
|
jsr pop_pointers
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -8882,6 +8866,7 @@ open: ldy #$00
|
|||||||
clc
|
clc
|
||||||
adc #$23
|
adc #$23
|
||||||
tay
|
tay
|
||||||
|
|
||||||
ldx #$23
|
ldx #$23
|
||||||
: lda (ptr),y
|
: lda (ptr),y
|
||||||
sta grafport2,x
|
sta grafport2,x
|
||||||
@ -11620,11 +11605,7 @@ LA46C: rts
|
|||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
.proc LA46D
|
.proc LA46D
|
||||||
ldx #10
|
COPY_BYTES 11, file_info_params2::access, file_info_params3::access
|
||||||
loop: lda file_info_params2::access,x
|
|
||||||
sta file_info_params3::access,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -11642,6 +11623,9 @@ done: rts
|
|||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
;;; Show Alert Dialog
|
||||||
|
;;; A=error. If ERR_VOL_NOT_FOUND or ERR_FILE_NOT_FOUND, will
|
||||||
|
;;; show "please insert source disk" (or destination, if flag set)
|
||||||
|
|
||||||
.proc show_error_alert_impl
|
.proc show_error_alert_impl
|
||||||
|
|
||||||
@ -11985,19 +11969,19 @@ LA777: jmp format_erase_overlay::L0CF9
|
|||||||
LA77A: bit LD8E7
|
LA77A: bit LD8E7
|
||||||
bvc LA79B
|
bvc LA79B
|
||||||
cmp #'Y'
|
cmp #'Y'
|
||||||
beq LA7E8
|
beq do_yes
|
||||||
cmp #'y'
|
cmp #'y'
|
||||||
beq LA7E8
|
beq do_yes
|
||||||
cmp #'N'
|
cmp #'N'
|
||||||
beq LA7F7
|
beq do_no
|
||||||
cmp #'n'
|
cmp #'n'
|
||||||
beq LA7F7
|
beq do_no
|
||||||
cmp #'A'
|
cmp #'A'
|
||||||
beq LA806
|
beq do_all
|
||||||
cmp #'a'
|
cmp #'a'
|
||||||
beq LA806
|
beq do_all
|
||||||
cmp #CHAR_RETURN
|
cmp #CHAR_RETURN
|
||||||
beq LA7E8
|
beq do_yes
|
||||||
|
|
||||||
LA79B: bit LD8F5
|
LA79B: bit LD8F5
|
||||||
bmi LA7C8
|
bmi LA7C8
|
||||||
@ -12027,7 +12011,7 @@ LA7C8: cmp #' '
|
|||||||
bcs LA7CF
|
bcs LA7CF
|
||||||
jmp LA717
|
jmp LA717
|
||||||
|
|
||||||
LA7CF: cmp #$7E
|
LA7CF: cmp #'~'
|
||||||
beq LA7DD
|
beq LA7DD
|
||||||
bcc LA7DD
|
bcc LA7DD
|
||||||
jmp LA717
|
jmp LA717
|
||||||
@ -12038,17 +12022,16 @@ LA7DD: ldx has_input_field_flag
|
|||||||
beq LA7E5
|
beq LA7E5
|
||||||
jsr LBB0B
|
jsr LBB0B
|
||||||
LA7E5: return #$FF
|
LA7E5: return #$FF
|
||||||
.endproc
|
|
||||||
|
|
||||||
LA7E8: jsr set_penmode_xor2
|
do_yes: jsr set_penmode_xor2
|
||||||
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect
|
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::yes_button_rect
|
||||||
return #prompt_button_yes
|
return #prompt_button_yes
|
||||||
|
|
||||||
LA7F7: jsr set_penmode_xor2
|
do_no: jsr set_penmode_xor2
|
||||||
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect
|
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::no_button_rect
|
||||||
return #prompt_button_no
|
return #prompt_button_no
|
||||||
|
|
||||||
LA806: jsr set_penmode_xor2
|
do_all: jsr set_penmode_xor2
|
||||||
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect
|
MGTK_RELAY_CALL MGTK::PaintRect, desktop_aux::all_button_rect
|
||||||
return #prompt_button_all
|
return #prompt_button_all
|
||||||
|
|
||||||
@ -12098,10 +12081,13 @@ LA88D: lda has_input_field_flag
|
|||||||
beq LA895
|
beq LA895
|
||||||
jsr LBB63
|
jsr LBB63
|
||||||
LA895: return #$FF
|
LA895: return #$FF
|
||||||
|
.endproc
|
||||||
|
|
||||||
rts1:
|
rts1:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
jump_relay:
|
jump_relay:
|
||||||
.assert * = $A899, error, "Entry point used by overlay"
|
.assert * = $A899, error, "Entry point used by overlay"
|
||||||
jmp dummy0000
|
jmp dummy0000
|
||||||
@ -12560,7 +12546,7 @@ LAE42: cmp #$40
|
|||||||
LAE49: copy #$80, has_input_field_flag
|
LAE49: copy #$80, has_input_field_flag
|
||||||
jsr clear_path_buf2
|
jsr clear_path_buf2
|
||||||
lda #$00
|
lda #$00
|
||||||
jsr LB509
|
jsr open_prompt_window
|
||||||
lda winfo_alert_dialog
|
lda winfo_alert_dialog
|
||||||
jsr set_port_from_window_id
|
jsr set_port_from_window_id
|
||||||
addr_call draw_dialog_title, desktop_aux::str_new_folder_title
|
addr_call draw_dialog_title, desktop_aux::str_new_folder_title
|
||||||
@ -12647,7 +12633,7 @@ LAF34: copy #0, has_input_field_flag
|
|||||||
lsr a
|
lsr a
|
||||||
ror a
|
ror a
|
||||||
eor #$80
|
eor #$80
|
||||||
jsr LB509
|
jsr open_prompt_window
|
||||||
lda winfo_alert_dialog
|
lda winfo_alert_dialog
|
||||||
jsr set_port_from_window_id
|
jsr set_port_from_window_id
|
||||||
addr_call draw_dialog_title, desktop_aux::str_info_title
|
addr_call draw_dialog_title, desktop_aux::str_info_title
|
||||||
@ -12913,7 +12899,7 @@ LB27D: jsr clear_path_buf1
|
|||||||
copy #$80, has_input_field_flag
|
copy #$80, has_input_field_flag
|
||||||
jsr clear_path_buf2
|
jsr clear_path_buf2
|
||||||
lda #$00
|
lda #$00
|
||||||
jsr LB509
|
jsr open_prompt_window
|
||||||
lda winfo_alert_dialog
|
lda winfo_alert_dialog
|
||||||
jsr set_port_from_window_id
|
jsr set_port_from_window_id
|
||||||
addr_call draw_dialog_title, desktop_aux::str_rename_title
|
addr_call draw_dialog_title, desktop_aux::str_rename_title
|
||||||
@ -13109,10 +13095,7 @@ set_penmode_xor2:
|
|||||||
double_click_deltax := 5
|
double_click_deltax := 5
|
||||||
double_click_deltay := 4
|
double_click_deltay := 4
|
||||||
|
|
||||||
ldx #3
|
COPY_STRUCT MGTK::Point, event_coords, coords
|
||||||
: copy event_coords,x, coords,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta counter+1
|
sta counter+1
|
||||||
@ -13219,22 +13202,25 @@ unused: .byte 0 ; unused
|
|||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
LB509:
|
.proc open_prompt_window
|
||||||
.assert * = $B509, error, "Entry point used by overlay"
|
.assert * = $B509, error, "Entry point used by overlay"
|
||||||
sta LD8E7
|
sta LD8E7
|
||||||
jsr open_dialog_window
|
jsr open_dialog_window
|
||||||
bit LD8E7
|
bit LD8E7
|
||||||
bvc LB51A
|
bvc :+
|
||||||
jsr draw_yes_no_all_cancel_buttons
|
jsr draw_yes_no_all_cancel_buttons
|
||||||
jmp LB526
|
jmp no_ok
|
||||||
|
|
||||||
LB51A: MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::ok_button_rect
|
: MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::ok_button_rect
|
||||||
jsr draw_ok_label
|
jsr draw_ok_label
|
||||||
LB526: bit LD8E7
|
no_ok: bit LD8E7
|
||||||
bmi LB537
|
bmi done
|
||||||
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::cancel_button_rect
|
MGTK_RELAY_CALL MGTK::FrameRect, desktop_aux::cancel_button_rect
|
||||||
jsr draw_cancel_label
|
jsr draw_cancel_label
|
||||||
LB537: jmp reset_grafport3a
|
done: jmp reset_grafport3a
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
.proc open_dialog_window
|
.proc open_dialog_window
|
||||||
MGTK_RELAY_CALL MGTK::OpenWindow, winfo_alert_dialog
|
MGTK_RELAY_CALL MGTK::OpenWindow, winfo_alert_dialog
|
||||||
@ -13246,6 +13232,8 @@ LB537: jmp reset_grafport3a
|
|||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
.proc open_alert_window
|
.proc open_alert_window
|
||||||
MGTK_RELAY_CALL MGTK::OpenWindow, winfo_alert_dialog
|
MGTK_RELAY_CALL MGTK::OpenWindow, winfo_alert_dialog
|
||||||
lda winfo_alert_dialog
|
lda winfo_alert_dialog
|
||||||
@ -14122,11 +14110,7 @@ LBD33: rts
|
|||||||
target := $20
|
target := $20
|
||||||
|
|
||||||
;; Backup copy of $20
|
;; Backup copy of $20
|
||||||
ldx #proc_len
|
COPY_BYTES proc_len+1, target, saved_proc_buf
|
||||||
: lda target,x
|
|
||||||
sta saved_proc_buf,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
;; Overwrite with proc
|
;; Overwrite with proc
|
||||||
ldx #proc_len
|
ldx #proc_len
|
||||||
@ -14140,11 +14124,7 @@ LBD33: rts
|
|||||||
pha
|
pha
|
||||||
|
|
||||||
;; Restore copy
|
;; Restore copy
|
||||||
ldx #proc_len
|
COPY_BYTES proc_len+1, saved_proc_buf, target
|
||||||
: lda saved_proc_buf,x
|
|
||||||
sta target,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
pla
|
pla
|
||||||
rts
|
rts
|
||||||
@ -14312,8 +14292,8 @@ reset_grafport3a:
|
|||||||
PAD_TO $BF00
|
PAD_TO $BF00
|
||||||
|
|
||||||
.endproc ; desktop_main
|
.endproc ; desktop_main
|
||||||
desktop_main_pop_zp_addrs := desktop_main::pop_zp_addrs
|
desktop_main_pop_pointers := desktop_main::pop_pointers
|
||||||
desktop_main_push_zp_addrs := desktop_main::push_zp_addrs
|
desktop_main_push_pointers := desktop_main::push_pointers
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; Segment loaded into MAIN $800-$FFF
|
;;; Segment loaded into MAIN $800-$FFF
|
||||||
@ -14449,12 +14429,12 @@ found_ram:
|
|||||||
.proc populate_icon_entries_table
|
.proc populate_icon_entries_table
|
||||||
ptr := $6
|
ptr := $6
|
||||||
|
|
||||||
jsr desktop_main::push_zp_addrs
|
jsr desktop_main::push_pointers
|
||||||
copy16 #icon_entries, ptr
|
copy16 #icon_entries, ptr
|
||||||
ldx #1
|
ldx #1
|
||||||
loop: cpx #max_icon_count
|
loop: cpx #max_icon_count
|
||||||
bne :+
|
bne :+
|
||||||
jsr desktop_main::pop_zp_addrs
|
jsr desktop_main::pop_pointers
|
||||||
jmp end
|
jmp end
|
||||||
: txa
|
: txa
|
||||||
pha
|
pha
|
||||||
|
159
desktop/mgtk.s
159
desktop/mgtk.s
@ -101,16 +101,8 @@
|
|||||||
bpl adjust_stack
|
bpl adjust_stack
|
||||||
|
|
||||||
;; Save $80...$FF, swap in what MGTK needs at $F4...$FF
|
;; Save $80...$FF, swap in what MGTK needs at $F4...$FF
|
||||||
ldx #$7F
|
COPY_BYTES $80, $80, zp_saved
|
||||||
: lda $80,x
|
COPY_BYTES $C, active_saved, active_port
|
||||||
sta zp_saved,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
ldx #$0B
|
|
||||||
: lda active_saved,x
|
|
||||||
sta active_port,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
jsr apply_active_port_to_port
|
jsr apply_active_port_to_port
|
||||||
|
|
||||||
adjust_stack: ; Adjust stack to account for params
|
adjust_stack: ; Adjust stack to account for params
|
||||||
@ -195,16 +187,9 @@ cleanup:
|
|||||||
: bit preserve_zp_flag
|
: bit preserve_zp_flag
|
||||||
bpl exit_with_0
|
bpl exit_with_0
|
||||||
jsr apply_port_to_active_port
|
jsr apply_port_to_active_port
|
||||||
ldx #$0B
|
|
||||||
: lda active_port,x
|
COPY_BYTES $C, active_port, active_saved
|
||||||
sta active_saved,x
|
COPY_BYTES $80, zp_saved, $80
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
ldx #$7F
|
|
||||||
: lda zp_saved,x
|
|
||||||
sta $80,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
;; default is to return with A=0
|
;; default is to return with A=0
|
||||||
exit_with_0:
|
exit_with_0:
|
||||||
@ -1690,11 +1675,7 @@ frect_ctr: .byte 0
|
|||||||
bottom := $A5
|
bottom := $A5
|
||||||
|
|
||||||
ldy #3
|
ldy #3
|
||||||
rloop: ldx #7
|
rloop: COPY_BYTES 8, left, left_masks_table
|
||||||
: lda left,x
|
|
||||||
sta left_masks_table,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
ldx rect_sides,y
|
ldx rect_sides,y
|
||||||
lda left,x
|
lda left,x
|
||||||
pha
|
pha
|
||||||
@ -1708,11 +1689,7 @@ rloop: ldx #7
|
|||||||
ldy frect_ctr
|
ldy frect_ctr
|
||||||
dey
|
dey
|
||||||
bpl rloop
|
bpl rloop
|
||||||
ldx #3
|
COPY_BYTES 4, left, current_penloc
|
||||||
: lda left,x
|
|
||||||
sta current_penloc,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
.endproc
|
.endproc
|
||||||
prts: rts
|
prts: rts
|
||||||
|
|
||||||
@ -3646,11 +3623,7 @@ next_byte:
|
|||||||
text_ndbm:
|
text_ndbm:
|
||||||
inc $A0
|
inc $A0
|
||||||
:
|
:
|
||||||
ldx #15
|
COPY_BYTES 16, text_bits_buf+16, text_bits_buf
|
||||||
: lda text_bits_buf+16,x
|
|
||||||
sta text_bits_buf,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
jmp L5BFF
|
jmp L5BFF
|
||||||
|
|
||||||
|
|
||||||
@ -3914,12 +3887,7 @@ maybe_stash:
|
|||||||
bpl end
|
bpl end
|
||||||
|
|
||||||
;; Copy buffer to ZP $00-$43
|
;; Copy buffer to ZP $00-$43
|
||||||
stash:
|
stash: COPY_BYTES $44, low_zp_stash_buffer, $00
|
||||||
ldx #$43
|
|
||||||
: lda low_zp_stash_buffer,x
|
|
||||||
sta $00,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
end: rts
|
end: rts
|
||||||
|
|
||||||
@ -3929,11 +3897,7 @@ maybe_unstash:
|
|||||||
|
|
||||||
;; Copy ZP $00-$43 to buffer
|
;; Copy ZP $00-$43 to buffer
|
||||||
unstash:
|
unstash:
|
||||||
ldx #$43
|
COPY_BYTES $44, $00, low_zp_stash_buffer
|
||||||
: lda $00,x
|
|
||||||
sta low_zp_stash_buffer,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
maybe_stash_low_zp := SetZP2Impl::maybe_stash
|
maybe_stash_low_zp := SetZP2Impl::maybe_stash
|
||||||
@ -4309,11 +4273,7 @@ active_cursor_mask := draw_cursor::active_cursor_mask
|
|||||||
bit cursor_flag
|
bit cursor_flag
|
||||||
bmi drts
|
bmi drts
|
||||||
|
|
||||||
ldx #3
|
COPY_BYTES 4, cursor_data, cursor_bytes
|
||||||
: lda cursor_data,x
|
|
||||||
sta cursor_bytes,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
ldx #$23
|
ldx #$23
|
||||||
ldy cursor_y2
|
ldy cursor_y2
|
||||||
@ -4600,11 +4560,7 @@ savesize: .res 2
|
|||||||
pla
|
pla
|
||||||
sta save_p_reg
|
sta save_p_reg
|
||||||
|
|
||||||
ldx #4
|
COPY_BYTES 5, params::machine, machid
|
||||||
: lda params::machine,x
|
|
||||||
sta machid,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
lda #$7F
|
lda #$7F
|
||||||
sta standard_port::textback
|
sta standard_port::textback
|
||||||
@ -5227,11 +5183,7 @@ up: lda #MGTK::EventKind::button_up
|
|||||||
set_state:
|
set_state:
|
||||||
sta input::state
|
sta input::state
|
||||||
|
|
||||||
ldx #2
|
COPY_BYTES 3, set_pos_params, input::key
|
||||||
: lda set_pos_params,x
|
|
||||||
sta input::key,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
put_key_event:
|
put_key_event:
|
||||||
jsr put_event
|
jsr put_event
|
||||||
@ -5269,11 +5221,7 @@ body: ; returned by GetIntHandler
|
|||||||
lda LOWSCR
|
lda LOWSCR
|
||||||
sta SET80COL
|
sta SET80COL
|
||||||
|
|
||||||
ldx #8 ; preserve 9 bytes of ZP
|
COPY_BYTES 9, $82, int_stash_zp ; preserve 9 bytes of ZP
|
||||||
sloop: lda $82,x
|
|
||||||
sta int_stash_zp,x
|
|
||||||
dex
|
|
||||||
bpl sloop
|
|
||||||
|
|
||||||
ldy #SERVEMOUSE
|
ldy #SERVEMOUSE
|
||||||
jsr call_mouse
|
jsr call_mouse
|
||||||
@ -5284,11 +5232,7 @@ sloop: lda $82,x
|
|||||||
bpl :+
|
bpl :+
|
||||||
clc ; carry clear if interrupt handled
|
clc ; carry clear if interrupt handled
|
||||||
|
|
||||||
: ldx #8 ; restore ZP
|
: COPY_BYTES 9, int_stash_zp, $82 ; restore ZP
|
||||||
rloop: lda int_stash_zp,x
|
|
||||||
sta $82,x
|
|
||||||
dex
|
|
||||||
bpl rloop
|
|
||||||
|
|
||||||
lda LOWSCR ; restore soft switches
|
lda LOWSCR ; restore soft switches
|
||||||
sta CLR80COL
|
sta CLR80COL
|
||||||
@ -6611,11 +6555,7 @@ check_char: .res 1
|
|||||||
control_char: .res 1
|
control_char: .res 1
|
||||||
END_PARAM_BLOCK
|
END_PARAM_BLOCK
|
||||||
|
|
||||||
ldx #3
|
COPY_BYTES 4, params, menu_glyphs
|
||||||
loop: lda params,x
|
|
||||||
sta menu_glyphs,x
|
|
||||||
dex
|
|
||||||
bpl loop
|
|
||||||
|
|
||||||
copy16 standard_port::textfont, params
|
copy16 standard_port::textfont, params
|
||||||
ldy #0
|
ldy #0
|
||||||
@ -6967,11 +6907,7 @@ in_winrect:
|
|||||||
;; and height of the maprect of the window's port.
|
;; and height of the maprect of the window's port.
|
||||||
;;
|
;;
|
||||||
.proc get_winrect
|
.proc get_winrect
|
||||||
ldx #3
|
COPY_BLOCK current_winport::viewloc, winrect ; copy viewloc to left/top of winrect
|
||||||
: lda current_winport::viewloc,x ; copy viewloc to left/top of winrect
|
|
||||||
sta winrect,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
ldx #2
|
ldx #2
|
||||||
: lda current_winport::maprect::x2,x ; x2/y2
|
: lda current_winport::maprect::x2,x ; x2/y2
|
||||||
@ -7786,11 +7722,8 @@ win_port: .addr 0
|
|||||||
jsr window_by_id_or_exit
|
jsr window_by_id_or_exit
|
||||||
copy16 params::win_port, params_addr
|
copy16 params::win_port, params_addr
|
||||||
|
|
||||||
ldx #7
|
COPY_STRUCT MGTK::Rect, fill_rect_params, current_maprect_x1
|
||||||
: lda fill_rect_params,x
|
|
||||||
sta current_maprect_x1,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
jsr prepare_winport
|
jsr prepare_winport
|
||||||
bcc err_obscured
|
bcc err_obscured
|
||||||
|
|
||||||
@ -8243,11 +8176,7 @@ DragWindowImpl_drag_or_grow := DragWindowImpl::drag_or_grow
|
|||||||
jsr set_desktop_port
|
jsr set_desktop_port
|
||||||
jsr get_winframerect
|
jsr get_winframerect
|
||||||
|
|
||||||
ldx #7
|
COPY_BLOCK winrect, left
|
||||||
: lda winrect,x
|
|
||||||
sta left,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
jsr clip_rect
|
jsr clip_rect
|
||||||
|
|
||||||
ldx #3
|
ldx #3
|
||||||
@ -9237,21 +9166,13 @@ movement_cancel: .byte $00
|
|||||||
kbd_mouse_status: .byte $00
|
kbd_mouse_status: .byte $00
|
||||||
|
|
||||||
.proc kbd_mouse_save_zp
|
.proc kbd_mouse_save_zp
|
||||||
ldx #$7F
|
COPY_BYTES $80, $80, kbd_mouse_zp_stash
|
||||||
: lda $80,x
|
|
||||||
sta kbd_mouse_zp_stash,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
.proc kbd_mouse_restore_zp
|
.proc kbd_mouse_restore_zp
|
||||||
ldx #$7F
|
COPY_BYTES $80, kbd_mouse_zp_stash,$80
|
||||||
: lda kbd_mouse_zp_stash,x
|
|
||||||
sta $80,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -9346,11 +9267,7 @@ scale_y:
|
|||||||
|
|
||||||
|
|
||||||
.proc kbd_mouse_to_mouse
|
.proc kbd_mouse_to_mouse
|
||||||
ldx #2
|
COPY_BYTES 3, kbd_mouse_x, mouse_x
|
||||||
: lda kbd_mouse_x,x
|
|
||||||
sta mouse_x,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -9362,11 +9279,7 @@ scale_y:
|
|||||||
|
|
||||||
.proc save_mouse_pos
|
.proc save_mouse_pos
|
||||||
jsr read_mouse_pos
|
jsr read_mouse_pos
|
||||||
ldx #2
|
COPY_BYTES 3, mouse_x, saved_mouse_pos
|
||||||
: lda mouse_x,x
|
|
||||||
sta saved_mouse_pos,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -9506,11 +9419,7 @@ waitloop:
|
|||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta kbd_mouse_status ; reset mouse button status
|
sta kbd_mouse_status ; reset mouse button status
|
||||||
ldx #2
|
COPY_BYTES 3, set_pos_params, kbd_mouse_x
|
||||||
: lda set_pos_params,x
|
|
||||||
sta kbd_mouse_x,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
ret: rts
|
ret: rts
|
||||||
|
|
||||||
in_kbd_mouse:
|
in_kbd_mouse:
|
||||||
@ -9545,11 +9454,7 @@ pla_ret:
|
|||||||
and #$20
|
and #$20
|
||||||
beq kbd_mouse_to_mouse_jmp
|
beq kbd_mouse_to_mouse_jmp
|
||||||
|
|
||||||
ldx #2
|
COPY_BYTES 3, mouse_x, kbd_mouse_x
|
||||||
: lda mouse_x,x
|
|
||||||
sta kbd_mouse_x,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
stx kbd_menu_select_flag ; =$ff
|
stx kbd_menu_select_flag ; =$ff
|
||||||
rts
|
rts
|
||||||
@ -10047,21 +9952,13 @@ out_of_boundsl:
|
|||||||
not_left:
|
not_left:
|
||||||
sta set_input_key
|
sta set_input_key
|
||||||
|
|
||||||
ldx #.sizeof(MGTK::GrafPort)-1
|
COPY_STRUCT MGTK::GrafPort, $A7, $0600
|
||||||
: lda $A7,x
|
|
||||||
sta $0600,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
lda set_input_key
|
lda set_input_key
|
||||||
jsr kbd_menu_by_shortcut
|
jsr kbd_menu_by_shortcut
|
||||||
php
|
php
|
||||||
|
|
||||||
ldx #.sizeof(MGTK::GrafPort)-1
|
COPY_STRUCT MGTK::GrafPort, $0600, $A7
|
||||||
: lda $0600,x
|
|
||||||
sta $A7,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
plp
|
plp
|
||||||
bcc :+
|
bcc :+
|
||||||
|
@ -48,11 +48,7 @@ start: lda #$80
|
|||||||
MGTK_RELAY_CALL MGTK::SetZP1, ptr
|
MGTK_RELAY_CALL MGTK::SetZP1, ptr
|
||||||
|
|
||||||
;; Copy menu bar up to language card, and use it.
|
;; Copy menu bar up to language card, and use it.
|
||||||
ldx #.sizeof(menu_bar)
|
COPY_BYTES .sizeof(menu_bar)+1, menu_bar, $D400
|
||||||
: lda menu_bar,x
|
|
||||||
sta $D400,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
MGTK_RELAY_CALL MGTK::SetMenu, menu_target
|
MGTK_RELAY_CALL MGTK::SetMenu, menu_target
|
||||||
|
|
||||||
;; Clear most of the system bitmap
|
;; Clear most of the system bitmap
|
||||||
|
@ -18,7 +18,7 @@ L0800: pha
|
|||||||
;;; Format Disk
|
;;; Format Disk
|
||||||
|
|
||||||
L080C: copy #$00, has_input_field_flag
|
L080C: copy #$00, has_input_field_flag
|
||||||
jsr desktop_main::LB509
|
jsr desktop_main::open_prompt_window
|
||||||
lda winfo_alert_dialog
|
lda winfo_alert_dialog
|
||||||
jsr desktop_main::set_port_from_window_id
|
jsr desktop_main::set_port_from_window_id
|
||||||
addr_call desktop_main::draw_dialog_title, desktop_aux::str_format_disk
|
addr_call desktop_main::draw_dialog_title, desktop_aux::str_format_disk
|
||||||
@ -154,7 +154,7 @@ L09D8: .byte 0
|
|||||||
|
|
||||||
L09D9: lda #$00
|
L09D9: lda #$00
|
||||||
sta has_input_field_flag
|
sta has_input_field_flag
|
||||||
jsr desktop_main::LB509
|
jsr desktop_main::open_prompt_window
|
||||||
lda winfo_alert_dialog
|
lda winfo_alert_dialog
|
||||||
jsr desktop_main::set_port_from_window_id
|
jsr desktop_main::set_port_from_window_id
|
||||||
addr_call desktop_main::draw_dialog_title, desktop_aux::str_erase_disk
|
addr_call desktop_main::draw_dialog_title, desktop_aux::str_erase_disk
|
||||||
|
@ -1179,11 +1179,7 @@ L5C27: ldx $177F
|
|||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
.proc L5C4F
|
.proc L5C4F
|
||||||
ldx #3
|
COPY_STRUCT MGTK::Point, screentowindow_screenx, L5CF0
|
||||||
: lda screentowindow_screenx,x
|
|
||||||
sta L5CF0,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
lda machine_type ; Timer for insertion point blink
|
lda machine_type ; Timer for insertion point blink
|
||||||
sta ip_blink_counter
|
sta ip_blink_counter
|
||||||
@ -1885,7 +1881,7 @@ L631A: iny
|
|||||||
L6322: lda L63BE
|
L6322: lda L63BE
|
||||||
sta L63C0
|
sta L63C0
|
||||||
ldx #$0F
|
ldx #$0F
|
||||||
lda #$20
|
lda #' '
|
||||||
L632C: sta L63C2,x
|
L632C: sta L63C2,x
|
||||||
dex
|
dex
|
||||||
bpl L632C
|
bpl L632C
|
||||||
|
@ -129,6 +129,17 @@ ERR_END_OF_FILE := $4C
|
|||||||
ERR_ACCESS_ERROR := $4E
|
ERR_ACCESS_ERROR := $4E
|
||||||
ERR_DUPLICATE_VOLUME := $57
|
ERR_DUPLICATE_VOLUME := $57
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
;;; Misc Structures
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
.struct DateTime
|
||||||
|
datelo .byte
|
||||||
|
datehi .byte
|
||||||
|
timelo .byte
|
||||||
|
timehi .byte
|
||||||
|
.endstruct
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; Directory Structures
|
;;; Directory Structures
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
22
macros.inc
22
macros.inc
@ -641,3 +641,25 @@ skip: dec arg
|
|||||||
.org saved_org
|
.org saved_org
|
||||||
.endscope
|
.endscope
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
;;; Structure Helpers
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
.macro COPY_BYTES size, src, dst
|
||||||
|
.scope
|
||||||
|
ldx #size - 1
|
||||||
|
loop: lda src,x
|
||||||
|
sta dst,x
|
||||||
|
dex
|
||||||
|
bpl loop
|
||||||
|
.endscope
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
.macro COPY_STRUCT type, src, dst
|
||||||
|
COPY_BYTES .sizeof(type), src, dst
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
.macro COPY_BLOCK block, dst
|
||||||
|
COPY_BYTES .sizeof(block), block, dst
|
||||||
|
.endmacro
|
||||||
|
Loading…
x
Reference in New Issue
Block a user