Golden Sun Hacking Community
October 17, 2018, 06:59:10 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 32819 times)
0 Members and 1 Guest 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: 539

« 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

"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"
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 29
Offline Offline

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

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

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
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: 29
Offline Offline

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

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

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
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: 539

« 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

"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"
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: 539

« 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

"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"
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: 539

« 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

"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"
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 29
Offline Offline

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

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

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
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: 539

« 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

"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"
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 29
Offline Offline

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

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

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
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: 539

« 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

"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"
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 29
Offline Offline

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

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

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
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: 539

« 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

"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"
View Profile
Pages: 1 ... 4 5 [6] 7   Go Up
  Print  
 
Jump to:  

Cbox
October 13, 2018, 03:23:06 AM
Salanewt: Updated it to provide more info that I forgot to mention.
October 13, 2018, 03:16:48 AM
Salanewt: I'm still trying to iron out IQ 2 but I'm pretty sure it's entirely random targeting.
October 13, 2018, 03:16:29 AM
Salanewt: Oh yeah, I posted some more info about enemy IQ.
October 12, 2018, 09:51:27 PM
FoxThe HTML5 project is too small to count
October 12, 2018, 06:19:48 AM
Luna_blade: there is jjppof's html5 project...
October 12, 2018, 06:19:17 AM
Luna_blade: Though Momo rings a bell it seems I came here after you left
October 11, 2018, 12:49:41 AM
Fox: (If that makes sense.)
October 11, 2018, 12:48:33 AM
Fox: Yeah, I guess so.  More just saying that's a good place to get answers to GS related questions at the moment.
October 11, 2018, 12:42:28 AM
Crystal Sonata: I did before, but I guess I could try it again
October 11, 2018, 12:41:32 AM
Fox: Not much at the moment. This forum seems pretty quiet. Perhaps you'd be interested in joining the Discord for GSHC that seems to have more activity?
October 10, 2018, 11:16:53 PM
Crystal Sonata: Any projects going on? I need a distraction from the daily grind and I'm interested in hacking GS again.
October 10, 2018, 10:02:53 PM
Fox: Thanks, and good to see you too!
October 10, 2018, 10:02:10 PM
Fox: A few people I'm sure... Most likely the regulars of the past. Such as Atrius, Charon, Role, Salanewt....
October 10, 2018, 03:11:17 AM
Crystal Sonata: I find myself wondering who still remembers me here. Obvs you do (Good to see ya Tea)
October 10, 2018, 12:46:11 AM
Fox: On second thought, it might be because you haven't posted much as Crystal Sonata.
October 10, 2018, 12:41:12 AM
Fox: And your intro isn't that bad. - I imagine most people would say the same about theirs?
October 10, 2018, 12:39:39 AM
Fox: :O - You've been gone so long, I think I forgot you were Momo.  Interesting.
October 09, 2018, 10:23:39 PM
Crystal Sonata: I just revisited my dark past on here and ouch. Someone delete that introduction thread please, the cringe.
October 09, 2018, 08:26:11 AM
Crystal Sonata: Aaaaand, she re-appears yet again. My life keeps dragging me away from the internet sadly.
October 01, 2018, 01:27:50 PM
Luna_blade: haha oof.

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.17 seconds with 22 queries.