a2d/desktop/ovl1.s

105 lines
2.7 KiB
ArmAsm
Raw Normal View History

2018-03-05 05:36:00 +00:00
;;; ============================================================
;;; Overlay for Disk Copy - $0800 - $09FF (file 1/4)
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-20 04:18:58 +00:00
.proc disk_copy_overlay
.org $800
2018-02-25 23:19:38 +00:00
2018-02-20 04:18:58 +00:00
jmp start
2018-02-20 04:37:04 +00:00
load_target := $1800
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-20 04:18:58 +00:00
;;; Menu - relocated up ot $D400
menu_target := $D400
.proc menu_bar
DEFINE_MENU_BAR 1
DEFINE_MENU_BAR_ITEM 1, menu_target + (menu_label - menu_bar), menu_target + (menu - menu_bar)
menu: DEFINE_MENU 1
DEFINE_MENU_ITEM menu_target + (item_label - menu_bar)
menu_label:
2018-11-19 07:35:25 +00:00
PASCAL_STRING .sprintf(" Disk copy version %d.%d ",::VERSION_MAJOR,::VERSION_MINOR)
2018-02-20 04:18:58 +00:00
item_label:
PASCAL_STRING "Rien"
.endproc
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-20 04:18:58 +00:00
2018-02-26 04:28:23 +00:00
DEFINE_OPEN_PARAMS open_params, str_desktop2, $1C00
DEFINE_SET_MARK_PARAMS set_mark_params, $131E0
DEFINE_READ_PARAMS read_params, load_target, $200
DEFINE_CLOSE_PARAMS close_params
2018-02-20 04:18:58 +00:00
str_desktop2:
PASCAL_STRING "DeskTop2"
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-20 04:37:04 +00:00
2018-02-20 04:18:58 +00:00
ptr := $6
start: lda #$80
sta ptr
2018-05-28 04:16:32 +00:00
DESKTOP_RELAY_CALL DT_UNHIGHLIGHT_ALL
2018-03-15 03:16:15 +00:00
MGTK_RELAY_CALL MGTK::CloseAll
2018-02-21 04:36:46 +00:00
MGTK_RELAY_CALL MGTK::SetZP1, ptr
2018-02-20 04:18:58 +00:00
;; Copy menu bar up to language card, and use it.
COPY_BYTES .sizeof(menu_bar)+1, menu_bar, $D400
2018-02-21 04:36:46 +00:00
MGTK_RELAY_CALL MGTK::SetMenu, menu_target
2018-02-20 04:18:58 +00:00
;; Clear most of the system bitmap
ldx #BITMAP_SIZE - 3
lda #0
: sta BITMAP+1,x
dex
bpl :-
2018-02-20 04:37:04 +00:00
;; Open self (DESKTOP2)
yax_call MLI_RELAY, OPEN, open_params
;; Slurp in yet another overlay...
lda open_params::ref_num
sta read_params::ref_num
sta set_mark_params::ref_num
yax_call MLI_RELAY, SET_MARK, set_mark_params
yax_call MLI_RELAY, READ, read_params
yax_call MLI_RELAY, CLOSE, close_params
2018-02-20 04:18:58 +00:00
2018-02-20 04:37:04 +00:00
;; And invoke it.
2018-02-20 04:18:58 +00:00
sta ALTZPOFF
2018-02-20 04:37:04 +00:00
lda ROMIN2
jmp load_target
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-20 04:18:58 +00:00
2018-02-20 04:37:04 +00:00
.proc MLI_RELAY
sty call
sta params
stx params+1
2018-02-20 04:18:58 +00:00
php
sei
sta ALTZPOFF
2018-02-25 21:47:06 +00:00
lda ROMIN2
2018-02-20 04:18:58 +00:00
jsr MLI
2018-02-20 04:37:04 +00:00
call: .byte 0
params: .addr 0
2018-02-20 04:18:58 +00:00
tax
sta ALTZPON
lda LCBANK1
lda LCBANK1
plp
txa
2018-02-20 04:37:04 +00:00
self: bne self ; hang on error?
2018-02-20 04:18:58 +00:00
rts
2018-02-20 04:37:04 +00:00
.endproc
2018-02-20 04:18:58 +00:00
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-25 23:19:38 +00:00
2018-02-20 04:18:58 +00:00
PAD_TO $A00
2018-02-25 23:19:38 +00:00
.endproc ; disk_copy_overlay