a2d/desk.acc/show.text.file/a2d.inc

176 lines
4.5 KiB
PHP
Raw Normal View History

;;; ------------------------------
;;; A2Desktop
;;; ------------------------------
;;; Entry Points
A2D := $4000
2017-09-02 03:30:55 +00:00
UNKNOWN_CALL := $8E00
2017-09-02 03:48:16 +00:00
JUMP_TABLE_01 := $4015 ; ???
JUMP_TABLE_02 := $4018
JUMP_TABLE_03 := $401E
JUMP_TABLE_04 := $4021
JUMP_TABLE_05 := $4021
JUMP_TABLE_06 := $4024
JUMP_TABLE_07 := $4027
JUMP_TABLE_08 := $402A
JUMP_TABLE_09 := $402D
JUMP_TABLE_10 := $4030
JUMP_TABLE_11 := $4033
JUMP_TABLE_12 := $4036
JUMP_TABLE_13 := $4039
JUMP_TABLE_14 := $403C
JUMP_TABLE_15 := $403F
2017-09-03 01:51:03 +00:00
A2D_UNK_03 := $03 ; Unknown - used in calculator after frame is drawn
2017-09-02 03:48:16 +00:00
2017-09-02 04:02:00 +00:00
A2D_TEXT_BOX1 := $04 ; Not sure what BOX1 vs. BOX2 is for
A2D_TEXT_BOX2 := $06 ; Not sure what BOX1 vs. BOX2 is for
;; .word left pixels from screen edge
;; .word top
;; .word $2000 ???
;; .word $80 ???
;; .word hoffset pixels scrolled
;; .word voffset
;; .word width pixels
;; .word height
2017-09-03 01:51:03 +00:00
A2D_UNK_08 := $08 ; Unknown - used frequently
A2D_UNK_0C := $0C ; Unknown - used in calculator
2017-09-01 15:15:05 +00:00
A2D_SET_TEXT_POS:= $0E
;; .word left
;; .word base
2017-09-03 01:51:03 +00:00
A2D_CLEAR_BOX := $11 ; To window background pattern
2017-09-02 16:44:33 +00:00
;; .word hoffset (includes scroll pos)
;; .word voffset
;; .word width pixels
;; .word height
2017-09-03 01:51:03 +00:00
A2D_UNK_14 := $14 ; Unknown - draws push button (calculator)
A2D_UNK_19 := $19 ; Unknown - draws button label (calculator)
2017-09-02 16:44:33 +00:00
2017-08-31 03:30:46 +00:00
A2D_DRAW_TEXT := $19
;; .addr data
;; .byte length
A2D_GET_BUTTON := $2A
2017-09-01 02:05:41 +00:00
;; .byte state (0=up, 1=pressed, 2=held???)
A2D_CREATE_WINDOW := $38
;; .byte id
2017-09-01 05:12:02 +00:00
;; 0 = desktop
;; 1, 2, ... = file windows
;; 100 = DA (for example)
2017-09-01 16:16:12 +00:00
;; .byte flags
;; bit 0: remove title bar
;; bit 1: add close box
;; bit 2: add resize box
2017-09-02 01:32:37 +00:00
;; .addr title
2017-09-03 01:51:03 +00:00
;; .byte ???
;; .byte ???
;; .byte ???
;; .byte ???
;; .byte ???
;; .byte vscroll_pos
;; .byte ???
;; .byte ???
;; .byte ???
;; .byte ???
;; .byte ???
;; .byte ???
;; .word width
;; .word height
2017-09-01 02:05:41 +00:00
A2D_DESTROY_WINDOW := $39
;; .byte id
;; .byte ???
2017-08-31 03:30:46 +00:00
A2D_GET_MOUSE := $40
;; .word x
;; .word y
2017-09-01 06:03:46 +00:00
;; .byte element
;; 0 = desktop
;; 1 = menu
;; 2 = client area (including scroll bars/resize box)
2017-08-31 03:30:46 +00:00
;; 3 = title bar
2017-09-01 16:20:32 +00:00
;; 4 = resize box
2017-08-31 03:30:46 +00:00
;; 5 = close box
2017-09-01 06:03:46 +00:00
;; .byte id of window
2017-08-31 03:30:46 +00:00
A2D_BTN_CLICK := $43
;; .byte clicked (0 = cancelled, 1 = clicked)
;; .byte ??
;; .byte ??
2017-09-02 02:54:04 +00:00
A2D_DRAG_RESIZE := $45
2017-09-02 04:24:35 +00:00
;; .byte id of window
;; .word xcoord of mouse
;; .word ycoord of mouse
;; .byte ?? (likely: moved? 0 = no change, 1 = moved)
2017-09-02 02:54:04 +00:00
2017-08-31 03:30:46 +00:00
A2D_QUERY_CLIENT:= $48
;; .word xcoord of query
;; .word ycoord of query
2017-09-01 05:39:06 +00:00
;; .byte part (0 = client, 1 = vscroll, 2 = hscroll)
2017-09-01 05:12:02 +00:00
;; .byte scroll (1 = up/left, 2 = down/right, 3 = above/before, 4 = below/after, 5 = thumb)
2017-09-02 02:54:04 +00:00
A2D_RESIZE_WINDOW := $49
2017-09-02 04:24:35 +00:00
;; .byte ?? (unused, so incomplete)
;; .byte ??
2017-09-02 02:54:04 +00:00
2017-09-01 05:39:06 +00:00
A2D_DRAG_SCROLL:= $4A
;; .byte type (1 = vscroll, 2 = hscroll)
2017-09-01 05:12:02 +00:00
;; .word xcoord of mouse
;; .word ycoord of mouse
;; .byte position (0...255)
;; .byte moved (0 = no change, 1 = moved)
2017-08-31 03:30:46 +00:00
2017-08-31 15:10:51 +00:00
A2D_UPDATE_SCROLL:= $4B
;; .byte type (1 = vertical, 2 = horizontal)
;; .byte pos (new position 0...250)
2017-09-02 02:54:04 +00:00
2017-09-01 05:39:06 +00:00
;;; Used in A2D_GET_MOUSE
2017-09-01 06:03:46 +00:00
A2D_ELEM_DESKTOP:= 0
A2D_ELEM_MENU := 1
2017-09-01 05:39:06 +00:00
A2D_ELEM_CLIENT := 2
A2D_ELEM_TITLE := 3
2017-09-01 16:20:32 +00:00
A2D_ELEM_RESIZE := 4
2017-09-01 05:39:06 +00:00
A2D_ELEM_CLOSE := 5
;;; Used in A2D_QUERY_CLIENT, A2D_DRAG_SCROLL, A2D_UPDATE_SCROLL
A2D_CLIENT := 0
A2D_VSCROLL := 1
A2D_HSCROLL := 2
;;; Used in A2D_QUERY_CLIENT
A2D_SCROLL_PART_UP := 1
A2D_SCROLL_PART_LEFT := 1
A2D_SCROLL_PART_DOWN := 2
A2D_SCROLL_PART_RIGHT := 2
A2D_SCROLL_PART_ABOVE := 3
A2D_SCROLL_PART_BEFORE := 3
A2D_SCROLL_PART_BELOW := 4
A2D_SCROLL_PART_AFTER := 4
A2D_SCROLL_PART_THUMB := 5
;;; Macros
.macro A2D_CALL op, addr
jsr A2D
.byte op
.addr addr
.endmacro
.macro A2D_DEFSTRING str ; String definition, for use with A2D_TEXT
.local data
.addr data
.byte .strlen(str)
data: .byte str
.endmacro