Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Matrefeytontias on September 04, 2012, 11:15:27 am
-
Hi guys !
I finally aborted AxiomGui to work on another project : add DCS GUI funcs to Axe. I know that several people tried to do this, but it never ended, so I try myself too.
For now, I only have one command, and it's not working properly -_-' So I also need help for this one (it's mostly due to Axe replacements, I think).
Here is the actual code (I'm using Mimas) :dw $C0DE
; Alert(
; Displays a modal msg box with custom text
dw AlertEnd+2 ; I use REP_NEXT twice
db %00001000 ; only for DoorsCS
db $BB,$1B ; normalpdf(
db 0 ; inline
db 1 ; 1 arg
rorg 0
push hl
inc hl
inc hl
inc hl
call sub_Length
ex de,hl
push de
call OpenGUIStack
REP_NEXT ; db $7F \ rorg $-1
ld hl,SmallWin
ld de,WinButtons-SmallWin
ld a,GUIRSmallWin
call PushGUIStack
REP_NEXT
ld hl,WinButtons
ld de,AlertEnd-WinButtons
ld a,GUIRWinButtons
call PushGUIStack
pop de
pop hl
inc de
inc de
inc de
ld a,GUIRText
call PushGUIStack
ld hl,0
call GUIMouse
ret
exitAx1:
call ResetAppPage
ret
SmallWin:
db 7,7
db $E0,$B0,$90,$90,$F0
db " ",0
WinButtons:
db %00100000
dw 0
dw 0
dw exitAx1
AlertEnd:
dw 0 ; AXM_END
; token hook
dw $03E0 ; hnormalpdf
db 6
db "Alert("
The only arg of this func is a data containing a GUIRText datas ::.AXEDCS
:#Axiom(AXIOMDCS)
:Data(0,0,0)"Bonjour"→GDB1
:Alert(GDB1
Here is a screen of it running :
(http://mattias.refeyton.fr/espace-ti/AxeDCS/axedcs1.gif)
Once the mouse freezed, I resetted manually Wabbitemu ; on my real calc it freezes, and that's all.
If someone can help me ..?
-
Actually, this might even be a better idea than doing GUI APIs from scratch, you're simply making wrappers to DCS' GUI functions. I look forward for a more complete axiom :D
-
For now, the first command isn't done :/ I need help for the moment, I can't go forward
-
KermMartian on Cemetech might help you. He did DoorsCS. Him or one of our ASM experts such as Runer112 or thepenguin77.
-
The issue is here:
WinButtons:
db %00100000
dw 0
dw 0
dw exitAx1
Firstly, it never works well to put data in a section designated for a command, because Axe may see certain bytes and think that they are REP_NEXT or OFS_NEXT macro identifiers. But the larger problem here is that Axe doesn't know to replace exitAx1, and I can't think of a way to make it replace it. :-\
However, we can always copy it in at run-time! ;D
dw $C0DE
; Alert(
; Displays a modal msg box with custom text
dw AlertEnd+6 ; I use REP_NEXT twice and OFS_NEXT twice **CHANGED**
db %00001000 ; only for DoorsCS
db $BB,$1B ; normalpdf(
db 1 ; subroutine **CHANGED**
db 1 ; 1 arg
rorg 0
push hl
inc hl
inc hl
inc hl
call sub_Length
ex de,hl
push de
call OpenGUIStack
REP_NEXT ; db $7F rorg $-1
ld hl,sub_Axiom2 ; **CHANGED**
ld de,WinButtons-SmallWin
ld a,GUIRSmallWin
call PushGUIStack
; **CHANGED**
REP_NEXT ; db $7F rorg $-1
ld hl,exitAx1
REP_NEXT(5+WinButtons-SmallWin) ; db $40 db 5+WinButtons-SmallWin rorg $-2
ld (sub_Axiom2),hl
REP_NEXT(WinButtons-SmallWin) ; db $40 db WinButtons-SmallWin rorg $-2
ld hl,sub_Axiom2
ld de,AlertEnd-WinButtons
ld a,GUIRWinButtons
call PushGUIStack
pop de
pop hl
inc de
inc de
inc de
ld a,GUIRText
call PushGUIStack
ld hl,0
call GUIMouse
ret
exitAx1:
call ResetAppPage
ret
AlertEnd:
;** CHANGED **
dw DataEnd
db %00001000
dw 0
db %00010000
db 0
rorg 0
SmallWin:
db 7,7
db $E0,$B0,$90,$90,$F0
db " ",0
WinButtons:
db %00100000
dw 0
dw 0
dw 0 ; **CHANGED**, although it doesn't really matter
DataEnd:
dw 0 ; AXM_END
; token hook
dw $03E0 ; hnormalpdf
db 6
db "Alert("
-
Ho waw, it's working \o/ but you'll have to explain it slowly :/
-
Update !
Now I have a bunch of widgets (and funcs) that you can use for your GUI using DCS ! Just check it out :
(http://mattias.refeyton.fr/espace-ti/AxeDCS/axedcs6.gif)
-
Awesome! Text input and custom buttons! Can't wait to try it out
-
I'll release the current progress when I'll write a doc on dcs.cemetech.net (KermMartian proposed it) :thumbsup: