mirror of
https://github.com/mi57730/a2d.git
synced 2025-08-09 01:24:57 +00:00
main loop noodling
This commit is contained in:
@@ -5829,52 +5829,62 @@ JT_RESTORE_SEF: jmp restore_dynamic_routine
|
|||||||
;; Main Loop
|
;; Main Loop
|
||||||
.proc enter_main_loop
|
.proc enter_main_loop
|
||||||
cli
|
cli
|
||||||
|
|
||||||
sta ALTZPON
|
sta ALTZPON
|
||||||
lda LCBANK1
|
lda LCBANK1
|
||||||
lda LCBANK1
|
lda LCBANK1
|
||||||
jsr L4530
|
|
||||||
|
jsr L4530 ; something with DEVLST ???
|
||||||
|
|
||||||
|
;; Add icons (presumably desktop ones?)
|
||||||
ldx #0
|
ldx #0
|
||||||
L4051: cpx cached_window_icon_count
|
iloop: cpx cached_window_icon_count
|
||||||
beq L4069
|
beq skip
|
||||||
txa
|
txa
|
||||||
pha
|
pha
|
||||||
lda cached_window_icon_list,x
|
lda cached_window_icon_list,x
|
||||||
jsr icon_entry_lookup
|
jsr icon_entry_lookup
|
||||||
ldy #1
|
ldy #DT_ADD_ICON
|
||||||
jsr DESKTOP_RELAY
|
jsr DESKTOP_RELAY ; icon entry addr in A,X
|
||||||
pla
|
pla
|
||||||
tax
|
tax
|
||||||
inx
|
inx
|
||||||
jmp L4051
|
jmp iloop
|
||||||
|
|
||||||
L4069: lda #0
|
skip: lda #0
|
||||||
sta cached_window_id
|
sta cached_window_id
|
||||||
jsr DESKTOP_COPY_FROM_BUF
|
jsr DESKTOP_COPY_FROM_BUF
|
||||||
|
|
||||||
|
;; Clear various flags
|
||||||
lda #0
|
lda #0
|
||||||
sta LD2A9
|
sta LD2A9
|
||||||
sta double_click_flag
|
sta double_click_flag
|
||||||
sta L40DF
|
sta loop_counter
|
||||||
sta $E26F
|
sta $E26F
|
||||||
lda L599F
|
|
||||||
|
;; Pending error message?
|
||||||
|
lda pending_alert
|
||||||
beq main_loop
|
beq main_loop
|
||||||
tay
|
tay
|
||||||
jsr DESKTOP_SHOW_ALERT0
|
jsr DESKTOP_SHOW_ALERT0
|
||||||
|
|
||||||
;; Main loop
|
;; Main loop
|
||||||
|
|
||||||
main_loop:
|
main_loop:
|
||||||
jsr reset_grafport3
|
jsr reset_grafport3
|
||||||
inc L40DF
|
|
||||||
inc L40DF
|
inc loop_counter
|
||||||
lda L40DF
|
inc loop_counter
|
||||||
cmp machine_type
|
lda loop_counter
|
||||||
bcc L40A6
|
cmp machine_type ; for per-machine timing
|
||||||
|
bcc :+
|
||||||
lda #0
|
lda #0
|
||||||
sta L40DF
|
sta loop_counter
|
||||||
jsr L4563
|
|
||||||
beq L40A6
|
jsr L4563 ; called every few ticks ???
|
||||||
jsr L40E0
|
beq :+
|
||||||
L40A6: jsr L464E
|
jsr L40E0 ; conditionally ???
|
||||||
|
|
||||||
|
: jsr L464E
|
||||||
|
|
||||||
;; Get an event
|
;; Get an event
|
||||||
jsr get_event
|
jsr get_event
|
||||||
@@ -5906,12 +5916,16 @@ click: jsr handle_click
|
|||||||
|
|
||||||
: jmp main_loop
|
: jmp main_loop
|
||||||
|
|
||||||
L40DF: .byte $00
|
loop_counter:
|
||||||
|
.byte 0
|
||||||
|
|
||||||
|
;;; --------------------------------------------------
|
||||||
|
|
||||||
L40E0: tsx
|
L40E0: tsx
|
||||||
stx LE256
|
stx LE256
|
||||||
sta menu_click_params::item_num
|
sta menu_click_params::item_num
|
||||||
jsr L59A0
|
jsr L59A0
|
||||||
lda #$00
|
lda #0
|
||||||
sta menu_click_params::item_num
|
sta menu_click_params::item_num
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@@ -6418,32 +6432,38 @@ L44A6: MGTK_RELAY_CALL MGTK::SelectWindow, findwindow_params_window_id
|
|||||||
|
|
||||||
;;; ==================================================
|
;;; ==================================================
|
||||||
|
|
||||||
L4530: ldx #$00
|
.proc L4530
|
||||||
|
ldx #0
|
||||||
ldy DEVCNT
|
ldy DEVCNT
|
||||||
L4535: lda DEVLST,y
|
loop: lda DEVLST,y
|
||||||
and #$0F
|
and #$0F
|
||||||
cmp #$0B
|
cmp #$0B ; RAM Disk???
|
||||||
beq L4559
|
beq L4559
|
||||||
L453E: dey
|
next: dey
|
||||||
bpl L4535
|
bpl loop
|
||||||
|
|
||||||
stx L4597
|
stx L4597
|
||||||
stx L45A0
|
stx L45A0
|
||||||
jsr L45B2
|
jsr L45B2
|
||||||
ldx L45A0
|
ldx L45A0
|
||||||
beq L4558
|
beq done
|
||||||
L454F: lda L45A0,x
|
: lda L45A0,x
|
||||||
sta L45A9,x
|
sta L45A9,x
|
||||||
dex
|
dex
|
||||||
bpl L454F
|
bpl :-
|
||||||
L4558: rts
|
done: rts
|
||||||
|
|
||||||
L4559: lda DEVLST,y
|
L4559: lda DEVLST,y
|
||||||
inx
|
inx
|
||||||
sta L4597,x
|
sta L4597,x
|
||||||
bne L453E
|
bne next
|
||||||
rts
|
rts
|
||||||
|
.endproc
|
||||||
|
|
||||||
L4563: lda L45A0
|
;;; ==================================================
|
||||||
|
|
||||||
|
.proc L4563
|
||||||
|
lda L45A0
|
||||||
beq L4579
|
beq L4579
|
||||||
jsr L45B2
|
jsr L45B2
|
||||||
ldx L45A0
|
ldx L45A0
|
||||||
@@ -6468,6 +6488,9 @@ L4591: tya
|
|||||||
clc
|
clc
|
||||||
adc #$03
|
adc #$03
|
||||||
rts
|
rts
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
;;; ==================================================
|
||||||
|
|
||||||
.byte $00
|
.byte $00
|
||||||
L4597: .byte $00,$00,$00,$00,$00,$00,$00,$00
|
L4597: .byte $00,$00,$00,$00,$00,$00,$00,$00
|
||||||
@@ -6476,7 +6499,13 @@ L45A0: .byte $00,$00,$00,$00,$00,$00,$00,$00
|
|||||||
.byte $00
|
.byte $00
|
||||||
L45A9: .byte $00,$00,$00,$00,$00,$00,$00,$00
|
L45A9: .byte $00,$00,$00,$00,$00,$00,$00,$00
|
||||||
.byte $00
|
.byte $00
|
||||||
L45B2: ldx L4597
|
|
||||||
|
;;; ==================================================
|
||||||
|
|
||||||
|
;; Possibly SmartPort STATUS call to determine ejectability ???
|
||||||
|
|
||||||
|
.proc L45B2
|
||||||
|
ldx L4597
|
||||||
beq L45C6
|
beq L45C6
|
||||||
stx L45A0
|
stx L45A0
|
||||||
L45BA: lda L4597,x
|
L45BA: lda L4597,x
|
||||||
@@ -6552,13 +6581,18 @@ L4629: sta L4638
|
|||||||
|
|
||||||
L4634: jmp ($06)
|
L4634: jmp ($06)
|
||||||
|
|
||||||
L4637: .byte $00
|
L4637: .byte 0
|
||||||
L4638: .byte $00
|
L4638: .byte 0
|
||||||
L4639: .byte $03
|
|
||||||
L463A: .byte $01
|
;; params for call
|
||||||
|
L4639: .byte 3
|
||||||
|
L463A: .byte 1
|
||||||
.addr L463E
|
.addr L463E
|
||||||
.byte 0
|
.byte 0
|
||||||
L463E: .res 16, 0
|
L463E: .res 16, 0
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
;;; ==================================================
|
||||||
|
|
||||||
L464E: lda LD343
|
L464E: lda LD343
|
||||||
beq :+
|
beq :+
|
||||||
@@ -8882,8 +8916,9 @@ L58E2: lda active_window_id
|
|||||||
;;; ==================================================
|
;;; ==================================================
|
||||||
|
|
||||||
.proc cmd_check_drives
|
.proc cmd_check_drives
|
||||||
lda #$00
|
lda #0
|
||||||
sta L599F
|
sta pending_alert
|
||||||
|
|
||||||
sta cached_window_id
|
sta cached_window_id
|
||||||
jsr DESKTOP_COPY_TO_BUF
|
jsr DESKTOP_COPY_TO_BUF
|
||||||
jsr cmd_close_all
|
jsr cmd_close_all
|
||||||
@@ -8919,8 +8954,8 @@ L594A: ldy L599E
|
|||||||
jsr get_device_info
|
jsr get_device_info
|
||||||
cmp #$57
|
cmp #$57
|
||||||
bne L5967
|
bne L5967
|
||||||
lda #$F9
|
lda #$F9 ; "... 2 volumes with the same name..."
|
||||||
sta L599F
|
sta pending_alert
|
||||||
L5967: inc L599E
|
L5967: inc L599E
|
||||||
lda L599E
|
lda L599E
|
||||||
cmp DEVCNT
|
cmp DEVCNT
|
||||||
@@ -8929,7 +8964,7 @@ L5967: inc L599E
|
|||||||
ldx #$00
|
ldx #$00
|
||||||
L5976: cpx cached_window_icon_count
|
L5976: cpx cached_window_icon_count
|
||||||
bne L5986
|
bne L5986
|
||||||
lda L599F
|
lda pending_alert
|
||||||
beq L5983
|
beq L5983
|
||||||
jsr DESKTOP_SHOW_ALERT0
|
jsr DESKTOP_SHOW_ALERT0
|
||||||
L5983: jmp DESKTOP_COPY_FROM_BUF
|
L5983: jmp DESKTOP_COPY_FROM_BUF
|
||||||
@@ -8951,7 +8986,10 @@ L5998: pla
|
|||||||
;;; ==================================================
|
;;; ==================================================
|
||||||
|
|
||||||
L599E: .byte 0
|
L599E: .byte 0
|
||||||
L599F: .byte 0
|
|
||||||
|
pending_alert:
|
||||||
|
.byte 0
|
||||||
|
|
||||||
L59A0: lda #$00
|
L59A0: lda #$00
|
||||||
beq L59AA
|
beq L59AA
|
||||||
L59A4: lda #$80
|
L59A4: lda #$80
|
||||||
@@ -20422,8 +20460,8 @@ L0D09: .byte 0
|
|||||||
;;; ==================================================
|
;;; ==================================================
|
||||||
|
|
||||||
.proc L0D0A
|
.proc L0D0A
|
||||||
ldy #$00
|
ldy #0
|
||||||
sty desktop_main::L599F
|
sty desktop_main::pending_alert
|
||||||
sty L0E33
|
sty L0E33
|
||||||
L0D12: lda L0E33
|
L0D12: lda L0E33
|
||||||
asl a
|
asl a
|
||||||
@@ -20461,8 +20499,8 @@ L0D12: lda L0E33
|
|||||||
|
|
||||||
L0D64: cmp #$57
|
L0D64: cmp #$57
|
||||||
bne L0D6D
|
bne L0D6D
|
||||||
lda #$F9
|
lda #$F9 ; "... 2 volumes with the same name..."
|
||||||
sta desktop_main::L599F
|
sta desktop_main::pending_alert
|
||||||
L0D6D: pla
|
L0D6D: pla
|
||||||
pha
|
pha
|
||||||
and #$0F
|
and #$0F
|
||||||
|
Reference in New Issue
Block a user