Author Topic: AxeDCS  (Read 2996 times)

0 Members and 1 Guest are viewing this topic.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
AxeDCS
« 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) :
Code: [Select]
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 :
Code: [Select]
:.AXEDCS
:#Axiom(AXIOMDCS)
:Data(0,0,0)"Bonjour"→GDB1
:Alert(GDB1


Here is a screen of it running :



Once the mouse freezed, I resetted manually Wabbitemu ; on my real calc it freezes, and that's all.

If someone can help me ..?

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: AxeDCS
« Reply #1 on: September 04, 2012, 11:55:38 am »
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

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: AxeDCS
« Reply #2 on: September 04, 2012, 12:02:22 pm »
For now, the first command isn't done :/ I need help for the moment, I can't go forward

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: AxeDCS
« Reply #3 on: September 04, 2012, 12:46:56 pm »
KermMartian on Cemetech might help you. He did DoorsCS. Him or one of our ASM experts such as Runer112 or thepenguin77.
« Last Edit: September 04, 2012, 12:47:41 pm by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: AxeDCS
« Reply #4 on: September 04, 2012, 01:24:03 pm »
The issue is here:

Code: [Select]
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

Code: [Select]
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("
« Last Edit: September 04, 2012, 01:26:58 pm by Runer112 »

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: AxeDCS
« Reply #5 on: September 04, 2012, 01:51:29 pm »
Ho waw, it's working \o/ but you'll have to explain it slowly :/

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: AxeDCS
« Reply #6 on: September 09, 2012, 02:33:05 am »
Update !

Now I have a bunch of widgets (and funcs) that you can use for your GUI using DCS ! Just check it out :


Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: AxeDCS
« Reply #7 on: September 09, 2012, 04:10:25 am »
Awesome! Text input and custom buttons! Can't wait to try it out

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: AxeDCS
« Reply #8 on: September 09, 2012, 04:16:25 am »
I'll release the current progress when I'll write a doc on dcs.cemetech.net (KermMartian proposed it) :thumbsup: