a2d/desktop/ovl1.s

117 lines
2.9 KiB
ArmAsm
Raw Normal View History

2018-02-20 04:18:58 +00:00
.setcpu "6502"
.include "apple2.inc"
.include "../inc/apple2.inc"
.include "../inc/prodos.inc"
.include "../mgtk.inc"
.include "../desktop.inc"
.include "../macros.inc"
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-20 04:18:58 +00:00
;;; Overlay for Disk Copy
2018-03-05 05:36:00 +00:00
;;; ============================================================
2018-02-20 04:18:58 +00:00
.org $800
.proc disk_copy_overlay
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:
PASCAL_STRING " Disk copy version 1.1 "
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-02-21 04:36:46 +00:00
DESKTOP_RELAY_CALL $6, $0
MGTK_RELAY_CALL MGTK::CloseAll, $0
MGTK_RELAY_CALL MGTK::SetZP1, ptr
2018-02-20 04:18:58 +00:00
;; Copy menu bar up to language card, and use it.
ldx #.sizeof(menu_bar)
2018-02-20 04:37:04 +00:00
: lda menu_bar,x
2018-02-20 04:18:58 +00:00
sta $D400,x
dex
2018-02-20 04:37:04 +00:00
bpl :-
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