Skip to content

Commit

Permalink
DeskTop: Increase buffer overlay size to 16k
Browse files Browse the repository at this point in the history
Allows preview DAs (Font, Electric Duet) and Find Files to have bigger
buffers for files.
  • Loading branch information
inexorabletash committed Nov 27, 2024
1 parent 26fcfa7 commit 9e95bc1
Show file tree
Hide file tree
Showing 6 changed files with 290 additions and 259 deletions.
2 changes: 1 addition & 1 deletion desk.acc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ highlighted in DeskTop. This can be done by copying the full path to
* If the DA uses the text or lores screens, it *must* save the visible
bytes on entry and restore them on exit, and *must not* modify the
screen holes.
* DAs can overwrite 10k of Main memory normally used for DeskTop code
* DAs can overwrite 16k of Main memory normally used for DeskTop code
that isn't used while a DA is running (e.g. command logic). This is
at `OVERLAY_BUFFER` and the size is `kOverlayBufferSize`. To
restore DeskTop, the DA *must* call DeskTop's `JUMP_TABLE_RESTORE_OVL`
Expand Down
2 changes: 1 addition & 1 deletion desk.acc/show.duet.file.s
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
;;;

;;; There is not enough room in the DA load area to hold 6k of audio
;;; data. A 10k buffer is available in DeskTop itself, in an area
;;; data. A larger buffer is available in DeskTop itself, in an area
;;; that can be restored after use.
data_buf := OVERLAY_BUFFER
kReadLength = kOverlayBufferSize
Expand Down
6 changes: 3 additions & 3 deletions desk.acc/show.image.file.s
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ slideshow_counter:

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

restore_10k_overlay_flag:
restore_buffer_overlay_flag:
.byte 0

.proc Exit
jsr MaybeCallExitHook

bit restore_10k_overlay_flag
bit restore_buffer_overlay_flag
IF_NS
lda #kDynamicRoutineRestoreBuffer
jsr JUMP_TABLE_RESTORE_OVL
Expand Down Expand Up @@ -394,7 +394,7 @@ signature:
.proc ShowLZ4FHFile
sta PAGE2OFF

copy #$80, restore_10k_overlay_flag
copy #$80, restore_buffer_overlay_flag
copy16 #OVERLAY_BUFFER, read_params::data_buffer
JUMP_TABLE_MLI_CALL READ, read_params
copy16 #$2000, read_params::data_buffer
Expand Down
2 changes: 1 addition & 1 deletion desk.acc/sort.directory.s
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
MLIEntry := MLI

;;; There is not enough room in the DA load area to a directory with
;;; 127 entries, the maximum number of icons DeskTop can handle. A 10k
;;; 127 entries, the maximum number of icons DeskTop can handle. A
;;; buffer is available in DeskTop itself, in an area that can be
;;; restored after use.
dir_data_buffer := OVERLAY_BUFFER
Expand Down
4 changes: 2 additions & 2 deletions desktop/desktop.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ kDAMaxSize = DA_IO_BUFFER - DA_LOAD_ADDRESS
;;; Used by DAs for window definitions
DEFAULT_FONT := $8600

;;; A 10k buffer that can be restored using overlays; load
;;; A 16k buffer that can be restored using overlays; load
;;; `kDynamicRoutineRestoreBuffer` and call `JUMP_TABLE_RESTORE_OVL`
;;; to restore DeskTop afterwards.
OVERLAY_BUFFER := $5000
kOverlayBufferSize = $2800
kOverlayBufferSize = $4000

;;; DAs must start with a header declaring sizes of the two
;;; segments (aux and main).
Expand Down
Loading

0 comments on commit 9e95bc1

Please sign in to comment.