Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 23:51:40 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: DCS Axiom development -  (Read 1448 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
alberthrocks
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Last Login: 11 May, 2013, 04:49:27
Date Registered: 01 May, 2010, 16:51:27
Posts: 743

Topic starter
Total Post Ratings: +88

View Profile
« on: 04 April, 2011, 21:23:08 »
+2

Sparking from this topic (http://www.omnimaga.org/index.php?topic=7480.msg139537;topicseen#new), I've decided to try and see if I can write a DCS axiom! Smiley However, my assembly is terrible, so I will need LOTS of help with it. From the messages in the thread, it seems that our assembly devs are puzzled at how to write an Axiom, but could easy make an ASM program. Hopefully, from this topic, a quick start/manual can be written on how to write Axioms. THEN our awesome assembly programmers' powers can be unleashed! Wink

OK, so let's get started! Cheesy

First off, I'm basing my Axiom from the MemKit template. My assembler is SPASM (part of the WabbitStudio suite), OS Linux.
I also am using http://dcs.cemetech.net/index.php?title=GUI_API for reference on how to use the DCS' GUI libraries in assembly.
With that, I'm currently just trying to write example code for myself (and probably others).
I'm focusing on: http://dcs.cemetech.net/index.php?title=GUI_API#Adding_GUI_Elements

Here's a code snip from the API docs:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
ld hl,SmWinData
ld de,SmWinDataEnd-SmWinData
ld a,GUIRSmallWin
call PushGUIStack
ld hl,winButtons
ld de,dat_end-winButtons
ld a,GUIRWinButtons
call pushGUIStack
ld hl,0
call GUIMouse
ret
SmWinData:
     .db 5,5     ;the x and y coordinates relative to the LCD of the top-left of the window
     .db $F8,$88,$88,$88,$F8   ;a square icon
     .db "My Window",0    ;the window title
SmWinDataEnd:
exitMyProg:
  call ResetAppPage
  ret
winButtons:
 .db 00100000b      ;only displaying a close button
 .dw 0              ;null pointer
 .dw 0              ;another null pointer
 .dw exitMyProg     ;we'll jump to exitMyProg when this button is clicked
dat_end:

Of course, we really don't want internal data, but the data for the arguments the user provides! Smiley

In the end, after a back and forth on IRC, I've gotten this code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.nolist
#include "ti83plus.inc"
#include "Axe.inc"
#include "dcs7.inc"
.list

#define B_CALL(xxxx) rst 28h \ .dw xxxx

 .dw AXM_HEADER

 .dw Ax1_End
 .db AXM_ALL
 .dw tok_DrawL ;DlgBox()
 .db AXM_INLINE
 .db AXM_1ARG
 .org 0
 ; OLD CODE:
 ; call OpenGUIStack
 ; ld hl,SmWinData
 ; ld de,SmWinDataEnd-SmWinData
 ; ld a,GUIRSmallWin
 
 ; OK, so let's first get stuff ready! (Open the GUI stack!)
 call OpenGUIStack
 ; Text is stored in HL already, no need to move it around!
 ; Save hl!
 push hl
 ; Now find the length of the string arg!
 call sub_Length
 ; Copy it to the correct place...
 ex de,hl
 ; ...and bring back the string arg!
 pop hl
 ; Set window type!
 ld a,GUIRSmallWin
 
 ; Push the GUI!
 call PushGUIStack
 
 ; Now, add the close button to the window.
 ld hl,winButtons
 ld de,dat_end-winButtons
 ld a,GUIRWinButtons
 call pushGUIStack

 ; Now, render the GUI and give control (mouse) to DCS!
 ld hl,0
 call GUIMouse

 ret

exitMyProg:
  call ResetAppPage
  ret
winButtons:
 .db 00100000b      ;only displaying a close button
 .dw 0              ;null pointer
 .dw 0              ;another null pointer
 .dw exitMyProg     ;we'll jump to exitMyProg when this button is clicked
dat_end:
Ax1_End:

 .dw AXM_END

.end

Unfortunately, this crashes! Sad Is there any errors that should be fixed?
« Last Edit: 04 April, 2011, 21:24:28 by alberthrocks » Logged

Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! Sad Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. Smiley

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler for "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it Tongue)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it Tongue)
wxWabbitemu: 40% done (NEED MOAR FEATURES Tongue)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming Tongue)
kindermoumoute
LV8 Addict (Next: 1000)
********
Offline Offline

Last Login: 17 May, 2013, 21:33:10
Date Registered: 15 May, 2010, 17:53:56
Posts: 836


Total Post Ratings: +51

View Profile
« Reply #1 on: 04 April, 2011, 21:50:46 »
0

Thank to launch this project, I hope you will succeed !
Logged

Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%
alberthrocks
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Last Login: 11 May, 2013, 04:49:27
Date Registered: 01 May, 2010, 16:51:27
Posts: 743

Topic starter
Total Post Ratings: +88

View Profile
« Reply #2 on: 05 April, 2011, 01:09:27 »
0

Thank to launch this project, I hope you will succeed !
Thanks kindermoumoute! Smiley Don't expect it to be fast though - it's going to be a tough thing to make (at least for me).

So, does anyone has any ideas why this is failing?
Also, if you think you're faster at making this all work, the code is licensed under GPL v3, so feel free to take it and work on it! Smiley
Logged

Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! Sad Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. Smiley

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler for "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it Tongue)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it Tongue)
wxWabbitemu: 40% done (NEED MOAR FEATURES Tongue)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming Tongue)
alberthrocks
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Last Login: 11 May, 2013, 04:49:27
Date Registered: 01 May, 2010, 16:51:27
Posts: 743

Topic starter
Total Post Ratings: +88

