Golden Sun Hacking Community
December 15, 2017, 09:52:01 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
  Home   Forum   DC Wiki Help Search Calendar Downloads Login Register  
Pages: 1 ... 4 5 [6] 7   Go Down
  Print  
Author Topic: Post your GBA ASM Questions here.  (Read 27553 times)
0 Members and 2 Guests are viewing this topic.
Luna_blade
The last member of the Luna clan
Luna Clan

Great Member
*

Coins: 0
Offline Offline

I am: Timeless. As in, i don't have much free time.
Posts: 533

« Reply #75 on: November 10, 2016, 02:38:07 PM »

Out of all the instructions, I think only LDR* can load any value from any address?
Okay then.
Quote from: Fox
While I know all Thumb code instructions, I don't think I know all ARM code instructions. (But I do know right many of them.) Not sure how co-processor works. But it's rarely seen anyway.... (On top of the fact that most code in these GBA games are Thumb... But I do know some games like The Lost Vikings was mostly Arm.)
Yeah, well I wasn't even sure if I am going to use much ARM at all... I mean, if you want to execute it fast, the best way is to put it in the IWRAM. And you can only store about 900 ARM instructions there...
Maybe I should just use THUMB and learn ARM when I need it?
Quote from: Fox
Immensely, yeah. :)
Hey I learned something besides assembly today!
Quote from: Fox
@Two instructions: I was referring to Thumb mode, and how the "bl" instruction is made up of two instructions.... And what I said was based on if you were executing in SDL-H... I probably could check the regular VBA, but I'd need to download it again, because my primary computer is in a broken state at the moment.
BL made up of two instructions... damn.
But yeah, the thing was a BL in ARM not THUMB.
Quote from: Fox
What does your ARM chart look like at the moment? You know GBATEK does have a chart for the Formats that you can use to help.... ARM9 ones are not on the GBA.
Referring to this:
But you'd still need to look at the actual instructions themselves. (Scroll up from there for brief explanations, or scroll down for more specific stuff.)
I basically took the THUMB chart and started adding ARM stuff.
But it looks shitty and have only two instuctions in there. While I want to have around 100 I guess?

If I am going to use ARM more, I will finish that chart. Because, GBATEK is just a bit to technical to be convenient IMO.
That's why I like the thumb chart, it's just pure Hex of an instruction + description.
Logged

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2394

« Reply #76 on: November 10, 2016, 02:48:30 PM »

Quote
BL made up of two instructions... damn.
Well, two 16-bits... But I assume they are both a type of blh or something. (Depending on how you see it.) The second one can be used by itself, so...

F000 = LR = PC+4+(nn SHL 12)
F800 = PC = LR + (nn SHL 1), and LR = PC+2 OR 1 This one sets the Return address.

Quote
But yeah, the thing was a BL in ARM not THUMB.
And that's why I said 1~2.... instead of just 2...

But I agree that pure hex = Cool stuff. (While I also think GBATEK is better than nothing. - It seems short and to the point if you already know what it all means.)
« Last Edit: November 10, 2016, 02:55:10 PM by Fox » Logged

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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Lord Wolfram
The Lone Wolf
Mars Clan

I am the Angel of darkness and I am back.

Regular Member
*

Coins: 2
Offline Offline

Gender: Male
I am: fine!
Posts: 316

« Reply #77 on: November 11, 2016, 04:50:21 PM »

My apology, life got me away, school.... people who want to ruin my life... etc.
Anyways. My idea is to convert the old code to see how it works and then edit and polish it for completely new engine.
Like if we have a GS ROM ASM code converted to C with all the data within and working thing. Then we can edit small details on the engine and make it work on PC. Then purify the code and then see what does what. In the end we have a new source code resource for our projects
Logged
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2394

« Reply #78 on: November 11, 2016, 06:54:29 PM »

That's okay... People come in and out all the time, I'm sure, so it is to be expected.

That idea sounds extremely similar to my own... (Or even Open GS if you made it a PC game.) ... But then later, I decided that it'd be even smarter/faster to simply convert machine code to ASM code... converting all pointers to labels to be converted back to pointers using armips. ; At least as a possible pre-requisite to any future plans like that of converting to a C language or such... Etc.

Since converting straight to C/C++ would take an extraordinary amount of time.

