Skip to content

Commit

Permalink
DeskTop: Shave 23 bytes using smaller rect offset code
Browse files Browse the repository at this point in the history
No functional changes.
  • Loading branch information
inexorabletash committed Oct 11, 2024
1 parent 3fa6229 commit 5d25e2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion desktop/desktop.s
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
DEFSEG SegmentLoader, $2000, $0200
DEFSEG SegmentDeskTopAux, $4000, $8000
DEFSEG SegmentDeskTopLC, $D000, $2000
DEFSEG SegmentDeskTopMain, $4000, $7900
DEFSEG SegmentDeskTopMain, $4000, $7800
DEFSEG SegmentInitializer, $0800, $0900
DEFSEG SegmentInvoker, $0290, $0160

Expand Down
15 changes: 11 additions & 4 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -3558,10 +3558,17 @@ common:
copy #(560 / kDeltaX), iter_count

rect_loop:
add16 delta_x, tmp_rect+MGTK::Rect::x1, tmp_rect+MGTK::Rect::x1
add16 delta_x, tmp_rect+MGTK::Rect::x2, tmp_rect+MGTK::Rect::x2
add16 delta_y, tmp_rect+MGTK::Rect::y1, tmp_rect+MGTK::Rect::y1
add16 delta_y, tmp_rect+MGTK::Rect::y2, tmp_rect+MGTK::Rect::y2
;; Offset rect
ptr := $06
copy16 #tmp_rect, ptr
ldy #0
ldx #2
: add16in (ptr),y, delta_x, (ptr),y
iny
add16in (ptr),y, delta_y, (ptr),y
iny
dex
bne :-

copy #0, index
icon_loop:
Expand Down

0 comments on commit 5d25e2b

Please sign in to comment.