addax macro

This commit is contained in:
Joshua Bell 2018-03-04 21:52:38 -08:00
parent 08a034911b
commit 5c46794531
2 changed files with 48 additions and 75 deletions

View File

@ -6101,7 +6101,7 @@ not_menu:
L445C: .byte 0 L445C: .byte 0
L445D: jsr clear_selection L445D: jsr clear_selection
ldx $D20E ldx findwindow_window_id
dex dex
lda LEC26,x lda LEC26,x
sta icon_param sta icon_param
@ -6722,12 +6722,7 @@ L49A6: lda menu_click_params::item_num
sbc #$06 sbc #$06
sta L49A5 sta L49A5
jsr a_times_16 jsr a_times_16
clc addax #run_list_entries, $06
adc #$1E
sta $06
txa
adc #$DB
sta $06+1
ldy #$0F ldy #$0F
lda ($06),y lda ($06),y
asl a asl a
@ -6756,12 +6751,7 @@ L49ED: lda L49A5
L49FA: lda L49A5 L49FA: lda L49A5
jsr a_times_64 jsr a_times_64
clc addax #$DB9E, $06
adc #$9E
sta $06
txa
adc #$DB
sta $06+1
L4A0A: ldy #$00 L4A0A: ldy #$00
lda ($06),y lda ($06),y
tay tay
@ -6794,12 +6784,7 @@ L4A2B: iny
L4A46: .byte 0 L4A46: .byte 0
L4A47: pha L4A47: pha
jsr a_times_64 jsr a_times_64
clc addax #$DB9E, $06
adc #$9E
sta $06
txa
adc #$DB
sta $06+1
ldy #$00 ldy #$00
lda ($06),y lda ($06),y
tay tay
@ -6933,12 +6918,7 @@ L4AEA: jsr L4B5F
addr_call copy_LD3EE_str, path_buffer addr_call copy_LD3EE_str, path_buffer
lda L4BB0 lda L4BB0
jsr a_times_64 jsr a_times_64
clc addax #$DB9E, $06
adc #<$DB9E
sta $06
txa
adc #>$DB9E
sta $06+1
ldy #$00 ldy #$00
lda ($06),y lda ($06),y
sta L4BB1 sta L4BB1
@ -8755,12 +8735,7 @@ L59F3: ldy menu_click_params::item_num
jmp L5A4C jmp L5A4C
L59FE: jsr icon_entry_lookup L59FE: jsr icon_entry_lookup
clc addax #9, $06
adc #$09
sta $06
txa
adc #$00
sta $06+1
ldy #$00 ldy #$00
lda ($06),y lda ($06),y
tay tay
@ -9894,12 +9869,7 @@ L650D: .word 0
.proc L6523 .proc L6523
lda active_window_id lda active_window_id
jsr window_lookup jsr window_lookup
clc addax #$14, $06
adc #$14
sta $06
txa
adc #$00
sta $06+1
ldy #$25 ldy #$25
: lda ($06),y : lda ($06),y
sta grafport2,y sta grafport2,y
@ -10197,7 +10167,7 @@ L67F6: bit BUTN0
bne L6818 bne L6818
DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, findicon_which_icon DESKTOP_RELAY_CALL DT_HIGHLIGHT_ICON, findicon_which_icon
ldx selected_icon_count ldx selected_icon_count
lda $D20D lda findicon_which_icon
sta selected_icon_list,x sta selected_icon_list,x
inc selected_icon_count inc selected_icon_count
jmp L6834 jmp L6834
@ -10389,23 +10359,20 @@ L6A3E: .byte 0
;;; ============================================================ ;;; ============================================================
.proc L6A3F .proc L6A3F
ldx #$07 ptr := $6
L6A41: cmp LEC26,x
ldx #7
: cmp LEC26,x
beq L6A80 beq L6A80
dex dex
bpl L6A41 bpl :-
jsr icon_entry_lookup jsr icon_entry_lookup
clc addax #icon_entry_offset_len, ptr
adc #$09 ldy #0
sta $06 lda (ptr),y
txa
adc #$00
sta $06+1
ldy #$00
lda ($06),y
tay tay
dey dey
L6A5C: lda ($06),y L6A5C: lda (ptr),y
sta $220,y sta $220,y
dey dey
bpl L6A5C bpl L6A5C
@ -19206,13 +19173,13 @@ LBBA4: lda path_buf1
cpx #1 cpx #1
beq LBBBC beq LBBBC
LBBB1: lda path_buf2,x LBBB1: lda path_buf2,x
sta $D485,x sta path_buf2+1,x
dex dex
cpx #1 cpx #1
bne LBBB1 bne LBBB1
LBBBC: ldx path_buf1 LBBBC: ldx path_buf1
lda path_buf1,x lda path_buf1,x
sta $D486 sta path_buf2+2
dec path_buf1 dec path_buf1
inc path_buf2 inc path_buf2
jsr measure_path_buf1 jsr measure_path_buf1
@ -19234,14 +19201,14 @@ LBC03: lda path_buf2
LBC0B: ldx path_buf1 LBC0B: ldx path_buf1
inx inx
lda $D486 lda path_buf2+2
sta path_buf1,x sta path_buf1,x
inc path_buf1 inc path_buf1
ldx path_buf2 ldx path_buf2
cpx #$03 cpx #$03
bcc LBC2D bcc LBC2D
ldx #$02 ldx #$02
LBC21: lda $D485,x LBC21: lda path_buf2+1,x
sta path_buf2,x sta path_buf2,x
inx inx
cpx path_buf2 cpx path_buf2
@ -19273,11 +19240,11 @@ LBC79: dex
stx LD3C0+1 stx LD3C0+1
ldx path_buf1 ldx path_buf1
LBC80: lda path_buf1,x LBC80: lda path_buf1,x
sta $D485,x sta path_buf2+1,x
dex dex
bne LBC80 bne LBC80
lda LD8EF lda LD8EF
sta $D485 sta path_buf2+1
inc path_buf1 inc path_buf1
lda path_buf1 lda path_buf1
sta path_buf2 sta path_buf2
@ -19393,7 +19360,7 @@ LBD33: rts
LBD69: lda #$01 LBD69: lda #$01
sta path_buf2 sta path_buf2
lda LD8EF lda LD8EF
sta $D485 sta path_buf2+1
rts rts
LBD75: lda #$00 LBD75: lda #$00
@ -20022,30 +19989,15 @@ read_selector_list:
;; Width of "123456 Items" ;; Width of "123456 Items"
addr_call desktop_main::measure_text1, str_items addr_call desktop_main::measure_text1, str_items
clc addax dx, width_items_label
adc dx
sta width_items_label
txa
adc dx+1
sta width_items_label+1
;; Width of "123456K in disk" ;; Width of "123456K in disk"
addr_call desktop_main::measure_text1, str_k_in_disk addr_call desktop_main::measure_text1, str_k_in_disk
clc addax dx, width_k_in_disk_label
adc dx
sta width_k_in_disk_label
txa
adc dx+1
sta width_k_in_disk_label+1
;; Width of "123456K available" ;; Width of "123456K available"
addr_call desktop_main::measure_text1, str_k_available addr_call desktop_main::measure_text1, str_k_available
clc addax dx, width_k_available_label
adc dx
sta width_k_available_label
txa
adc dx+1
sta width_k_available_label+1
add16 width_k_in_disk_label, width_k_available_label, width_right_labels add16 width_k_in_disk_label, width_k_available_label, width_right_labels
add16 width_items_label, #5, width_items_label_padded add16 width_items_label, #5, width_items_label_padded

View File

@ -197,6 +197,27 @@
sta arg3+1 sta arg3+1
.endmacro .endmacro
;;; Add A,Z to arg1 (immediate or absolute), store to arg2
;;; addax #$1111, $3333 ; immediate, absolute
;;; addax $1111, $3333 ; absolute, absolute
.macro addax arg1, arg2
.if is_immediate {arg1}
clc
adc #<immediate_value {arg1}
sta arg2
txa
adc #>immediate_value {arg1}
sta arg2+1
.else
clc
adc arg1
sta arg2
txa
adc arg1+1
sta arg2+1
.endif
.endmacro
;;; Subtract arg2 from arg1, store to arg3 ;;; Subtract arg2 from arg1, store to arg3
;;; sub16 #$1111, $2222, $3333 ; immediate, absolute, absolute ;;; sub16 #$1111, $2222, $3333 ; immediate, absolute, absolute
;;; sub16 $1111, #$2222, $3333 ; absolute, immediate, absolute ;;; sub16 $1111, #$2222, $3333 ; absolute, immediate, absolute