Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Matrefeytontias

Pages: 1 ... 103 104 [105] 106 107 ... 133
1561
Other Calc-Related Projects and Ideas / Re: OmniRPG - Coding
« on: December 12, 2012, 08:07:52 am »
With my engine, each animation is 1 byte + 8 bytes per frame (I'll post screen+code in 2 hours).

Also Xeda, how big is your engine ?

1562
It's ok now, thanks =)

1563
Other Calc-Related Projects and Ideas / Re: OmniRPG - Coding
« on: December 12, 2012, 01:25:46 am »
I added animated tiles support to my previous tilemapper, and it works greatly ! Currently the engine is 554 bytes. I'll post a screenshot later (I'm in the bus carrying me to school D: ).

1564
Axe / [Tutorial] Using the PageSwap axiom
« on: December 11, 2012, 01:58:02 pm »
PageSwap is an Axiom made by myself which allows you to use Axe subroutines you defined in another program and compiled separately as an app directly in your classic Axe program.

What's the benefit for it ? Well, imagine that your Axe program is so large that it can't fit in the RAM, even if it's all free (this means that your program is greater than 24K). You can write 16K of code in an app as subroutines, make a 8k program and use PageSwap to access this last app and use the functions you defined in it. The result is 24K of executable code which take only 8k of RAM. You can even use CrabCake by Hot_Dog or FullRene by thepenguin77 to overpass the 8K limit, to have still moar executable code ! And more of that, you can also use PageSwap with several apps, which is 16K of executable code per app !

So, how to use this axiom ? It can be pretty complicated due to all the things you have to beware when you use that.

