gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

ASM > How to..

#172111 - Javs - Sat Jan 16, 2010 12:17 am

Hi!
I want to make an ASM routine for Pok?mon Ruby Version..
The routine is a 3D camera.. like in Pok?mon Diamond and Pearl..
The point is try to put that effect in a GBA game, so, Who can help me?
I hope you can help me!
Thanks!

PD: I only need the routine, not all the Programming things..
I will insert it like a level script..

#172115 - Ruben - Sat Jan 16, 2010 1:23 am

Well, complete 3D can't be simulated to a good degree on GBA, but I assume you're speaking of mode 7. Have a look at TONC's mode 7 pages for the code+theory.

However, it's rather simple: Calculate scaling/rotation values and displacements for each scanline, and copy to the rot/scale registers every H-Blank [using DMA, or H-Blank IRQ].
This is usually done using perspective division so you have something like (taken pretty much directly from TONC)
Code:
                         cy
λ  = ------------------------------------------
     ( (z - top)*cos(theta) + dist*sin(theta) )
pA = λcos(yaw)
pC = λsin(yaw)
zB = (z - top)*sin(theta) - dist*cos(theta)
dX = cx + cos(yaw)*left - sin(yaw)*zB
dY = cz + sin(yaw)*left + cos(yaw)*zB

#172118 - Kyoufu Kawa - Sat Jan 16, 2010 10:34 am

Okay, for one this is a homebrew forum. What you're asking is a romhack.

For two, Pok?mon DPP's camera goes way beyond what you could do on the GBA without rewriting the whole thing and finding yourself incapable of continuing. The best you can get is Mode7, as Ruben assumed, which won't look at all good.

For three, the game uses three layers for the maps, plus one for the interface. I am not so sure you can do Mode7 on all three layers at the same time.

#172119 - Javs - Sat Jan 16, 2010 4:17 pm

Ok, I'd understand..
I posted here beacuse this is the best forum about the ASM and C++ coding..
I'm an ASM hacker, but I have difficult for analize the situation.. I'm not analyst..
So I wanted you give me some possibilities for this "Camera Effect".
I'll try the previous tips..
Thanks for all! Greeting!

-OMG! Kyofu Kawa is here? xD-

#172128 - Kyoufu Kawa - Sun Jan 17, 2010 2:55 pm

Yes, yes I am. I lurk, mostly.

And again, comparing the best you can get from Mode7 to the fully 3D graphics in Pok?mon 4th gen, you're boned no matter what, pardon my Klatchian.

#172129 - Miked0801 - Sun Jan 17, 2010 4:27 pm

Wow, here we go:
Javs wrote:
Hi!


So far so good...

Quote:

I want to make an ASM routine


still fine...

Quote:

for Pok?mon Ruby Version..


warning bells start ringing, but still listening

Quote:

The routine is a 3D camera.. like in Pok?mon Diamond and Pearl..


clueless script kiddie alarm level rising quickly...

Quote:

The point is try to put that effect in a GBA game, so, Who can help me?


Levels reaching critical, soon to bail from thread.

Quote:

I hope you can help me!
Thanks!
PD: I only need the routine, not all the Programming things..
I will insert it like a level script..


OMG, the alarms were correct. Clueless level to infinity. Abort, Retry,or Cancel? None will help...

I'm not one to flame, but in all seriousness, you are asking to do something that is completely impossible. Writing in asm is tedious. Writing a 3D camera in asm would be extremely tedious and error prone. Hacking some byte codes into pokemon to get said camera is far beyond silly impossible. Doing so in a way that magically works so you don't have to know anything at all, just script it is is, well... something beyond silly impossible. I wish you the best.

#172131 - Javs - Sun Jan 17, 2010 8:33 pm

Miked0801 wrote:
Wow, here we go:
Javs wrote:
Hi!


So far so good...

Quote:

I want to make an ASM routine


still fine...

Quote:

for Pok?mon Ruby Version..


warning bells start ringing, but still listening

Quote:

The routine is a 3D camera.. like in Pok?mon Diamond and Pearl..


clueless script kiddie alarm level rising quickly...

Quote:

The point is try to put that effect in a GBA game, so, Who can help me?


Levels reaching critical, soon to bail from thread.

Quote:

I hope you can help me!
Thanks!
PD: I only need the routine, not all the Programming things..
I will insert it like a level script..


OMG, the alarms were correct. Clueless level to infinity. Abort, Retry,or Cancel? None will help...

I'm not one to flame, but in all seriousness, you are asking to do something that is completely impossible. Writing in asm is tedious. Writing a 3D camera in asm would be extremely tedious and error prone. Hacking some byte codes into pokemon to get said camera is far beyond silly impossible. Doing so in a way that magically works so you don't have to know anything at all, just script it is is, well... something beyond silly impossible. I wish you the best.


I think your post is right, so, do you suggest me make it on C++?

-Woaaa! Kyoufu Kawa is here!-

#172132 - Ruben - Sun Jan 17, 2010 10:35 pm

That was not at all the point of Mike's post; what he meant was that what you're asking for [which I overlooked, mind you >_>'] is next to impossible. While Pokemon has been hacked over and over again, I daresay it would be impossible to make it in such a way that you would have mode 7 graphics. Sorry to burst your bubble, but that's how things are, unfortunately. =/

#172133 - Dwedit - Sun Jan 17, 2010 11:03 pm

Maybe not mode 7, but you could do shearing combined with vertical downscaling that scales down more at the top.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#172135 - Javs - Mon Jan 18, 2010 12:21 am

Hum, is the topic's mission..
I wanted you tell me "Is possible or not possible", so I think the issue has finished..
If was possible, tell me how. But, if isn't possible, like this instance, is ok..
What's the matter?
I thank to all the people who replied to my post..
I will still accepting suggestions until the post be closed..
See ya!

#172142 - sgeos - Mon Jan 18, 2010 3:34 pm

Javs wrote:
I wanted you tell me "Is possible or not possible"

Possible, yes. Worth the effort, no.

Just buy latest Pokemon game if you want cool fancy effects. Even if you need to hold a job to pay for it, finding a job and working it for a couple days or a week will be far less effort than what you are proposing to do. The division of labor is special like that.