News:

As a consequence of the forum being updated and repaired, the chatbox has been lost.
However, you can still come say hi on our Discord server!

Main Menu

Post your GBA ASM Questions here.

Started by Daddy Poi's Oily Gorillas, 03, November, 2010, 06:10:08 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Lord Wolfram

The Main idea is to see how the old games were made and learn how to make a game with this feel that old games gave you. Long story short I want to make a game that's going to be something like spiritual successor of old castlevania games. We know about Bloodstained.... well it's that. But I want to make a 2D one and want to see if  I can learn the structure of the old games for this purpose.

Luna_blade

Quote from: Lord Wolfram on 11, November, 2016, 04:21:44 PM
The Main idea is to see how the old games were made and learn how to make a game with this feel that old games gave you. Long story short I want to make a game that's going to be something like spiritual successor of old castlevania games. We know about Bloodstained.... well it's that. But I want to make a 2D one and want to see if  I can learn the structure of the old games for this purpose.
And you want to do it on the GBA?
That is a pretty nice idea.
I'm not sure how many is known about the Aria of Sorrow engine, but that is probably the best base.

How do you mean the structure? As in, how it looks inside the ROM or just when you map out gameplay, story, music all that?
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Lord Wolfram

I am interested to see the way how maps were made, and how it's shown in code. (soul system seems to be overused lately, so I think about HOD from GBA about in terms of some details.
PSX games were written in C so maybe the same was done for GBA?

Luna_blade

#83
Quote from: Lord Wolfram on 13, November, 2016, 03:51:40 AM
I am interested to see the way how maps were made, and how it's shown in code. (soul system seems to be overused lately, so I think about HOD from GBA about in terms of some details.
PSX games were written in C so maybe the same was done for GBA?
Aha! Yes that can be quite interesting. The NES had a whole system for this, but in the GBA it is mostly up to the programmer.
Yeah it is very likely they did write it using C in that case.

EDIT: anyway another question popped up.

I wrote a little ROM which should go into Thumb mode almost directly after booting.
But I'm not really sure if I'm am doing it right. As you can see, I load the address where the BX should branch to in R0. Then I BX out of R0. Is this the right way/good way to do it?
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#84
QuoteI sure hope you don't mean assembly in armips or Devkitarm?
That's exactly what I mean... (Convert it to something armips can compile.) But mainly because I figure it'd be an easy experiment compared to the alternative. (And I do think it'd be better than hex editing code.) I mean, I would love to have the ability to repoint entire sections of code (Like the code files themselves)... with little to no effort on the user... and things like that. - Those who like organization, can keep it.

I still have to think how the visual editors would be done at that point... There are ways, but I'm referring to maximizing user-friendliness... (Who knows.)

Edit again: I mean, I think formulas can still be used  directly in data... if armips is compiling it... unlike what you usually have to do by putting the value in directly yourself?


@Maps: All graphics you see on screen, is based on what has been put in VRAM data. (And if certain BG Types  (Indexed Pixel Format types), then the Palette section may be used as well.)


---
@EDIT: Yes, you loaded the pointer correctly, but the address there should point to code instead of itself... What is the "1" in 0x180000D1 about?
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 13, November, 2016, 09:40:37 AM
@Maps: All graphics you see on screen, is based on what has been put in VRAM data. (And if certain BG Types  (Indexed Pixel Format types), then the Palette section may be used as well.)
I know. I was mostly refering to how those numbers end up in the VRAM. With the GBA you likely have to keep a map of the tiles in the RAM. or load them from ROM when the camera moved.
Quote from: Fox on 13, November, 2016, 09:40:37 AM
@EDIT: Yes, you loaded the pointer correctly, but the address there should point to code instead of itself... What is the "1" in 0x180000D1 about?
Well... So it has to point to the space just after it I suppose (if I want to run it as close to the header as possible)?
I read bit 0 of the register you are using must be 1 for the Mode Switch. But I'm really unsure what becomes bit 0 (the last or first place from left to right) with all that crazy endianness.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

The very first instruction ever run in a GBA file is at 0x08000000.... it is an ARM instruction, it usually jumps to 0x080000C0, but it doesn't always.

The left most bit, (Most significant bit.) 0x80000000, is bit 31, and the least significant bit, 0x00000001 is bit 0....
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 13, November, 2016, 10:56:09 AM
The very first instruction ever run in a GBA file is at 0x08000000.... it is an ARM instruction, it usually jumps to 0x080000C0, but it doesn't always.
WAIT WHAT?
I gotta check that out. I thought it started at some obscure place, checks the header then proceeds to 0x080000C0.
Quote from: Fox
The left most bit, (Most significant bit.) 0x80000000, is bit 31, and the least significant bit, 0x00000001 is bit 0....
Oh alright. That makes sense for me.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

YES! That's right!! The very first piece of data in the ROM is an ARM instruction! Unlike the DS games, that start with a name string.... (The DS games basically have ARM9/ARM7 binaries, with a ROM entry address for both - That's how they work.)