View Profile
« Reply #3 on: 08 April, 2011, 21:42:48 »
0

Bumpity bumpity bump. Any fix for the crashing code above?

Also, this project is 100% open source (and free, obviously)! Smiley That means that this project is open for any collaboration, and I'd love to get some help for this Axiom. If you want to help out, hop right in! Cheesy
Logged

Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! Sad Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. Smiley

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler for "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it Tongue)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it Tongue)
wxWabbitemu: 40% done (NEED MOAR FEATURES Tongue)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming Tongue)
Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 07 May, 2013, 22:49:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Total Post Ratings: +174

View Profile
« Reply #4 on: 08 April, 2011, 21:57:08 »
0


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
call OpenGUIStack

 push hl

 call sub_Length

 ex de,hl

 pop hl

 ld a,GUIRSmallWin
 
 call PushGUIStack
 
 ld hl,winButtons
 ld de,dat_end-winButtons
 ld a,GUIRWinButtons
 call pushGUIStack

 ld hl,0
 call GUIMouse

 ret

This seems like fully working to me. So, I have no idea of what the problem might me. Maybe ask for help at Cemetech too, they have some Assembly experts over there Cheesy
Logged
Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 07 May, 2013, 22:49:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Total Post Ratings: +174

View Profile
« Reply #5 on: 12 April, 2011, 17:28:02 »
0

I may have an idea (Kerm Martian's actually).


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; OK, so let's first get stuff ready! (Open the GUI stack!)
 call OpenGUIStack
 ; Text is stored in HL already, no need to move it around!
 ; Save hl!
 push hl
 ; Now find the length of the string arg!
 call sub_Length
 ; Copy it to the correct place...
 ex de,hl
 ; ...and bring back the string arg!
 pop hl
 ; Set window type!
 ld a,GUIRSmallWin
 
 ; Push the GUI!

When you call OpenGUIStack, it probably deletes what's in hl, so then you can't really push it.
Logged
alberthrocks
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Last Login: 11 May, 2013, 04:49:27
Date Registered: 01 May, 2010, 16:51:27
Posts: 743

Topic starter
Total Post Ratings: +88

View Profile
« Reply #6 on: 14 April, 2011, 02:57:19 »
0

OK, I've (hopefully) fixed it! Smiley Unfortunately, I'm *really* busy atm, so I didn't have time to test.
From what you've said above, I've followed this logic:

1
2
3
4
5
; Save hl!
 push hl
 ; Now find the length of the string arg!
 call sub_Length
The argument is saved, and we call sub_Length to figure out the length of that string argument.
It gets pushed back to HL, so I pushed HL to a stack to save the argument.

1
2
; Copy it to the correct place...
 ex de,hl
I exchanged the new HL with DE, where it's supposed to go. Now the length is saved!


1
call OpenGUIStack
Since we don't need HL anymore, we're can call it and let it destroy things!


1
2
; ...and bring back the string arg!
 pop hl
And of course, HL is save and sound.... right?

Hopefully that logic will work! Smiley
I've attached the compiled 8Xp - simply add #Axiom(DCSAXIOM) to your code, and then
use DrawL("hello world!") to test! Smiley

Beware that this may crash your calc, so please, please, PLEASE back up your stuff before proceeding.
Thanks to KermMartian for the tip! Smiley

EDIT: Silly me, forgot to actually attach something! Tongue
Also, you can view the entire code here:
http://code.google.com/p/axe-gui-libraries/source/browse/src/dcs7axiom/DCSAxiom.z80

EDIT 2: Apparently DE is also destroyed too (according to http://dcs.cemetech.net/index.php?title=OpenGUIStack), so I've added a push/pop de into the code and recompiled - hopefully this is the panacea to the crash? (Reattached program with changes)

* DCSAxiom.8xp (0.13 KB - downloaded 73 times.)
« Last Edit: 14 April, 2011, 03:17:29 by alberthrocks » Logged

Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! Sad Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. Smiley

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler for "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it Tongue)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it Tongue)
wxWabbitemu: 40% done (NEED MOAR FEATURES Tongue)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming Tongue)
Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 07 May, 2013, 22:49:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Total Post Ratings: +174

View Profile
« Reply #7 on: 14 April, 2011, 12:10:22 »
0

Very nice alberthrocks! I gotta check that and try and add CloseGUIStack.
Logged
kindermoumoute
LV8 Addict (Next: 1000)
********
Offline Offline

Last Login: 17 May, 2013, 21:33:10
Date Registered: 15 May, 2010, 17:53:56
Posts: 836


Total Post Ratings: +51

View Profile
« Reply #8 on: 16 May, 2011, 18:54:15 »
0

Up ?
Logged

Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 19:36:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50202


Total Post Ratings: +2611

View Profile WWW
« Reply #9 on: 16 May, 2011, 23:33:01 »
0

IN summary, this is an Axiom to use Doors CS GUI libraries and such things, right?
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
alberthrocks
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Last Login: 11 May, 2013, 04:49:27
Date Registered: 01 May, 2010, 16:51:27
Posts: 743

Topic starter
Total Post Ratings: +88

View Profile
« Reply #10 on: 17 May, 2011, 01:25:34 »
0

Yup! Smiley
It's still a heavy WIP, but it will be ready soon! Cheesy
Thank you guys for reminding me! It'll be a while before this takes off due to much projects and HW from school, and tests next week. I'm literally swamped to death... X_X
Logged

Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! Sad Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. Smiley

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler for "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it Tongue)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it Tongue)
wxWabbitemu: 40% done (NEED MOAR FEATURES Tongue)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming Tongue)
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 19:36:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50202


Total Post Ratings: +2611

View Profile WWW
« Reply #11 on: 17 May, 2011, 02:47:35 »
0

When do you finish school?
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.284 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.