From c1673a5de616628a6b00a3a6940038177cddb687 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Fri, 25 Jan 2019 00:14:45 -0800 Subject: [PATCH] disasm: volume icon clippping/window props --- desktop/desktop_aux.s | 103 ++++++++++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 40 deletions(-) diff --git a/desktop/desktop_aux.s b/desktop/desktop_aux.s index 151917f..8b9bfa3 100644 --- a/desktop/desktop_aux.s +++ b/desktop/desktop_aux.s @@ -2376,33 +2376,41 @@ done: MGTK_CALL MGTK::SetPortBits, portbits ;;; ============================================================ .proc calc_window_intersections + ptr := $06 lda #$00 ; immediately overwritten??? jmp LA6C7 +;;; findwindow_params::window_id is used as first part of +;;; GetWinPtr params structure including window_ptr. .proc findwindow_params mousex: .word 0 mousey: .word 0 which_area: .byte 0 window_id: .byte 0 .endproc +window_ptr: .word 0 + + -LA6AE: .word 0 pt_num: .byte $00 -LA6B1: .byte $00 -LA6B2: .byte $00 +scrollbar_flags: + .byte 0 ; bit 7 = hscroll present; bit 6 = vscroll present +dialogbox_flag: + .byte 0 ; bit 7 = dialog box pt1: DEFINE_POINT 0,0,pt1 pt2: DEFINE_POINT 0,0,pt2 pt3: DEFINE_POINT 0,0,pt3 pt4: DEFINE_POINT 0,0,pt4 -LA6C3: .word 0 -LA6C5: .word 0 +xcoord: .word 0 +ycoord: .word 0 LA6C7: lda more_drawing_needed_flag beq LA6FA + ;; portbits::cliprect::x1 = portbits::viewloc::xcoord = porbits::cliprect::x2 lda portbits::cliprect::x2 clc adc #1 @@ -2417,6 +2425,10 @@ LA6C7: lda more_drawing_needed_flag copy16 portbits::cliprect::y1, portbits::viewloc::ycoord + ;; pt1::xcoord = pt4::xcoord = portbits::cliprect::x1 + ;; pt1::xcoord = pt2::xcoord = portbits::cliprect::y1 + ;; pt2::xcoord = pt3::xcoord = portbits::cliprect::x2 + ;; pt3::xcoord = pt4::xcoord = portbits::cliprect::y2 LA6FA: lda portbits::cliprect::x1 sta pt1::xcoord sta pt4::xcoord @@ -2493,30 +2505,36 @@ LA775: lda pt_num lda findwindow_params::window_id sta getwinport_params MGTK_CALL MGTK::GetWinPort, getwinport_params + jsr push_pointers + MGTK_CALL MGTK::GetWinPtr, findwindow_params::window_id - copy16 LA6AE, $06 - ldy #1 - lda ($06),y - and #$01 - bne LA7C3 - sta LA6B2 - beq LA7C8 -LA7C3: copy #$80, LA6B2 -LA7C8: ldy #4 - lda ($06),y - and #$80 - sta LA6B1 + copy16 window_ptr, ptr + + ;; Check window properties + ldy #MGTK::Winfo::options + lda (ptr),y ; options + and #MGTK::Option::dialog_box + bne :+ ; yes + sta dialogbox_flag + beq @continue +: copy #$80, dialogbox_flag +@continue: + + ldy #MGTK::Winfo::hscroll + lda (ptr),y ; hscroll + and #MGTK::Scroll::option_present + sta scrollbar_flags iny - lda ($06),y - and #$80 + lda (ptr),y ; vscroll + and #MGTK::Scroll::option_present lsr a - ora LA6B1 - sta LA6B1 + ora scrollbar_flags + sta scrollbar_flags sub16 icon_grafport::viewloc::xcoord, #2, icon_grafport::viewloc::xcoord sub16 icon_grafport::cliprect::x1, #2, icon_grafport::cliprect::x1 - bit LA6B2 + bit dialogbox_flag bmi LA820 ;; viewloc::ycoord -= 14 @@ -2537,7 +2555,7 @@ LA7C8: ldy #4 dec icon_grafport::cliprect::y1+1 : -LA820: bit LA6B1 +LA820: bit scrollbar_flags bpl :+ ;; cliprect::y2 += 12 @@ -2548,7 +2566,7 @@ LA820: bit LA6B1 bcc :+ inc icon_grafport::cliprect::y2+1 -: bit LA6B1 +: bit scrollbar_flags bvc :+ ;; cliprect::x2 += 20 @@ -2560,25 +2578,26 @@ LA820: bit LA6B1 inc icon_grafport::cliprect::x2+1 : jsr pop_pointers - sub16 icon_grafport::cliprect::x2, icon_grafport::cliprect::x1, LA6C3 - sub16 icon_grafport::cliprect::y2, icon_grafport::cliprect::y1, LA6C5 - ;; LA6C3 += viewloc::xcoord - lda LA6C3 + sub16 icon_grafport::cliprect::x2, icon_grafport::cliprect::x1, xcoord + sub16 icon_grafport::cliprect::y2, icon_grafport::cliprect::y1, ycoord + + ;; xcoord += viewloc::xcoord + lda xcoord clc adc icon_grafport::viewloc::xcoord - sta LA6C3 + sta xcoord lda icon_grafport::viewloc::xcoord+1 - adc LA6C3+1 - sta LA6C3+1 + adc xcoord+1 + sta xcoord+1 - ;; LA6C5 += viewloc::ycoord - add16 LA6C5, icon_grafport::viewloc::ycoord, LA6C5 + ;; ycoord += viewloc::ycoord + add16 ycoord, icon_grafport::viewloc::ycoord, ycoord - ;; if (cliprect::x2 < LA6C3) LA6C3 = cliprect::x2 + 1 - cmp16 portbits::cliprect::x2, LA6C3 + ;; if (cliprect::x2 < xcoord) xcoord = cliprect::x2 + 1 + cmp16 portbits::cliprect::x2, xcoord bmi :+ - add16 LA6C3, #1, portbits::cliprect::x2 + add16 xcoord, #1, portbits::cliprect::x2 jmp LA8D4 ;; if (viewloc::xcoord < cliprect::x1) viewloc::xcoord = cliprect::x2 @@ -2588,27 +2607,31 @@ LA820: bit LA6B1 jmp LA6FA - ;; if (viewloc::ycoord < cliprect::y1) viewloc::ycoord = cliprect::y2 + ;; if (viewloc::ycoord < cliprect::y1) LA8D4: cmp16 icon_grafport::viewloc::ycoord, portbits::cliprect::y1 bmi :+ + ;; viewloc::ycoord = cliprect::y2 copy16 icon_grafport::viewloc::ycoord, portbits::cliprect::y2 copy #1, more_drawing_needed_flag jmp LA6FA -: cmp16 LA6C5, portbits::cliprect::y2 + ;; if (ycoord > portbits::cliprect::y2) +: cmp16 ycoord, portbits::cliprect::y2 bpl LA923 - lda LA6C5 + ;; portbits::cliprect::y1 = portbits::viewloc::ycoord = ycoord + 2 + lda ycoord clc adc #2 sta portbits::cliprect::y1 sta portbits::viewloc::ycoord - lda LA6C5+1 + lda ycoord+1 adc #0 sta portbits::cliprect::y1+1 sta portbits::viewloc::ycoord+1 copy #1, more_drawing_needed_flag jmp LA6FA + ;; portbits::cliprect::x1 = portview::viewloc::xcoord = portbits::cliprect::x2 LA923: lda portbits::cliprect::x2 sta portbits::cliprect::x1 sta portbits::viewloc::xcoord