A2osX/SBIN/GUI.S.txt

231 lines
4.8 KiB
Plaintext
Raw Normal View History

NEW
2020-10-02 14:57:05 +00:00
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
2020-06-30 15:32:23 +00:00
.TF sbin/gui
*--------------------------------------
2020-06-30 15:32:23 +00:00
.INB inc/io.i
.INB inc/macros.i
.INB inc/a2osx.i
2020-09-03 15:19:25 +00:00
.INB inc/gfx.i
2020-06-30 15:32:23 +00:00
.INB inc/libgui.i
*--------------------------------------
2019-01-08 16:29:26 +00:00
* Zero Page Segment, up to 32 bytes
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
2020-10-27 16:33:10 +00:00
hWND .BS 1
2019-01-08 16:29:26 +00:00
ZS.END
.ED
*--------------------------------------
2015-06-03 18:30:57 +00:00
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
2015-06-03 18:30:57 +00:00
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
2019-01-08 16:29:26 +00:00
.DA #S.PS.F.EVENT
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data SegmentSize
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
2015-06-03 18:30:57 +00:00
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.LIBGUI .DA LIBGUI
L.MouseData .DA MouseData
2020-09-13 19:05:38 +00:00
L.WND.TITLE .DA WND.TITLE
2020-09-29 15:37:26 +00:00
L.WND.MBAR .DA WND.MBAR
2020-09-13 19:05:38 +00:00
L.WND.STATUS .DA WND.STATUS
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBGUI
2018-07-19 15:33:55 +00:00
>SYSCALL LoadLib
2019-01-09 16:42:20 +00:00
bcs .9
2020-10-26 06:38:50 +00:00
2017-11-15 16:29:23 +00:00
sta hLIBGUI
2016-06-15 06:21:42 +00:00
2020-10-26 06:38:50 +00:00
* clc
2020-10-12 06:04:19 +00:00
.9
CS.INIT.RTS rts
*--------------------------------------
2020-10-27 16:33:10 +00:00
CS.RUN >SLEEP
2020-09-04 15:21:15 +00:00
>PUSHW L.MouseData
>LIBCALL hLIBGUI,LIBGUI.ReadMouse
2020-10-27 16:33:10 +00:00
bcs CS.RUN
2020-09-02 15:47:23 +00:00
lda MouseData+S.MOUSE.S
bit #S.MOUSE.S.MOVE
beq .1
>PUSHW L.MouseData
>LIBCALL hLIBGUI,LIBGUI.SetCursorPos
2020-09-04 15:21:15 +00:00
lda MouseData+S.MOUSE.S
2020-09-02 15:47:23 +00:00
2020-10-27 16:33:10 +00:00
.1 bit #S.MOUSE.S.DCLK
beq CS.RUN
2020-10-26 06:38:50 +00:00
jsr WND.Test
2020-10-27 16:33:10 +00:00
bra CS.RUN
2020-09-04 15:21:15 +00:00
clc
2020-10-26 06:38:50 +00:00
rts
*--------------------------------------
2017-12-04 07:18:24 +00:00
CS.DOEVENT lda (pEvent)
bpl .9
2020-09-03 15:27:28 +00:00
2017-12-04 07:18:24 +00:00
>LIBCALL hLIBGUI,LIBGUI.UpdateCursor
2020-09-03 15:27:28 +00:00
2017-12-04 07:18:24 +00:00
.9 sec
rts
*--------------------------------------
CS.QUIT clc
2020-09-13 19:05:38 +00:00
CS.QUIT.RTS rts
*--------------------------------------
2020-09-08 15:31:41 +00:00
WND.Test >PUSHBI S.WND.F.RESIZE+S.WND.F.MOVE+S.WND.F.CLOSE+S.WND.F.MAX+S.WND.F.MIN
2020-10-26 06:38:50 +00:00
2020-09-08 15:31:41 +00:00
>PUSHW MouseData+S.MOUSE.X1
>PUSHW MouseData+S.MOUSE.Y1
2020-11-19 15:34:02 +00:00
>PUSHWI 360 witdh
>PUSHWI 96 height
2020-10-01 15:30:25 +00:00
>LIBCALL hLIBGUI,LIBGUI.WND.New
2020-09-13 19:05:38 +00:00
bcs CS.QUIT.RTS
2020-09-08 15:31:41 +00:00
sta hWND
2020-10-26 06:38:50 +00:00
2020-09-17 05:43:06 +00:00
>PUSHA A = hWND
2020-10-26 06:38:50 +00:00
>PUSHBI S.WND.BGCOLOR
>PUSHWI C.WHITE
>LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
>PUSHB hWND
2020-09-10 15:28:59 +00:00
>PUSHBI S.WND.TITLE
2020-09-13 19:05:38 +00:00
>PUSHW L.WND.TITLE
2020-10-26 06:38:50 +00:00
>LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
2020-09-30 15:32:54 +00:00
>PUSHB hWND
2020-09-29 15:37:26 +00:00
>PUSHBI S.WND.MBAR
>PUSHW L.WND.MBAR
2020-10-26 06:38:50 +00:00
>LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
2020-09-13 19:05:38 +00:00
2020-09-30 15:32:54 +00:00
>PUSHB hWND
2020-09-13 19:05:38 +00:00
>PUSHBI S.WND.STATUS
>PUSHW L.WND.STATUS
2020-10-26 06:38:50 +00:00
>LIBCALL hLIBGUI,LIBGUI.OBJ.SetProp
2017-12-04 16:42:08 +00:00
2020-09-08 15:31:41 +00:00
lda hWND
2020-09-17 05:43:06 +00:00
>LIBCALL hLIBGUI,LIBGUI.WND.Show
2020-10-02 14:57:05 +00:00
2020-10-06 06:27:35 +00:00
rts
2020-10-26 06:38:50 +00:00
*--------------------------------------
CS.END
2020-06-30 15:32:23 +00:00
LIBGUI .AZ "libgui"
2017-11-15 16:29:23 +00:00
hLIBGUI .BS 1
2017-12-14 16:25:03 +00:00
*--------------------------------------
2017-12-04 16:42:08 +00:00
MouseData .BS S.MOUSE
2020-09-03 15:19:25 +00:00
*--------------------------------------
2020-09-13 19:05:38 +00:00
WND.TITLE .AZ "Window Title"
2020-09-12 12:09:24 +00:00
*--------------------------------------
2020-09-29 15:37:26 +00:00
WND.MBAR .DA #.1-* next
.DA #0 status
.DA 0 X1
.DA 0 XT
.DA 0 X2
.DA 0 MENU
2020-10-26 06:38:50 +00:00
.AZ "File"
2020-10-09 06:02:45 +00:00
2020-09-29 15:37:26 +00:00
.1 .DA #.2-* next
.DA #0 status
.DA 0 X1
.DA 0 XT
.DA 0 X2
.DA 0 MENU
2020-09-12 12:09:24 +00:00
.AZ "Edit"
2020-10-09 06:02:45 +00:00
2020-09-29 15:37:26 +00:00
.2 .DA #.3-* next
.DA #0 status
.DA 0 X1
.DA 0 XT
.DA 0 X2
.DA 0 MENU
2020-09-12 12:09:24 +00:00
.AZ "Options"
2020-10-09 06:02:45 +00:00
2020-09-29 15:37:26 +00:00
.3 .DA #.4-* next
.DA #0 status
.DA 0 X1
.DA 0 XT
.DA 0 X2
.DA 0 MENU
2020-09-13 19:05:38 +00:00
.AZ "?"
2020-10-09 06:02:45 +00:00
2020-09-15 14:48:35 +00:00
.4 .DA #0
2020-09-13 19:05:38 +00:00
*--------------------------------------
WND.STATUS .AZ "Window status bar message"
2020-09-29 15:37:26 +00:00
*--------------------------------------
WND.MENU.FILE .DA #02 ID
.DA #S.MITEM.KEYMOD.CTRL
.DA #'N'
.AZ "New"
.DA #04 ID
.DA #S.MITEM.KEYMOD.CTRL
.DA #'O'
.AZ "Open..."
.DA #06 ID
.DA #S.MITEM.KEYMOD.CTRL
.DA #'S'
.AZ "Save"
.DA #08 ID
.DA #S.MITEM.KEYMOD.OA+S.MITEM.KEYMOD.CTRL
.DA #'S'
.AZ "Save As..."
.DA #10 ID
.DA #S.MITEM.KEYMOD.CTRL
.DA #'Q'
.AZ "Quit"
.DA #0
*--------------------------------------
WND.MENU.EDIT .DA #12 ID
.DA #S.MITEM.KEYMOD.OA
.DA #'X'
.AZ "Cut"
.DA #14 ID
.DA #S.MITEM.KEYMOD.OA
.DA #'C'
.AZ "Copy"
.DA #16 ID
.DA #S.MITEM.KEYMOD.OA
.DA #'V'
.AZ "Paste"
.DA #0
*--------------------------------------
WND.MENU.OPTIONS .DA #18 ID
.DA #0
.DA #0
.AZ "Check Me"
.DA #0
*--------------------------------------
WND.MENU.HELP .DA #20 ID
.DA #0
.DA #0
.AZ "About..."
.DA #0
2017-11-15 16:29:23 +00:00
*--------------------------------------
.DUMMY
.OR 0
DS.START
2020-10-26 16:32:51 +00:00
2020-09-04 15:21:15 +00:00
DS.END .ED
MAN
2020-06-30 15:32:23 +00:00
SAVE usr/src/sbin/gui.s
ASM