a2d/desk.acc/show.text.file/stf.list

1773 lines
85 KiB
Plaintext
Raw Normal View History

2017-08-29 03:58:09 +00:00
ca65 V2.16 - Git f5e9b401
Main file : stf.s
Current file: stf.s
000000r 1 .setcpu "65C02"
000000r 1 .org $800
000800 1
2017-09-02 02:37:18 +00:00
000800 1 .include "../../inc/prodos.inc"
000800 2 ;;; ------------------------------
000800 2 ;;; ProDOS MLI
000800 2 ;;; ------------------------------
000800 2
000800 2 ;;; Entry point
000800 2 MLI := $BF00
000800 2
000800 2 ;;; Housekeeping Calls
000800 2 CREATE := $C0
000800 2 DESTROY := $C1
000800 2 RENAME := $C2
000800 2 SET_FILE_INFO := $C3
000800 2 GET_FILE_INFO := $C4
000800 2 ON_LINE := $C5
000800 2 SET_PREFIX := $C6
000800 2 GET_PREFIX := $C7
000800 2 ;;; Filing Calls
000800 2 OPEN := $C8
000800 2 NEWLINE := $C9
000800 2 READ := $CA
000800 2 WRITE := $CB
000800 2 CLOSE := $CC
000800 2 FLUSH := $CD
000800 2 SET_MARK := $CE
000800 2 GET_MARK := $CF
000800 2 SET_EOF := $D0
000800 2 GET_EOF := $D1
000800 2 SET_BUF := $D2
000800 2 GET_BUF := $D3
000800 2 ;;; System Calls
000800 2 GET_TIME := $82
000800 2 ALLOC_INTERRUPT := $40
000800 2 DEALLOC_INTERRUPT := $41
000800 2 ;;; Direct Disk Access Commands
000800 2 READ_BLOCK := $80
000800 2 WRITE_BLOCK := $71
000800 2
000800 2 ;;; Macros
000800 2 .macro MLI_CALL op, addr
000800 2 jsr MLI
000800 2 .byte op
000800 2 .addr addr
000800 2 .endmacro
000800 2
2017-09-02 02:37:18 +00:00
000800 1 .include "../../inc/auxmem.inc"
000800 2 ;;; ------------------------------
000800 2 ;;; Aux Memory
000800 2 ;;; ------------------------------
000800 2
000800 2 ;;; Softswitches
000800 2 RAMRDOFF := $C002
000800 2 RAMRDON := $C003
000800 2 RAMWRTOFF := $C004
000800 2 RAMWRTON := $C005
000800 2 ALTZPOFF := $C008
000800 2 ALTZPON := $C009
000800 2 LCBANK1 := $C08B
000800 2
000800 2 ;;; Routines
2017-09-01 01:20:36 +00:00
000800 2 AUXMOVE := $C311 ; carry set main>aux, carry clear aux>main
000800 2
000800 2 STARTLO := $3C
000800 2 STARTHI := $3D
000800 2 ENDLO := $3E
000800 2 ENDHI := $3F
000800 2 DESTINATIONLO := $42
000800 2 DESTINATIONHI := $43
000800 2
000800 1 .include "a2d.inc"
000800 2 ;;; ------------------------------
000800 2 ;;; A2Desktop
000800 2 ;;; ------------------------------
000800 2
000800 2 ;;; Entry Points
000800 2 A2D := $4000
2017-09-02 03:48:16 +00:00
000800 2
000800 2 UNKNOWN_CALL := $8E00
000800 2
2017-09-02 03:48:16 +00:00
000800 2 JUMP_TABLE_01 := $4015 ; ???
000800 2 JUMP_TABLE_02 := $4018
000800 2 JUMP_TABLE_03 := $401E
000800 2 JUMP_TABLE_04 := $4021
000800 2 JUMP_TABLE_05 := $4021
000800 2 JUMP_TABLE_06 := $4024
000800 2 JUMP_TABLE_07 := $4027
000800 2 JUMP_TABLE_08 := $402A
000800 2 JUMP_TABLE_09 := $402D
000800 2 JUMP_TABLE_10 := $4030
000800 2 JUMP_TABLE_11 := $4033
000800 2 JUMP_TABLE_12 := $4036
000800 2 JUMP_TABLE_13 := $4039
000800 2 JUMP_TABLE_14 := $403C
000800 2 JUMP_TABLE_15 := $403F
000800 2
2017-09-03 01:51:03 +00:00
000800 2 A2D_UNK_03 := $03 ; Unknown - used in calculator after frame is drawn
2017-09-02 03:48:16 +00:00
000800 2
2017-09-02 04:02:00 +00:00
000800 2 A2D_TEXT_BOX1 := $04 ; Not sure what BOX1 vs. BOX2 is for
000800 2 A2D_TEXT_BOX2 := $06 ; Not sure what BOX1 vs. BOX2 is for
000800 2 ;; .word left pixels from screen edge
000800 2 ;; .word top
000800 2 ;; .word $2000 ???
000800 2 ;; .word $80 ???
000800 2 ;; .word hoffset pixels scrolled
000800 2 ;; .word voffset
000800 2 ;; .word width pixels
000800 2 ;; .word height
000800 2
2017-09-03 03:23:14 +00:00
000800 2 A2D_SET_PATTERN := $08
000800 2 ;; .byte r0...r7 8x8 pixel pattern for A2D_CLEAR_BOX calls
2017-09-03 01:51:03 +00:00
000800 2
000800 2 A2D_UNK_0C := $0C ; Unknown - used in calculator
000800 2
2017-09-01 15:15:05 +00:00
000800 2 A2D_SET_TEXT_POS:= $0E
000800 2 ;; .word left
000800 2 ;; .word base
000800 2
2017-09-03 01:51:03 +00:00
000800 2 A2D_CLEAR_BOX := $11 ; To window background pattern
2017-09-02 16:44:33 +00:00
000800 2 ;; .word hoffset (includes scroll pos)
000800 2 ;; .word voffset
000800 2 ;; .word width pixels
000800 2 ;; .word height
000800 2
2017-09-03 01:51:03 +00:00
000800 2 A2D_UNK_14 := $14 ; Unknown - draws push button (calculator)
000800 2 A2D_UNK_19 := $19 ; Unknown - draws button label (calculator)
2017-09-02 16:44:33 +00:00
000800 2
2017-08-31 03:30:46 +00:00
000800 2 A2D_DRAW_TEXT := $19
000800 2 ;; .addr data
000800 2 ;; .byte length
000800 2
000800 2 A2D_GET_BUTTON := $2A
2017-09-01 02:05:41 +00:00
000800 2 ;; .byte state (0=up, 1=pressed, 2=held???)
000800 2
000800 2 A2D_CREATE_WINDOW := $38
000800 2 ;; .byte id
2017-09-01 05:12:02 +00:00
000800 2 ;; 0 = desktop
000800 2 ;; 1, 2, ... = file windows
000800 2 ;; 100 = DA (for example)
2017-09-03 03:49:28 +00:00
000800 2 ;; .byte flags (A2D_CWF_*)
2017-09-01 16:16:12 +00:00
000800 2 ;; bit 0: remove title bar
000800 2 ;; bit 1: add close box
000800 2 ;; bit 2: add resize box
2017-09-02 01:32:37 +00:00
000800 2 ;; .addr title
2017-09-03 03:49:28 +00:00
000800 2 ;; .byte hscroll bits: 7 = enable, 6 = show thumb, 0 = show track
000800 2 ;; .byte vscroll
2017-09-03 03:56:08 +00:00
000800 2 ;; .byte hscroll_max
000800 2 ;; .byte hscroll_pos
000800 2 ;; .byte vscroll_max
2017-09-03 01:51:03 +00:00
000800 2 ;; .byte vscroll_pos
000800 2 ;; .byte ???
000800 2 ;; .byte ???
000800 2 ;; .byte ???
000800 2 ;; .byte ???
000800 2 ;; .byte ???
000800 2 ;; .byte ???
000800 2 ;; .word width
000800 2 ;; .word height
2017-09-01 02:05:41 +00:00
000800 2
000800 2 A2D_DESTROY_WINDOW := $39
2017-09-03 03:56:08 +00:00
000800 2 ;; pass the same block as passed to A2D_CREATE_WINDOW
2017-08-31 03:30:46 +00:00
000800 2
000800 2 A2D_GET_MOUSE := $40
000800 2 ;; .word x
000800 2 ;; .word y
2017-09-03 03:29:06 +00:00
000800 2 ;; .byte element (A2D_ELEM_*)
2017-09-01 15:15:05 +00:00
000800 2 ;; 0 = desktop
000800 2 ;; 1 = menu
000800 2 ;; 2 = client area (including scroll bars/resize box)
2017-08-31 03:30:46 +00:00
000800 2 ;; 3 = title bar
2017-09-01 16:20:32 +00:00
000800 2 ;; 4 = resize box
2017-08-31 03:30:46 +00:00
000800 2 ;; 5 = close box
2017-09-01 15:15:05 +00:00
000800 2 ;; .byte id of window
2017-08-31 03:30:46 +00:00
000800 2
000800 2 A2D_BTN_CLICK := $43
000800 2 ;; .byte clicked (0 = cancelled, 1 = clicked)
000800 2 ;; .byte ??
000800 2 ;; .byte ??
000800 2
2017-09-02 02:54:04 +00:00
000800 2 A2D_DRAG_RESIZE := $45
2017-09-02 04:24:35 +00:00
000800 2 ;; .byte id of window
000800 2 ;; .word xcoord of mouse
000800 2 ;; .word ycoord of mouse
000800 2 ;; .byte ?? (likely: moved? 0 = no change, 1 = moved)
2017-09-02 02:54:04 +00:00
000800 2
2017-08-31 03:30:46 +00:00
000800 2 A2D_QUERY_CLIENT:= $48
000800 2 ;; .word xcoord of query
000800 2 ;; .word ycoord of query
2017-09-01 05:39:06 +00:00
000800 2 ;; .byte part (0 = client, 1 = vscroll, 2 = hscroll)
2017-09-01 05:12:02 +00:00
000800 2 ;; .byte scroll (1 = up/left, 2 = down/right, 3 = above/before, 4 = below/after, 5 = thumb)
000800 2
2017-09-02 02:54:04 +00:00
000800 2 A2D_RESIZE_WINDOW := $49
2017-09-02 04:24:35 +00:00
000800 2 ;; .byte ?? (unused, so incomplete)
000800 2 ;; .byte ??
2017-09-02 02:54:04 +00:00
000800 2
2017-09-01 05:39:06 +00:00
000800 2 A2D_DRAG_SCROLL:= $4A
000800 2 ;; .byte type (1 = vscroll, 2 = hscroll)
2017-09-01 05:12:02 +00:00
000800 2 ;; .word xcoord of mouse
000800 2 ;; .word ycoord of mouse
000800 2 ;; .byte position (0...255)
000800 2 ;; .byte moved (0 = no change, 1 = moved)
2017-08-31 03:30:46 +00:00
000800 2
2017-08-31 15:10:51 +00:00
000800 2 A2D_UPDATE_SCROLL:= $4B
000800 2 ;; .byte type (1 = vertical, 2 = horizontal)
000800 2 ;; .byte pos (new position 0...250)
000800 2
2017-09-02 02:54:04 +00:00
000800 2
2017-09-01 05:39:06 +00:00
000800 2 ;;; Used in A2D_GET_MOUSE
2017-09-01 15:15:05 +00:00
000800 2 A2D_ELEM_DESKTOP:= 0
000800 2 A2D_ELEM_MENU := 1
2017-09-01 05:39:06 +00:00
000800 2 A2D_ELEM_CLIENT := 2
000800 2 A2D_ELEM_TITLE := 3
2017-09-01 16:20:32 +00:00
000800 2 A2D_ELEM_RESIZE := 4
2017-09-01 05:39:06 +00:00
000800 2 A2D_ELEM_CLOSE := 5
000800 2
000800 2 ;;; Used in A2D_QUERY_CLIENT, A2D_DRAG_SCROLL, A2D_UPDATE_SCROLL
000800 2 A2D_CLIENT := 0
000800 2 A2D_VSCROLL := 1
000800 2 A2D_HSCROLL := 2
000800 2
000800 2 ;;; Used in A2D_QUERY_CLIENT
000800 2 A2D_SCROLL_PART_UP := 1
000800 2 A2D_SCROLL_PART_LEFT := 1
000800 2 A2D_SCROLL_PART_DOWN := 2
000800 2 A2D_SCROLL_PART_RIGHT := 2
000800 2 A2D_SCROLL_PART_ABOVE := 3
000800 2 A2D_SCROLL_PART_BEFORE := 3
000800 2 A2D_SCROLL_PART_BELOW := 4
000800 2 A2D_SCROLL_PART_AFTER := 4
000800 2 A2D_SCROLL_PART_THUMB := 5
000800 2
2017-09-03 03:29:06 +00:00
000800 2 ;;; Used in A2D_CREATE_WINDOW
2017-09-03 03:49:28 +00:00
000800 2 A2D_CWF_NOTITLE := 1 << 0
000800 2 A2D_CWF_ADDCLOSE := 1 << 1
000800 2 A2D_CWF_ADDRESIZE:= 1 << 2
000800 2
000800 2 A2D_CWS_NOSCROLL := 0
000800 2 A2D_CWS_SCROLL_ENABLED := 1 << 7
000800 2 A2D_CWS_SCROLL_THUMB := 1 << 6
000800 2 A2D_CWS_SCROLL_TRACK := 1 << 0
000800 2 A2D_CWS_SCROLL_NORMAL := A2D_CWS_SCROLL_ENABLED | A2D_CWS_SCROLL_THUMB | A2D_CWS_SCROLL_TRACK
000800 2
2017-09-01 05:39:06 +00:00
000800 2
000800 2 ;;; Macros
000800 2 .macro A2D_CALL op, addr
000800 2 jsr A2D
000800 2 .byte op
000800 2 .addr addr
000800 2 .endmacro
000800 2
000800 2 .macro A2D_DEFSTRING str ; String definition, for use with A2D_TEXT
000800 2 .local data
000800 2 .addr data
000800 2 .byte .strlen(str)
000800 2 data: .byte str
000800 2 .endmacro
000800 2
000800 1
2017-08-29 03:58:09 +00:00
000800 1 4C 04 08 start: jmp copy2aux
000803 1
2017-09-01 05:53:07 +00:00
000803 1 00 save_stack:.byte 0
000804 1
000804 1 ;;; Copy $800 through $13FF (the DA) to aux
2017-08-30 02:07:44 +00:00
000804 1 .proc copy2aux
2017-08-29 03:58:09 +00:00
000804 1 BA tsx
2017-09-01 05:53:07 +00:00
000805 1 8E 03 08 stx save_stack
2017-08-29 03:58:09 +00:00
000808 1 8D 05 C0 sta RAMWRTON
2017-09-01 05:53:07 +00:00
00080B 1 A0 00 ldy #0
00080D 1 B9 00 08 src: lda start,y ; self-modified
000810 1 99 00 08 dst: sta start,y ; self-modified
2017-08-29 03:58:09 +00:00
000813 1 88 dey
2017-09-01 05:53:07 +00:00
000814 1 D0 F7 bne src
2017-08-29 03:58:09 +00:00
000816 1 8D 04 C0 sta RAMWRTOFF
2017-09-01 05:53:07 +00:00
000819 1 EE 0F 08 inc src+2
00081C 1 EE 12 08 inc dst+2
2017-08-29 03:58:09 +00:00
00081F 1 8D 05 C0 sta RAMWRTON
2017-09-01 05:53:07 +00:00
000822 1 AD 12 08 lda dst+2
2017-08-29 03:58:09 +00:00
000825 1 C9 14 cmp #$14
2017-09-01 05:53:07 +00:00
000827 1 D0 E4 bne src
2017-08-30 02:07:44 +00:00
000829 1 .endproc
000829 1
2017-09-02 02:37:18 +00:00
000829 1 call_main_trampoline := $20 ; installed on ZP, turns off auxmem and calls...
000829 1 call_main_addr := call_main_trampoline+7 ; address patched in here
000829 1
2017-09-02 02:06:14 +00:00
000829 1 ;;; Copy the following "call_main_template" routine to $20
2017-09-01 05:53:07 +00:00
000829 1 .scope
2017-08-29 03:58:09 +00:00
000829 1 8D 05 C0 sta RAMWRTON
00082C 1 8D 03 C0 sta RAMRDON
2017-09-02 02:06:14 +00:00
00082F 1 A2 10 ldx #(call_main_template_end - call_main_template)
000831 1 BD 3C 08 loop: lda call_main_template,x
000834 1 95 20 sta call_main_trampoline,x
2017-08-29 03:58:09 +00:00
000836 1 CA dex
2017-09-01 05:53:07 +00:00
000837 1 10 F8 bpl loop
000839 1 4C 4C 08 jmp call_init
00083C 1 .endscope
2017-08-29 03:58:09 +00:00
00083C 1
2017-09-02 02:06:14 +00:00
00083C 1 .proc call_main_template
2017-08-30 02:07:44 +00:00
00083C 1 8D 02 C0 sta RAMRDOFF
2017-08-29 03:58:09 +00:00
00083F 1 8D 04 C0 sta RAMWRTOFF
2017-09-02 02:06:14 +00:00
000842 1 20 00 10 jsr $1000 ; overwritten (in zp version)
2017-08-29 03:58:09 +00:00
000845 1 8D 03 C0 sta RAMRDON
000848 1 8D 05 C0 sta RAMWRTON
00084B 1 60 rts
2017-08-30 02:07:44 +00:00
00084C 1 .endproc
2017-09-02 02:37:18 +00:00
00084C 1 call_main_template_end: ; can't .sizeof(proc) before declaration
00084C 1 ;; https://github.com/cc65/cc65/issues/478
2017-08-29 03:58:09 +00:00
00084C 1
2017-09-01 05:53:07 +00:00
00084C 1 .proc call_init
00084C 1 ;; run the DA
00084C 1 20 DE 09 jsr init
00084F 1
00084F 1 ;; tear down/exit
2017-08-29 03:58:09 +00:00
00084F 1 8D 09 C0 sta ALTZPON
000852 1 AD 8B C0 lda LCBANK1
000855 1 AD 8B C0 lda LCBANK1
000858 1 8D 02 C0 sta RAMRDOFF
00085B 1 8D 04 C0 sta RAMWRTOFF
2017-09-01 05:53:07 +00:00
00085E 1 AE 03 08 ldx save_stack
2017-08-29 03:58:09 +00:00
000861 1 9A txs
2017-09-01 05:53:07 +00:00
000862 1 60 rts
000863 1 .endproc
000863 1
000863 1 ;;; ==================================================
000863 1 ;;; ProDOS MLI calls
2017-08-29 03:58:09 +00:00
000863 1
000863 1 .proc open_file
2017-08-30 01:47:15 +00:00
000863 1 20 C2 08 jsr copy_params_aux_to_main
2017-08-29 03:58:09 +00:00
000866 1 8D 08 C0 sta ALTZPOFF
2017-08-29 15:40:35 +00:00
000869 1 20 00 BF C8 MLI_CALL OPEN, open_params
2017-08-29 03:58:09 +00:00
00086D 1 EA 08
00086F 1 8D 09 C0 sta ALTZPON
2017-08-29 16:08:46 +00:00
000872 1 20 D4 08 jsr copy_params_main_to_aux
2017-08-29 03:58:09 +00:00
000875 1 60 rts
2017-08-30 01:47:15 +00:00
000876 1 .endproc
2017-08-29 03:58:09 +00:00
000876 1
000876 1 .proc read_file
2017-08-30 01:47:15 +00:00
000876 1 20 C2 08 jsr copy_params_aux_to_main
2017-08-29 03:58:09 +00:00
000879 1 8D 08 C0 sta ALTZPOFF
2017-08-29 15:40:35 +00:00
00087C 1 20 00 BF CA MLI_CALL READ, read_params
2017-08-29 03:58:09 +00:00
000880 1 F0 08
000882 1 8D 09 C0 sta ALTZPON
2017-08-29 16:08:46 +00:00
000885 1 20 D4 08 jsr copy_params_main_to_aux
2017-08-29 03:58:09 +00:00
000888 1 60 rts
2017-08-30 01:47:15 +00:00
000889 1 .endproc
2017-08-29 03:58:09 +00:00
000889 1
000889 1 .proc get_file_eof
2017-08-30 01:47:15 +00:00
000889 1 20 C2 08 jsr copy_params_aux_to_main
2017-08-29 03:58:09 +00:00
00088C 1 8D 08 C0 sta ALTZPOFF
2017-08-29 15:45:32 +00:00
00088F 1 20 00 BF D1 MLI_CALL GET_EOF, get_eof_params
2017-08-29 03:58:09 +00:00
000893 1 F8 08
000895 1 8D 09 C0 sta ALTZPON
2017-08-29 16:08:46 +00:00
000898 1 20 D4 08 jsr copy_params_main_to_aux
2017-08-29 03:58:09 +00:00
00089B 1 60 rts
2017-08-30 01:47:15 +00:00
00089C 1 .endproc
2017-08-29 03:58:09 +00:00
00089C 1
2017-08-30 01:47:15 +00:00
00089C 1 .proc set_file_mark
00089C 1 20 C2 08 jsr copy_params_aux_to_main
2017-08-29 03:58:09 +00:00
00089F 1 8D 08 C0 sta ALTZPOFF
2017-08-29 15:47:42 +00:00
0008A2 1 20 00 BF CE MLI_CALL SET_MARK, set_mark_params
2017-08-29 03:58:09 +00:00
0008A6 1 FD 08
0008A8 1 8D 09 C0 sta ALTZPON
2017-08-29 16:08:46 +00:00
0008AB 1 20 D4 08 jsr copy_params_main_to_aux
2017-08-29 03:58:09 +00:00
0008AE 1 60 rts
2017-08-30 01:47:15 +00:00
0008AF 1 .endproc
2017-08-29 03:58:09 +00:00
0008AF 1
2017-08-30 01:47:15 +00:00
0008AF 1 .proc close_file
0008AF 1 20 C2 08 jsr copy_params_aux_to_main
2017-08-29 03:58:09 +00:00
0008B2 1 8D 08 C0 sta ALTZPOFF
2017-08-29 15:45:32 +00:00
0008B5 1 20 00 BF CC MLI_CALL CLOSE, close_params
2017-08-29 03:58:09 +00:00
0008B9 1 02 09
0008BB 1 8D 09 C0 sta ALTZPON
2017-08-29 16:08:46 +00:00
0008BE 1 20 D4 08 jsr copy_params_main_to_aux
2017-08-29 03:58:09 +00:00
0008C1 1 60 rts
2017-08-30 01:47:15 +00:00
0008C2 1 .endproc
2017-08-29 03:58:09 +00:00
0008C2 1
2017-09-01 05:53:07 +00:00
0008C2 1 ;;; ==================================================
0008C2 1
2017-08-29 16:08:46 +00:00
0008C2 1 ;;; Copies param blocks from Aux to Main
0008C2 1 .proc copy_params_aux_to_main
2017-08-29 16:08:46 +00:00
0008C2 1 A0 65 ldy #(params_end - params_start + 1)
2017-08-29 03:58:09 +00:00
0008C4 1 8D 04 C0 sta RAMWRTOFF
2017-08-29 16:08:46 +00:00
0008C7 1 B9 E9 08 loop: lda params_start - 1,y
0008CA 1 99 E9 08 sta params_start - 1,y
2017-08-29 03:58:09 +00:00
0008CD 1 88 dey
2017-08-29 16:08:46 +00:00
0008CE 1 D0 F7 bne loop
2017-08-29 03:58:09 +00:00
0008D0 1 8D 02 C0 sta RAMRDOFF
0008D3 1 60 rts
2017-08-29 16:08:46 +00:00
0008D4 1 .endproc
2017-08-29 03:58:09 +00:00
0008D4 1
2017-08-29 16:08:46 +00:00
0008D4 1 ;;; Copies param blocks from Main to Aux
0008D4 1 .proc copy_params_main_to_aux
2017-08-29 16:08:46 +00:00
0008D4 1 48 pha
2017-08-29 03:58:09 +00:00
0008D5 1 08 php
0008D6 1 8D 05 C0 sta RAMWRTON
2017-08-29 16:08:46 +00:00
0008D9 1 A0 65 ldy #(params_end - params_start + 1)
0008DB 1 B9 E9 08 loop: lda params_start - 1,y
0008DE 1 99 E9 08 sta params_start - 1,y
2017-08-29 03:58:09 +00:00
0008E1 1 88 dey
2017-08-29 16:08:46 +00:00
0008E2 1 D0 F7 bne loop
2017-08-29 03:58:09 +00:00
0008E4 1 8D 03 C0 sta RAMRDON
0008E7 1 28 plp
0008E8 1 68 pla
2017-08-29 16:08:46 +00:00
0008E9 1 60 rts
0008EA 1 .endproc
2017-08-29 03:58:09 +00:00
0008EA 1
2017-08-29 16:08:46 +00:00
0008EA 1 ;;; ----------------------------------------
0008EA 1
0008EA 1 params_start:
0008EA 1 ;;; This block gets copied between main/aux
2017-08-29 15:40:35 +00:00
0008EA 1
2017-09-01 05:53:07 +00:00
0008EA 1 ;;; ProDOS MLI param blocks
0008EA 1
0008EA 1 .proc open_params
2017-08-29 15:45:32 +00:00
0008EA 1 03 .byte 3 ; param_count
2017-09-01 01:38:49 +00:00
0008EB 1 04 09 .addr pathname ; pathname
2017-08-29 15:40:35 +00:00
0008ED 1 00 0C .addr $0C00 ; io_buffer
0008EF 1 00 ref_num:.byte 0 ; ref_num
0008F0 1 .endproc
2017-08-29 15:40:35 +00:00
0008F0 1
2017-09-01 05:39:06 +00:00
0008F0 1 default_buffer := $1200
0008F0 1
0008F0 1 .proc read_params
2017-08-29 15:45:32 +00:00
0008F0 1 04 .byte 4 ; param_count
0008F1 1 00 ref_num:.byte 0 ; ref_num
2017-09-01 05:39:06 +00:00
0008F2 1 00 12 buffer: .addr default_buffer ; data_buffer
2017-08-29 15:40:35 +00:00
0008F4 1 00 01 .word $100 ; request_count
0008F6 1 00 00 .word 0 ; trans_count
0008F8 1 .endproc
2017-08-29 15:40:35 +00:00
0008F8 1
0008F8 1 .proc get_eof_params
2017-08-29 15:45:32 +00:00
0008F8 1 02 .byte 2 ; param_count
0008F9 1 00 ref_num:.byte 0 ; ref_num
2017-08-29 15:47:42 +00:00
0008FA 1 00 00 00 .byte 0,0,0 ; EOF (lo, mid, hi)
0008FD 1 .endproc
2017-08-29 15:45:32 +00:00
0008FD 1
0008FD 1 .proc set_mark_params
2017-08-29 15:47:42 +00:00
0008FD 1 02 .byte 2 ; param_count
0008FE 1 00 ref_num:.byte 0 ; ref_num
2017-08-29 15:47:42 +00:00
0008FF 1 00 00 00 .byte 0,0,0 ; position (lo, mid, hi)
000902 1 .endproc
2017-08-29 15:45:32 +00:00
000902 1
000902 1 .proc close_params
2017-08-29 15:45:32 +00:00
000902 1 01 .byte 1 ; param_count
000903 1 00 ref_num:.byte 0 ; ref_num
000904 1 .endproc
2017-08-29 16:08:46 +00:00
000904 1
2017-09-02 01:32:37 +00:00
000904 1 .proc pathname ; 1st byte is length, rest is full path
000904 1 00 length: .byte $00
000905 1 00 00 00 00 data: .byte $00,$00,$00,$00,$00,$00,$00,$00
000909 1 00 00 00 00
00090D 1 00 00 00 00 .byte $00,$00,$00,$00,$00,$00,$00,$00
000911 1 00 00 00 00
000915 1 00 00 00 00 .byte $00,$00,$00,$00,$00,$00,$00,$00
000919 1 00 00 00 00
00091D 1 00 00 00 00 .byte $00,$00,$00,$00,$00,$00,$00,$00
000921 1 00 00 00 00
000925 1 00 00 00 00 .byte $00,$00,$00,$00,$00,$00,$00,$00
000929 1 00 00 00 00
00092D 1 00 00 00 00 .byte $00,$00,$00,$00,$00,$00,$00,$00
000931 1 00 00 00 00
000935 1 00 00 00 00 .byte $00,$00,$00,$00,$00,$00,$00,$00
000939 1 00 00 00 00
00093D 1 00 00 00 00 .byte $00,$00,$00,$00,$00,$00,$00,$00
000941 1 00 00 00 00
000945 1 .endproc
2017-09-01 01:38:49 +00:00
000945 1
2017-08-29 03:58:09 +00:00
000945 1 00 L0945: .byte $00
000946 1 00 L0946: .byte $00
000947 1 00 L0947: .byte $00
000948 1 00 L0948: .byte $00
000949 1 00 L0949: .byte $00
2017-09-02 03:10:21 +00:00
00094A 1
2017-09-03 03:23:14 +00:00
00094A 1 params_end := * + 4 ; bug in original? (harmless as this is static)
00094A 1 ;;; ----------------------------------------
00094A 1
00094A 1 black_pattern:
00094A 1 00 00 00 00 .byte $00,$00,$00,$00,$00,$00,$00,$00
00094E 1 00 00 00 00
2017-09-01 15:32:29 +00:00
000952 1
2017-09-03 03:23:14 +00:00
000952 1 white_pattern:
2017-09-03 07:31:23 +00:00
000952 1 FF FF FF FF .byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
2017-08-29 03:58:09 +00:00
000956 1 FF FF FF FF
2017-09-03 03:23:14 +00:00
00095A 1
00095A 1 window_id := $64
00095A 1
2017-08-29 03:58:09 +00:00
00095A 1 00 L095A: .byte $00
00095B 1 FA L095B: .byte $FA
00095C 1 01 L095C: .byte $01
2017-09-01 15:15:05 +00:00
00095D 1
00095D 1 .proc line_pos
00095D 1 00 00 left: .word 0
00095F 1 00 00 base: .word 0
000961 1 .endproc
000961 1
2017-09-01 15:48:46 +00:00
000961 1 00 00 window_width: .word 0
000963 1 00 00 window_height: .word 0
000965 1
2017-08-29 03:58:09 +00:00
000965 1 00 L0965: .byte $00
000966 1 00 00 L0966: .byte $00,$00
000968 1 00 L0968: .byte $00
000969 1 00 L0969: .byte $00
00096A 1 00 L096A: .byte $00
00096B 1 00 L096B: .byte $00
00096C 1 00 L096C: .byte $00
00096D 1 00 L096D: .byte $00
2017-08-31 04:13:25 +00:00
00096E 1
00096E 1 track_scroll_delta:
00096E 1 00 .byte $00
00096F 1
00096F 1 fixed_mode_flag:
2017-09-02 03:30:55 +00:00
00096F 1 00 .byte $00 ; 0 = proportional, otherwise = fixed
000970 1
000970 1 button_state:
000970 1 00 .byte $00
000971 1
2017-09-02 03:30:55 +00:00
000971 1 .proc mouse_params ; queried by main input loop
2017-08-31 03:30:46 +00:00
000971 1 00 00 xcoord: .word 0
000973 1 00 00 ycoord: .word 0
2017-08-31 04:04:16 +00:00
000975 1 00 elem: .byte 0
000976 1 00 win: .byte 0
000977 1 .endproc
000977 1
2017-09-02 02:54:04 +00:00
000977 1 .proc resize_drag_params
000977 1 64 id: .byte window_id
000978 1 00 00 xcoord: .word 0
00097A 1 00 00 ycoord: .word 0
2017-08-31 03:30:46 +00:00
00097C 1 00 .byte 0 ; ???
2017-09-02 02:54:04 +00:00
00097D 1 .endproc
2017-08-30 06:47:18 +00:00
00097D 1
2017-09-03 07:31:23 +00:00
00097D 1 .proc close_btn_params ; queried after close clicked to see if aborted/finished
2017-08-31 04:04:16 +00:00
00097D 1 00 state: .byte 0 ; 0 = aborted, 1 = clicked
2017-09-02 17:15:15 +00:00
00097E 1 00 00 .byte 0,0 ; ???
2017-08-31 03:30:46 +00:00
000980 1 .endproc
2017-08-30 06:47:18 +00:00
000980 1
2017-08-31 15:10:51 +00:00
000980 1 .proc query_client_params ; queried after a client click to identify target
2017-08-31 03:30:46 +00:00
000980 1 00 00 xcoord: .word 0
000982 1 00 00 ycoord: .word 0
2017-09-02 17:15:15 +00:00
000984 1 00 part: .byte 0 ; 0 = client, 1 = vscroll, 2 = hscroll
2017-08-31 03:30:46 +00:00
000985 1 00 scroll: .byte 0 ; 1 = up, 2 = down, 3 = above, 4 = below, 5 = thumb
000986 1 .endproc
000986 1
2017-09-01 16:30:29 +00:00
000986 1 ;; param block used in dead code (resize?)
2017-09-02 02:54:04 +00:00
000986 1 .proc resize_window_params
2017-09-02 03:30:55 +00:00
000986 1 00 L0986: .byte 0
000987 1 00 L0987: .byte 0
2017-09-02 02:54:04 +00:00
000988 1 .endproc
2017-08-31 15:10:51 +00:00
000988 1
000988 1 .proc update_scroll_params ; called to update scroll bar position
2017-09-03 05:52:38 +00:00
000988 1 00 type: .byte 0 ; 1 = vscroll, 2 = hscroll
000989 1 00 pos: .byte 0 ; new position
2017-08-31 15:10:51 +00:00
00098A 1 .endproc
2017-08-31 05:13:41 +00:00
00098A 1
00098A 1 ;;; Used when dragging vscroll thumb
2017-08-31 05:22:04 +00:00
00098A 1 .proc thumb_drag_params
2017-09-03 05:52:38 +00:00
00098A 1 00 type: .byte 0 ; 1 = vscroll, 2 = hscroll
2017-08-31 05:13:41 +00:00
00098B 1 00 00 xcoord: .word 0
00098D 1 00 00 ycoord: .word 0
2017-09-03 05:52:38 +00:00
00098F 1 00 pos: .byte 0 ; position
2017-09-01 05:12:02 +00:00
000990 1 00 moved: .byte 0 ; 0 if not moved, 1 if moved
2017-08-31 05:22:04 +00:00
000991 1 .endproc
2017-08-30 01:52:56 +00:00
000991 1
2017-09-01 05:12:02 +00:00
000991 1 .proc text_string
000991 1 00 00 addr: .addr 0 ; address
000993 1 00 len: .byte 0 ; length
000994 1 .endproc
2017-08-30 01:52:56 +00:00
000994 1
2017-09-03 01:51:03 +00:00
000994 1 default_width := 512
000994 1 default_height := 150
000994 1
2017-09-01 02:05:41 +00:00
000994 1 .proc window_params
000994 1 64 id: .byte window_id ; window identifier
2017-09-03 03:49:28 +00:00
000995 1 02 flags: .byte A2D_CWF_ADDCLOSE; window flags (2=include close box)
2017-09-02 05:08:43 +00:00
000996 1 00 10 title: .addr $1000 ; overwritten to point at filename
2017-09-03 03:56:08 +00:00
000998 1
2017-09-03 03:49:28 +00:00
000998 1 00 hscroll:.byte A2D_CWS_NOSCROLL
000999 1 C1 vscroll:.byte A2D_CWS_SCROLL_NORMAL
2017-09-03 03:56:08 +00:00
00099A 1 hscroll_max:
00099A 1 20 .byte 32
00099B 1 hscroll_pos:
00099B 1 00 .byte 0
00099C 1 vscroll_max:
00099C 1 FF .byte 255
2017-08-31 03:41:54 +00:00
00099D 1 vscroll_pos:
00099D 1 00 .byte 0
00099E 1
2017-09-03 03:56:08 +00:00
00099E 1 ;; ???
2017-09-03 01:51:03 +00:00
00099E 1 00 00 C8 00 .byte $00,$00,$C8,$00,$33,$00
0009A2 1 33 00
0009A4 1
0009A4 1 00 02 width: .word default_width
0009A6 1 96 00 height: .word default_height
2017-09-01 16:16:12 +00:00
0009A8 1 .endproc
2017-09-01 05:12:02 +00:00
0009A8 1
2017-09-01 15:32:29 +00:00
0009A8 1 .proc text_box ; or whole window ??
0009A8 1 0A 00 left: .word 10
0009AA 1 1C 00 top: .word 28
0009AC 1 00 20 .word $2000 ; ??? never changed
0009AE 1 80 00 .word $80 ; ??? never changed
2017-09-02 16:44:33 +00:00
0009B0 1 00 00 hoffset:.word 0 ; Also used for A2D_CLEAR_BOX
2017-09-02 04:02:00 +00:00
0009B2 1 00 00 voffset:.word 0
2017-09-03 01:51:03 +00:00
0009B4 1 00 02 width: .word default_width
0009B6 1 96 00 height: .word default_height
2017-09-01 15:32:29 +00:00
0009B8 1 .endproc
0009B8 1
0009B8 1 ;; unused?
0009B8 1 00 00 00 00 .byte $00,$00,$00,$00,$00,$00,$00
0009BC 1 00 00 00
2017-08-29 03:58:09 +00:00
0009BF 1 00 FF 00 00 .byte $00,$FF,$00,$00,$00,$00,$00,$01
0009C3 1 00 00 00 01
0009C7 1 01 00 7F 00 .byte $01,$00,$7F,$00,$88,$00,$00
0009CB 1 88 00 00
2017-09-01 15:15:05 +00:00
0009CE 1
2017-09-01 15:32:29 +00:00
0009CE 1 ;; gets copied over text_box after mode is drawn
0009CE 1 .proc default_box
0009CE 1 0A 00 left: .word 10
0009D0 1 1C 00 top: .word 28
0009D2 1 00 20 .word $2000
0009D4 1 80 00 .word $80
2017-09-02 04:02:00 +00:00
0009D6 1 00 00 hoffset:.word 0
0009D8 1 00 00 voffset:.word 0
2017-09-03 01:51:03 +00:00
0009DA 1 00 02 width: .word default_width
0009DC 1 96 00 height: .word default_height
2017-09-01 15:32:29 +00:00
0009DE 1 .endproc
2017-08-29 16:08:46 +00:00
0009DE 1
2017-09-01 05:53:07 +00:00
0009DE 1 .proc init
2017-09-02 03:30:55 +00:00
0009DE 1 8D 09 C0 sta ALTZPON
2017-08-29 03:58:09 +00:00
0009E1 1 AD 8B C0 lda LCBANK1
0009E4 1 AD 8B C0 lda LCBANK1
2017-09-02 01:43:53 +00:00
0009E7 1
2017-09-03 02:52:45 +00:00
0009E7 1 ;; These are DeskTop internals, but it appears there is no
0009E7 1 ;; API for getting the selected file.
2017-09-02 05:08:43 +00:00
0009E7 1 file_selected := $DF21 ; 0 if no selection, 1 otherwise
0009E7 1 path_index := $DF20 ; index of selected window (used to get prefix)
0009E7 1 path_table := $DFB3 ; window address table
2017-09-03 02:52:45 +00:00
0009E7 1 ;; each entry is 65 bytes long
2017-09-02 05:08:43 +00:00
0009E7 1 ;; each entry is length-prefixed path string (no trailing /)
0009E7 1 file_index := $DF22 ; index of selected file (global, not w/in window)
0009E7 1 file_table := $DD9F ; file address table
2017-09-03 02:52:45 +00:00
0009E7 1 ;; each entry is 27 bytes long
0009E7 1 ;; .byte ??
0009E7 1 ;; .byte ??
0009E7 1 ;; .byte type/icon (bits 4,5,6 clear = directory)
0009E7 1 ;; .word iconx (pixels)
0009E7 1 ;; .word icony (pixels)
0009E7 1 ;; .byte ??
0009E7 1 ;; .byte ??
0009E7 1 ;; .byte len, name (length-prefixed, spaces before/after; 17 byte buffer)
2017-09-02 01:43:53 +00:00
0009E7 1
2017-09-02 01:32:37 +00:00
0009E7 1 A9 00 lda #0
0009E9 1 8D 04 09 sta pathname::length
2017-09-02 05:08:43 +00:00
0009EC 1 AD 21 DF lda file_selected
2017-09-02 01:32:37 +00:00
0009EF 1 F0 05 beq abort ; some file properties?
2017-09-02 01:43:53 +00:00
0009F1 1 AD 20 DF lda path_index ; prefix index in table
2017-09-02 02:39:29 +00:00
0009F4 1 D0 01 bne :+
2017-09-02 01:32:37 +00:00
0009F6 1 60 abort: rts
2017-08-29 03:58:09 +00:00
0009F7 1
2017-09-02 01:58:36 +00:00
0009F7 1 ;; Copy path (prefix) into pathname buffer.
2017-09-02 02:39:29 +00:00
0009F7 1 : src := $06
2017-09-02 01:32:37 +00:00
0009F7 1 dst := $08
2017-09-02 01:43:53 +00:00
0009F7 1
0009F7 1 0A asl a ; (since address table is 2 bytes wide)
2017-08-29 03:58:09 +00:00
0009F8 1 AA tax
2017-09-02 01:43:53 +00:00
0009F9 1 BD B3 DF lda path_table,x ; pathname ???
2017-09-02 01:32:37 +00:00
0009FC 1 85 06 sta src
2017-09-02 01:43:53 +00:00
0009FE 1 BD B4 DF lda path_table+1,x
2017-09-02 01:32:37 +00:00
000A01 1 85 07 sta src+1
000A03 1 A0 00 ldy #0
000A05 1 B1 06 lda (src),y
2017-08-29 03:58:09 +00:00
000A07 1 AA tax
2017-09-02 01:32:37 +00:00
000A08 1 E6 06 inc src
000A0A 1 D0 02 bne :+
000A0C 1 E6 07 inc src+1
000A0E 1 A9 05 : lda #<(pathname::data)
000A10 1 85 08 sta dst
000A12 1 A9 09 lda #>(pathname::data)
000A14 1 85 09 sta dst+1
2017-09-02 01:43:53 +00:00
000A16 1 20 72 0A jsr copy_pathname ; copy x bytes (src) to (dst)
2017-09-02 01:32:37 +00:00
000A19 1
2017-09-02 01:58:36 +00:00
000A19 1 ;; Append separator.
000A19 1 A9 2F lda #'/'
2017-09-02 01:32:37 +00:00
000A1B 1 A0 00 ldy #0
000A1D 1 91 08 sta (dst),y
000A1F 1 EE 04 09 inc pathname::length
000A22 1 E6 08 inc dst
000A24 1 D0 02 bne :+
000A26 1 E6 09 inc dst+1
2017-09-02 01:43:53 +00:00
000A28 1
2017-09-02 05:08:43 +00:00
000A28 1 ;; Get file entry.
2017-09-02 01:58:36 +00:00
000A28 1 AD 22 DF : lda file_index ; file index in table
2017-09-02 01:43:53 +00:00
000A2B 1 0A asl a ; (since table is 2 bytes wide)
2017-08-29 03:58:09 +00:00
000A2C 1 AA tax
2017-09-02 01:58:36 +00:00
000A2D 1 BD 9F DD lda file_table,x
2017-09-02 01:32:37 +00:00
000A30 1 85 06 sta src
2017-09-02 01:58:36 +00:00
000A32 1 BD A0 DD lda file_table+1,x
2017-09-02 01:32:37 +00:00
000A35 1 85 07 sta src+1
2017-09-02 01:58:36 +00:00
000A37 1
2017-09-02 05:08:43 +00:00
000A37 1 ;; Exit if a directory.
000A37 1 A0 02 ldy #2 ; 2nd byte of entry
2017-09-02 01:32:37 +00:00
000A39 1 B1 06 lda (src),y
2017-09-02 01:58:36 +00:00
000A3B 1 29 70 and #$70 ; check that one of bits 4,5,6 is set ???
2017-09-02 05:08:43 +00:00
000A3D 1 ;; some vague patterns, but unclear
000A3D 1 ;; basic = $32,$33, text = $52, sys = $11,$14,??, bin = $23,$24,$33
000A3D 1 ;; dir = $01 (so not shown)
2017-09-02 01:32:37 +00:00
000A3D 1 D0 01 bne :+
000A3F 1 60 rts ; abort ???
2017-09-02 01:58:36 +00:00
000A40 1
2017-09-02 05:08:43 +00:00
000A40 1 ;; Set window title to point at filename (9th byte of entry)
2017-09-02 16:44:33 +00:00
000A40 1 ;; (title includes the spaces before/after from the icon)
2017-09-02 01:32:37 +00:00
000A40 1 18 : clc
2017-09-02 05:08:43 +00:00
000A41 1 A5 06 lda src ; name is 9 bytes into entry
2017-09-02 01:58:36 +00:00
000A43 1 69 09 adc #9
2017-09-02 01:32:37 +00:00
000A45 1 8D 96 09 sta window_params::title
000A48 1 A5 07 lda src+1
2017-09-02 01:58:36 +00:00
000A4A 1 69 00 adc #0
2017-09-02 01:32:37 +00:00
000A4C 1 8D 97 09 sta window_params::title+1
2017-09-02 01:58:36 +00:00
000A4F 1
2017-09-02 05:08:43 +00:00
000A4F 1 ;; Append filename to path.
2017-09-02 01:58:36 +00:00
000A4F 1 A0 09 ldy #9
2017-09-02 05:08:43 +00:00
000A51 1 B1 06 lda (src),y ; grab length
2017-09-02 16:44:33 +00:00
000A53 1 AA tax ; name has spaces before/after
000A54 1 CA dex ; so subtract 2 to get actual length
2017-08-29 03:58:09 +00:00
000A55 1 CA dex
000A56 1 18 clc
2017-09-02 01:32:37 +00:00
000A57 1 A5 06 lda src
2017-09-02 16:44:33 +00:00
000A59 1 69 0B adc #11 ; 9 = length, 10 = space, 11 = name
2017-09-02 01:32:37 +00:00
000A5B 1 85 06 sta src
2017-09-02 01:58:36 +00:00
000A5D 1 90 02 bcc :+
2017-09-02 01:32:37 +00:00
000A5F 1 E6 07 inc src+1
2017-09-02 01:58:36 +00:00
000A61 1 20 72 0A : jsr copy_pathname ; copy x bytes (src) to (dst)
000A64 1
2017-09-02 03:48:16 +00:00
000A64 1 ;; ???
000A64 1 A9 1E lda #<JUMP_TABLE_03
2017-09-02 02:06:14 +00:00
000A66 1 85 27 sta call_main_addr
2017-09-02 03:48:16 +00:00
000A68 1 A9 40 lda #>JUMP_TABLE_03
2017-09-02 02:06:14 +00:00
000A6A 1 85 28 sta call_main_addr+1
000A6C 1 20 20 00 jsr call_main_trampoline
2017-09-02 01:58:36 +00:00
000A6F 1
2017-09-01 05:12:02 +00:00
000A6F 1 4C 8A 0A jmp open_file_and_init_window
2017-08-29 03:58:09 +00:00
000A72 1
2017-09-02 01:32:37 +00:00
000A72 1 .proc copy_pathname ; copy x bytes from src to dst
000A72 1 A0 00 ldy #0 ; incrementing path length and dst
000A74 1 B1 06 loop: lda (src),y
000A76 1 91 08 sta (dst),y
2017-08-29 03:58:09 +00:00
000A78 1 C8 iny
2017-09-02 01:32:37 +00:00
000A79 1 EE 04 09 inc pathname::length
2017-08-29 03:58:09 +00:00
000A7C 1 CA dex
2017-09-01 05:12:02 +00:00
000A7D 1 D0 F5 bne loop
2017-08-29 03:58:09 +00:00
000A7F 1 98 tya
000A80 1 18 clc
2017-09-02 01:32:37 +00:00
000A81 1 65 08 adc dst
000A83 1 85 08 sta dst
2017-09-01 05:12:02 +00:00
000A85 1 90 02 bcc end
2017-09-02 01:32:37 +00:00
000A87 1 E6 09 inc dst+1
2017-09-01 05:12:02 +00:00
000A89 1 60 end: rts
000A8A 1 .endproc
2017-08-29 03:58:09 +00:00
000A8A 1
2017-09-02 01:32:37 +00:00
000A8A 1 .endproc
000A8A 1
2017-09-01 05:12:02 +00:00
000A8A 1 .proc open_file_and_init_window
000A8A 1 A9 00 lda #0
000A8C 1 8D 6F 09 sta fixed_mode_flag
2017-09-01 05:12:02 +00:00
000A8F 1
000A8F 1 ;; copy bytes (length at $8801) from $8802 to $10FF ???
2017-09-02 03:48:16 +00:00
000A8F 1 ;; length is $7f in tests
2017-08-29 03:58:09 +00:00
000A8F 1 AE 01 88 ldx $8801
000A92 1 8D 04 C0 sta RAMWRTOFF
2017-09-01 05:12:02 +00:00
000A95 1 BD 02 88 loop: lda $8802,x
2017-09-02 02:06:14 +00:00
000A98 1 9D FF 10 sta L10FD+2,x
2017-08-29 03:58:09 +00:00
000A9B 1 CA dex
2017-09-01 05:12:02 +00:00
000A9C 1 D0 F7 bne loop
2017-08-29 03:58:09 +00:00
000A9E 1 8D 05 C0 sta RAMWRTON
2017-09-01 05:12:02 +00:00
000AA1 1
000AA1 1 ;; open file, get length
2017-08-30 01:47:15 +00:00
000AA1 1 20 63 08 jsr open_file
000AA4 1 AD EF 08 lda open_params::ref_num
000AA7 1 8D F1 08 sta read_params::ref_num
000AAA 1 8D FE 08 sta set_mark_params::ref_num
000AAD 1 8D F9 08 sta get_eof_params::ref_num
000AB0 1 8D 03 09 sta close_params::ref_num
2017-08-30 01:47:15 +00:00
000AB3 1 20 89 08 jsr get_file_eof
2017-09-01 05:12:02 +00:00
000AB6 1
000AB6 1 ;; create window
2017-09-01 02:05:41 +00:00
000AB6 1 20 00 40 38 A2D_CALL A2D_CREATE_WINDOW, window_params
2017-08-29 03:58:09 +00:00
000ABA 1 94 09
2017-09-02 04:02:00 +00:00
000ABC 1 20 00 40 04 A2D_CALL A2D_TEXT_BOX1, text_box
2017-08-29 03:58:09 +00:00
000AC0 1 A8 09
2017-09-02 16:44:33 +00:00
000AC2 1 20 88 10 jsr calc_window_size
000AC5 1 20 98 11 jsr calc_and_draw_mode
2017-09-01 01:38:49 +00:00
000AC8 1 20 30 0E jsr draw_content
2017-09-02 03:10:21 +00:00
000ACB 1 20 00 40 2B A2D_CALL $2B, 0 ; ???
2017-08-29 03:58:09 +00:00
000ACF 1 00 00
2017-09-02 03:10:21 +00:00
000AD1 1 ;; fall through
2017-09-01 05:12:02 +00:00
000AD1 1 .endproc
000AD1 1
2017-09-02 04:24:35 +00:00
000AD1 1 ;;; ==================================================
000AD1 1 ;;; Main Input Loop
000AD1 1
000AD1 1 input_loop:
000AD1 1 20 00 40 2A A2D_CALL A2D_GET_BUTTON, button_state
2017-08-29 03:58:09 +00:00
000AD5 1 70 09
000AD7 1 AD 70 09 lda button_state
2017-09-01 02:05:41 +00:00
000ADA 1 C9 01 cmp #1 ; was clicked?
000ADC 1 D0 F3 bne input_loop ; nope, keep waiting
000ADE 1
2017-09-02 02:54:04 +00:00
000ADE 1 20 00 40 40 A2D_CALL A2D_GET_MOUSE, mouse_params
2017-08-29 03:58:09 +00:00
000AE2 1 71 09
2017-09-02 02:54:04 +00:00
000AE4 1 AD 76 09 lda mouse_params::win ; in our window?
2017-09-01 05:39:06 +00:00
000AE7 1 C9 64 cmp #window_id
000AE9 1 D0 E6 bne input_loop
2017-09-01 05:39:06 +00:00
000AEB 1
000AEB 1 ;; which part of the window?
2017-09-02 02:54:04 +00:00
000AEB 1 AD 75 09 lda mouse_params::elem
2017-09-01 05:39:06 +00:00
000AEE 1 C9 05 cmp #A2D_ELEM_CLOSE
2017-09-02 04:24:35 +00:00
000AF0 1 F0 2F beq on_close_click
2017-09-01 05:39:06 +00:00
000AF2 1
2017-09-02 04:24:35 +00:00
000AF2 1 ;; title and resize clicks need mouse location
000AF2 1 AE 71 09 ldx mouse_params::xcoord
2017-09-02 02:54:04 +00:00
000AF5 1 8E 78 09 stx resize_drag_params::xcoord
2017-08-31 03:30:46 +00:00
000AF8 1 8E 80 09 stx query_client_params::xcoord
2017-09-02 02:54:04 +00:00
000AFB 1 AE 72 09 ldx mouse_params::xcoord+1
000AFE 1 8E 79 09 stx resize_drag_params::xcoord+1
2017-08-31 03:30:46 +00:00
000B01 1 8E 81 09 stx query_client_params::xcoord+1
2017-09-02 02:54:04 +00:00
000B04 1 AE 73 09 ldx mouse_params::ycoord
000B07 1 8E 7A 09 stx resize_drag_params::ycoord
2017-08-31 03:30:46 +00:00
000B0A 1 8E 82 09 stx query_client_params::ycoord
2017-09-01 05:39:06 +00:00
000B0D 1
000B0D 1 C9 03 cmp #A2D_ELEM_TITLE
000B0F 1 F0 0A beq title
2017-09-02 04:24:35 +00:00
000B11 1 C9 04 cmp #A2D_ELEM_RESIZE ; not enabled, so this will never match
000B13 1 F0 BC beq input_loop
2017-08-31 03:30:46 +00:00
000B15 1 20 B4 0B jsr on_client_click
000B18 1 4C D1 0A jmp input_loop
2017-08-29 03:58:09 +00:00
000B1B 1
2017-09-01 05:39:06 +00:00
000B1B 1 20 3A 11 title: jsr on_title_bar_click
000B1E 1 4C D1 0A jmp input_loop
2017-08-29 03:58:09 +00:00
000B21 1
2017-09-02 04:24:35 +00:00
000B21 1 ;;; ==================================================
000B21 1 ;;; Close Button
000B21 1
000B21 1 .proc on_close_click
2017-09-03 07:31:23 +00:00
000B21 1 20 00 40 43 A2D_CALL A2D_BTN_CLICK, close_btn_params ; wait to see if the click completes
2017-08-29 03:58:09 +00:00
000B25 1 7D 09
2017-09-03 07:31:23 +00:00
000B27 1 AD 7D 09 lda close_btn_params::state ; did click complete?
2017-08-30 06:47:18 +00:00
000B2A 1 F0 A5 beq input_loop ; nope
2017-08-30 01:47:15 +00:00
000B2C 1 20 AF 08 jsr close_file
2017-09-01 02:05:41 +00:00
000B2F 1 20 00 40 39 A2D_CALL A2D_DESTROY_WINDOW, window_params
2017-08-29 03:58:09 +00:00
000B33 1 94 09
2017-09-02 03:48:16 +00:00
000B35 1
2017-09-02 16:44:33 +00:00
000B35 1 20 00 8E jsr UNKNOWN_CALL ; ???
2017-08-29 03:58:09 +00:00
000B38 1 0C .byte $0C
2017-08-31 03:46:50 +00:00
000B39 1 00 00 .addr 0
2017-09-02 03:48:16 +00:00
000B3B 1
2017-08-30 06:47:18 +00:00
000B3B 1 60 rts ; exits input loop
000B3C 1 .endproc
2017-08-29 03:58:09 +00:00
000B3C 1
2017-09-02 04:24:35 +00:00
000B3C 1 ;;; ==================================================
000B3C 1 ;;; Resize Handle
000B3C 1
2017-09-02 02:54:04 +00:00
000B3C 1 ;;; This is dead code (no resize handle!) and may be buggy
000B3C 1 .proc on_resize_click
000B3C 1 20 00 40 45 A2D_CALL A2D_DRAG_RESIZE, resize_drag_params
2017-08-29 03:58:09 +00:00
000B40 1 77 09
2017-09-02 02:06:14 +00:00
000B42 1 20 FD 10 jsr L10FD ; call $4015 on main
2017-09-02 16:44:33 +00:00
000B45 1 20 88 10 jsr calc_window_size
2017-09-01 16:30:29 +00:00
000B48 1
2017-09-03 01:51:03 +00:00
000B48 1 max_width := default_width
2017-09-01 16:30:29 +00:00
000B48 1 A9 02 lda #>max_width
2017-09-01 15:32:29 +00:00
000B4A 1 CD B5 09 cmp text_box::width+1
2017-09-02 02:39:29 +00:00
000B4D 1 D0 05 bne :+
2017-09-01 16:30:29 +00:00
000B4F 1 A9 00 lda #<max_width
2017-09-01 15:32:29 +00:00
000B51 1 CD B4 09 cmp text_box::width
2017-09-02 02:39:29 +00:00
000B54 1 B0 1D : bcs wider
2017-09-01 16:30:29 +00:00
000B56 1
000B56 1 A9 00 lda #<max_width
2017-09-01 15:32:29 +00:00
000B58 1 8D B4 09 sta text_box::width
2017-09-01 16:30:29 +00:00
000B5B 1 A9 02 lda #>max_width
2017-09-01 15:32:29 +00:00
000B5D 1 8D B5 09 sta text_box::width+1
2017-08-29 03:58:09 +00:00
000B60 1 38 sec
2017-09-01 15:32:29 +00:00
000B61 1 AD B4 09 lda text_box::width
2017-09-01 15:48:46 +00:00
000B64 1 ED 61 09 sbc window_width
2017-09-02 04:02:00 +00:00
000B67 1 8D B0 09 sta text_box::hoffset
2017-09-01 15:32:29 +00:00
000B6A 1 AD B5 09 lda text_box::width+1
2017-09-01 15:48:46 +00:00
000B6D 1 ED 62 09 sbc window_width+1
2017-09-02 04:02:00 +00:00
000B70 1 8D B1 09 sta text_box::hoffset+1
2017-09-03 03:49:28 +00:00
000B73 1 AD 98 09 wider: lda window_params::hscroll
2017-09-01 15:48:46 +00:00
000B76 1 AE 61 09 ldx window_width
2017-09-01 16:30:29 +00:00
000B79 1 E0 00 cpx #<max_width
2017-08-29 03:58:09 +00:00
000B7B 1 D0 0C bne L0B89
2017-09-01 15:48:46 +00:00
000B7D 1 AE 62 09 ldx window_width+1
2017-09-01 16:30:29 +00:00
000B80 1 E0 02 cpx #>max_width
2017-08-29 03:58:09 +00:00
000B82 1 D0 05 bne L0B89
2017-09-03 03:49:28 +00:00
000B84 1 29 FE and #(A2D_CWS_SCROLL_TRACK ^ $FF)
2017-08-29 03:58:09 +00:00
000B86 1 4C 8B 0B jmp L0B8B
000B89 1
2017-09-03 03:49:28 +00:00
000B89 1 09 01 L0B89: ora #A2D_CWS_SCROLL_TRACK
000B8B 1 8D 98 09 L0B8B: sta window_params::hscroll
2017-08-29 03:58:09 +00:00
000B8E 1 38 sec
2017-09-02 01:32:37 +00:00
000B8F 1 A9 00 lda #<max_width
2017-09-01 15:48:46 +00:00
000B91 1 ED 61 09 sbc window_width
2017-08-29 03:58:09 +00:00
000B94 1 85 06 sta $06
2017-09-02 01:32:37 +00:00
000B96 1 A9 02 lda #>max_width
2017-09-01 15:48:46 +00:00
000B98 1 ED 62 09 sbc window_width+1
2017-08-29 03:58:09 +00:00
000B9B 1 85 07 sta $07
2017-09-03 05:52:38 +00:00
000B9D 1 20 DF 10 jsr div_by_16
2017-09-02 02:54:04 +00:00
000BA0 1 8D 87 09 sta resize_window_params::L0987
2017-08-29 03:58:09 +00:00
000BA3 1 A9 02 lda #$02
2017-09-02 02:54:04 +00:00
000BA5 1 8D 86 09 sta resize_window_params::L0986
000BA8 1 20 00 40 49 A2D_CALL A2D_RESIZE_WINDOW, resize_window_params ; change to clamped size ???
2017-08-29 03:58:09 +00:00
000BAC 1 86 09
000BAE 1 20 98 11 jsr calc_and_draw_mode
2017-09-02 03:30:55 +00:00
000BB1 1 4C F9 0D jmp finish_resize
2017-08-31 03:30:46 +00:00
000BB4 1 .endproc
2017-08-29 03:58:09 +00:00
000BB4 1
2017-09-02 04:24:35 +00:00
000BB4 1 ;;; ==================================================
000BB4 1 ;;; Client Area
000BB4 1
2017-08-31 04:04:16 +00:00
000BB4 1 ;;; Non-title (client) area clicked
2017-08-31 03:30:46 +00:00
000BB4 1 .proc on_client_click
2017-09-02 04:24:35 +00:00
000BB4 1 ;; On one of the scroll bars?
2017-08-31 03:30:46 +00:00
000BB4 1 20 00 40 48 A2D_CALL A2D_QUERY_CLIENT, query_client_params
2017-08-29 03:58:09 +00:00
000BB8 1 80 09
2017-08-31 03:30:46 +00:00
000BBA 1 AD 84 09 lda query_client_params::part
2017-09-01 05:39:06 +00:00
000BBD 1 C9 01 cmp #A2D_VSCROLL
2017-08-31 03:41:54 +00:00
000BBF 1 F0 08 beq on_vscroll_click
2017-09-01 05:39:06 +00:00
000BC1 1 C9 02 cmp #A2D_HSCROLL
000BC3 1 D0 03 bne end
2017-09-01 05:12:02 +00:00
000BC5 1 4C 95 0C jmp on_hscroll_click
2017-08-31 03:41:54 +00:00
000BC8 1 60 end: rts
000BC9 1 .endproc
2017-08-29 03:58:09 +00:00
000BC9 1
2017-09-02 04:24:35 +00:00
000BC9 1 ;;; ==================================================
000BC9 1 ;;; Vertical Scroll Bar
000BC9 1
2017-08-31 03:41:54 +00:00
000BC9 1 .proc on_vscroll_click
2017-09-02 03:30:55 +00:00
000BC9 1 A9 01 lda #A2D_VSCROLL
2017-08-31 05:22:04 +00:00
000BCB 1 8D 8A 09 sta thumb_drag_params::type
2017-08-31 15:10:51 +00:00
000BCE 1 8D 88 09 sta update_scroll_params::type
2017-08-31 03:30:46 +00:00
000BD1 1 AD 85 09 lda query_client_params::scroll
2017-09-01 05:39:06 +00:00
000BD4 1 C9 05 cmp #A2D_SCROLL_PART_THUMB
2017-08-31 03:41:54 +00:00
000BD6 1 F0 14 beq on_vscroll_thumb_click
2017-09-01 05:39:06 +00:00
000BD8 1 C9 04 cmp #A2D_SCROLL_PART_BELOW
2017-08-31 03:41:54 +00:00
000BDA 1 F0 62 beq on_vscroll_below_click
2017-09-01 05:39:06 +00:00
000BDC 1 C9 03 cmp #A2D_SCROLL_PART_ABOVE
2017-08-31 03:41:54 +00:00
000BDE 1 F0 31 beq on_vscroll_above_click
2017-09-01 05:39:06 +00:00
000BE0 1 C9 01 cmp #A2D_SCROLL_PART_UP
2017-08-31 03:41:54 +00:00
000BE2 1 F0 49 beq on_vscroll_up_click
2017-09-01 05:39:06 +00:00
000BE4 1 C9 02 cmp #A2D_SCROLL_PART_DOWN
2017-08-31 03:30:46 +00:00
000BE6 1 D0 03 bne end
2017-08-31 03:41:54 +00:00
000BE8 1 4C 60 0C jmp on_vscroll_down_click
000BEB 1 60 end: rts
2017-08-31 03:30:46 +00:00
000BEC 1 .endproc
2017-08-29 03:58:09 +00:00
000BEC 1
2017-08-31 03:41:54 +00:00
000BEC 1 .proc on_vscroll_thumb_click
2017-09-01 05:39:06 +00:00
000BEC 1 20 39 0D jsr do_thumb_drag
2017-09-01 05:12:02 +00:00
000BEF 1 AD 90 09 lda thumb_drag_params::moved
2017-08-31 03:41:54 +00:00
000BF2 1 F0 1C beq end
2017-09-01 05:12:02 +00:00
000BF4 1 AD 8F 09 lda thumb_drag_params::pos
2017-08-31 15:10:51 +00:00
000BF7 1 8D 89 09 sta update_scroll_params::pos
2017-09-02 16:44:33 +00:00
000BFA 1 20 7C 0D jsr update_voffset
2017-08-31 15:17:06 +00:00
000BFD 1 20 ED 0D jsr update_vscroll
2017-09-01 01:38:49 +00:00
000C00 1 20 30 0E jsr draw_content
2017-08-29 03:58:09 +00:00
000C03 1 AD 47 09 lda L0947
2017-08-31 03:41:54 +00:00
000C06 1 F0 08 beq end
2017-08-29 03:58:09 +00:00
000C08 1 AD 49 09 lda L0949
2017-08-31 03:41:54 +00:00
000C0B 1 D0 03 bne end
2017-08-29 03:58:09 +00:00
000C0D 1 20 1D 0E jsr L0E1D
2017-08-31 03:41:54 +00:00
000C10 1 60 end: rts
000C11 1 .endproc
2017-08-29 03:58:09 +00:00
000C11 1
2017-08-31 03:41:54 +00:00
000C11 1 .proc on_vscroll_above_click
2017-09-01 16:16:12 +00:00
000C11 1 AD 9D 09 loop: lda window_params::vscroll_pos
2017-08-31 03:41:54 +00:00
000C14 1 F0 16 beq end
2017-08-31 04:13:25 +00:00
000C16 1 20 84 0C jsr calc_track_scroll_delta
2017-08-29 03:58:09 +00:00
000C19 1 38 sec
2017-09-01 16:16:12 +00:00
000C1A 1 AD 9D 09 lda window_params::vscroll_pos
2017-08-31 04:13:25 +00:00
000C1D 1 ED 6E 09 sbc track_scroll_delta
2017-08-31 15:17:06 +00:00
000C20 1 B0 02 bcs store
2017-09-02 02:54:04 +00:00
000C22 1 A9 00 lda #0 ; underflow
2017-08-31 15:17:06 +00:00
000C24 1 8D 89 09 store: sta update_scroll_params::pos
2017-08-31 04:04:16 +00:00
000C27 1 20 73 0C jsr update_scroll_pos
000C2A 1 90 E5 bcc loop ; repeat while button down
2017-08-31 03:41:54 +00:00
000C2C 1 60 end: rts
000C2D 1 .endproc
2017-08-29 03:58:09 +00:00
000C2D 1
2017-08-31 03:41:54 +00:00
000C2D 1 .proc on_vscroll_up_click
2017-09-01 16:16:12 +00:00
000C2D 1 AD 9D 09 loop : lda window_params::vscroll_pos
2017-08-31 03:41:54 +00:00
000C30 1 F0 0B beq end
2017-08-29 03:58:09 +00:00
000C32 1 38 sec
2017-08-31 04:04:16 +00:00
000C33 1 E9 01 sbc #1
2017-08-31 15:10:51 +00:00
000C35 1 8D 89 09 sta update_scroll_params::pos
2017-08-31 04:04:16 +00:00
000C38 1 20 73 0C jsr update_scroll_pos
000C3B 1 90 F0 bcc loop ; repeat while button down
2017-08-31 03:41:54 +00:00
000C3D 1 60 end: rts
000C3E 1 .endproc
2017-08-29 03:58:09 +00:00
000C3E 1
2017-08-31 04:04:16 +00:00
000C3E 1 vscroll_max := $FA
000C3E 1
2017-08-31 03:41:54 +00:00
000C3E 1 .proc on_vscroll_below_click
2017-09-01 16:16:12 +00:00
000C3E 1 AD 9D 09 loop: lda window_params::vscroll_pos
2017-08-31 04:04:16 +00:00
000C41 1 C9 FA cmp #vscroll_max ; pos == max ?
2017-08-31 03:41:54 +00:00
000C43 1 F0 1A beq end
2017-08-31 04:13:25 +00:00
000C45 1 20 84 0C jsr calc_track_scroll_delta
2017-08-29 03:58:09 +00:00
000C48 1 18 clc
2017-09-01 16:16:12 +00:00
000C49 1 AD 9D 09 lda window_params::vscroll_pos
2017-08-31 04:13:25 +00:00
000C4C 1 6D 6E 09 adc track_scroll_delta ; pos + delta
2017-08-31 04:04:16 +00:00
000C4F 1 B0 04 bcs overflow
000C51 1 C9 FB cmp #vscroll_max+1 ; > max ?
000C53 1 90 02 bcc store ; nope, it's good
000C55 1 overflow:
000C55 1 A9 FA lda #vscroll_max ; set to max
2017-08-31 15:10:51 +00:00
000C57 1 8D 89 09 store: sta update_scroll_params::pos
2017-08-31 04:04:16 +00:00
000C5A 1 20 73 0C jsr update_scroll_pos
000C5D 1 90 DF bcc loop ; repeat while button down
2017-08-31 03:41:54 +00:00
000C5F 1 60 end: rts
000C60 1 .endproc
2017-08-29 03:58:09 +00:00
000C60 1
2017-08-31 03:41:54 +00:00
000C60 1 .proc on_vscroll_down_click
2017-09-01 16:16:12 +00:00
000C60 1 AD 9D 09 loop: lda window_params::vscroll_pos
2017-08-31 04:04:16 +00:00
000C63 1 C9 FA cmp #vscroll_max
2017-08-31 03:41:54 +00:00
000C65 1 F0 0B beq end
2017-08-29 03:58:09 +00:00
000C67 1 18 clc
2017-08-31 04:04:16 +00:00
000C68 1 69 01 adc #1
2017-08-31 15:10:51 +00:00
000C6A 1 8D 89 09 sta update_scroll_params::pos
2017-08-31 04:04:16 +00:00
000C6D 1 20 73 0C jsr update_scroll_pos
000C70 1 90 EE bcc loop ; repeat while button down
2017-08-31 03:41:54 +00:00
000C72 1 60 end: rts
000C73 1 .endproc
2017-08-29 03:58:09 +00:00
000C73 1
2017-08-31 04:13:25 +00:00
000C73 1 .proc update_scroll_pos ; Returns with carry set if mouse released
2017-09-02 16:44:33 +00:00
000C73 1 20 7C 0D jsr update_voffset
2017-08-31 15:17:06 +00:00
000C76 1 20 ED 0D jsr update_vscroll
2017-09-01 01:38:49 +00:00
000C79 1 20 30 0E jsr draw_content
2017-08-31 04:04:16 +00:00
000C7C 1 20 52 0D jsr was_button_released
2017-08-29 03:58:09 +00:00
000C7F 1 18 clc
2017-08-31 04:04:16 +00:00
000C80 1 D0 01 bne end
2017-08-29 03:58:09 +00:00
000C82 1 38 sec
2017-08-31 04:04:16 +00:00
000C83 1 60 end: rts
000C84 1 .endproc
2017-08-29 03:58:09 +00:00
000C84 1
2017-08-31 04:13:25 +00:00
000C84 1 .proc calc_track_scroll_delta
2017-09-02 16:44:33 +00:00
000C84 1 AD 63 09 lda window_height ; ceil(??? / 50)
2017-08-31 05:13:41 +00:00
000C87 1 A2 00 ldx #0
2017-08-31 04:13:25 +00:00
000C89 1 E8 loop: inx
2017-08-29 03:58:09 +00:00
000C8A 1 38 sec
2017-08-31 04:13:25 +00:00
000C8B 1 E9 32 sbc #50
000C8D 1 C9 32 cmp #50
000C8F 1 B0 F8 bcs loop
000C91 1 8E 6E 09 stx track_scroll_delta
2017-08-29 03:58:09 +00:00
000C94 1 60 rts
2017-08-31 04:13:25 +00:00
000C95 1 .endproc
2017-08-29 03:58:09 +00:00
000C95 1
2017-09-02 04:24:35 +00:00
000C95 1 ;;; ==================================================
000C95 1 ;;; Horizontal Scroll Bar
000C95 1 ;;; (Unused in STF DA, so most of this is speculation)
000C95 1
2017-09-01 05:12:02 +00:00
000C95 1 .proc on_hscroll_click
2017-09-01 05:39:06 +00:00
000C95 1 A9 02 lda #A2D_HSCROLL
2017-08-31 05:22:04 +00:00
000C97 1 8D 8A 09 sta thumb_drag_params::type
2017-08-31 15:10:51 +00:00
000C9A 1 8D 88 09 sta update_scroll_params::type
2017-08-31 03:30:46 +00:00
000C9D 1 AD 85 09 lda query_client_params::scroll
2017-09-01 05:39:06 +00:00
000CA0 1 C9 05 cmp #A2D_SCROLL_PART_THUMB
2017-09-01 05:12:02 +00:00
000CA2 1 F0 11 beq on_hscroll_thumb_click
2017-09-01 05:39:06 +00:00
000CA4 1 C9 04 cmp #A2D_SCROLL_PART_AFTER
2017-09-01 05:12:02 +00:00
000CA6 1 F0 3F beq on_hscroll_after_click
2017-09-01 05:39:06 +00:00
000CA8 1 C9 03 cmp #A2D_SCROLL_PART_BEFORE
2017-09-01 05:12:02 +00:00
000CAA 1 F0 43 beq on_hscroll_before_click
2017-09-01 05:39:06 +00:00
000CAC 1 C9 01 cmp #A2D_SCROLL_PART_LEFT
2017-09-01 05:12:02 +00:00
000CAE 1 F0 4E beq on_hscroll_left_click
2017-09-01 05:39:06 +00:00
000CB0 1 C9 02 cmp #A2D_SCROLL_PART_RIGHT
2017-09-01 05:12:02 +00:00
000CB2 1 F0 42 beq on_hscroll_right_click
2017-08-29 03:58:09 +00:00
000CB4 1 60 rts
2017-09-01 05:12:02 +00:00
000CB5 1 .endproc
2017-08-29 03:58:09 +00:00
000CB5 1
2017-09-01 05:12:02 +00:00
000CB5 1 .proc on_hscroll_thumb_click
2017-09-01 05:39:06 +00:00
000CB5 1 20 39 0D jsr do_thumb_drag
2017-09-01 05:12:02 +00:00
000CB8 1 AD 90 09 lda thumb_drag_params::moved
000CBB 1 F0 29 beq end
000CBD 1 AD 8F 09 lda thumb_drag_params::pos
2017-09-03 05:52:38 +00:00
000CC0 1 20 EC 10 jsr mul_by_16
2017-08-29 03:58:09 +00:00
000CC3 1 A5 06 lda $06
2017-09-02 04:02:00 +00:00
000CC5 1 8D B0 09 sta text_box::hoffset
2017-08-29 03:58:09 +00:00
000CC8 1 A5 07 lda $07
2017-09-02 04:02:00 +00:00
000CCA 1 8D B1 09 sta text_box::hoffset+1
2017-08-29 03:58:09 +00:00
000CCD 1 18 clc
2017-09-02 04:02:00 +00:00
000CCE 1 AD B0 09 lda text_box::hoffset
2017-09-01 15:48:46 +00:00
000CD1 1 6D 61 09 adc window_width
2017-09-01 15:32:29 +00:00
000CD4 1 8D B4 09 sta text_box::width
2017-09-02 04:02:00 +00:00
000CD7 1 AD B1 09 lda text_box::hoffset+1
2017-09-01 15:48:46 +00:00
000CDA 1 6D 62 09 adc window_width+1
2017-09-01 15:32:29 +00:00
000CDD 1 8D B5 09 sta text_box::width+1
2017-09-02 03:30:55 +00:00
000CE0 1 20 D1 0D jsr update_hscroll
2017-09-01 01:38:49 +00:00
000CE3 1 20 30 0E jsr draw_content
2017-09-01 05:12:02 +00:00
000CE6 1 60 end: rts
000CE7 1 .endproc
2017-08-29 03:58:09 +00:00
000CE7 1
2017-09-01 05:12:02 +00:00
000CE7 1 .proc on_hscroll_after_click
000CE7 1 A2 02 ldx #2
2017-09-03 03:56:08 +00:00
000CE9 1 AD 9A 09 lda window_params::hscroll_max
2017-09-01 05:12:02 +00:00
000CEC 1 4C 02 0D jmp hscroll_common
000CEF 1 .endproc
2017-08-29 03:58:09 +00:00
000CEF 1
2017-09-01 05:12:02 +00:00
000CEF 1 .proc on_hscroll_before_click
000CEF 1 A2 FE ldx #254
000CF1 1 A9 00 lda #0
000CF3 1 4C 02 0D jmp hscroll_common
000CF6 1 .endproc
2017-08-29 03:58:09 +00:00
000CF6 1
2017-09-01 05:12:02 +00:00
000CF6 1 .proc on_hscroll_right_click
000CF6 1 A2 01 ldx #1
2017-09-03 03:56:08 +00:00
000CF8 1 AD 9A 09 lda window_params::hscroll_max
2017-09-01 05:12:02 +00:00
000CFB 1 4C 02 0D jmp hscroll_common
000CFE 1 .endproc
2017-08-29 03:58:09 +00:00
000CFE 1
2017-09-01 05:12:02 +00:00
000CFE 1 .proc on_hscroll_left_click
000CFE 1 A2 FF ldx #255
000D00 1 A9 00 lda #0
000D02 1 ;; fall through
000D02 1 .endproc
000D02 1
000D02 1 .proc hscroll_common
000D02 1 8D 0C 0D sta compare+1
000D05 1 8E 15 0D stx delta+1
2017-09-03 03:56:08 +00:00
000D08 1 AD 9B 09 loop: lda window_params::hscroll_pos
2017-09-01 05:12:02 +00:00
000D0B 1 C9 0A compare:cmp #$0A ; self-modified
000D0D 1 D0 01 bne continue
2017-08-29 03:58:09 +00:00
000D0F 1 60 rts
2017-09-01 05:12:02 +00:00
000D10 1 continue:
000D10 1 18 clc
2017-09-03 03:56:08 +00:00
000D11 1 AD 9B 09 lda window_params::hscroll_pos
2017-09-01 05:12:02 +00:00
000D14 1 69 01 delta: adc #1 ; self-modified
000D16 1 30 0D bmi overflow
2017-09-03 03:56:08 +00:00
000D18 1 CD 9A 09 cmp window_params::hscroll_max
2017-09-01 05:12:02 +00:00
000D1B 1 F0 0A beq store
000D1D 1 90 08 bcc store
2017-09-03 03:56:08 +00:00
000D1F 1 AD 9A 09 lda window_params::hscroll_max
2017-09-01 05:12:02 +00:00
000D22 1 4C 27 0D jmp store
000D25 1 overflow:
000D25 1 A9 00 lda #0
2017-09-03 03:56:08 +00:00
000D27 1 8D 9B 09 store: sta window_params::hscroll_pos
2017-08-29 03:58:09 +00:00
000D2A 1 20 5E 0D jsr L0D5E
2017-09-02 03:30:55 +00:00
000D2D 1 20 D1 0D jsr update_hscroll
2017-09-01 01:38:49 +00:00
000D30 1 20 30 0E jsr draw_content
2017-08-31 04:04:16 +00:00
000D33 1 20 52 0D jsr was_button_released
2017-09-01 05:12:02 +00:00
000D36 1 D0 D0 bne loop
2017-08-29 03:58:09 +00:00
000D38 1 60 rts
2017-09-01 05:12:02 +00:00
000D39 1 .endproc
2017-08-29 03:58:09 +00:00
000D39 1
2017-09-02 04:24:35 +00:00
000D39 1 ;;; ==================================================
000D39 1 ;;; UI Helpers
000D39 1
2017-08-31 05:13:41 +00:00
000D39 1 ;; Used at start of thumb drag
2017-09-01 05:39:06 +00:00
000D39 1 .proc do_thumb_drag
2017-09-02 02:54:04 +00:00
000D39 1 AD 71 09 lda mouse_params::xcoord
2017-08-31 05:22:04 +00:00
000D3C 1 8D 8B 09 sta thumb_drag_params::xcoord
2017-09-02 02:54:04 +00:00
000D3F 1 AD 72 09 lda mouse_params::xcoord+1
2017-08-31 05:22:04 +00:00
000D42 1 8D 8C 09 sta thumb_drag_params::xcoord+1
2017-09-02 02:54:04 +00:00
000D45 1 AD 73 09 lda mouse_params::ycoord
2017-08-31 05:22:04 +00:00
000D48 1 8D 8D 09 sta thumb_drag_params::ycoord
2017-09-01 05:39:06 +00:00
000D4B 1 20 00 40 4A A2D_CALL A2D_DRAG_SCROLL, thumb_drag_params
2017-08-29 03:58:09 +00:00
000D4F 1 8A 09
000D51 1 60 rts
2017-08-31 05:22:04 +00:00
000D52 1 .endproc
2017-08-29 03:58:09 +00:00
000D52 1
2017-09-01 02:05:41 +00:00
000D52 1 ;;; Checks button state; z clear if button was released, set otherwise
2017-08-31 04:04:16 +00:00
000D52 1 .proc was_button_released
000D52 1 20 00 40 2A A2D_CALL A2D_GET_BUTTON, button_state
2017-08-29 03:58:09 +00:00
000D56 1 70 09
000D58 1 AD 70 09 lda button_state
2017-08-31 04:04:16 +00:00
000D5B 1 C9 02 cmp #2
2017-08-29 03:58:09 +00:00
000D5D 1 60 rts
2017-08-31 04:04:16 +00:00
000D5E 1 .endproc
2017-08-29 03:58:09 +00:00
000D5E 1
2017-09-01 05:12:02 +00:00
000D5E 1 ;;; only used from hscroll code?
000D5E 1 .proc L0D5E
2017-09-03 03:56:08 +00:00
000D5E 1 AD 9B 09 lda window_params::hscroll_pos
2017-09-03 05:52:38 +00:00
000D61 1 20 EC 10 jsr mul_by_16
2017-08-29 03:58:09 +00:00
000D64 1 18 clc
000D65 1 A5 06 lda $06
2017-09-02 04:02:00 +00:00
000D67 1 8D B0 09 sta text_box::hoffset
2017-09-01 15:48:46 +00:00
000D6A 1 6D 61 09 adc window_width
2017-09-01 15:32:29 +00:00
000D6D 1 8D B4 09 sta text_box::width
2017-08-29 03:58:09 +00:00
000D70 1 A5 07 lda $07
2017-09-02 04:02:00 +00:00
000D72 1 8D B1 09 sta text_box::hoffset+1
2017-09-01 15:48:46 +00:00
000D75 1 6D 62 09 adc window_width+1
2017-09-01 15:32:29 +00:00
000D78 1 8D B5 09 sta text_box::width+1
2017-08-29 03:58:09 +00:00
000D7B 1 60 rts
2017-09-01 05:12:02 +00:00
000D7C 1 .endproc
2017-08-29 03:58:09 +00:00
000D7C 1
2017-09-02 16:44:33 +00:00
000D7C 1 .proc update_voffset
2017-09-01 05:39:06 +00:00
000D7C 1 A9 00 lda #0
2017-09-02 04:02:00 +00:00
000D7E 1 8D B2 09 sta text_box::voffset
000D81 1 8D B3 09 sta text_box::voffset+1
2017-08-31 15:10:51 +00:00
000D84 1 AE 89 09 ldx update_scroll_params::pos
2017-09-01 05:39:06 +00:00
000D87 1 F0 12 loop: beq L0D9B
2017-08-29 03:58:09 +00:00
000D89 1 18 clc
2017-09-02 04:02:00 +00:00
000D8A 1 AD B2 09 lda text_box::voffset
2017-08-31 15:17:06 +00:00
000D8D 1 69 32 adc #50
2017-09-02 04:02:00 +00:00
000D8F 1 8D B2 09 sta text_box::voffset
2017-09-02 02:39:29 +00:00
000D92 1 90 03 bcc :+
2017-09-02 04:02:00 +00:00
000D94 1 EE B3 09 inc text_box::voffset+1
2017-09-02 02:39:29 +00:00
000D97 1 CA : dex
2017-09-01 05:39:06 +00:00
000D98 1 4C 87 0D jmp loop
000D9B 1 .endproc
2017-08-29 03:58:09 +00:00
000D9B 1
2017-09-01 05:39:06 +00:00
000D9B 1 .proc L0D9B ; ?? part of vscroll
2017-09-02 16:44:33 +00:00
000D9B 1 ;; increase text_box height to cover full window (offset + height)
2017-09-01 05:39:06 +00:00
000D9B 1 18 clc
2017-09-02 04:02:00 +00:00
000D9C 1 AD B2 09 lda text_box::voffset
2017-09-01 15:48:46 +00:00
000D9F 1 6D 63 09 adc window_height
2017-09-01 15:32:29 +00:00
000DA2 1 8D B6 09 sta text_box::height
2017-09-02 04:02:00 +00:00
000DA5 1 AD B3 09 lda text_box::voffset+1
2017-09-01 15:48:46 +00:00
000DA8 1 6D 64 09 adc window_height+1
2017-09-01 15:32:29 +00:00
000DAB 1 8D B7 09 sta text_box::height+1
2017-08-29 03:58:09 +00:00
000DAE 1 20 A5 10 jsr L10A5
2017-08-31 15:17:06 +00:00
000DB1 1 A9 00 lda #0
2017-08-29 03:58:09 +00:00
000DB3 1 8D 6A 09 sta L096A
000DB6 1 8D 6B 09 sta L096B
2017-08-31 15:10:51 +00:00
000DB9 1 AE 89 09 ldx update_scroll_params::pos
2017-09-01 05:39:06 +00:00
000DBC 1 F0 12 loop: beq end
2017-08-29 03:58:09 +00:00
000DBE 1 18 clc
000DBF 1 AD 6A 09 lda L096A
2017-08-31 15:17:06 +00:00
000DC2 1 69 05 adc #5
2017-08-29 03:58:09 +00:00
000DC4 1 8D 6A 09 sta L096A
2017-09-02 02:39:29 +00:00
000DC7 1 90 03 bcc :+
2017-08-29 03:58:09 +00:00
000DC9 1 EE 6B 09 inc L096B
2017-09-02 02:39:29 +00:00
000DCC 1 CA : dex
2017-09-01 05:39:06 +00:00
000DCD 1 4C BC 0D jmp loop
000DD0 1 60 end: rts
000DD1 1 .endproc
2017-08-29 03:58:09 +00:00
000DD1 1
2017-09-02 03:30:55 +00:00
000DD1 1 .proc update_hscroll
000DD1 1 A9 02 lda #2
2017-08-31 15:10:51 +00:00
000DD3 1 8D 88 09 sta update_scroll_params::type
2017-09-02 04:02:00 +00:00
000DD6 1 AD B0 09 lda text_box::hoffset
2017-08-29 03:58:09 +00:00
000DD9 1 85 06 sta $06
2017-09-02 04:02:00 +00:00
000DDB 1 AD B1 09 lda text_box::hoffset+1
2017-08-29 03:58:09 +00:00
000DDE 1 85 07 sta $07
2017-09-03 05:52:38 +00:00
000DE0 1 20 DF 10 jsr div_by_16
2017-08-31 15:10:51 +00:00
000DE3 1 8D 89 09 sta update_scroll_params::pos
000DE6 1 20 00 40 4B A2D_CALL A2D_UPDATE_SCROLL, update_scroll_params
2017-08-29 03:58:09 +00:00
000DEA 1 88 09
000DEC 1 60 rts
2017-09-02 03:30:55 +00:00
000DED 1 .endproc
2017-08-29 03:58:09 +00:00
000DED 1
2017-08-31 15:17:06 +00:00
000DED 1 .proc update_vscroll ; update_scroll_params::pos set by caller
000DED 1 A9 01 lda #1
2017-08-31 15:10:51 +00:00
000DEF 1 8D 88 09 sta update_scroll_params::type
000DF2 1 20 00 40 4B A2D_CALL A2D_UPDATE_SCROLL, update_scroll_params
2017-08-29 03:58:09 +00:00
000DF6 1 88 09
000DF8 1 60 rts
2017-08-31 15:17:06 +00:00
000DF9 1 .endproc
2017-08-29 03:58:09 +00:00
000DF9 1
2017-09-02 03:30:55 +00:00
000DF9 1 .proc finish_resize ; only called from dead code
2017-09-01 05:39:06 +00:00
000DF9 1 20 00 8E jsr UNKNOWN_CALL
2017-08-30 02:07:44 +00:00
000DFC 1 0C .byte $0C
2017-08-31 03:46:50 +00:00
000DFD 1 00 00 .addr 0
2017-09-02 04:02:00 +00:00
000DFF 1 20 00 40 04 A2D_CALL A2D_TEXT_BOX1, text_box
2017-08-29 03:58:09 +00:00
000E03 1 A8 09
2017-09-03 03:49:28 +00:00
000E05 1 AD 98 09 lda window_params::hscroll
000E08 1 6A ror a ; check if low bit (track enabled) is set
2017-09-02 02:39:29 +00:00
000E09 1 90 03 bcc :+
2017-09-02 03:30:55 +00:00
000E0B 1 20 D1 0D jsr update_hscroll
2017-09-02 02:39:29 +00:00
000E0E 1 AD 9D 09 : lda window_params::vscroll_pos
2017-08-31 15:10:51 +00:00
000E11 1 8D 89 09 sta update_scroll_params::pos
2017-08-31 15:17:06 +00:00
000E14 1 20 ED 0D jsr update_vscroll
2017-09-01 01:38:49 +00:00
000E17 1 20 30 0E jsr draw_content
000E1A 1 4C D1 0A jmp input_loop
2017-09-01 05:39:06 +00:00
000E1D 1 .endproc
2017-08-29 03:58:09 +00:00
000E1D 1
2017-09-02 16:44:33 +00:00
000E1D 1 ;; called on scroll
2017-09-03 03:23:14 +00:00
000E1D 1 20 00 40 08 L0E1D: A2D_CALL A2D_SET_PATTERN, white_pattern
2017-08-29 03:58:09 +00:00
000E21 1 52 09
2017-09-02 16:44:33 +00:00
000E23 1 20 00 40 11 A2D_CALL A2D_CLEAR_BOX, text_box::hoffset
2017-08-29 03:58:09 +00:00
000E27 1 B0 09
2017-09-03 03:23:14 +00:00
000E29 1 20 00 40 08 A2D_CALL A2D_SET_PATTERN, black_pattern
2017-08-29 03:58:09 +00:00
000E2D 1 4A 09
000E2F 1 60 rts
000E30 1
2017-09-02 04:24:35 +00:00
000E30 1 ;;; ==================================================
000E30 1 ;;; Content Rendering
000E30 1
2017-09-01 01:38:49 +00:00
000E30 1 .proc draw_content
2017-09-01 05:39:06 +00:00
000E30 1 A9 00 lda #0
2017-08-29 03:58:09 +00:00
000E32 1 8D 49 09 sta L0949
000E35 1 20 29 11 jsr L1129
2017-08-30 01:47:15 +00:00
000E38 1 20 9C 08 jsr set_file_mark
2017-09-01 05:39:06 +00:00
000E3B 1 A9 00 lda #<default_buffer
2017-09-01 01:38:49 +00:00
000E3D 1 8D F2 08 sta read_params::buffer
2017-08-29 03:58:09 +00:00
000E40 1 85 06 sta $06
2017-09-01 05:39:06 +00:00
000E42 1 A9 12 lda #>default_buffer
2017-09-01 01:38:49 +00:00
000E44 1 8D F3 08 sta read_params::buffer+1
2017-08-29 03:58:09 +00:00
000E47 1 85 07 sta $07
000E49 1 A9 00 lda #$00
000E4B 1 8D 45 09 sta L0945
000E4E 1 8D 46 09 sta L0946
000E51 1 8D 47 09 sta L0947
2017-09-01 15:15:05 +00:00
000E54 1 8D 60 09 sta line_pos::base+1
2017-08-29 03:58:09 +00:00
000E57 1 8D 6C 09 sta L096C
000E5A 1 8D 6D 09 sta L096D
000E5D 1 8D 48 09 sta L0948
2017-09-02 04:02:00 +00:00
000E60 1 A9 0A lda #$0A ; line spacing = 10
2017-09-01 15:15:05 +00:00
000E62 1 8D 5F 09 sta line_pos::base
2017-08-29 03:58:09 +00:00
000E65 1 20 DB 0E jsr L0EDB
000E68 1 AD 6D 09 L0E68: lda L096D
000E6B 1 CD 6B 09 cmp L096B
000E6E 1 D0 0E bne L0E7E
000E70 1 AD 6C 09 lda L096C
000E73 1 CD 6A 09 cmp L096A
000E76 1 D0 06 bne L0E7E
000E78 1 20 1D 0E jsr L0E1D
000E7B 1 EE 48 09 inc L0948
2017-09-01 15:15:05 +00:00
000E7E 1 20 00 40 0E L0E7E: A2D_CALL A2D_SET_TEXT_POS, line_pos
2017-08-29 03:58:09 +00:00
000E82 1 5D 09
000E84 1 38 sec
2017-09-02 03:10:21 +00:00
000E85 1 A9 FA lda #250
2017-09-01 15:15:05 +00:00
000E87 1 ED 5D 09 sbc line_pos::left
2017-08-29 03:58:09 +00:00
000E8A 1 8D 5B 09 sta L095B
2017-09-02 03:10:21 +00:00
000E8D 1 A9 01 lda #1
2017-09-01 15:15:05 +00:00
000E8F 1 ED 5E 09 sbc line_pos::left+1
2017-08-29 03:58:09 +00:00
000E92 1 8D 5C 09 sta L095C
000E95 1 20 F3 0E jsr L0EF3
000E98 1 B0 3D bcs L0ED7
000E9A 1 18 clc
2017-09-01 05:12:02 +00:00
000E9B 1 AD 93 09 lda text_string::len
2017-08-29 03:58:09 +00:00
000E9E 1 65 06 adc $06
000EA0 1 85 06 sta $06
000EA2 1 90 02 bcc L0EA6
000EA4 1 E6 07 inc $07
000EA6 1 AD 5A 09 L0EA6: lda L095A
000EA9 1 D0 BD bne L0E68
000EAB 1 18 clc
2017-09-01 15:15:05 +00:00
000EAC 1 AD 5F 09 lda line_pos::base
2017-09-02 04:02:00 +00:00
000EAF 1 69 0A adc #$0A ; line spacing = 10
2017-09-01 15:15:05 +00:00
000EB1 1 8D 5F 09 sta line_pos::base
2017-08-29 03:58:09 +00:00
000EB4 1 90 03 bcc L0EB9
2017-09-01 15:15:05 +00:00
000EB6 1 EE 60 09 inc line_pos::base+1
2017-08-29 03:58:09 +00:00
000EB9 1 20 DB 0E L0EB9: jsr L0EDB
000EBC 1 AD 6C 09 lda L096C
000EBF 1 CD 68 09 cmp L0968
000EC2 1 D0 08 bne L0ECC
000EC4 1 AD 6D 09 lda L096D
000EC7 1 CD 69 09 cmp L0969
000ECA 1 F0 0B beq L0ED7
000ECC 1 EE 6C 09 L0ECC: inc L096C
000ECF 1 D0 03 bne L0ED4
000ED1 1 EE 6D 09 inc L096D
000ED4 1 4C 68 0E L0ED4: jmp L0E68
000ED7 1
000ED7 1 20 09 11 L0ED7: jsr L1109
000EDA 1 60 rts
2017-09-01 01:38:49 +00:00
000EDB 1 .endproc
2017-08-29 03:58:09 +00:00
000EDB 1
2017-09-01 01:38:49 +00:00
000EDB 1 .proc L0EDB ; ???
2017-09-02 03:10:21 +00:00
000EDB 1 A9 FA lda #250
2017-08-29 03:58:09 +00:00
000EDD 1 8D 5B 09 sta L095B
2017-09-02 03:10:21 +00:00
000EE0 1 A9 01 lda #1
2017-08-29 03:58:09 +00:00
000EE2 1 8D 5C 09 sta L095C
2017-09-02 03:10:21 +00:00
000EE5 1 A9 03 lda #3
2017-09-01 15:15:05 +00:00
000EE7 1 8D 5D 09 sta line_pos::left
2017-09-02 03:10:21 +00:00
000EEA 1 A9 00 lda #0
2017-09-01 15:15:05 +00:00
000EEC 1 8D 5E 09 sta line_pos::left+1
2017-08-29 03:58:09 +00:00
000EEF 1 8D 5A 09 sta L095A
000EF2 1 60 rts
2017-09-01 01:38:49 +00:00
000EF3 1 .endproc
2017-08-29 03:58:09 +00:00
000EF3 1
000EF3 1 A9 FF L0EF3: lda #$FF
000EF5 1 8D 9B 0F sta L0F9B
000EF8 1 A9 00 lda #$00
000EFA 1 8D 9C 0F sta L0F9C
000EFD 1 8D 9D 0F sta L0F9D
000F00 1 8D 5A 09 sta L095A
2017-09-01 05:12:02 +00:00
000F03 1 8D 93 09 sta text_string::len
2017-08-29 03:58:09 +00:00
000F06 1 A5 06 lda $06
2017-09-01 05:12:02 +00:00
000F08 1 8D 91 09 sta text_string::addr
2017-08-29 03:58:09 +00:00
000F0B 1 A5 07 lda $07
2017-09-01 05:12:02 +00:00
000F0D 1 8D 92 09 sta text_string::addr+1
2017-08-29 03:58:09 +00:00
000F10 1 AD 45 09 L0F10: lda L0945
000F13 1 D0 0D bne L0F22
000F15 1 AD 47 09 lda L0947
000F18 1 F0 05 beq L0F1F
000F1A 1 20 F6 0F jsr L0FF6
000F1D 1 38 sec
000F1E 1 60 rts
000F1F 1
000F1F 1 20 0C 10 L0F1F: jsr L100C
2017-09-01 05:12:02 +00:00
000F22 1 AC 93 09 L0F22: ldy text_string::len
2017-08-29 03:58:09 +00:00
000F25 1 B1 06 lda ($06),y
2017-08-30 02:07:44 +00:00
000F27 1 29 7F and #$7F ; clear high bit
2017-08-29 03:58:09 +00:00
000F29 1 91 06 sta ($06),y
000F2B 1 EE 45 09 inc L0945
2017-08-30 02:07:44 +00:00
000F2E 1 C9 0D cmp #$0D ; return character
2017-08-29 03:58:09 +00:00
000F30 1 F0 54 beq L0F86
2017-09-02 03:10:21 +00:00
000F32 1 C9 20 cmp #' ' ; space character
2017-08-29 03:58:09 +00:00
000F34 1 D0 0B bne L0F41
000F36 1 8C 9B 0F sty L0F9B
000F39 1 48 pha
000F3A 1 AD 45 09 lda L0945
000F3D 1 8D 46 09 sta L0946
000F40 1 68 pla
000F41 1 C9 09 L0F41: cmp #$09
000F43 1 D0 03 bne L0F48
000F45 1 4C 9E 0F jmp L0F9E
000F48 1
000F48 1 A8 L0F48: tay
000F49 1 B9 03 88 lda $8803,y
000F4C 1 18 clc
000F4D 1 6D 9C 0F adc L0F9C
000F50 1 8D 9C 0F sta L0F9C
000F53 1 90 03 bcc L0F58
000F55 1 EE 9D 0F inc L0F9D
000F58 1 AD 5C 09 L0F58: lda L095C
000F5B 1 CD 9D 0F cmp L0F9D
000F5E 1 D0 06 bne L0F66
000F60 1 AD 5B 09 lda L095B
000F63 1 CD 9C 0F cmp L0F9C
000F66 1 90 06 L0F66: bcc L0F6E
2017-09-01 05:12:02 +00:00
000F68 1 EE 93 09 inc text_string::len
2017-08-29 03:58:09 +00:00
000F6B 1 4C 10 0F jmp L0F10
000F6E 1
2017-09-02 03:10:21 +00:00
000F6E 1 A9 00 L0F6E: lda #0
2017-08-29 03:58:09 +00:00
000F70 1 8D 5A 09 sta L095A
000F73 1 AD 9B 0F lda L0F9B
000F76 1 C9 FF cmp #$FF
000F78 1 F0 09 beq L0F83
2017-09-01 05:12:02 +00:00
000F7A 1 8D 93 09 sta text_string::len
2017-08-29 03:58:09 +00:00
000F7D 1 AD 46 09 lda L0946
000F80 1 8D 45 09 sta L0945
2017-09-01 05:12:02 +00:00
000F83 1 EE 93 09 L0F83: inc text_string::len
2017-08-29 03:58:09 +00:00
000F86 1 20 F6 0F L0F86: jsr L0FF6
2017-09-01 05:12:02 +00:00
000F89 1 AC 93 09 ldy text_string::len
2017-08-29 03:58:09 +00:00
000F8C 1 B1 06 lda ($06),y
2017-09-02 03:10:21 +00:00
000F8E 1 C9 09 cmp #$09 ; tab character?
2017-08-29 03:58:09 +00:00
000F90 1 F0 04 beq L0F96
2017-09-02 03:10:21 +00:00
000F92 1 C9 0D cmp #$0D ; return character
2017-08-29 03:58:09 +00:00
000F94 1 D0 03 bne L0F99
2017-09-01 05:12:02 +00:00
000F96 1 EE 93 09 L0F96: inc text_string::len
2017-08-29 03:58:09 +00:00
000F99 1 18 L0F99: clc
000F9A 1 60 rts
000F9B 1
2017-08-29 16:08:46 +00:00
000F9B 1 00 L0F9B: .byte 0
000F9C 1 00 L0F9C: .byte 0
000F9D 1 00 L0F9D: .byte 0
2017-09-01 02:05:41 +00:00
000F9E 1 .proc L0F9E ; ???
000F9E 1 A9 01 lda #1
2017-08-29 03:58:09 +00:00
000FA0 1 8D 5A 09 sta L095A
000FA3 1 18 clc
000FA4 1 AD 9C 0F lda L0F9C
2017-09-01 15:15:05 +00:00
000FA7 1 6D 5D 09 adc line_pos::left
000FAA 1 8D 5D 09 sta line_pos::left
2017-08-29 03:58:09 +00:00
000FAD 1 AD 9D 0F lda L0F9D
2017-09-01 15:15:05 +00:00
000FB0 1 6D 5E 09 adc line_pos::left+1
000FB3 1 8D 5E 09 sta line_pos::left+1
2017-09-01 02:05:41 +00:00
000FB6 1 A2 00 ldx #0
000FB8 1 BD E9 0F loop: lda times70+1,x
2017-09-01 15:15:05 +00:00
000FBB 1 CD 5E 09 cmp line_pos::left+1
2017-08-29 03:58:09 +00:00
000FBE 1 D0 06 bne L0FC6
2017-09-01 02:05:41 +00:00
000FC0 1 BD E8 0F lda times70,x
2017-09-01 15:15:05 +00:00
000FC3 1 CD 5D 09 cmp line_pos::left
2017-08-29 03:58:09 +00:00
000FC6 1 B0 09 L0FC6: bcs L0FD1
000FC8 1 E8 inx
000FC9 1 E8 inx
2017-09-01 02:05:41 +00:00
000FCA 1 E0 0E cpx #14
000FCC 1 F0 12 beq done
000FCE 1 4C B8 0F jmp loop
000FD1 1 BD E8 0F L0FD1: lda times70,x
2017-09-01 15:15:05 +00:00
000FD4 1 8D 5D 09 sta line_pos::left
2017-09-01 02:05:41 +00:00
000FD7 1 BD E9 0F lda times70+1,x
2017-09-01 15:15:05 +00:00
000FDA 1 8D 5E 09 sta line_pos::left+1
2017-08-29 03:58:09 +00:00
000FDD 1 4C 86 0F jmp L0F86
2017-09-01 02:05:41 +00:00
000FE0 1 A9 00 done: lda #0
2017-08-29 03:58:09 +00:00
000FE2 1 8D 5A 09 sta L095A
000FE5 1 4C 86 0F jmp L0F86
000FE8 1
2017-09-01 02:05:41 +00:00
000FE8 1 46 00 times70:.word 70
000FEA 1 8C 00 .word 140
000FEC 1 D2 00 .word 210
000FEE 1 18 01 .word 280
000FF0 1 5E 01 .word 350
000FF2 1 A4 01 .word 420
000FF4 1 EA 01 .word 490
000FF6 1 .endproc
000FF6 1
2017-09-01 05:12:02 +00:00
000FF6 1 ;;; Draws a line of content
2017-08-29 03:58:09 +00:00
000FF6 1 AD 48 09 L0FF6: lda L0948
000FF9 1 F0 10 beq L100B
2017-09-01 05:12:02 +00:00
000FFB 1 AD 93 09 lda text_string::len
2017-08-29 03:58:09 +00:00
000FFE 1 F0 0B beq L100B
2017-09-02 02:06:14 +00:00
001000 1 20 00 40 19 A2D_CALL A2D_DRAW_TEXT, text_string
2017-08-29 03:58:09 +00:00
001004 1 91 09
2017-09-01 05:53:07 +00:00
001006 1 A9 01 lda #1
2017-08-29 03:58:09 +00:00
001008 1 8D 49 09 sta L0949
00100B 1 60 L100B: rts
00100C 1
2017-09-01 05:12:02 +00:00
00100C 1 AD 92 09 L100C: lda text_string::addr+1
2017-09-01 05:39:06 +00:00
00100F 1 C9 12 cmp #$12 ; #>default_buffer?
2017-08-29 03:58:09 +00:00
001011 1 F0 18 beq L102B
2017-09-02 03:10:21 +00:00
001013 1
001013 1 ;; copy a page of characters from $1300 to the buffer
001013 1 A0 00 ldy #0
001015 1 B9 00 13 loop: lda $1300,y
2017-09-01 05:39:06 +00:00
001018 1 99 00 12 sta default_buffer,y
2017-08-29 03:58:09 +00:00
00101B 1 C8 iny
2017-09-02 03:10:21 +00:00
00101C 1 D0 F7 bne loop
00101E 1
2017-09-01 05:12:02 +00:00
00101E 1 CE 92 09 dec text_string::addr+1
001021 1 AD 91 09 lda text_string::addr
2017-08-29 03:58:09 +00:00
001024 1 85 06 sta $06
2017-09-01 05:12:02 +00:00
001026 1 AD 92 09 lda text_string::addr+1
2017-08-29 03:58:09 +00:00
001029 1 85 07 sta $07
2017-09-02 03:10:21 +00:00
00102B 1 A9 00 L102B: lda #0
2017-08-29 03:58:09 +00:00
00102D 1 8D 45 09 sta L0945
001030 1 20 3E 10 jsr L103E
2017-09-01 01:38:49 +00:00
001033 1 AD F3 08 lda read_params::buffer+1
2017-09-01 05:39:06 +00:00
001036 1 C9 12 cmp #$12 ; #>default_buffer?
2017-08-29 03:58:09 +00:00
001038 1 D0 03 bne L103D
2017-09-01 01:38:49 +00:00
00103A 1 EE F3 08 inc read_params::buffer+1
2017-08-29 03:58:09 +00:00
00103D 1 60 L103D: rts
00103E 1
2017-09-02 03:10:21 +00:00
00103E 1 .proc L103E
2017-09-01 01:38:49 +00:00
00103E 1 AD F2 08 lda read_params::buffer
2017-08-30 02:07:44 +00:00
001041 1 8D 52 10 sta store+1
2017-09-01 01:38:49 +00:00
001044 1 AD F3 08 lda read_params::buffer+1
2017-08-30 02:07:44 +00:00
001047 1 8D 53 10 sta store+2
2017-08-29 03:58:09 +00:00
00104A 1 A9 20 lda #$20
00104C 1 A2 00 ldx #$00
00104E 1 8D 04 C0 sta RAMWRTOFF
2017-09-01 05:39:06 +00:00
001051 1 9D 00 12 store: sta default_buffer,x ; self-modified
2017-08-29 03:58:09 +00:00
001054 1 E8 inx
2017-08-30 02:07:44 +00:00
001055 1 D0 FA bne store
2017-08-29 03:58:09 +00:00
001057 1 8D 05 C0 sta RAMWRTON
00105A 1 A9 00 lda #$00
00105C 1 8D 47 09 sta L0947
2017-08-30 01:47:15 +00:00
00105F 1 20 76 08 jsr read_file
2017-08-29 03:58:09 +00:00
001062 1 48 pha
001063 1 A9 00 lda #$00
2017-09-01 01:20:36 +00:00
001065 1 85 3C sta STARTLO
001067 1 85 42 sta DESTINATIONLO
2017-08-29 03:58:09 +00:00
001069 1 A9 FF lda #$FF
2017-09-01 01:20:36 +00:00
00106B 1 85 3E sta ENDLO
2017-09-01 01:38:49 +00:00
00106D 1 AD F3 08 lda read_params::buffer+1
2017-09-01 01:20:36 +00:00
001070 1 85 43 sta DESTINATIONHI
001072 1 85 3D sta STARTHI
001074 1 85 3F sta ENDHI
2017-09-01 01:38:49 +00:00
001076 1 38 sec ; main>aux
2017-08-29 03:58:09 +00:00
001077 1 20 11 C3 jsr AUXMOVE
00107A 1 68 pla
2017-08-30 02:07:44 +00:00
00107B 1 F0 0A beq end
2017-08-29 03:58:09 +00:00
00107D 1 C9 4C cmp #$4C
2017-08-30 02:07:44 +00:00
00107F 1 F0 01 beq done
001081 1 00 brk ; ????
001082 1 A9 01 done: lda #$01
2017-08-29 03:58:09 +00:00
001084 1 8D 47 09 sta L0947
2017-08-30 02:07:44 +00:00
001087 1 60 end: rts
2017-09-02 03:10:21 +00:00
001088 1 .endproc
2017-08-29 03:58:09 +00:00
001088 1
2017-09-02 16:44:33 +00:00
001088 1 .proc calc_window_size
001088 1 38 sec
2017-09-01 15:32:29 +00:00
001089 1 AD B4 09 lda text_box::width
2017-09-02 04:02:00 +00:00
00108C 1 ED B0 09 sbc text_box::hoffset
2017-09-01 15:48:46 +00:00
00108F 1 8D 61 09 sta window_width
2017-09-01 15:32:29 +00:00
001092 1 AD B5 09 lda text_box::width+1
2017-09-02 04:02:00 +00:00
001095 1 ED B1 09 sbc text_box::hoffset+1
2017-09-01 15:48:46 +00:00
001098 1 8D 62 09 sta window_width+1
2017-09-02 04:24:35 +00:00
00109B 1
2017-08-29 03:58:09 +00:00
00109B 1 38 sec
2017-09-01 15:32:29 +00:00
00109C 1 AD B6 09 lda text_box::height
2017-09-02 04:02:00 +00:00
00109F 1 ED B2 09 sbc text_box::voffset
2017-09-01 15:48:46 +00:00
0010A2 1 8D 63 09 sta window_height
2017-09-02 16:44:33 +00:00
0010A5 1 ;; fall through
0010A5 1 .endproc
0010A5 1
0010A5 1 ;; calculate line offset ?
0010A5 1 .proc L10A5
0010A5 1 AD B6 09 lda text_box::height
2017-08-29 03:58:09 +00:00
0010A8 1 8D 65 09 sta L0965
2017-09-01 15:32:29 +00:00
0010AB 1 AD B7 09 lda text_box::height+1
2017-08-29 03:58:09 +00:00
0010AE 1 8D 66 09 sta L0966
2017-09-02 04:24:35 +00:00
0010B1 1
2017-09-02 16:44:33 +00:00
0010B1 1 A9 00 lda #0
2017-08-29 03:58:09 +00:00
0010B3 1 8D 68 09 sta L0968
0010B6 1 8D 69 09 sta L0969
2017-09-02 16:44:33 +00:00
0010B9 1 AD 66 09 loop: lda L0966
0010BC 1 D0 07 bne :+
2017-08-29 03:58:09 +00:00
0010BE 1 AD 65 09 lda L0965
2017-09-02 04:24:35 +00:00
0010C1 1 C9 0A cmp #$0A ; line spacing = 10
2017-09-02 16:44:33 +00:00
0010C3 1 90 19 bcc end
0010C5 1 38 : sec
2017-08-29 03:58:09 +00:00
0010C6 1 AD 65 09 lda L0965
2017-09-02 04:24:35 +00:00
0010C9 1 E9 0A sbc #$0A ; line spacing = 10
2017-08-29 03:58:09 +00:00
0010CB 1 8D 65 09 sta L0965
2017-09-02 16:44:33 +00:00
0010CE 1 B0 03 bcs :+
2017-08-29 03:58:09 +00:00
0010D0 1 CE 66 09 dec L0966
2017-09-02 16:44:33 +00:00
0010D3 1 EE 68 09 : inc L0968
0010D6 1 D0 E1 bne loop
2017-08-29 03:58:09 +00:00
0010D8 1 EE 69 09 inc L0969
2017-09-02 16:44:33 +00:00
0010DB 1 4C B9 10 jmp loop
0010DE 1 60 end: rts
0010DF 1 .endproc
2017-08-29 03:58:09 +00:00
0010DF 1
2017-09-03 05:52:38 +00:00
0010DF 1 .proc div_by_16 ; input in $06/$07, output in a
0010DF 1 A2 04 ldx #4
2017-09-02 03:10:21 +00:00
0010E1 1 18 loop: clc
2017-08-29 03:58:09 +00:00
0010E2 1 66 07 ror $07
0010E4 1 66 06 ror $06
0010E6 1 CA dex
2017-09-02 03:10:21 +00:00
0010E7 1 D0 F8 bne loop
2017-08-29 03:58:09 +00:00
0010E9 1 A5 06 lda $06
0010EB 1 60 rts
2017-09-02 03:10:21 +00:00
0010EC 1 .endproc
2017-08-29 03:58:09 +00:00
0010EC 1
2017-09-03 05:52:38 +00:00
0010EC 1 .proc mul_by_16 ; input in a, output in $06/$07
2017-09-02 03:10:21 +00:00
0010EC 1 85 06 sta $06
2017-09-03 05:52:38 +00:00
0010EE 1 A9 00 lda #0
2017-08-29 03:58:09 +00:00
0010F0 1 85 07 sta $07
2017-09-03 05:52:38 +00:00
0010F2 1 A2 04 ldx #4
2017-09-02 03:10:21 +00:00
0010F4 1 18 loop: clc
2017-08-29 03:58:09 +00:00
0010F5 1 26 06 rol $06
0010F7 1 26 07 rol $07
0010F9 1 CA dex
2017-09-02 03:10:21 +00:00
0010FA 1 D0 F8 bne loop
2017-08-29 03:58:09 +00:00
0010FC 1 60 rts
2017-09-02 03:10:21 +00:00
0010FD 1 .endproc
2017-08-29 03:58:09 +00:00
0010FD 1
2017-09-02 02:06:14 +00:00
0010FD 1 .proc L10FD
2017-09-02 03:48:16 +00:00
0010FD 1 A9 15 lda #<JUMP_TABLE_01
2017-09-02 02:06:14 +00:00
0010FF 1 85 27 sta call_main_addr ; self-modified
2017-09-02 03:48:16 +00:00
001101 1 A9 40 lda #>JUMP_TABLE_01
2017-09-02 02:06:14 +00:00
001103 1 85 28 sta call_main_addr+1
001105 1 20 20 00 jsr call_main_trampoline
2017-08-29 03:58:09 +00:00
001108 1 60 rts
2017-09-02 02:06:14 +00:00
001109 1 .endproc
2017-08-29 03:58:09 +00:00
001109 1
2017-09-01 02:05:41 +00:00
001109 1 ;;; if fixed mode, do a main->aux copy of a code block ???
2017-09-01 01:38:49 +00:00
001109 1 .proc L1109
001109 1 AD 6F 09 lda fixed_mode_flag ; if not fixed (i.e. proportional)
2017-09-01 02:05:41 +00:00
00110C 1 F0 1A beq end ; then exit
2017-09-01 01:38:49 +00:00
00110E 1
00110E 1 A9 00 lda #$00 ; start := $1100
2017-09-01 01:20:36 +00:00
001110 1 85 3C sta STARTLO
2017-08-29 03:58:09 +00:00
001112 1 A9 7E lda #$7E
2017-09-01 01:38:49 +00:00
001114 1 85 3E sta ENDLO ; end := $117E
2017-08-29 03:58:09 +00:00
001116 1 A9 11 lda #$11
2017-09-01 01:20:36 +00:00
001118 1 85 3D sta STARTHI
00111A 1 85 3F sta ENDHI
2017-09-01 01:38:49 +00:00
00111C 1
00111C 1 dest := $8803
00111C 1 A9 88 lda #>dest
2017-09-01 01:20:36 +00:00
00111E 1 85 43 sta DESTINATIONHI
2017-09-01 01:38:49 +00:00
001120 1 A9 03 lda #<dest
2017-09-01 01:20:36 +00:00
001122 1 85 42 sta DESTINATIONLO
2017-09-01 01:38:49 +00:00
001124 1 38 sec ; main>aux
2017-08-29 03:58:09 +00:00
001125 1 20 11 C3 jsr AUXMOVE
2017-09-01 02:05:41 +00:00
001128 1 60 end: rts
2017-09-01 01:38:49 +00:00
001129 1 .endproc
2017-08-29 03:58:09 +00:00
001129 1
2017-09-01 01:38:49 +00:00
001129 1 .proc L1129 ; ???
2017-09-01 02:05:41 +00:00
001129 1 AD 6F 09 lda fixed_mode_flag ; if not fixed (i.e. proportional)
00112C 1 F0 0B beq end ; then exit
2017-08-29 03:58:09 +00:00
00112E 1 AE 01 88 ldx $8801
2017-09-02 02:35:50 +00:00
001131 1 A9 07 lda #7 ; 7 pixels/character
2017-09-01 01:38:49 +00:00
001133 1 9D 02 88 loop: sta $8802,x
2017-08-29 03:58:09 +00:00
001136 1 CA dex
2017-09-01 01:38:49 +00:00
001137 1 D0 FA bne loop
2017-09-01 02:05:41 +00:00
001139 1 60 end: rts
2017-09-01 01:38:49 +00:00
00113A 1 .endproc
2017-08-29 03:58:09 +00:00
00113A 1
2017-09-02 04:24:35 +00:00
00113A 1 ;;; ==================================================
00113A 1 ;;; Title Bar (Proportional/Fixed mode button)
00113A 1
00113A 1 .proc on_title_bar_click
2017-09-02 02:54:04 +00:00
00113A 1 AD 72 09 lda mouse_params::xcoord+1 ; mouse x high byte?
2017-09-01 15:15:05 +00:00
00113D 1 CD 85 11 cmp mode_box_left+1
001140 1 D0 06 bne :+
2017-09-02 02:54:04 +00:00
001142 1 AD 71 09 lda mouse_params::xcoord
2017-09-01 15:15:05 +00:00
001145 1 CD 84 11 cmp mode_box_left
001148 1 90 19 : bcc ignore
2017-09-02 04:24:35 +00:00
00114A 1
00114A 1 ;; Toggle the state and redraw
00114A 1 AD 6F 09 lda fixed_mode_flag
00114D 1 F0 09 beq set_flag
00114F 1 CE 6F 09 dec fixed_mode_flag ; clear flag (mode = proportional)
2017-08-29 03:58:09 +00:00
001152 1 20 09 11 jsr L1109
001155 1 4C 5B 11 jmp redraw
2017-08-29 03:58:09 +00:00
001158 1
001158 1 set_flag:
001158 1 EE 6F 09 inc fixed_mode_flag ; set flag (mode = fixed)
00115B 1 20 BD 11 redraw: jsr draw_mode
2017-09-01 01:38:49 +00:00
00115E 1 20 30 0E jsr draw_content
001161 1 38 sec ; Click consumed
2017-08-29 03:58:09 +00:00
001162 1 60 rts
001163 1
001163 1 18 ignore: clc ; Click ignored
2017-08-29 03:58:09 +00:00
001164 1 60 rts
001165 1 .endproc
2017-08-29 03:58:09 +00:00
001165 1
001165 1 68 11 0D 46 fixed_str: A2D_DEFSTRING "Fixed "
001169 1 69 78 65 64
00116D 1 20 20 20 20
001175 1 78 11 0C 50 prop_str: A2D_DEFSTRING "Proportional"
001179 1 72 6F 70 6F
00117D 1 72 74 69 6F
2017-09-01 15:48:46 +00:00
001184 1 label_width := 50
001184 1 title_bar_height := 12
2017-09-01 15:15:05 +00:00
001184 1 .proc mode_box ; bounding box for mode label
001184 1 00 00 left: .word 0
001186 1 00 00 top: .word 0
2017-09-01 15:32:29 +00:00
001188 1 00 20 .word $2000 ; ??
00118A 1 80 00 .word $80 ; ??
2017-09-02 04:02:00 +00:00
00118C 1 00 00 hoffset:.word 0
00118E 1 00 00 voffset:.word 0
2017-09-01 15:15:05 +00:00
001190 1 50 00 width: .word 80
001192 1 0A 00 height: .word 10
001194 1 .endproc
001194 1 mode_box_left := mode_box::left ; forward refs to mode_box::left don't work?
2017-09-02 02:37:18 +00:00
001194 1 ;; https://github.com/cc65/cc65/issues/479
2017-09-01 15:15:05 +00:00
001194 1
001194 1 .proc mode_pos
001194 1 00 00 left: .word 0 ; horizontal text offset
001196 1 0A 00 base: .word 10 ; vertical text offset (to baseline)
001198 1 .endproc
001198 1
001198 1 .proc calc_and_draw_mode
001198 1 38 sec
2017-09-01 15:48:46 +00:00
001199 1 AD AA 09 lda text_box::top
00119C 1 E9 0C sbc #title_bar_height
00119E 1 8D 86 11 sta mode_box::top
2017-08-29 03:58:09 +00:00
0011A1 1 18 clc
2017-09-01 15:32:29 +00:00
0011A2 1 AD A8 09 lda text_box::left
2017-09-01 15:48:46 +00:00
0011A5 1 6D 61 09 adc window_width
2017-08-29 03:58:09 +00:00
0011A8 1 48 pha
2017-09-01 15:32:29 +00:00
0011A9 1 AD A9 09 lda text_box::left+1
2017-09-01 15:48:46 +00:00
0011AC 1 6D 62 09 adc window_width+1
2017-08-29 03:58:09 +00:00
0011AF 1 AA tax
0011B0 1 38 sec
0011B1 1 68 pla
2017-09-01 15:48:46 +00:00
0011B2 1 E9 32 sbc #<label_width
2017-09-01 15:15:05 +00:00
0011B4 1 8D 84 11 sta mode_box::left
2017-08-29 03:58:09 +00:00
0011B7 1 8A txa
2017-09-01 15:48:46 +00:00
0011B8 1 E9 00 sbc #>label_width
2017-09-01 15:15:05 +00:00
0011BA 1 8D 85 11 sta mode_box::left+1
2017-09-01 02:05:41 +00:00
0011BD 1 ;; fall through...
0011BD 1 .endproc
2017-09-01 02:05:41 +00:00
0011BD 1
0011BD 1 .proc draw_mode
2017-09-02 04:02:00 +00:00
0011BD 1 20 00 40 06 A2D_CALL A2D_TEXT_BOX2, mode_box ; guess: setting up draw location ???
2017-08-29 03:58:09 +00:00
0011C1 1 84 11
2017-09-01 15:15:05 +00:00
0011C3 1 20 00 40 0E A2D_CALL A2D_SET_TEXT_POS, mode_pos
2017-08-29 03:58:09 +00:00
0011C7 1 94 11
0011C9 1 AD 6F 09 lda fixed_mode_flag
0011CC 1 F0 09 beq else ; is proportional?
2017-08-31 03:30:46 +00:00
0011CE 1 20 00 40 19 A2D_CALL A2D_DRAW_TEXT, fixed_str
2017-08-29 03:58:09 +00:00
0011D2 1 65 11
0011D4 1 4C DD 11 jmp endif
2017-08-31 03:30:46 +00:00
0011D7 1 20 00 40 19 else: A2D_CALL A2D_DRAW_TEXT, prop_str
2017-08-29 03:58:09 +00:00
0011DB 1 75 11
2017-09-01 15:15:05 +00:00
0011DD 1
2017-08-31 15:10:51 +00:00
0011DD 1 A2 0F endif: ldx #$0F
2017-09-01 15:32:29 +00:00
0011DF 1 BD CE 09 loop: lda default_box,x
0011E2 1 9D A8 09 sta text_box,x
2017-08-29 03:58:09 +00:00
0011E5 1 CA dex
0011E6 1 10 F7 bpl loop
2017-09-02 04:02:00 +00:00
0011E8 1 20 00 40 06 A2D_CALL A2D_TEXT_BOX2, text_box
2017-08-29 03:58:09 +00:00
0011EC 1 A8 09
0011EE 1 60 rts
0011EF 1 .endproc
0011EF 1