First, we need an API. It's an Axe program you'll compile into an app and which will contain all of your subroutines. Let's call it AppTest (app names can contain lowercase). Then we need a program to use these subroutines, let's call it APPTEST in uppercase (yeah, I'm lacking names). That's all what we need.

So, our app needs to have a specific format. Since it's a lib, it must contains functions. And in order to know where are located all of these functions, we do a jump table.

:.AppTest
:
:Goto Func1
:Goto Func2
:Goto Func3
:.and so on
:
:Lbl Func1
:. code here
:Return
:
:Lbl Func2
:.same
:Return
:
:Lbl Func3
:.same again
:Return
:
:.and so on


So when in your code you need to call one of these funcs, you'll just have to call the corresponding Goto (which has a fixed address the axiom knows).

But wait, we must not run this app ! So let's write a Start function that exits the app when the user launches it :

:.AppTest
:
:.Execution will start here
:Goto Start
:Goto Func1
:Goto Func2
:Goto Func3
:.and so on
:
:Lbl Start
:ClrHome
:Text(0,,"This app is an Axe lib
:Text(0,8,"It's not meant to be ran
:Text(0,16,"Press any key to quit
:getKeyr
:Return
:
:Lbl Func1
:. code here
:Return
:
:Lbl Func2
:.same
:Return
:
:Lbl Func3
:.same again
:Return
:
:.and so on


Okay, now we have a pattern for our API !

You can write your subroutines the same way you write ones in a classic Axe source. So you can use r1 to r6, static pointers (GDB, Pic ...) and so on.

When, let's fill these routines with something so we'll can use them.

:.AppTest
:
:Goto Start
:Goto Func1
:Goto Func2
:Goto Func3
:
:Lbl Start
:ClrHome
:Text(0,,"This app is an Axe lib
:Text(0,8,"It's not meant to be ran
:Text(0,16,"Press any key to quit
:getKeyr
:Return
:
:Lbl Func1
:Pt-On(r1,r2,r3
:Return
:
:Lbl Func2
:Text(r1,r2,r3
:Return
:
:Lbl Func3
:DispGraph
:Return


Now, let's write our prgmAPPTEST program. First, let's include PageSwap.

:.APPTEST
:
:#Axiom(PAGESWAP)


Now, you can start working with PageSwap.

Using PageSwap is a bit complicated since it works with really low level things : app pages. When you launch a regular program (I mean not an app), it's usually from the page 0, which is the RAM. Now, you want to access your lib which is an app, but apps aren't stored in page 0. So, you'll need to go to the page of your app, use the routines inside, and when you're done with it go back to the page 0 before exit your program.

You'll say "hey, but what if I launch my program from flash using a shell ?" In fact that remains the same : the program must exit in the same page as the one which he started. So at the start of APPTEST, just save your current page by using PageSwap's getCurPage (all the PageSwap commands are the Angle menu [2nd] [apps]).

:.APPTEST
:#Axiom(PAGESWAP)
:
:getCurPage?P
:
:.code here


Then, to change the current app page, use the well-named setCurPage() :P

But which page must we go in ? You know that we want to access AppTest to be able to use the subroutines in it. So search for your app by using getAppPage("APP"), and then set the current page to it.

:.APPTEST
:#Axiom(PAGESWAP)
:
:getCurPage?P
:setCurPage(getAppPage("AppTest"))
:
:.Don't forget to restore the initial page before quitting !
:setCurPage(P)


Now that you're in the page of your app, you can use its functions ! Well, in fact you don't know the addresses of your functions ... but PageSwap does ! Just retrieve the address of the Nth function of your app by using appFunc(N), then call it with Axe's (ADDR)(ARGS). Beware, the 0th function is the Start function !

:.APPTEST
:#Axiom(PAGESWAP)
:
:getCurPage?P
:setCurPage(getAppPage("AppTest"))
:
:.You have to remember which function does what
:(appFunc(1))(0,8,[3C4281818181423C])
:(appFunc(3))()
:(appFunc(2))(0,0,"Over 9000!")
:getKeyr
:
:setCurPage(P)


Now compile AppTest into an app, APPTEST into Noshell, try to run AppTest, run APPTEST, and see !

And that's all, now you know how to use PageSwap !

Now, go make a 40KB-large program ! :P

1565
I tried with the address [email protected] but I never received the confirmation email :(

1566
Other Calc-Related Projects and Ideas / Re: OmniRPG - Coding
« on: December 10, 2012, 12:49:05 pm »
I think of a way of using animated tiles that would fit amazingly on my engine but difficultly on yours :/

The thing is that with our tiles (let's say they are at Pic1TILE), we have a cumulated offset corresponding to the number times 8 you need to add to Pic1TILE to have the right frame of the right tile to be displayed. Let's do some pseudo-code :

Code: [Select]
[...->Pic1TILE
.Our animated tiles here

Data(0,2,5,8,10,11...)->GDB1OFST

.I skip the code to draw the entire map
DispTile(X,Y,{{Ytile + Xtile + GDB1MAP} + GDB1OFST} * 8 + Pic1TILE)

Let me know if you don't understand something :P

1567
The Axe Parser Project / Re: Which Axe version do you use?
« on: December 10, 2012, 11:24:26 am »
@Hayleia try use a DS>( loop and you'll see.

1568
The Axe Parser Project / Re: Which Axe version do you use?
« on: December 10, 2012, 11:15:10 am »
I currently use 1.2.0 because of all the optimization stuffs and 13 characters-long label names, but I think I'll go back to 1.1.2 because of the many bugs <_<

1569
Other Calc-Related Projects and Ideas / Re: OmniRPG - Coding
« on: December 10, 2012, 10:42:11 am »
Yeah, but do we want a fast or a light smoothscroller ? I don't think my engine will ever be as fast as yours, but maybe yours will be as light as mine :P

1570
Other Calc-Related Projects and Ideas / Re: OmniRPG - Coding
« on: December 10, 2012, 10:31:08 am »
My engine also updates the LCD each two pixels ... so I think that in fact mine is VEEEERY slow compared to yours :P

1571
Other Calc-Related Projects and Ideas / Re: OmniRPG - Coding
« on: December 10, 2012, 10:27:30 am »
Oh yeah I see. Well, I think I can do that in quite a few code, I'll post a screenshot.

Also Xeda, nice intro effect :D I think that I thought your 2nd screenie was at 15MHz because since you wait for a keypress (which is slow) every 4 frames instead of one, it's faster, right ?

1572
Other Calc-Related Projects and Ideas / Re: OmniRPG - Coding
« on: December 10, 2012, 10:21:00 am »
I only have to change the *2 in the two getkey lines to *n to scroll n pixel each frame. Also Xeda, your 2nd screenie is at 15MHz btw ?

1573
Other Calc-Related Projects and Ideas / Re: OmniRPG - Coding
« on: December 10, 2012, 09:33:25 am »
I forgot to say : it runs at 6Mhz :)

I calculated on IRC that the real engine's code, I mean without datas and without the map filling code, is only 465 bytes :o

1574
Other Calc-Related Projects and Ideas / Re: OmniRPG - Coding
« on: December 10, 2012, 08:37:20 am »
I coded a very simple (and a bit optimised) smooth-scrolling engine (after all, I'm at school, thanks to Wabbitemu :P ). It's only 963 bytes, so I thank that we should compare our techniques.



Here's the code :

Code: [Select]
:.AXESMTH
:[3C4281818181423C→Pic1TILE
:[3C7EFFFFFFFF7E3C
:[0000000000000000
:
:Buff(384)→GDB1MAP           // this does take a lot of the 963b of the prgm
:0→H→V→S-1
:For(384)
:+1→r1
:rand^3→{r1+GDB1MAP
:r1
:End
:
:While 1
:‾1
:For(10)
:+1→r2
:‾1
:For(14)
:Pt-On(+1→r1-1*8-(H and 7),r2-1*8-(V and 7),{VAsm(CB2DCB2DCB2D)+r2*8*3+r1+(HAsm(CB2DCB2DCB2D))+GDB1MAP}*8+Pic1TILE
:r1
:End
:r2
:End
:
:DispGraphClrDraw
:getKey(1)-getKey(4)*2+VAsm(E5)≥≥0?Asm(E1)→V,Asm(E1)                                  \  I move 2 pixels
:getKey(3)-getKey(2)*2+HAsm(E5)≥≥0?Asm(E1)→H,Asm(E1)                                  /    by 2 pixels
:EndIf getKey(15)

Fun fact : I used #ExprOff to optimise this program for size, and the size remained the same ;D

1575
[FR] Programmation Axe Parser / Re: [Axe parser] : projet worms
« on: December 10, 2012, 08:03:08 am »
Euuuh ouais mais nan :P moi j'ai WiredWorks, Super Crate Box (not dead yet o/) et OmniRPG ousque je fais toujours des trucs. C'est pas le moment de se lancer dans un gros projet en plus ;D

Pages: 1 ... 103 104 [105] 106 107 ... 133