Skip to content

Commit

Permalink
Shave a few bytes IIgs-specific startup/shutdown paths
Browse files Browse the repository at this point in the history
On the IIgs the TSB/TRB opcodes can be used to save a few bytes.

No functional changes.
  • Loading branch information
inexorabletash committed Oct 24, 2024
1 parent 16589f5 commit 0a2edbb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
18 changes: 10 additions & 8 deletions desktop.system/desktop.system.s
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,16 @@ str_128k_required:
;; IIgs: Reset shadowing
sec
jsr IDROUTINE
bcs :+
lda SHADOW
and #%10000000 ; bit 7 is reserved
sta SHADOW
lda NEWVIDEO
and #%00011111 ; bits 1-4 are reserved, bit 0 unchanged
sta NEWVIDEO
:
IF_CC
.pushcpu
.p816
.a8
lda #%01111111 ; bit 7 is reserved
trb SHADOW ; ensure shadowing is enabled
lda #%11100000 ; bits 1-4 are reserved, bit 0 unchanged
trb NEWVIDEO ; color DHR, etc
.popcpu
END_IF
rts
.endproc ; ClearScreenEnable80Cols

Expand Down
19 changes: 11 additions & 8 deletions lib/bootstrap.s
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ self:
;; IIgs: Reset shadowing
sec
jsr IDROUTINE
bcs :+
lda SHADOW
and #%10000000 ; bit 7 is reserved
sta SHADOW
lda NEWVIDEO
and #%00011111 ; bits 1-4 are reserved, bit 0 unchanged
sta NEWVIDEO
:
IF_CC
.pushcpu
.p816
.a8
lda #%01111111 ; bit 7 is reserved
trb SHADOW ; ensure shadowing is enabled
lda #%11100000 ; bits 1-4 are reserved, bit 0 unchanged
trb NEWVIDEO ; color DHR, etc
.popcpu
END_IF

;; --------------------------------------------------
;; Display the loading string
retry:
Expand Down

0 comments on commit 0a2edbb

Please sign in to comment.