Crimson Red Posted October 30, 2011 Share Posted October 30, 2011 (edited) @thumb .org 0x01051400 #add r2,0x04 #strb r2,[r2,0x0202bd80] Trying to write instructions to add 0x04 to register 2, then store that byte at the memory offset 0x0202bd80. and I'm trying to have this be written at 0x01051400 (though that's not too important, I can just copy/paste it). I don't know if this is right, don't think it's right, and for some reason all the programs I normally use to compile assembly hacks have gone ape-shit on me and just won't do it. >_____> Edited October 30, 2011 by Strawhat Luffy Quote Link to comment Share on other sites More sharing options...
shadowofchaos Posted October 30, 2011 Share Posted October 30, 2011 (edited) Uhh... as in trigger a "memory hack" with an event? I remember making this video for someone who needed to get conditions, maybe it could be useful for you since it uses an ASM command that I had: Ignore the "Contitions" I was half asleep when I made this. .thumb .org 0x1010000 ldr r1, =0x202BC38 mov r0, #0x40 strb r0, [r1, #0] bx lr TEX6 0x7 [0,0] 0x9A5 // Ask to switch Text speed to "Fast" Waitfortextbox IFYN 0x01 ASMC 0x9010001 //Sets text speed to "Fast" ENIF 0x01 From your ASM, you're telling it to store the byte in r2... in an address supposedly loaded at r2 AND THEN add 0x0202bd80 to make an address. Which... will definitely cause problems. You would need another register for that address. Edited October 31, 2011 by shadowofchaos Quote Link to comment Share on other sites More sharing options...
zahlman Posted October 31, 2011 Share Posted October 31, 2011 Yep. STRB Rd, [Rb, #x] stores Rd at (value in Rb) + x. The available range for x is quite small, btw, putting an address in there won't do it. Use LDR to put the address 0x0202bd80 into another register, and then use STRB using that register as Rb and an offset of 0. You can supply a full address value like that to LDR by prefacing it with '='; this is a pseudo-opcode - the assembler will put the address value after the function (in the "pool"), and turn the LDR instruction into LDR PC, <some offset> such that it indexes the constant correctly. Quote Link to comment Share on other sites More sharing options...
Crimson Red Posted October 31, 2011 Author Share Posted October 31, 2011 Ah, well, my patience for the month has been worn out, I have no desire to throw myself into an abyss of poorly documented programming for more than a couple hours a month. >_> thanks anyhow, I might come back to this later. Quote Link to comment Share on other sites More sharing options...
zahlman Posted October 31, 2011 Share Posted October 31, 2011 (edited) GBATEK is pretty thorough, honestly. Assembly programming is something of a specialized skill, though. Especially with THUMB - single opcodes really don't do very much, so it can really exercise your problem-solving skills trying to get anything meaningful accomplished. (That said, the results can be very impressive; e.g. a decompressor for my improved text compression that fits in the space of the original routine, or ryru's half-body and 4th stats screen work, or any of soc's one-offs.) Edited October 31, 2011 by zahlman Quote Link to comment Share on other sites More sharing options...
Crimson Red Posted October 31, 2011 Author Share Posted October 31, 2011 GBATEK is more of a reference or guide than a tutorial or detailed explanation. For average people like me, GBATEK is no more than a listing of details on how the GBA hardware works/where certain data is, and a list of available programming opcodes or instructions or whatever. It'd be like giving a person a list of ingredients and what each one is used for, then expecting them to cook something without a recipe. Most people probably couldn't just take the ingredients and come up with a delicious meal--given just the ingredients and what they are used for, they wouldn't know how to use them, or with what, or in what order, under what circumstances, and how to put everything together. If a person is smart then maybe s/he can make sense of that stuff and just come up with his/her own recipe, but those people have to understand that it's not normal or even feasible, forget easy, for an average person to do something like that on their own... Hopefully I made my point XP. I'd say more but... too tired... *falls asleep8 Quote Link to comment Share on other sites More sharing options...
zahlman Posted October 31, 2011 Share Posted October 31, 2011 (edited) Yeah, I hear you, it's just that ASM programming is pretty much always just gonna be like that. Honestly, programming in any language is. You're not going to learn (much about) how to sprite from a tutorial, either. :/ (Or at least, you might, but it's still going to seem unbearably tedious until you get some experience. Unless I just suck...) Anyway, gl;hf next time you try it. Edited October 31, 2011 by zahlman Quote Link to comment Share on other sites More sharing options...
Crimson Red Posted November 1, 2011 Author Share Posted November 1, 2011 Yeah, I understand where you're coming from too. ASM might be one aspect of hacking Fire Emblem, but it's also a programming language, and PLs require much intuition. Which I clearly lack... XD. Thanks. Quote Link to comment Share on other sites More sharing options...
Ryrumeli Posted November 3, 2011 Share Posted November 3, 2011 (edited) Just saying, Formal training in programming helps every now or then, but determination helps more than that. I learned ASM out of sheer determination myself, at least, and I don't find myself to be outstanding. :) And I don't think you lack intuitions, your code was very close to the real deal as it was. You just lack confidence in your basics. :) And to be honest I think a tutorial for ASM might be more helpful than a tutorial on spriting. XD Since spriting is an art, and ASM is a programming language, and thus more technical. Edited November 3, 2011 by Ryrumeli Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.