Plus, having an ASM option gives us that good feel... and people can really learn what the GBA is made of.

---
But note that I may or may not be working on the project at the moment... since the primary computer I use was... er... broke... (Probably no hard drive issues? - But it just simply wouldn't boot passed a flash of a button. - If I had to take a guess, it was probably a power issue.) (BUT I did upload stuff to github so it's not like I lost anything related to the project itself...)
« Last Edit: November 11, 2016, 07:15:39 PM by Fox » Logged

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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Luna_blade
The last member of the Luna clan
Luna Clan

Great Member
*

Coins: 0
Offline Offline

I am: Timeless. As in, i don't have much free time.
Posts: 533

« Reply #79 on: November 11, 2016, 09:07:25 PM »

Quote from: Lord Wolfram
My apology, life got me away, school.... people who want to ruin my life... etc.
Anyways. My idea is to convert the old code to see how it works and then edit and polish it for completely new engine.
Like if we have a GS ROM ASM code converted to C with all the data within and working thing. Then we can edit small details on the engine and make it work on PC. Then purify the code and then see what does what. In the end we have a new source code resource for our projects.
Which old code?
We might have OpenGoldenSun.
Aye, a C source would be nice, but even if labeling is easy, the code might look like a mess where things really aren't that easy to change.
In any case, I would prefer to have OpenGoldenSun, or just Hex edit GS (either RAM or instructions).

Quote from: Fox
Plus, having an ASM option gives us that good feel... and people can really learn what the GBA is made of.
I sure hope you don't mean assembly in armips or Devkitarm?
Logged

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
View Profile
Lord Wolfram
The Lone Wolf
Mars Clan

I am the Angel of darkness and I am back.

Regular Member
*

Coins: 2
Offline Offline

Gender: Male
I am: fine!
Posts: 316

« Reply #80 on: November 11, 2016, 09: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.
 
Logged
View Profile WWW
Luna_blade
The last member of the Luna clan
Luna Clan

Great Member
*

Coins: 0
Offline Offline

I am: Timeless. As in, i don't have much free time.
Posts: 533

« Reply #81 on: November 13, 2016, 07:52:27 AM »

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?
Logged

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
View Profile
Lord Wolfram
The Lone Wolf
Mars Clan

I am the Angel of darkness and I am back.

Regular Member
*

Coins: 2
Offline Offline

Gender: Male
I am: fine!
Posts: 316

« Reply #82 on: November 13, 2016, 08: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?
Logged
View Profile WWW
Luna_blade
The last member of the Luna clan
Luna Clan

Great Member
*

Coins: 0
Offline Offline

I am: Timeless. As in, i don't have much free time.
Posts: 533

« Reply #83 on: November 13, 2016, 10:53:16 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?
« Last Edit: November 13, 2016, 12:25:58 PM by Luna_blade » Logged

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2394

« Reply #84 on: November 13, 2016, 02:40:37 PM »

Quote
I 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?
« Last Edit: November 13, 2016, 03:46:56 PM by Fox » Logged

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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Luna_blade
The last member of the Luna clan
Luna Clan

Great Member
*

Coins: 0
Offline Offline

I am: Timeless. As in, i don't have much free time.
Posts: 533

« Reply #85 on: November 13, 2016, 03:46:00 PM »

@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.
@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.
Logged

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2394

« Reply #86 on: November 13, 2016, 03:56:09 PM »

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....
Logged

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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Luna_blade
The last member of the Luna clan
Luna Clan

Great Member
*

Coins: 0
Offline Offline

I am: Timeless. As in, i don't have much free time.
Posts: 533

« Reply #87 on: November 13, 2016, 04:09:40 PM »

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.
Logged

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2394

« Reply #88 on: November 13, 2016, 11:25:01 PM »

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.)

:)
Logged

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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Luna_blade
The last member of the Luna clan
Luna Clan

Great Member
*

Coins: 0
Offline Offline

I am: Timeless. As in, i don't have much free time.
Posts: 533

« Reply #89 on: November 14, 2016, 08:51:19 AM »

(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?
Logged

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
View Profile
Pages: 1 ... 4 5 [6] 7   Go Up
  Print  
 
Jump to:  

Cbox
December 13, 2017, 09:19:38 PM
Fox: Okay, so that Summon Night games adds the fram number to the seed, before generating another seed via mul/add....  (GS1-GS3 never adds the fram number.) ... So um, that makes sense! ;  Summon Night:  ((seed + frame) * 0x343FD + 0x269E3C) >> 0x10 ; Which is also on the list here: https://en.wikipedia.org/wiki/Linear_congruential_generator
December 12, 2017, 11:10:45 PM
Fox: Yes, and there could be contests. Maybe ones where 1st/2nd/3rd place get a cash reward, but eh. Dunno.... Kind of thinking about making a topic about how people got their job, and what was their experience. (e.g. Did they use references of people already working in the job, and various other things.)
December 09, 2017, 04:24:14 AM
Majora: Import old forum posts for reference, perhaps take posts containing important info like documentation away from the old stickied forum post model and make them into their own pages on a site with an in-built search bar. Might help with SEO, too. If nothing else, perhaps whipping them into PDFs and hosting them via Scribd? The possibilities are boundless when it comes to restructuring a site
December 09, 2017, 04:20:02 AM
Majora: Just a nice idea to have even if it doesn't come to fruition. Updating, modernizing, always a good idea. Could probably do something pretty nifty using a good Wordpress theme
December 09, 2017, 04:15:45 AM
Majora: Would be kind of neat to do something like that for GSHC. Could change it up a bit to show all tweets/instagram posts/facebook posts/golden sun subreddit posts all in one sidebar. It would be cool in that it gives the site it's on (and the topic in general) appear more lively and active, which is a plus
December 09, 2017, 04:14:19 AM
Majora: That does sound interesting. One cool thing I've seen some sites use is a sort of unique take on a sidebar option that acts like a social media integration (like, "See GSHC's latest Tweets"). It displays activity from a variety of related sites, such as Reddit, Twitter, Instagram, etc.
December 09, 2017, 12:58:53 AM
Fox: And the way it'd work via code is not that all users would instantly get nicknames the minute you register... but rather, the moment you view a name if it doesn't have a nickname, it gets one. (My Thoughts.)
December 09, 2017, 12:53:55 AM
Fox: (I was thinking that it would be "Name (Nickname)" ... The nickname is what you first known the user as, and you can change that yourself... and the Name is what the user wants to be called... Something like that.
December 09, 2017, 12:47:56 AM
Fox: So like... for starters, one idea I had was to make it so anyone can name anyone... much like how it works on Skype, and you (the namer) would be the only one to see it, and such...
December 09, 2017, 12:45:02 AM
Fox: Would need to be carefully thought out and tested, though.
December 09, 2017, 12:43:02 AM
Fox: I'm thinking I could make it so that name changes can happen whenever... (Without any limit)... Since I believe there's a way to do it with minimum confusion. (I think.) Hmm....
December 09, 2017, 12:31:36 AM
Fox: (I mean an offline version... at least initially.)
December 09, 2017, 12:25:01 AM
Fox: Now that I have thought about it a bit more, would I be right to assume that GSHC would be one of the most interesting websites to administrate, or no? It's sad to see not much going on with it. == I almost want to make a concept website at some point. :D Anyway, how is everyone doing today?
December 06, 2017, 12:12:59 AM
Fox: Like... Start using Github or something... Do like how many of those other projects such as Citra (WIP 3DS Emulator) does. Etc.
December 06, 2017, 12:08:12 AM
Fox: No idea. I just wish OpenGoldenSun would release it as unfinished, but oh well.
December 05, 2017, 06:52:09 AM
MaxiPower: Bummed out that the open golden sun project is dead it seems with no actitivy in close to a year at this point. Is there any hope left in any other projects?
November 27, 2017, 10:25:28 AM
Fox: (When I say research, mainly refering to the data in the game, though checking websites can count to a degree.)
November 27, 2017, 09:52:27 AM
Fox: Maybe. But Dark Dawn is meh, hahah... I still research it, though, because data can be interesting.
November 27, 2017, 05:28:36 AM
Portakin: I'm here! This game is underrated!
November 25, 2017, 08:03:23 PM
Fox: .... and the email listed in that post makes me think we should just make a new rules topic with most of the same information. (So the old ones can be sort o archived.)

Affiliates
Temple of Kraden Golden Sunrise
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.075 seconds with 22 queries.