Page 2 of 2

Re: [Staff][Dev] GL 2D Game Engine

Posted: Sun 26 Jul, 2009 8:09 am
by qarnos
graphmastur wrote:I think that this project is amazing!!! Do you have a current release?
Thanks :)

There is no current release - I am still in the process of moving it over into an APP. Some things - like the texture mapping - use a lot of self-modifying code and will be painfully slow without it, so I'm still considering the possible solutions on that.

There is probably enough usable code in it to make an experimental release, perhaps next weekend, but I already wasted all this weekend playing with gravity so I will have to get cracking.

Re: [Staff][Dev] GL 2D Game Engine

Posted: Wed 29 Jul, 2009 4:28 pm
by graphmastur
That is good. So I could program it just like a standard asm program?

Re: [Staff][Dev] GL 2D Game Engine

Posted: Fri 31 Jul, 2009 9:24 am
by qarnos
graphmastur wrote:That is good. So I could program it just like a standard asm program?
Yep. You use it in the same way you would use the built in routines in a shell such as MirageOS - it just provides a bunch of routines which your program can call. The are some #defines as well, such as .glLoadIdentity, but these just expand into routine calls. They're just there for convenience, and they make the code easier to read.

The only catch is that you need some special code at the start of your program to make the routines available (although this is just a cut-and-paste job) and once the library is loaded, you need to jump through a few hoops if you want to call a shell routine. This is because the library gets paged into the same address range ($4000 - $7FFF) that the shell was loaded into. So if you want to call a shell routine, you need to flip to the shell page, call the routine, and then flip back to the library page again.

This might be an issue initially, since the library doesn't provide any sprite routines (yet), apart from the really slow texture mapped ones. I'd like to add regular sprites but they are pretty low down on my priority list, since I don't need them for the game I am working on (which is, after all, the motivation for this project!).

Are there any features in particular which piqued your interest? I'd like to do some kind of experimental release this weekend but a lot of stuff is going to have to be left out. If there is something in particular you liked, I will make sure I include it if at all possible.

Re: [Staff][Dev] GL 2D Game Engine

Posted: Fri 31 Jul, 2009 2:24 pm
by graphmastur
What piqued my interest was the idea of doing the 2d lines like this. It seems very fast, and could be used for many different things. The whole shell mapping thing is not that big of a deal. I mean, how hard is it to have two routines:

Code: Select all

SwapAppPages:
    in (06),a
    cp 69 ; Your application page, whatever it is
    jr z,loadback
    ld HL, AppBackupScreen
    ld (HL), a
    ld a, 69 ; Your application page, whatever it is
    out (06),a
    ret
loadback:
    ld HL, AppBackupScreen
    ld a,(HL)
    out (06),a
    ret
That should work, and it uses the first byte of AppBackupScreen.

Oh, and I don't really know about features to add, until I actually see what it can do. Basic lines would be good, I guess.

Re: [Staff][Dev] GL 2D Game Engine

Posted: Sat 01 Aug, 2009 7:14 am
by King Harold
That assumes your page is known at compile time or you use SMC, and if you go down that road you could just as well do:

Code: Select all

SwapAppPages:
    in (6),a
  label_hack = $ + 1
    xor 69^69 (Your applicationg page ^ the other page)
    out (6),a
    ret
Just write the correct value into label_hack when your app starts..

Re: [Staff][Dev] GL 2D Game Engine

Posted: Sun 02 Aug, 2009 3:32 am
by qarnos
Actually, what I'd like is a custom B_CALL type system. Something like:

Code: Select all

    call shellcall
    .dw ifastcopy   ; shell routine address
The tricky part is you need to preserve all registers (including F) because you don't know the inputs/outputs of the shell routine. I wrote a couple of versions of a routine to do it, but it's always pretty slow - usually around 200cc iirc.

Anyway, I've put together a usable version, though it's still lacking a lot of stuff. Polygons are drawn a little off. Lines can only be draw black. Lots of other shortcomings, but usable.

The zip file contains the binaries and includes, a small demo and some incomplete reference documentation. Between the documentation and the demo comments, you might be able to piece enough of it together to at least play around with it.
Image

Re: [Staff][Dev] GL 2D Game Engine

Posted: Sun 02 Aug, 2009 7:14 am
by qarnos
Just a little extra...

I used the lib to create a very crude orbit game. Try it out if you like

The left and right arrows control rotation (one press = one pulse of the thrusters) and holding down 2nd fires your main engine. Plus/minus zoom in and out and mode quits.

There is no collision detection :P
Image

Re: [Staff][Dev] GL 2D Game Engine

Posted: Mon 03 Aug, 2009 10:27 am
by NanoWar
"Shit guys, we got the missiles are coming, fire our shit" "but i am le tired." "well have a nap, THEN FIRE ZE MISSLES!"

Re: [Staff][Dev] GL 2D Game Engine

Posted: Mon 03 Aug, 2009 6:27 pm
by darkstone knight
that makes me think about wind waker :D

that boat game dude is hilarious 8)

Re: [Staff][Dev] GL 2D Game Engine

Posted: Wed 26 Aug, 2009 1:37 am
by Eeems
hmm, I tried the orbit thing, but it just quits on me before doing anything...

Re: [Staff][Dev] GL 2D Game Engine

Posted: Wed 26 Aug, 2009 6:01 am
by qarnos
Eeems wrote:hmm, I tried the orbit thing, but it just quits on me before doing anything...
Did you send zlibgl83.8xk to your calc as well as orbit.8xp? If you didn't it will quit immediately with no error message. That's the only reason I can think for that happening.

Re: [Staff][Dev] GL 2D Game Engine

Posted: Fri 28 Aug, 2009 3:10 pm
by tr1p1ea
I gave it a try and it works really nicely.

Also i had a quick squiz at some of your routines and i am particularly impressed with the math ones :).

Re: [Staff][Dev] GL 2D Game Engine

Posted: Fri 28 Aug, 2009 4:35 pm
by Eeems
qarnos wrote:
Eeems wrote:hmm, I tried the orbit thing, but it just quits on me before doing anything...
Did you send zlibgl83.8xk to your calc as well as orbit.8xp? If you didn't it will quit immediately with no error message. That's the only reason I can think for that happening.
actually no I didn't...I can't seem to find it, could you give me a link to it please? I thought I was missing something, but yeah....

Re: [Staff][Dev] GL 2D Game Engine

Posted: Wed 02 Sep, 2009 9:14 pm
by qarnos
tr1p1ea wrote:I gave it a try and it works really nicely.

Also i had a quick squiz at some of your routines and i am particularly impressed with the math ones :).
Thanks :)

I have a fetish for maths routines :P
qarnos wrote:
Eeems wrote:hmm, I tried the orbit thing, but it just quits on me before doing anything...
It's available in this zip file (in the "bin" directory).

Re: [Staff][Dev] GL 2D Game Engine

Posted: Wed 02 Sep, 2009 9:44 pm
by Eeems
ah thanks :)
hmm interesting...I like it