-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New DA: Screenshot; rename "Screen Dump" to "Print Screen"
The new DA writes out a graphics file named "Screenshot" to the application directory i.e. where DeskTop.system lives. If there is an existing file it will be overwritten. It lives in Extras, but it is most useful when added to the Apple Menu or as a Shortcut. Also, to make it easier to distinguish this DA (especially in localized builds), the "Screen Dump" DA was renamed to "Print Screen"
- Loading branch information
1 parent
b82b9f2
commit 99f61f1
Showing
16 changed files
with
154 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
;;; ============================================================ | ||
;;; SCREENSHOT - Desk Accessory | ||
;;; | ||
;;; Saves the contents of the graphics screen to a file. | ||
;;; ============================================================ | ||
|
||
.include "../config.inc" | ||
|
||
.include "apple2.inc" | ||
.include "../inc/apple2.inc" | ||
.include "../inc/macros.inc" | ||
.include "../inc/prodos.inc" | ||
.include "../mgtk/mgtk.inc" | ||
.include "../common.inc" | ||
.include "../desktop/desktop.inc" | ||
|
||
;;; ============================================================ | ||
|
||
DA_HEADER | ||
DA_START_MAIN_SEGMENT | ||
|
||
;;; ============================================================ | ||
|
||
jmp start | ||
|
||
;;; ============================================================ | ||
|
||
kBlockSize = $200 | ||
BLOCK_BUFFER := DA_IO_BUFFER - kBlockSize | ||
.assert .lobyte(BLOCK_BUFFER) = 0, error, "page align" | ||
|
||
DEFINE_CREATE_PARAMS create_params, filename, ACCESS_DEFAULT, FT_GRAPHICS, $2000 | ||
DEFINE_OPEN_PARAMS open_params, filename, DA_IO_BUFFER | ||
DEFINE_WRITE_PARAMS write_block_params, BLOCK_BUFFER, kBlockSize | ||
DEFINE_WRITE_PARAMS write_screen_params, $2000, $2000 | ||
DEFINE_CLOSE_PARAMS close_params | ||
|
||
|
||
filename: | ||
PASCAL_STRING "Screenshot" | ||
|
||
|
||
;;; ============================================================ | ||
|
||
start: JUMP_TABLE_MGTK_CALL MGTK::HideCursor | ||
jsr JUMP_TABLE_HILITE_MENU | ||
|
||
JUMP_TABLE_MLI_CALL CREATE, create_params | ||
bcc :+ | ||
cmp #ERR_DUPLICATE_FILENAME | ||
bne done | ||
: | ||
JUMP_TABLE_MLI_CALL OPEN, open_params | ||
bcs done | ||
lda open_params::ref_num | ||
sta write_block_params::ref_num | ||
sta write_screen_params::ref_num | ||
sta close_params::ref_num | ||
|
||
;; ---------------------------------------- | ||
;; Aux Segment | ||
|
||
;; Mark Graphics file as "560 x 192 Black & White" | ||
;; See File Type Note $08 | ||
sta SET80STORE | ||
sta PAGE2ON | ||
lda #2 | ||
sta $2000+$78 | ||
sta PAGE2OFF | ||
sta CLR80STORE | ||
|
||
;; Can't write it with 80STORE on since banking not guaranteed | ||
;; during ProDOS I/O (e.g. aux RAM disks), so do it block by | ||
;; block. | ||
ptr := $06 | ||
copy16 #$2000, ptr | ||
ldy #$00 | ||
|
||
block_loop: | ||
sta SET80STORE | ||
sta PAGE2ON | ||
: lda (ptr),y | ||
sta BLOCK_BUFFER,y | ||
iny | ||
bne :- | ||
inc ptr+1 | ||
: lda (ptr),y | ||
sta BLOCK_BUFFER+$100,y | ||
iny | ||
bne :- | ||
inc ptr+1 | ||
sta PAGE2OFF | ||
sta CLR80STORE | ||
|
||
JUMP_TABLE_MLI_CALL WRITE, write_block_params | ||
|
||
lda ptr+1 | ||
cmp #$40 | ||
bne block_loop | ||
|
||
;; ---------------------------------------- | ||
;; Write main segment | ||
|
||
;; Just write directly | ||
JUMP_TABLE_MLI_CALL WRITE, write_screen_params | ||
|
||
close: JUMP_TABLE_MLI_CALL CLOSE, close_params | ||
|
||
done: jsr JUMP_TABLE_HILITE_MENU | ||
JUMP_TABLE_MGTK_CALL MGTK::ShowCursor | ||
rts | ||
|
||
|
||
;;; ============================================================ | ||
|
||
DA_END_MAIN_SEGMENT | ||
|
||
;;; ============================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters