Skip to content

Commit

Permalink
MGTK: Shave 16 bytes.
Browse files Browse the repository at this point in the history
No functional changes.
  • Loading branch information
inexorabletash committed Feb 3, 2025
1 parent 2f59b04 commit 190fd6b
Showing 1 changed file with 26 additions and 31 deletions.
57 changes: 26 additions & 31 deletions mgtk/mgtk.s
Original file line number Diff line number Diff line change
Expand Up @@ -5663,6 +5663,11 @@ set_x: stax current_penloc_x
rts
.endproc ; SetPenloc

.proc SetFillModeXOR
lda #MGTK::penXOR
FALL_THROUGH_TO SetFillMode
.endproc ; SetFillModeXOR

;; Set fill mode to A
.proc SetFillMode
sta current_penmode
Expand Down Expand Up @@ -6037,8 +6042,7 @@ loop: lda curmenu::x_min,x
dex
bpl loop

lda #MGTK::penXOR
jsr SetFillMode
jsr SetFillModeXOR
MGTK_CALL MGTK::PaintRect, hilite_menu_rect
rts
.endproc ; HiliteMenu
Expand Down Expand Up @@ -6676,6 +6680,12 @@ last_cursor_pos:
rts
.endproc ; SavebehindGetVidaddr

;;; ============================================================

.proc SaveScreenRectImpl
jsr SetUpRectSavebehind
FALL_THROUGH_TO DoSavebehind
.endproc ; SaveScreenRectImpl

.proc DoSavebehind
loop: jsr SavebehindGetVidaddr
Expand Down Expand Up @@ -6709,6 +6719,11 @@ row: ldy savebehind_mapwidth
: rts
.endproc ; SavebehindNextLine

.proc RestoreScreenRectImpl
jsr SetUpRectSavebehind
jmp RestoreSavebehind
.endproc ; RestoreScreenRectImpl

.proc RestoreMenuSavebehind
jsr SetUpMenuSavebehind
FALL_THROUGH_TO RestoreSavebehind
Expand Down Expand Up @@ -6903,8 +6918,7 @@ ep2: jsr SetFillMode
MGTK_CALL MGTK::PaintRect, menu_item_rect
MGTK_CALL MGTK::SetPattern, standard_port::pattern

lda #MGTK::penXOR
jmp SetFillMode
jmp SetFillModeXOR
.endproc ; DimMenuitem

.proc DrawFiller
Expand Down Expand Up @@ -6953,8 +6967,7 @@ hmrts: rts
sty menu_fill_rect+MGTK::Rect::y2
jsr HideCursorImpl

lda #MGTK::penXOR
jsr SetFillMode
jsr SetFillModeXOR
MGTK_CALL MGTK::PaintRect, menu_fill_rect
jmp ShowCursorImpl
.endproc ; HiliteMenuItem
Expand Down Expand Up @@ -7561,8 +7574,8 @@ stripes_pattern_alt := *+1
copy16 winrect::y2, bottom

lda winrect::y1
and #1
beq :+
ror
bcc :+
MGTK_CALL MGTK::SetPattern, stripes_pattern
rts

Expand All @@ -7574,7 +7587,7 @@ stripes_pattern_alt := *+1
.proc EraseWinframe
lda #MGTK::penOR
ldx #0
beq :+
beq :+ ; always
.endproc ; EraseWinframe

.proc DrawWinframe
Expand Down Expand Up @@ -8325,8 +8338,7 @@ in_close_box: .byte 0
lda #$80
toggle: sta in_close_box

lda #MGTK::penXOR
jsr SetFillMode
jsr SetFillModeXOR

jsr HideCursorImpl
MGTK_CALL MGTK::PaintRect, winrect
Expand Down Expand Up @@ -8417,8 +8429,7 @@ drag_or_grow:
: jsr HideCursorSaveParams
jsr WinframeToSetPort

lda #MGTK::penXOR
jsr SetFillMode
jsr SetFillModeXOR
MGTK_CALL MGTK::SetPattern, checkerboard_pattern

loop: jsr GetWindow
Expand Down Expand Up @@ -9365,8 +9376,7 @@ got_ctl:lda params::which_ctl
jsr SaveParamsAndStack
jsr SetDesktopPort

lda #MGTK::penXOR
jsr SetFillMode
jsr SetFillModeXOR
MGTK_CALL MGTK::SetPattern, light_speckles_pattern

jsr HideCursorImpl
Expand Down Expand Up @@ -10591,28 +10601,13 @@ rect .tag MGTK::Rect
.proc FlashMenuBarImpl
jsr SaveParamsAndStack
jsr SetStandardPort
lda #MGTK::penXOR
jsr SetFillMode
jsr SetFillModeXOR
MGTK_CALL MGTK::PaintRect, menu_bar_rect
jmp RestoreParamsActivePort
.endproc ; FlashMenuBarImpl

;;; ============================================================

.proc SaveScreenRectImpl
jsr SetUpRectSavebehind
jmp DoSavebehind
.endproc ; SaveScreenRectImpl

;;; ============================================================

.proc RestoreScreenRectImpl
jsr SetUpRectSavebehind
jmp RestoreSavebehind
.endproc ; RestoreScreenRectImpl

;;; ============================================================

.proc InflateRectImpl
PARAM_BLOCK params, $82
rect .addr
Expand Down

0 comments on commit 190fd6b

Please sign in to comment.