:)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 13, November, 2016, 06:25:01 PM
(The DS games basically have ARM9/ARM7 binaries, with a ROM entry address for both - That's how they work.)
You mean the CPU ARM9 and ARM7TDMI right? Not ARMv9 & ARMv7?
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#90
Good point... Can you remind me what the difference is?

I'm assuming they're basically the same, but referred to in different ways.
-The CPU that executes the instruction set.
-Files that require the instruction set. (But isn't the instruction set itself.)
-Etc.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

the little v is a reference to a whole CPU architecture/serie. Like the X in a intel architecture number X000.
ARM7TDMI is one of the CPU's in the v4T set. Very old.
This is a good list:
https://en.wikipedia.org/wiki/List_of_ARM_microarchitectures

Oh and apparently, the CPU of the DS is even older than the GBA in comparison.
ARM7TDMI: 1998 - GBA release: 2001
ARM946E-S: 2000 - DS release: 2005.
Damn.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#92
Thanks... Although, in the original post (previous page), I wasn't referring to it with the v, however, that is nice to know about.
I was just simply referring to it as ARM7/ARM9, because that's the way I've seen it labeled. Any of the more extreme specifics, I haven't looked into yet. (Don't really need to know it for hacking, I suppose... I think terminology has been one of my weaker points so far...)

QuoteOh and apparently, the CPU of the DS is even older than the GBA in comparison.
ARM7TDMI: 1998 - GBA release: 2001
ARM946E-S: 2000 - DS release: 2005.
Damn.
The GBA was released in Japan on March 21, 2001.

Interesting... However, that may sound reasonable....
-Cut costs by using an older system you were already testing before the new architecture...
-The GBA could have been made before release.../ Millions of GBAs could have been manufactured before "release"....
-And nobody can know when new bugs are introduced in new versions... (Of course, the GBA does have bug(s) anyway, but...)

There's a Python class that has people using an older version of Python instead of the newer one... so it can be thought similar to that as well.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox
(Don't really need to know it for hacking, I suppose... I think terminology has been one of my weaker points so far...)
And to an extend, that is not really bad. Especially in the CPU world there are to many different terms going around, often synonymous or way to detailed.
Quote from: Fox
Interesting... However, that may sound reasonable....
-Cut costs by using an older system you were already testing before the new architecture...
-The GBA could have been made before release.../ Millions of GBAs could have been manufactured before "release"....
-And nobody can know when new bugs are introduced in new versions... (Of course, the GBA does have bug(s) anyway, but...)
Yeah it is. Most console also use this principle. (PS3 excluded they had their own special CPU made, which turned out to be a very awkward thing, but getting a hella lot of topic here).

Update: I'm almost done with a very small assembly demo.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

I agree...

WORD is probably one of the big ones... Some groups think it is 16-bit, others, 32-bit. - Really dislike how that terminology works...
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 14, November, 2016, 01:48:20 PM
WORD is probably one of the big ones... Some groups think it is 16-bit, others, 32-bit. - Really dislike how that terminology works...
Pfff yeah what nonsense that is.
Especially in x86. Every instruction is bound to a word size, but some can deviate. :sad:
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"