• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 19, 2024, 03:32:49 am

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


ASM Lessons

Started by LastingDawn, December 12, 2008, 08:08:10 am

formerdeathcorps

The next session will be sometime tomorrow afternoon (PST).  I presume that whoever wishes to join me tomorrow understands Xif's tutorial on the website's main page (Xif's ASM tutorial).
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

AeroGP

March 24, 2012, 09:25:41 pm #41 Last Edit: March 24, 2012, 09:35:45 pm by AeroGP
Session Start (FFHacktics:#ffhs): Sat Mar 24 15:23:16 2012 -0700
*** Aero[homework] has joined #ffhs
<formerdeathcorps> hey Aero
<formerdeathcorps> ready for the lesson?
*** iRyu has quit IRC: Ping timeout: 204 seconds
<Aero[homework]> nope
<Aero[homework]> i'm just preparing
<Aero[homework]> in case you start without me
<formerdeathcorps> I'm not
<Aero[homework]> that way I can follow along
<formerdeathcorps> as no students have shown up
<Aero[homework]> =/
<Aero[homework]> I'll be ready in... an hour tops
<Aero[homework]> I'm going to do a small portion of my homework and try to finish everything tomorrow
<Aero[homework]> I guess I work better with a fire lit under my ass
*** Pride has joined #ffhs
<formerdeathcorps> Pride, do you have the revised weapon XA hack with you?
<Pride> (Link: http://ffhacktics.com/wiki/Base_Weapon_XA_Rewrite)http://ffhacktics.com/wiki/Base_Weapon_XA_Rewrite
<secondadvent> should i throw in some graphical code to be mean? :v
<secondadvent> or to be really mean, BoF3 code? :P
<formerdeathcorps> in the lesson itself?
<formerdeathcorps> not yet
<secondadvent> what -not- to do
<formerdeathcorps> oh yeah
<formerdeathcorps> but no human being is that stupid
<formerdeathcorps> only compilers doing type casts can
<formerdeathcorps> do that
<formerdeathcorps> SA, actually I want you to talk about disk sectors
<formerdeathcorps> and compression
<formerdeathcorps> you know more about both than me
<formerdeathcorps> but that won't be necessary until we talk about "special topics"
<secondadvent> (Link: http://www.gamefront.com/files/21463912/facepalm.txt)http://www.gamefront.com/files/21463912/facepalm.txt
<secondadvent> while these two routines are badly done, it should still be something that's somewhat easy to read/get started with :P
<secondadvent> not FFT, but still
<Aero[homework]> why hasn't someone rewritten most of the game yet?
<Aero[homework]> i mean small patches are nice, but you'd think with all this information sweeping optimizations would have been made
<Aero[homework]> in at least one area, anyways
<Aero[homework]> or am I uninformed?
<formerdeathcorps> Have you written code before, Aero?
<Aero[homework]> not ASM for FFT
<Aero[homework]> is it overbearing?
<Aero[homework]> *overwhelming
<formerdeathcorps> It's worse than Squarecode
<Aero[homework]> You mean code Square uses for games other than FFT?
<formerdeathcorps> No
<formerdeathcorps> I mean code written by kids just out of college
<formerdeathcorps> who forgot their Data Structures class
<Aero[homework]> ... I was talking about that word "Squarecode"
<formerdeathcorps> No, Aero...that's Square's code
<formerdeathcorps> for any game
<formerdeathcorps> FFT/FFVII anything
<formerdeathcorps> though...to be honest, FFI was atrocious
<formerdeathcorps> it's gotten better over time
<Aero[homework]> okay, so then you confused what I was referring to
<Aero[homework]> I am not talking about BoF3
<formerdeathcorps> maybe I did get confused
<formerdeathcorps> what were you trying to say?
<Aero[homework]> why hasn't someone done some major changes to FFT outside of small patches?
<Aero[homework]> optimizations, restructuring, stuff like that?
<formerdeathcorps> have you written code before?
<Aero[homework]> same answer, eh?
<formerdeathcorps> My point is that
<formerdeathcorps> if you have
<formerdeathcorps> you'd know that in any High LEvel Language
<formerdeathcorps> the logic of whatever you write
<formerdeathcorps> usually takes up a few KB at most
<formerdeathcorps> after weeks of work
<formerdeathcorps> the rest is simply filler space
<formerdeathcorps> now...BATTLE.BIN is 1.5 MB
<Aero[homework]> ah
<formerdeathcorps> or something close to that
<Aero[homework]> it's hard to find routines, yes?
<formerdeathcorps> no.
<formerdeathcorps> rather...
<formerdeathcorps> imagine if we had to replace 20 KB
<formerdeathcorps> of routines
<formerdeathcorps> entirely customly
<formerdeathcorps> that's the equivalent of doing this as a full time job for about 4 months
<formerdeathcorps> and because of the support structure
<Aero[homework]> i can't imagine it taking that long for someone as talented as you
<Aero[homework]> o_O
<formerdeathcorps> your custom stuff has to "fit"
<formerdeathcorps> within the rest of it.
<formerdeathcorps> you know...let's say I wanted to expand the item table to 512 items
<Aero[homework]> if it were written in an even higher level like c++
<formerdeathcorps> to do that reuiqres changing every single instance that reads items
<Aero[homework]> and you could see the miles of data structures and stuff
<formerdeathcorps> to halfword
<formerdeathcorps> correct, Aero
<formerdeathcorps> but there's one thing...doing that
<Aero[homework]> I still can't imagine taking more than 2 months to do a full overhaul of one aspect
<formerdeathcorps> *we can't increase file-size AEro
<Aero[homework]> oh
<Aero[homework]> you know, that could have been the first thing you said
<Aero[homework]> I'd understand that
<Aero[homework]> same issue with hacking sonic games
*** Aero[homework] is now known as Aero
<Aero> in any case, i'm finishing homework tomorrow
<secondadvent> there's also testing/planning/rewriting of your own code
<secondadvent> sometimes a single mistake can require a ton of changes that could set you back a ways
<secondadvent> and then there's occasionally times when you can't figure out why something isn't working correctly, which requires time to debug/change code to fix it
<Aero> well, i do that all the time with my fangame
<formerdeathcorps> because the RAM is 2 MB
<formerdeathcorps> and because we don't know ROM expansion
<formerdeathcorps> seeing miles of data structures is fine...we already do...but fixing them requires you do fix all the cross-references...something that's much harder to do in ASM than with a nice comipler pointing out the entire run cycle for you
<formerdeathcorps> *fixing them entirely as you want
<formerdeathcorps> and much of the cross-reference "linker" routines are uncharted territory because they're not as much the "meat" as the code that actually determines damage and stuff
<formerdeathcorps> but if you want to change the data strucutres, you need to fix those too
<formerdeathcorps> The problem is also...if you tried reverse transcribing FFT into C
<formerdeathcorps> you'll also get stuff that will be marked poorly or left out with ???
<formerdeathcorps> exactly, the trials of a coder
<formerdeathcorps> Pokeytax wrote close to 2 KB of code
<formerdeathcorps> and a 10 KB data structure
<Aero> whoa, wtf?
<formerdeathcorps> ...it took him 4 months?
<Aero> my internet must have hiccuped
<formerdeathcorps> and seriously...it wore him out
*** -NickServ- This nickname is registered. Please choose a different nickname, or identify via /msg NickServ identify <password>.
<Aero> hold on
<formerdeathcorps> and is bugged like crazy
*** -to NickServ-: r@gingst0rm
*** -NickServ- Invalid command. Use /msg NickServ help for a command listing.
<formerdeathcorps> sorry
*** -to NickServ-: identify r@gingst0rm
*** -NickServ- You are now identified for Aero.
<formerdeathcorps> all right
<formerdeathcorps> ready, AEro?
<Aero> hold on, just reread what my dumb internet had backlogged somehow
<Aero> at least, I think it was me
<formerdeathcorps> I read it.
<Aero> <Aero> well, i do that all the time with my fangame
<Aero> whos post was directly before this one?
<formerdeathcorps> oh, must have missed that one
<Aero> *message
<Aero> ^
<secondadvent> my internet seemed to hiccup as well
<Aero> it might be fdc, or the server
<Aero> or something
<Aero> anyways, i was responding to 2nd
<Aero> but it doesn't matter
<Aero> that longass explanation fdc gave convinced me
<Aero> I guess I'm ready
<formerdeathcorps> all right
<formerdeathcorps> we left off yesterday at mult
<formerdeathcorps> I think you got the hang of how to create fractions
<Aero> yes
<formerdeathcorps> just as a quick exercise
<formerdeathcorps> how would you do 30%?
<Aero> it's wierd that square would do it that way, but I guess it's so they can still have numeric values up to 4294967295
<Aero> as for your question
<formerdeathcorps> right.
<Aero> 3 * 5555 5556
<Aero> although it wouldn't really be 30%
<formerdeathcorps> it's not
<Aero> it's be more like 33.3333333%
<Aero> *it'd
<formerdeathcorps> in short...we did the unit fraction case last night
<formerdeathcorps> if we were to do non-unit fractions, how would you proceed?
<Aero> what would be different about it?
<formerdeathcorps> well...go through the process and you tell me
<Aero> hmm
<Aero> 30% is 3/10
<formerdeathcorps> right
<Aero> so it'd be 3 * 1/10
<formerdeathcorps> ok
<Aero> which is 3 * 1000 0000
<Aero> erm... hmmm
<Aero> derp
<Aero> 3 * 1999999A
<Aero> ... still no
<Aero> fuck
<formerdeathcorps> hint...
<formerdeathcorps> take FFFFFFFF as a decimal
<formerdeathcorps> multiply by 3/10
<formerdeathcorps> and then round up
<Aero> oh
<Aero> i keep just dividing by 10
<Aero> or rather A
<Aero> for 1/10
<formerdeathcorps> right
<secondadvent> i usually go 0x100000000 instead of FFFFFFFF
<Aero> but then just multiplying by 3 wouldn't teh same
<Aero> *wouldn't be the same
<Aero> would it?
<Aero> or would my answer just be incomplete
<Aero> duh, of course it would
<Aero> 3 * 1999999A
<formerdeathcorps> you divide last
<Aero> ... oh
<formerdeathcorps> so you do 3 * FFFF FFFF first
<formerdeathcorps> and then divide
<formerdeathcorps> and add 1
<Aero> 4CCCCCCD
<formerdeathcorps> do you see why?
<Aero> what, but...
<formerdeathcorps> you do this rather than the opposite?
<Aero> the way I did it before was just as good an answer
<formerdeathcorps> except there's one problem...
<formerdeathcorps> the +1 part?
<Aero> it isn't closest to the factional equivalent?
<formerdeathcorps> was to estimate right?
<formerdeathcorps> a roundoff error
<Aero> oh
<formerdeathcorps> you also want to make that roundoff error last
<formerdeathcorps> in any list of calculations
<Aero> can't round off until after all is said and done
<formerdeathcorps> to limit total error
<formerdeathcorps> right
<Aero> hold on
<formerdeathcorps> FFFF FFFF / A
<Aero> 19999999
<formerdeathcorps> you add 1
<formerdeathcorps> to get 1/10
<Aero> 1999 999A
<formerdeathcorps> but that leaves a roundoff error there
<formerdeathcorps> which you then amplify by multiplication
<Aero> =/
<secondadvent> what i usually do is use wincalc in scientific mode, enter the decimal value i want, * 0x100000000 and get the value i want (still need to round though) :P
<formerdeathcorps> now...let's see some examples from Square
<formerdeathcorps> The DEFUP code
<formerdeathcorps> is * 2/3 right?
<Aero> that'd be [(FFFF FFFF * 2)/3]+1
<Aero> which is AAAAAAAB
<formerdeathcorps> you would think so
<formerdeathcorps> Square, however
<formerdeathcorps> does not do that
<formerdeathcorps> they split the steps up
<Aero> -_-;
<formerdeathcorps> 1) XA * 2
<formerdeathcorps> then divide by 3
<secondadvent> they do * 1/3 then sll 0x1 right?
<formerdeathcorps> do they, SA?
<secondadvent> i forget
<secondadvent> :P
<formerdeathcorps> that's even worse, that leaves round off errors
<formerdeathcorps> point is...Square is inefficient
<secondadvent> i'm working on no sleep here
<formerdeathcorps> Aero, want to guess the reason why they don't do that?
<Aero> well, i don't expect them to process the whole calculation in one line
<Aero> ASM can't do that
<formerdeathcorps> ASM can
<formerdeathcorps> simply type in AAAA AAAB
<secondadvent> yep
<Aero> ... oh
<formerdeathcorps> and have your compiler figure out properly how to do fractions
<Aero> derp, forgot that's how it's used
<formerdeathcorps> but guess why Square didn't
<formerdeathcorps> (hint...remember the discussion we had yesterday about signed numbers)
<Aero> okay... why doesn't square do it that way?
<Aero> oh
<Aero> is the damage signed?
<Aero> due to absorb?
<formerdeathcorps> yeah
<Aero> ah
<formerdeathcorps> there's two forms of sign
<formerdeathcorps> *mult
<formerdeathcorps> rather
<formerdeathcorps> mult and multu
<formerdeathcorps> signed and unsigned
<formerdeathcorps> as a practice, to stop stupidity, always use multu
<formerdeathcorps> just so you can express all fractions
<Aero> k
<formerdeathcorps> there is another way...slightly less precise
<formerdeathcorps> but it's the way SA and I use
<formerdeathcorps> we simply multiply by a byte
<formerdeathcorps> and divide by 128
<secondadvent> oh derp, i had the order reversed
<secondadvent> i need sleep
<formerdeathcorps> (i.e. srl 0x07)
<formerdeathcorps> Square never does this
<formerdeathcorps> but you'll see this in my code and SA's
<Aero> ic
<formerdeathcorps> in that system
<formerdeathcorps> 56 is 1/3
<formerdeathcorps> 34 is 1/5
<formerdeathcorps> err...no
<Aero> ;p;
<Aero> *lol
<formerdeathcorps> 2B is 1/3
<formerdeathcorps> anyways...the advantages here
<formerdeathcorps> is that you only need to multiply by one byte
<formerdeathcorps> so you can just extract your number from lo
<formerdeathcorps> and that you can use small numbers (faster operations when you do the srl)
<Aero> cool
<formerdeathcorps> also...you can express all multipliers
<formerdeathcorps> from 0 to 2
<Aero> how'd you determine the bytes?
<Aero> FF / 128?
<formerdeathcorps> the same way as you did before, Aero
<formerdeathcorps> no
<formerdeathcorps> 7F * MULT + 1
<Aero> where MULT is?
<formerdeathcorps> your desired multiplier
<formerdeathcorps> between 0 and 2
<formerdeathcorps> obviously, if your multiplier is 0
<formerdeathcorps> just clear out your variable
<formerdeathcorps> and if it's a power of two, use the shift right / left logicals
<Aero> okay, i'm getting like damned now, though
<formerdeathcorps> sorry
<Aero> why only between 0 and 2
<Aero> *?
<Aero> show me an example
<Aero> show me how you got 2B
<formerdeathcorps> 7F * 1/3 + 1
<formerdeathcorps> 7F * 1/3 = 2A
<formerdeathcorps> +1 is 2B
<Aero> oh
<formerdeathcorps> why is it only between 0 and 2?
<Aero> you cut the fraction down to 7 bytes?
<formerdeathcorps> yeah
<Aero> interesting
<formerdeathcorps> this is just a simple way of doing fractions by bytes
<formerdeathcorps> that way people don't need to remember large numbers
<formerdeathcorps> obviously, if you have large denominators like 100, you don't have a choice
<Aero> OH DERP
<Aero> i got confused again, but I figured it out
<Aero> instead of FFFF FFFF, you used 7F
<formerdeathcorps> but for small fractions, this approximation holds for all values up to around 60 or so
<formerdeathcorps> right
<Aero> now I wonder how I got the wrong numbers before
<Aero> what was I thinking?
<Aero> o_O
<formerdeathcorps> do you see why the multipliers are between 0 and 2?
<Aero> yes
<formerdeathcorps> ok
<formerdeathcorps> now...
<formerdeathcorps> Square, sadly, is not this smart
<Aero> there aren't enough bytes to properly represent fractions larger than 2
<formerdeathcorps> correct, Aero
<formerdeathcorps> just like base 10 can't represent anything not a power of 2 or 5
<formerdeathcorps> SA, care to explain how Square does percents?
<Aero> I wouldn't blanket term them
<Aero> we have interviews and such, don't we
<Aero> it was a very poor, very specific team
<formerdeathcorps> ok, sure
<Aero> that is probably no longer working there
<formerdeathcorps> SA, can you explain how FFT coded percents?
<Aero> lol
<formerdeathcorps> just to give a comparison?
<formerdeathcorps> all right... I will
<formerdeathcorps> FFT does percents
<secondadvent> you go ahead, i'm ready to pass out. i'll try to be more helpful tomorrow :P
<formerdeathcorps> by dividing by 1/320 or something like that
<Aero> o_O
<formerdeathcorps> and then multiplies by 2^5
<formerdeathcorps> and divides by 10
<formerdeathcorps> it's awful
<Pride> lol
<Aero> so... they round it to 1/100th then they scale back up?
<formerdeathcorps> yeah
<Aero> >_<
<formerdeathcorps> The reason why Square does this?
<formerdeathcorps> Speed
<formerdeathcorps> sll / srl
<formerdeathcorps> are the fastest operations
<formerdeathcorps> mind you...this wastes space
<formerdeathcorps> ...and that's what matters most to us
<Aero> so you took a trade-off - ease of user for slight speed disadvantage?
<formerdeathcorps> Aero, since most of us use emulators
<formerdeathcorps> on machines far stronger than the PSX
<formerdeathcorps> That's hardly an issue since the same thing would run on the real machine
<formerdeathcorps> just a few microseconds slower
<Aero> yeah, I get you
<Aero> Knowing that they did it for speed, though
<Aero> I wouldn't blame 'em
<formerdeathcorps> back to your earlier question yesterday
<Aero> They still ended up with slowdown, but they tried
<Aero> =/
<formerdeathcorps> why don't we just multiply and divide
<formerdeathcorps> divide exists also as a FFT function
<formerdeathcorps> but there's two things to know immediately
<formerdeathcorps> DIV / DIVU
<formerdeathcorps> is a very costly operation
<formerdeathcorps> it is twice as costly as multiplication
<formerdeathcorps> and if you think about why...it makes sense
<Aero> of course
* Pride didn't know that
<Aero> division operators are always more costly
<formerdeathcorps> to be able to divide you need to be able to multiply
<Aero> apparently
<formerdeathcorps> and subtract
<Aero> it's simpler to multiply by a fraction than directly divide an integer.
<formerdeathcorps> correct
<Aero> for some reason
<formerdeathcorps> which is why Square does what it does
<formerdeathcorps> in MIPS
<formerdeathcorps> the reason is simple
<formerdeathcorps> everything is an int
<formerdeathcorps> floating point does not exist
<Aero> ah
<formerdeathcorps> video game systems tend to have fast integer based engines
<Aero> so extra processor time is spent rounding off the excess
<formerdeathcorps> most consoles have floating point
<formerdeathcorps> exactly
<Aero> that makes sense
<formerdeathcorps> *most PCs I mean
<formerdeathcorps> *most consoles have the integer engines
<formerdeathcorps> anyways...
<formerdeathcorps> the only time square uses divide
<formerdeathcorps> is usually when the number they are dividing by
<formerdeathcorps> is variable
<formerdeathcorps> and not constant
<Aero> so they can't readily conver it
<Aero> *convert
<formerdeathcorps> right
<formerdeathcorps> which is why your computer must be stronger a processor than the console
<formerdeathcorps> which is also why emulating the PS2 is so hard
<formerdeathcorps> it uses SO much resources
<formerdeathcorps> because we need to remember that just based on processor speed, for when it was released, the PS2 was several years ahead of its field
<formerdeathcorps> anyhow...this is a serious digression
<formerdeathcorps> you just need to remember that div
<formerdeathcorps> stores the result in hi
<formerdeathcorps> and the remainder in lo
<Aero> k
<formerdeathcorps> the only thing is...the remainder is virtually never used in FFT
<formerdeathcorps> even though I found it quite useful...mathematically
<Aero> because they round EVERYTHING
<formerdeathcorps> well, no
<formerdeathcorps> let's say you want to calculate patterns in the Zodiac
<formerdeathcorps> the easy way is to use modular divison
<formerdeathcorps> the stupid way is to waste space the way Square did
<Pride> lol
<formerdeathcorps> ...making separate flags for when units had opposite alignment and stuff
<Aero> can't even stay consistent with their own design ethic
<Aero> dur, zodiac patterns are good place to break our edict on saving processor speed hur!
<formerdeathcorps> the result is their routine is longer
<formerdeathcorps> and actually just as bad
<Aero> actually, i should ask this
<formerdeathcorps> mm?
<Aero> why does the filesize need to be maintained?
<formerdeathcorps> you can't make the file larger
<secondadvent> their way FFT usually does it is -> base - (base / X * X)
<formerdeathcorps> because each file is given a fixed number of disk sectors
<formerdeathcorps> and after each file is the next one
<formerdeathcorps> on the disk
<Aero> oh
<formerdeathcorps> thus, if you made one file larger
<Aero> that can't be adjusted?
<formerdeathcorps> you'll have to edit every other file
<secondadvent> i can increase filesize in BoF3 though
<Aero> or is it just too costly
<formerdeathcorps> *not easily, Aero
<Aero> okay
<formerdeathcorps> also...you have to adjust it in RAM
<Aero> just curious
<secondadvent> since it has a neat little LBA table
<formerdeathcorps> and that's the really nasty part
<formerdeathcorps> because if I made BATTLE.BIN larger
<formerdeathcorps> I'd have to make another file smaller
<secondadvent> and has a file header for how large the subfiles are, and where to load in RAM
<formerdeathcorps> and adjust every single pointer to that second file
<Aero> what a hassle
<formerdeathcorps> exactly
<formerdeathcorps> which is why I'd prefer not to think about it
<Pride> A shame really
<formerdeathcorps> now...onwards to OPCODES
<secondadvent> nop
<Pride> :x
* secondadvent losing powe...
<formerdeathcorps> these make up the basic instructions of MIPS
<formerdeathcorps> I've already introduced you to some, Aero
<formerdeathcorps> shifts
<formerdeathcorps> adds
<formerdeathcorps> subtracts
<formerdeathcorps> you probably should remember these
<formerdeathcorps> as an example
<formerdeathcorps> add r1, r2, r3
<formerdeathcorps> what does this mean?
<formerdeathcorps> it takes r2 and r3
<formerdeathcorps> the values in them
<formerdeathcorps> adds them
<formerdeathcorps> and puts the result in r1
<formerdeathcorps> in general, when you read opcodes
<formerdeathcorps> the first register given
<Aero> so if you just wanted one or the other, it'd be
<Aero> add r1, r2?
<formerdeathcorps> is always the one whose value gets replaced
<Aero> or addi, r1, r2, 0?
<formerdeathcorps> right
<formerdeathcorps> except since MIPS is 32-bit
<Aero> ... erm, which one
<formerdeathcorps> you always have 3 arguments
<Aero> oh
<Aero> k
<formerdeathcorps> the first one is always the value that gets replaced
<Aero> i do remember argument order
<Aero> from my class
<formerdeathcorps> right.
<formerdeathcorps> just know that since 32-bit commands
<formerdeathcorps> have 3 arguments
<formerdeathcorps> the first one has no place
<formerdeathcorps> in the calculation itself
<Aero> k
<Aero> argument1 is the destination
<formerdeathcorps> right
<Aero> argument2 is formula argument 1
<formerdeathcorps> hence known as the rd
<formerdeathcorps> rs
<Aero> argument3 is formula argument2
<formerdeathcorps> right
<formerdeathcorps> but argument 3 is sometimes a constant
<Aero> right
<formerdeathcorps> (all constants in MIPS are halfwords
<formerdeathcorps> i.e. 2 bytes
<Aero> so they can't be larger than FF FF?
<formerdeathcorps> right
<Aero> i guess 65536 is sufficiently large
<formerdeathcorps> also...one thing to note
<Aero> *6553
<Aero> *5
<formerdeathcorps> all constants are signed
<Aero> ugh
<Aero> so it's not even that
<formerdeathcorps> except for logic commands
<formerdeathcorps> like and / xor
<formerdeathcorps> err...
<formerdeathcorps> andi / xori / ori
<Aero> it's {-255, 255}
<Aero> lame
<formerdeathcorps> no
<formerdeathcorps> more like (-2^15, 2^15)
<formerdeathcorps> a very large space
<formerdeathcorps> now...let's refer to my list
<Aero> {-32768, 32768}
<formerdeathcorps> (Link: http://ffhacktics.com/smf/index.php?topic=6728.0)http://ffhacktics.com/smf/index.php?topic=6728.0
<Aero> onto your list
<Aero> ah
<Aero> okay, so now you guy's code snippets make sense
<Aero> first 2 bytes is the opcode
<Aero> all others are arguments
<Aero> right?
<formerdeathcorps> right
<Aero> so I just gotta memorize the op codes
<Aero> hmmm
<formerdeathcorps> back in the old days...yes
<formerdeathcorps> you did
<formerdeathcorps> now we have massHex
<Aero> oh
<formerdeathcorps> and you just need to be able to write opcodes
<formerdeathcorps> symbolically
<Aero> ah
<secondadvent> i still do it in a hex editor though
<formerdeathcorps> correct
<formerdeathcorps> because of that
<formerdeathcorps> it is still advised you memorize opcodes
<Aero> the snippets are just how your compiler exports the high level language
<Pride> I'm surprised you don't have Jump Register on that list
<Aero> figures
<formerdeathcorps> I don't?
<Aero> he doesn't?
<formerdeathcorps> yes I do
<Pride> Oh I see it
<Pride> nvm
<formerdeathcorps> it's under R commands
<Pride> Yeah I was just looking under the jump commands
<Aero> in my class, we use visual studio to write ASM
<Aero> so we didn't have to remember the opcodes in hex
<Aero> just the shorthands
<Aero> so I know some of them
<formerdeathcorps> Aero, to know the opcodes you have to deconstruct the commands in binary
<Aero> but not the IDs
<formerdeathcorps> let's give an example
<formerdeathcorps> add r1, r2, r3
<formerdeathcorps> the first is add
<Aero> oh dur
<formerdeathcorps> 100 000
<formerdeathcorps> or 1000 00
<formerdeathcorps> err...wait
<Aero> wait, no
<formerdeathcorps> 10 0000
<Aero> hmmm
<formerdeathcorps> notice that is hex for 20
<Aero> where'd you get that number?
<formerdeathcorps> the first four zeroes
<formerdeathcorps> form the 0 byte
<formerdeathcorps> *0 hex digit
<Aero> no
<Aero> not the 20
<Aero> the binary
<formerdeathcorps> right
<formerdeathcorps> 10 0000 = 0010 0000
<formerdeathcorps> the first hex digit is 0
<formerdeathcorps> 0010 is 2
<formerdeathcorps> right?
<Aero> ...
<Aero> NO
<Aero> not the 20
<formerdeathcorps> what?
<Aero> where'd you get 0010 0000
<Aero> *?
<formerdeathcorps> look at the tutorial
<Aero> they're predefined, then?
<formerdeathcorps> the opcode for ADD is 10 0000
<formerdeathcorps> yeah
<Aero> why'd you say: <formerdeathcorps> Aero, to know the opcodes you have to deconstruct the commands in binary
<formerdeathcorps> because 20 = 10 0000 in binary?
<Aero> <Aero> in my class, we use visual studio to write ASM <Aero> so we didn't have to remember the opcodes in hex <Aero> just the shorthands <Aero> so I know some of them
<formerdeathcorps> right.
<Aero> semantics: you were complaining that I said that i didn't need to know them in hex, but they're in binary first
<Aero> semantics
<Aero> you know what I meant. >_<
<formerdeathcorps> you don't need to know them in hex, because we have the tools to ignore this
<formerdeathcorps> but if you want to know it
<Aero> ....
<formerdeathcorps> you need to be able to use binary to decompose stuff
<Aero> seems you didn't know what I meant
<Aero> my point was, i didn't need to know the opcodes
<Aero> before
<Aero> nothing more
<Aero> semantics
<formerdeathcorps> oh, right
<formerdeathcorps> ok...are we cool now?
<Aero> yes
<formerdeathcorps> in the example add r1, r2, r3
<formerdeathcorps> add has opcode of 10 0000
<formerdeathcorps> or 20
<formerdeathcorps> this means
<formerdeathcorps> you have byte 1 as 20
<formerdeathcorps> now...the r1 would be 08
<formerdeathcorps> r2 would be 10
<formerdeathcorps> and so on...
<Aero> already understood that
<formerdeathcorps> so you have 20 0 8
<formerdeathcorps> *20 08
<formerdeathcorps> next is the other two registers
<formerdeathcorps> r2 / r3
<formerdeathcorps> you double the value
<formerdeathcorps> of r2
<formerdeathcorps> so it is 4
<formerdeathcorps> you leave 3 alone
<formerdeathcorps> so you have 3
<formerdeathcorps> On all R-commands
<formerdeathcorps> *i.e. those that use 3 registers
<formerdeathcorps> the last command is always 00
<formerdeathcorps> *byte
<Aero> k
<formerdeathcorps> not really though...
<formerdeathcorps> using the formulas given
<formerdeathcorps> try....
<formerdeathcorps> writing
<formerdeathcorps> add r15, r6, r26
<formerdeathcorps> Still here?
<Aero> yes
<Aero> okay, um...
<Aero> 20 1E 06 00?
<formerdeathcorps> no
<formerdeathcorps> hing
<formerdeathcorps> what is r15?
<Aero> what IS r15?
<Aero> is it a constant
<Aero> *?
<formerdeathcorps> no
<formerdeathcorps> it's a register
<formerdeathcorps> and it fits in byte 2
<Aero> okay
<Aero> you never said what was in it
<Aero> or any of them
<formerdeathcorps> oh right...
<formerdeathcorps> anything with r before it
<formerdeathcorps> designates a register
<Aero> i know
<Aero> oh derp
<Aero> no wait
<Aero> question
<Aero> why'd you double r2 before?
<formerdeathcorps> because it's the register in the second position
<formerdeathcorps> you always doulbe that one and place it in the first hex digit of byte 3
<Aero> is 15 * 2 1E or 2A?
<formerdeathcorps> carrying over what you must
<formerdeathcorps> except that's the first register
<formerdeathcorps> which means you multiply by 8
<Aero> wait
<Aero> i didn't see that part
<Aero> o_O
<Aero> i must have nodded "yes" to the wrong thing
<Aero> oy vay
<Aero> okay, i see it now
<Aero> first register is multiplied by 8
<Aero> 2nd by 4
<Aero> third by 2
<Aero> okay
<formerdeathcorps> no
<formerdeathcorps> 2nd by 2
<formerdeathcorps> 3rd not at all
<Aero> okay
<formerdeathcorps> and anything that requires you to carry over digits, you do so
<formerdeathcorps> into the next digit
<Aero> 20 78 0C 1A
<formerdeathcorps> almost
<formerdeathcorps> the second and third registers share the same byte
<Aero> 20 78 C1 A0?
<formerdeathcorps> no
<formerdeathcorps> you carry over into the second byte
<formerdeathcorps> i.e.
<formerdeathcorps> C0 + 1A
<formerdeathcorps> *second digit
<Aero> i don't get it
<formerdeathcorps> think of the second register as the "tens place"
<formerdeathcorps> and the third register as the "ones"
<Aero> why is it done that way?
<formerdeathcorps> becuase they all occupy distinct binary digits
<formerdeathcorps> register 2 occupies the next 5 after the opcode
<Aero> but why don't they just occup 2 bytes each?
<Aero> *occupy
<formerdeathcorps> but we only have 32 registers
<formerdeathcorps> so we only need 5 bits
<formerdeathcorps> for each register
<formerdeathcorps> saving space in the opcode so we can address more command types
<Aero> but you're left with extra space anyways
<formerdeathcorps> right
<formerdeathcorps> but that lets you make more MIPS commands
<formerdeathcorps> in later MIPS versions
<Aero> oh
<Aero> =/
<Aero> okay
<Aero> wierd way to do it
<Aero> so it's 20 78 C0 1A
<formerdeathcorps> no
<formerdeathcorps> remember I said the second and third registers
<formerdeathcorps> share the third byte
<formerdeathcorps> so you have C0 + 1A = DA
<Aero> hmm
<Aero> oh
<Aero> 20 78 DA 00
<formerdeathcorps> if these seems confusing, imagine stacking groups of 5 bits next to each other
<Aero> that's... awkward to work with
<formerdeathcorps> the opcode is 6 bits
<formerdeathcorps> 10 0000
<Aero> you'd have to look at the binary
<Aero> or at least, I'd have to
<formerdeathcorps> Yeah
<formerdeathcorps> that's why this system is cumbersome
<formerdeathcorps> but notice
<formerdeathcorps> the next two bytes
<Aero> so it's not even a full word, it's just 10 bits
<formerdeathcorps> right
<Aero> =/
<Aero> well, not 10
<formerdeathcorps> 0000 0 | 000 00 | 00 000 UNUSED
<Aero> 24
<Aero> ugh
<formerdeathcorps> I'm not done with complexity
<formerdeathcorps> when you read the HEX
<formerdeathcorps> it's all backwards
<formerdeathcorps> so you actually read 00 DA 78 20
<formerdeathcorps> in the hex editor
<Aero> little endian
<formerdeathcorps> right
<Aero> like the guide says
<formerdeathcorps> but only each command is little endian
<formerdeathcorps> the commands read in forward order
<Aero> right
<formerdeathcorps> ok...just so you know and aren't going to pull a Damned moment on me
<formerdeathcorps> is there any command you don't get?
<formerdeathcorps> that I wrote??
<Aero> such as?
<formerdeathcorps> as in...do you understand all the symbolic three letter commands? I wrote
<formerdeathcorps> what they do?
<Aero> let me see
<formerdeathcorps> as well as the overall types of commands
<formerdeathcorps> I / R / J
<Aero> i - immediate
<Aero> r - register
<Aero> j - jump/
<Aero> *?
<formerdeathcorps> right
<formerdeathcorps> do you understand the difference, opcode wise?
<formerdeathcorps> and function wise?
<Aero> immediate handles constants
<Aero> register handles registers
<Aero> jump moves to a specified point in code
<formerdeathcorps> right
<Aero> yeah, as long as I know the shorthands, i'm good
<Aero> it becomes... something close to traditional programming
*** Chotokukyan has joined #ffhs
<Aero> and I worked with this in my class when i had it
<formerdeathcorps> ok, good
<Aero> i actually have a working maze game
<formerdeathcorps> Choto, we're doing review over opcodes
<Aero> too bad I wouldn't be able to tell you how the hell I pulled that off
<formerdeathcorps> (Link: http://ffhacktics.com/smf/index.php?topic=6728.0)http://ffhacktics.com/smf/index.php?topic=6728.0
<Aero> hold on, i'll grab it and upload it so you can lol at it
<Chotokukyan> ah k
<Aero> I wonder if it's even compatible with your comp
<formerdeathcorps> OK...Aero, if you're good with this
<formerdeathcorps> we're going to talk about...load delay
<Aero> (Link: http://64digits.com/users/AeroGP/asm_maze.rar)http://64digits.com/users/AeroGP/asm_maze.rar
<Aero> k
<formerdeathcorps> Choto, you probably should stay here
<Aero> you won't be able to compile it, but an executable is available
<Aero> and the code is readable
<formerdeathcorps> all right.
<formerdeathcorps> let's finish up
<Aero> k
<formerdeathcorps> Load Delay
<formerdeathcorps> this is important
<formerdeathcorps> and one of my first assignements to all of you
<formerdeathcorps> would be to fix Pokeytax and Xif's work
<formerdeathcorps> namely, here's the problem
<formerdeathcorps> every branch and jump command
<formerdeathcorps> will execute the command after it
<formerdeathcorps> before it jumps
<formerdeathcorps> this is not true in EVERY assembly language
<formerdeathcorps> it's actually particular only to early versions of MIPS
<formerdeathcorps> what this means, though
<formerdeathcorps> is that we can do stuff like
<formerdeathcorps> addu STUFF
<formerdeathcorps> jump
<Aero> that sounds easy enough - you just move the last command down into the branch as if the branch starts after it
<formerdeathcorps> right
<formerdeathcorps> there's only one thing
<formerdeathcorps> there's also what is known as a pipeline hazard
<formerdeathcorps> this occurs first because each MIPS command has 4 stages
<formerdeathcorps> and while the first command runs, the second command starts
<formerdeathcorps> this can lead to paradoxes of time
<formerdeathcorps> this is called a pipeline hazard
<formerdeathcorps> MIPS can catch some of the more obvious ones
<Aero> so commands are semi-threaded?
<formerdeathcorps> but not all of them
<formerdeathcorps> *yes, Aero
<Aero> interesting
<formerdeathcorps> they're threaded 4 deep
<formerdeathcorps> *no more than
<Aero> i can see how that'd result in paradoxes
<formerdeathcorps> to avoid this
<formerdeathcorps> the rules are as thus
<formerdeathcorps> if you load a variable
<formerdeathcorps> *load a value into a register
<formerdeathcorps> you can't use it immediately after
<Aero> because it isn't executed right away
<formerdeathcorps> correct
<Aero> got it
<formerdeathcorps> another thing
<formerdeathcorps> if you use mult or div
<formerdeathcorps> and then mfhi mflo
<formerdeathcorps> you can't use mult or div again for the next two commands after the mfhi / mflo
<formerdeathcorps> or you'll mess up the values of hi and lo
<Aero> because it takes 2 steps to release hi and lo?
<formerdeathcorps> correct
<formerdeathcorps> mult and div take longer
<formerdeathcorps> than other commands
<Aero> right
<formerdeathcorps> also...one more thing...
<formerdeathcorps> you can't store a register's value into a location
<formerdeathcorps> and then load that location right after
<formerdeathcorps> ...it's the inverse of loading
<formerdeathcorps> but it's the same kind of problem
<formerdeathcorps> as you can imagine
<Aero> ic
<formerdeathcorps> this can get tricky if you do stuff like
<formerdeathcorps> addiu r3, r0, 0x00C0
<formerdeathcorps> jal PLACE
<formerdeathcorps> lbu r2, PLACE (r1)
<formerdeathcorps> *PLACE2
<Aero> so in general, ram manipulation takes a step to finalize, so don't do anything funny with addresses right after you've modified them
<formerdeathcorps> Right
<formerdeathcorps> just remember that if you jump
<formerdeathcorps> this is also possible
<Aero> okay
<formerdeathcorps> because you execute that lbu right before the first step
<formerdeathcorps> so you probably shouldn't use r2
<Aero> k

Your homework: grab Xifanie's Ability Requirements Hack (ARH). Transcribe each line and point out any and all pipeline hazards.

Hint: Whatever it says in BATTLE.BIN as an offset, add +0x67000... ~Formerdeathcorps
Quote from: Tycho"There are a number of different factors impacting server connectivity on Xbox 360," the spokesperson said. "It is a particularly complex server architecture and we continue to work with Microsoft to improve connectivity."

I don't want to bolster any "violent gamer" tropes, but that statement makes me want to improve the connectivity of my front two knuckles with their esophagus.  I wonder how Brenna would respond if I told her that "fidelity" was complicated.

Glain

Gah. I keep hearing about how Square does things this way or that, when you're dealing with the specifics of how things like multiplication are done in the ASM. Almost every single thing you're attributing to Square is actually being done by their compiler. I'm not saying there aren't legit things to point out about Square's code (hardcoding is a big offender, and some of the stuff you mentioned about rounding errors is relevant), but a lot of this stuff... they probably didn't have anything to do with. As far as I know, for example, they probably did something like:

return (fix)(1/3) * number; // No FPU, using fixed point

and the compiler created something like:

lui r3,0x5555
ori r3,r3,0x5556
mult r3,r4
mfhi r2
jr r31
nop

It's not as if they went "HMMM... 0x55555556 is how to represent 1/3". Same with the percents. The 32 is probably because it's 2^5 and the compiler wanted to do a bit shift.

Also... you memorize opcodes?! That amazes me. Also, they're only 6 bits. Trying to break up an encoded instruction by byte isn't going to work that well. Opcodes are 6 bits, register indexes are 5, shift amount is... 5, I think... jump addresses are 26... it doesn't cleanly divide into eights (bytes). You need to use binary to represent them.

Regarding absorb... very interesting. Are you saying that if you do negative damage, it counts as absorb? The way the elemental  absorb routine (0x1870fc) does it, it checks to see if you absorbed the attack and if you did, it takes the HP damage, moves it to HP healing, sets the HP damage to 0, and sets the ability type to [HP Healing].
  • Modding version: Other/Unknown

formerdeathcorps

Quote
Regarding absorb... very interesting. Are you saying that if you do negative damage, it counts as absorb? The way the elemental  absorb routine (0x1870fc) does it, it checks to see if you absorbed the attack and if you did, it takes the HP damage, moves it to HP healing, sets the HP damage to 0, and sets the ability type to [HP Healing].


No, that's not what's supposed to happen, though I may have accidentally implied that.  All finalized damage in the game is treated as if it was signed, though.  This is why mult is used almost exclusively over multu in the damage calculation steps (and why you have 5555 5556 instead of AAAA AAAB).  Of course, it doesn't quite matter since when you store data from registers, the signs are ignored.  It's also worth noting that all the original loads of PA / MA / SP / X / Y are unsigned and the results are guaranteed within the part of the number line where unsigned = signed (often quite forcefully on the stat up/down routines), so there are no discrepancies with the results.  The fact both are used is probably a holdover of the production process: different teams worked on adjoining pieces of code, but one team used unsigned int, and other used signed int.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Glain

The book I used shows 5 stages for MIPS instructions... basically the ones shown in this link.

Memory loading is where you have to watch out for delay (Load delay):

lbu r4,0x0034(r5)
addi r4,r4,1               # Oops, pipeline hazard - load delay - r4's value isn't loaded yet.

Memory storing may also have the same one command delay, but, well...?

sb r4,0x0034(r5)        # Save the value to memory...
lbu r4,0x0034(r5)       # Now load it from memory, even though it's still in the register, for no reason! \o/

And if you do that, then, well, uh...  :shock:
So there's nothing to worry about with storing values to memory, it's just the loading that you have to watch out for.

We talk about avoiding pipeline hazards here.
  • Modding version: Other/Unknown

Pickle Girl Fanboy

FDC's Lesson on MIPS R3000A syntax

16:13    PickleGirlFanboy: hey
16:13    PickleGirlFanboy: i have about an hour
16:13    formerdeathcorps: sure
16:13    PickleGirlFanboy: care to explain some of the syntax of mips r3000a, and answer some questions for me
16:14    formerdeathcorps: ok
16:14    formerdeathcorps: COMMAND rD, rA, rB
16:14    PickleGirlFanboy: reverse polish notation, correct?
16:14    formerdeathcorps: these are known as R type commands
16:14    formerdeathcorps: this means you do the operation A COMMAND B
16:14    formerdeathcorps: and apply the result to D
16:15    PickleGirlFanboy: what about stuff in parenthesis
16:15    formerdeathcorps: it's not post-fix
16:15    formerdeathcorps: next type of commands
16:15    formerdeathcorps: COMMAND rD, OFFSET (rS)
16:15    PickleGirlFanboy: and i'm screencapping this
16:16    formerdeathcorps: in this case, you apply the command at rS + Offset
16:16    formerdeathcorps: and you either write to rD
16:16    formerdeathcorps: or you dump rD's contents to rS + OFFSET in memory
16:16    PickleGirlFanboy: depending on the command?
16:18    PickleGirlFanboy: and that's it? just those two types?
16:18    formerdeathcorps: well...yeah
16:18    formerdeathcorps: because the only commands like this
16:18    formerdeathcorps: are load and store
16:19    PickleGirlFanboy: i mean just those two types of commands to worry about: COMMAND rD rA rB; and COMMAND rD, OFFSET (rS)
16:19    formerdeathcorps: Oh no
16:19    formerdeathcorps: there's more
16:20    PickleGirlFanboy: how many
16:20    formerdeathcorps: there's also COMMAND rD, rS, OFFSET
16:20    formerdeathcorps: here, you apply COMMAND to rS by the amount of the OFFSET
16:20    formerdeathcorps: 3 main types, and a few subtypes
16:20    formerdeathcorps: and you dump the result in rD
16:21    formerdeathcorps: collectively, commands of the form COMMAND rD, rS, OFFSET or COMMAND rD, OFFSET (rS)
16:21    formerdeathcorps: are known as I type commands
16:21    PickleGirlFanboy: i or 1?
16:21    formerdeathcorps: I
16:21    PickleGirlFanboy: gotcha
16:21    formerdeathcorps: I stands for Immediate
16:21    formerdeathcorps: because the OFFSET
16:21    formerdeathcorps: because the IMMEDIATE value
16:21    formerdeathcorps: can be used as a offset
16:21    formerdeathcorps: or a number
16:22    formerdeathcorps: except in logical operations, though
16:22    formerdeathcorps: it is always signed
16:23    formerdeathcorps: then there's the last type
16:23    formerdeathcorps: J commands
16:23    PickleGirlFanboy: and, IMO, I'm a decent writer - I'm not "good" because I haven't sold anything (because I haven't tried yet, homeless), but I can read your writing and critique it
16:23    formerdeathcorps: COMMAND: OFFSET
16:24    formerdeathcorps: or COMMAND: REGISTER
16:24    formerdeathcorps: J stands for jump
16:24    formerdeathcorps: all they do is jump to a place
16:24    formerdeathcorps: thanks, PGF
16:24    formerdeathcorps: in either case, any value in the register is read as an offset
16:25    formerdeathcorps: then there's a few oddballs
16:25    formerdeathcorps: lui rD, VALUE
16:25    formerdeathcorps: gives rD the value of VALUE in the upper 2 bytes and 0000 in the lower 2 bytes
16:25    formerdeathcorps: mflo rD takes the value in the register lo
16:25    formerdeathcorps: and stuffs it into rD
16:25    formerdeathcorps: mfhi is the same, but for the register hi
16:26    formerdeathcorps: obviously, you have the corollary mtlo/hi, which dump stuff into those registers
16:26    formerdeathcorps: ...any questions?
16:26    PickleGirlFanboy: wait a minute I'm copying and pasting
16:27    PickleGirlFanboy: are you sure floating point math isn't used in FFT?
16:27    PickleGirlFanboy: it's used extensively in saga frontier
16:27    PickleGirlFanboy: according to zaraktheus
16:27    formerdeathcorps: MIPS isn't the most space-conservant system for opcodes
16:27    formerdeathcorps: hence, the code will always be somewhat larger
16:27    formerdeathcorps: It is not, PGF
16:27    formerdeathcorps: the PSX machine can't do floating point.
16:28    formerdeathcorps: it's possible to simulate floating point though
16:28    PickleGirlFanboy: he did talk about weirdness
16:28    formerdeathcorps: It's not going to be your standard floating point
16:28    formerdeathcorps: it would have to be an improvised system
16:28    formerdeathcorps: of doing the same thing
16:29    PickleGirlFanboy: improvised - that's the definition of saga froniter
16:30    PickleGirlFanboy: and i actually do know a lot about writing fiction. i've read - almost memorized a few textbooks on the matter, and the only book i now own is eb white & william strunk's elements of style
16:30    formerdeathcorps: Anyways...back to MIPS
16:30    PickleGirlFanboy: i can recommend useful books, i'm saying
16:30    formerdeathcorps: it's one of the more intutive systems out there
16:30    formerdeathcorps: And its opcodes are structured logically
16:30    formerdeathcorps: so they're relatively easy to remember
16:31    formerdeathcorps: and are also structured for relatively simple construction and runtime
16:31    formerdeathcorps: Also, because it's 32 bit
16:31    formerdeathcorps: you have free range for logical comparators
16:31    formerdeathcorps: something 16 bit ASM languages lack
16:32    formerdeathcorps: Are there more space conservant langauges out there? Yes
16:32    formerdeathcorps: but those tend to be hard to upgrade
16:32    formerdeathcorps: because you don't have the space to make more commands
16:32    formerdeathcorps: without overriding functionality of old systems
16:32    PickleGirlFanboy: so mips has room to grow?
16:32    formerdeathcorps: and 32-bit space conservant commands do like 3-4 things at once
16:33    formerdeathcorps: so it's nearly impossible to read
16:33    formerdeathcorps: if you don't believe me
16:33    formerdeathcorps: open up your VBA
16:33    formerdeathcorps: and look at any game boy game in ARM
16:33    formerdeathcorps: ...it's a disaster, trying to read any of that
16:33    formerdeathcorps: yes, MIPS has much more room to grow
16:33    formerdeathcorps: though the commands MIPS added for later versions
16:33    formerdeathcorps: were mostly bug fixes and double (64-bit) and float specific supports
16:35    PickleGirlFanboy: got about 5 minutes left
16:35    formerdeathcorps: Questions?
16:35    PickleGirlFanboy: just anything else u think i need to know as i get into this
16:36    PickleGirlFanboy: would it be useful to memorize which bits correspond to which instructions, registers, and possible values?
16:37    formerdeathcorps: Yes
16:37    formerdeathcorps: or...rather
16:37    formerdeathcorps: you should know how to do it
16:37    formerdeathcorps: in case you are away from your commputer
16:37    formerdeathcorps: or are trying to hack some other game
16:37    formerdeathcorps: ...in another assembly langauge you don't recognize
16:37    formerdeathcorps: now...should you be doing it habitually?
16:37    formerdeathcorps: no
16:37    formerdeathcorps: because massHex
16:37    formerdeathcorps: by Glain
16:37    formerdeathcorps: does it all for you
16:38    PickleGirlFanboy: one of the texbooks i pirated had tables in it, so that should be useful. wait, what? other asm languages use the same bits for similar things?
16:38    PickleGirlFanboy: ...in another assembly langauge you don't recognize
16:38    PickleGirlFanboy: ^Refering to this
16:39    PickleGirlFanboy: and fyi, masshexasm doesn't work for me, unless i feel like downloading the latest java and setting it up - i'm kinda worried it might affect the stability of my computer, so instead i'll try to get the windows version to work with wine.
16:40    formerdeathcorps: No
16:40    formerdeathcorps: every assembly language
16:40    formerdeathcorps: must use opcodes
16:40    formerdeathcorps: of some kind
16:40    formerdeathcorps: just they won't use the same setup as MIPS
16:40    formerdeathcorps: but they'll use opcodes
16:40    formerdeathcorps: either in little or big endian format
16:40    formerdeathcorps: so knowing how to decode these things
16:40    formerdeathcorps: is good
16:41    PickleGirlFanboy: ok, thanks.
16:41    PickleGirlFanboy: i got a ways to go before i start programming in a high level language - like a year, probably, if i don't fail any math classes
16:41    PickleGirlFanboy: but the first two projects i do for myself will be
16:42    PickleGirlFanboy: a hex editor with features i wish i had when i was save state hacking
16:42    PickleGirlFanboy: for linux
16:42    PickleGirlFanboy: and a linux assembler and disassembler, probably for mips, and for snes or gba asm if i ever get around to finishing my projects for those games
16:43    formerdeathcorps: ok
16:43    formerdeathcorps: sounds good
16:43    formerdeathcorps: but I will tell you
16:43    PickleGirlFanboy: unrelated, this is just what i think about when walking around town, waiting for places to open up
16:43    formerdeathcorps: a disassembler
16:43    PickleGirlFanboy: ^all that stuff, i mean
16:43    formerdeathcorps: is not fun to code
16:43    PickleGirlFanboy: excessive tedium?
16:44    PickleGirlFanboy: oh yeah, and a library for input/output in ps1 disc images, too
16:45    formerdeathcorps: What do you mean there?
16:45    PickleGirlFanboy: input/output?
16:45    PickleGirlFanboy: in ps1 disc images?
16:45    PickleGirlFanboy: is that what ur askin gabout?
16:45    formerdeathcorps: oh
16:46    formerdeathcorps: you mean the ability to read it regardless of the file format?
16:46    PickleGirlFanboy: exactly
16:46    formerdeathcorps: and then distinguish between JP/EU/USA
16:46    formerdeathcorps: PAL or whatever else?
16:46    PickleGirlFanboy: to alter game files inside the disc image, instead of the disc image iteslf - and to recognize paths, and update disc image-y things
16:47    PickleGirlFanboy: because patching disc images directly = stupid
16:47    PickleGirlFanboy: what if the disc image is expanded, and your data table is moved?
16:48    PickleGirlFanboy: or a file is shrunk, for that matter, which comes before your data table in the disc image?
16:48    PickleGirlFanboy: also, you can't expand shit in a disc image, you gotta move EVERYTHING around (or so i imagine)
16:48    PickleGirlFanboy: working with the actual files and directories inside the disc image is much smarter, i think
16:50    PickleGirlFanboy: ok, see you later - thanks for the syntax (and, seemingly, semantics) tutorial