[02:40] <@RadioSprite> satsu
[02:40] <@RadioSprite> if you still have enough brain power left at this time of the night
[02:40] <@RadioSprite> do you want to do the filerna thing now?
[02:41] <satsu> yeah, sure. lemme just do a quick edit and you'll have my fool attention.
[02:41] <@RadioSprite> send me the game, too.
[02:41] <@RadioSprite> you're allowed.
[02:41] <satsu> arrite.
[02:41] <@RadioSprite> this kind of a hack takes about five minutes if you know what you're doing.
[02:42] <satsu> yay!
[02:42] <satsu> unfortunately, i rarely do. :P
[02:42] <@RadioSprite> I'm gonna teach ya a few things
[02:43] <@RadioSprite> #1, I'm going to teach you how to find a compression routine and how to bypass it
[02:43] <@RadioSprite> #2, I'm going to teach you how to use the SNES' direct-memory access transfer capabilities
[02:43] <satsu> i see. o_o
[02:44] <@RadioSprite> you'll need to know a few things
[02:44] <@RadioSprite> you'll need to know how to load and store data using ASM
[02:44] <@RadioSprite> you'll need lordtech's Hex2SNES
[02:44] *** Disconnected
[02:47] *** Attempting to rejoin...
[02:47] *** Rejoined channel #romhACKing
[02:48] <@RadioSprite> er
[02:48] <@RadioSprite> ASM2Hex rather
[02:48] <@RadioSprite> Hex2SNES is the J2E address conversion utility, and that's useful too
[02:48] <@RadioSprite> You're also going to need to be logging this so I can submit it as an article on RHDO
[02:48] <satsu> yeah, i have irc logging always on.
[02:49] <satsu> good thing this isn't in #romhack, or i'd have a 12mb+ log to go through. :P
[02:49] <@RadioSprite> You'll also need LordTech's SNES9X tracelogger thingie.
[02:49] <@RadioSprite> you're allowed again
[02:49] <@RadioSprite> I'll piece together your logs, by the way.
[02:49] <satsu> k.
[02:50] <satsu> alright, i have asm2hex and snes9xlt.
[02:50] <@RadioSprite> Is Filerna hirom or lorom?
[02:50] <satsu> i think it's lorom.
[02:50] <@RadioSprite> Generally, HiROM and LoROM don't make a huge hell of a lot of difference except when calculating pointers
[02:50] * @RadioSprite curses
[02:50] <@RadioSprite> I hate lorom.
[02:51] <@RadioSprite> Alright though, we'll deal.
[02:51] <@RadioSprite> Grab Hex2SNES while you're at it, it helps a LOT for lorom->absolute conversions.
[02:51] <satsu> got it.
[02:51] <@RadioSprite> Okay.
[02:51] <@RadioSprite> Now, you probably know the difference between hirom and lorom
[02:52] <@RadioSprite> but for the benefit of those who might be reading the log, I'm gonna explain them.
[02:52] <satsu> yes, sensei!
[02:52] <@RadioSprite> Act like you don't know what they are ^_^
[02:52] <satsu> i barely know it, so it's cool. ^^;
[02:52] <@RadioSprite> Basically, SNES programs are divided into "banks" of data. Databanks, if you will.
[02:53] <@RadioSprite> When you're dealing with LoROMs, each bank is 32K in size, or $8000.
[02:53] <@RadioSprite> When you're dealing with HiROMs, each bank is 64K in size, or $10000.
[02:54] <@RadioSprite> When writing code or moving data around, you -cannot- exceed these bank boundaries.
[02:54] <@RadioSprite> You can rig things up to read from a different bank than you're in, but you can't have one continuous piece of data crossing the bank boundary.
[02:54] <@RadioSprite> You got all that?
[02:54] <satsu> i can dig it.
[02:54] <@RadioSprite> Alright, now addressing.
[02:55] <@RadioSprite> The "origin" of an SNES program can vary, but for the sake of argument, we'll call it $0, the first byte in the file.
[02:55] <@RadioSprite> When you're doing hirom addressing, that's actually $C0:0000 or $C0/0000.
[02:56] <satsu> k. (incidentally, the rom i sent you doesn't have a header.)
[02:56] <@RadioSprite> I think it can also be $00/0000 but I've never actually seen mirrored hirom before.
[02:56] <@RadioSprite> satsu- alright, that's good.
[02:56] <@RadioSprite> that makes things much less of a pain in the arse.
[02:56] <satsu> question!
[02:56] <satsu> what does mirrored mean?
[02:56] <@RadioSprite> Kids, always remove your headers from your SNES roms before playing with them!
[02:56] <ipkiss> heh
[02:56] <@RadioSprite> Basically...
[02:56] <@RadioSprite> It's -kind of- hard to explain
[02:57] <@RadioSprite> When you have a mirrored address, it means the same thing, I guess
[02:57] <@RadioSprite> Lemme use lorom as an example, cuz I know how lorom mirroring works.
[02:57] <@RadioSprite> When dealing with lorom programs, the origin is either $00/8000
[02:58] <@RadioSprite> or it's $80/8000.
[02:58] <@RadioSprite> So basically, $00 and $80 are "mirrored" lorom banks
[02:59] <@RadioSprite> When you access data at either $80/8000 or $00/8000, you'll always get the same thing.
[02:59] <satsu> hm, i see.
[02:59] <@RadioSprite> Also notice that when you're dealing with LoROM, addresses in each individual bank start at $8000
[03:00] <@RadioSprite> if you try to access data in the $0000-$7FFF address range, you're pulling at memory
[03:00] <@RadioSprite> you don't want to do that unless you have to :)
[03:00] <@RadioSprite> unless you -really- know what you're doing.
[03:00] <satsu> which i don't, so let's leave it at that. :)
[03:00] * @RadioSprite nods
[03:01] <@RadioSprite> me throw filerna on disk, and we'll start with the routines and stuff.
[03:01] <@RadioSprite> Also note that you'll need ZSNES for this, too.
[03:01] <satsu> k.
[03:01] * satsu notes
[03:02] <@RadioSprite> which reminds me that you'll also be learning how the SNES' memory is set up in a ZSNES savestate.
[03:02] <@RadioSprite> You can theoretically do this with an SNES9X savestate too, but the format's a bit weird, and it's compressed on top of that
[03:02] <@RadioSprite> The SNES savestate format is constant.
[03:03] <@RadioSprite> the ZSNES savestate format, rather
[03:03] <@RadioSprite> Therefore it's easier to work with ^_^
[03:03] * satsu nods
[03:04] <satsu> i should probably note that filerna will not work with the newer zsnesses.
[03:04] <satsu> ZSNES 1.337 works fine though.
[03:05] <@RadioSprite> how 'bout .988c? :p
[03:05] <@RadioSprite> I use zsnes dos for most of my debugging, it loads faster
[03:05] <satsu> dunno.
[03:06] <satsu> zsnes dos runs REALLY slow on my computer for some reason, though.
[03:06] <@RadioSprite> alright, now the piece you want is the battle font, right?
[03:06] <@RadioSprite> the 8x8?
[03:06] <satsu> yeah.
[03:06] <satsu> 2bpp, 8x8.
[03:06] <@RadioSprite> Use whatever you want, it shouldn't make much of a difference.
[03:06] <@RadioSprite> just so long as you can get a zsnes format savestate out of it.
[03:06] <satsu> k.
[03:08] <@RadioSprite> Okay well, this is going to be a little bit tough.
[03:08] * Looking up Naoya user info...
[03:08] <@RadioSprite> My first try when saving state turned up the font at $2CC13.
[03:08] <@RadioSprite> Now the time for savestate layout lesson.
[03:09] <satsu> with added engrish! :D
[03:09] <@RadioSprite> Not just any engrish!
[03:09] <@RadioSprite> That's MACROSS engrish!
[03:09] <@RadioSprite> Anyway, moving on.
[03:09] <@RadioSprite> The first $C12 bytes of a zsnes savestate are information for ZSNES itself. A header, if you will.
[03:09] <@RadioSprite> Starting at $C13 is the first bank of RAM, $7E.
[03:10] <@RadioSprite> Starting at $10C13 is the -second- bank of RAM, $7F.
[03:10] <@RadioSprite> Banks $7E and $7F are the same no matter what addressing mode you're in.
[03:11] <@RadioSprite> Except for maybe the screwy addressing mode that rom images greater than 32mbit/4mbyte use, but we won't go there.
[03:11] * satsu nods
[03:11] <@RadioSprite> Starting at $20C13 is VRAM.
[03:11] <@RadioSprite> VRAM is evil.
[03:11] <@RadioSprite> Well, not really.
[03:12] <@RadioSprite> But generally speaking (and I may be eating my words later) you can -only- write to vram during the NMI period, which lasts for just over 8000 CPU cycles
[03:12] <@RadioSprite> doing loop-heavy stuff like decompressing a font is generally not something you want to have a time limit on
[03:12] <@RadioSprite> So what usually happens is compressed data gets dumped somewhere in normal RAM and is later transfered to VRAM.
[03:13] <@RadioSprite> You want to try to get a savestate with the compressed font in RAM, not in VRAM.
[03:13] <@RadioSprite> Most likely, it's the battle initialization code which does this (during the big black screen after it says FILERNA 6(kanji)
[03:14] <@RadioSprite> and before the battle starts
[03:14] <satsu> k.
[03:14] <@RadioSprite> so try doing savestates and such real quick during that time, and if you can manage to get the font in normal ram, great
[03:14] <@RadioSprite> if not, I'll try too, and if I get it before you I'll send you the state.
[03:14] <satsu> alright!
[03:14] <@RadioSprite> wow, I just got a BSOD and recovered o_O
[03:15] <satsu> @_@
[03:15] <satsu> you want to reboot?
[03:15] <@RadioSprite> nah
[03:15] <@RadioSprite> I'll be k
[03:16] <satsu> k.
[03:19] <@RadioSprite> (This is usually the hardest part, if you haven't guessed ^^)
[03:19] <satsu> hooray!
[03:21] <@RadioSprite> damn, I missed it
[03:21] <@RadioSprite> this is where zsnes' rewind key comes in handy
[03:21] <satsu> yeah, i just missed it too. :P
[03:22] <satsu> rewind key? o_O
[03:22] <@RadioSprite> 'cept my version doesn't have one ^^;
[03:22] <satsu> damn, i never knew that.
[03:22] * satsu binds the slowdown key
[03:25] <@RadioSprite> HMMM
[03:25] <@RadioSprite> ahah
[03:25] <@RadioSprite> I think I might have something.
[03:25] <satsu> !!
[03:26] <@RadioSprite> nope, never mind
[03:26] <satsu> -_-
[03:26] <@RadioSprite> trust me, it's better :p
[03:28] <@RadioSprite> almost there.
[03:30] <satsu> i have a savestate with SOME of the font in ram...
[03:31] <@RadioSprite> that'll do fine, so long as it's the -first part- of the font, and not the last part.
[03:31] <@RadioSprite> we need to know where it starts, not where it ends.
[03:31] <satsu> d'oh.
[03:32] <satsu> this is harder than saturn disk swapping. @_@
[03:32] <@RadioSprite> hahah :)
[03:33] <satsu> damn, i got the end of the font again. >_<;
[03:35] <@RadioSprite> arrite, I got one with the entire thing.
[03:35] <@RadioSprite> one second, lemme floppyify it
[03:35] <satsu> aw, i lost. :(
[03:36] <@RadioSprite> to be honest, I ended up using zsnes dos' debugger to step 1000 instructions at a time once I started seeing it show up :p
[03:36] <@RadioSprite> (that's zsnes -d romname.smc for you dos junkies ^^)
[03:37] <satsu> cheater :P
[03:39] * @RadioSprite goes to get a can of sprite while waiting for satsu to accept the file
[03:40] <@RadioSprite> good timing ^_^
[03:40] <@RadioSprite> right then
[03:40] <@RadioSprite> as you can see, the font is located at $11D13 in the savestate
[03:41] <@RadioSprite> POP QUIZ What's the full address of that in ram?
[03:41] <satsu> agh$Q%%!
[03:42] * @RadioSprite taptaptap
[03:42] <satsu> hang on a sec, i'm figuring it out. x_x
[03:42] <@RadioSprite> okay
[03:42] <@RadioSprite> it should be pretty simple, but I suppose I've been doing this long enough...
[03:42] <satsu> i know it starts with 7F at least. :P
[03:42] <@RadioSprite> you better not be cheating :p
[03:42] <satsu> not yet. :P
[03:42] <@RadioSprite> yep, that's right
[03:43] <satsu> is it 7F:9D13?
[03:43] <@RadioSprite> Nope.
[03:43] <satsu> d'oh.
[03:43] <@RadioSprite> Not even close x_x
[03:43] <@RadioSprite> you're ballpark, but that's about it
[03:43] <@RadioSprite> remember the header file tacked onto the savestates.
[03:44] <satsu> oh yeah. :P
[03:44] <@RadioSprite> er, the header gunk, rather.
[03:44] <satsu> it's not 7F:9101 then, is it? :P
[03:44] <@RadioSprite> you're kind of close
[03:44] <@RadioSprite> it's $7F:0100
[03:44] <@RadioSprite> er
[03:44] <@RadioSprite> rather
[03:45] <@RadioSprite> $7F:1100
[03:45] <@RadioSprite> Now I know what I said about loroms and $8000 earlier, but that only applies to rom data, not ram
[03:45] <satsu> oh, ok.
[03:45] <@RadioSprite> but you should've been able to get at least $7F:X100 ^^;
[03:46] <satsu> yeah, i think i told a few times before math isn't my strong point. ^^;;;;;
[03:46] <satsu> or typing, it would appear. :P
[03:46] * @RadioSprite shrugs
[03:46] <@RadioSprite> well, so now you know that the font starts, in ram, at $7F:1100
[03:46] <@RadioSprite> You're gonna need some empty romspace for this too, you know
[03:46] <@RadioSprite> one second
[03:47] <@RadioSprite> actually
[03:47] <@RadioSprite> if you could point me to the not-compressed 8x8 font, that'd work too
[03:47] <satsu> the non-compressed one is 4bpp, does that make a difference?
[03:48] <@RadioSprite> ergh, yeah.
[03:48] <@RadioSprite> so much for that idea.
[03:48] <satsu> there's what appears to be free space starting at 106500...
[03:49] <satsu> enough for the font too, i think
[03:49] <@RadioSprite> I was just going to say that there's a decent-sized chunk at $FE300.
[03:49] <satsu> that'll work too.
[03:49] <@RadioSprite> but we'll use yours because you thought of it and it's your game and stuff.
[03:49] <@RadioSprite> remember though that we need more than enough for the font, we need enough for the new code too.
[03:50] <satsu> hm, let's just see which is bigger then.
[03:50] * @RadioSprite shrug
[03:50] <@RadioSprite> up to you ^_^
[03:50] <@RadioSprite> it's not gonna be a lot of code regardless.
[03:50] <satsu> well, at any rate, it would appear that yours is bigger than mine.
[03:52] <@RadioSprite> arrite satsu
[03:52] <@RadioSprite> time to haul out snes9x
[03:52] <@RadioSprite> numlock toggles tracing
[03:53] <@RadioSprite> play up to the point where it shows the FILERNA 6(kanji)
[03:53] <@RadioSprite> right before the first battle
[03:53] <@RadioSprite> as that text is fading out, hit numlock
[03:53] <satsu> k.
[03:53] <@RadioSprite> once the battle appears, hit numlock again to turn off tracing
[03:53] <@RadioSprite> this way, we capture the decompression routine as it happens.
[03:53] <satsu> for ease of typing, that kanji is read 'sai' btw. :P
[03:53] <@RadioSprite> alright.
[03:53] <satsu> k, i'm starting now.
[03:54] <@RadioSprite> Let me know when you have the trace.
[03:57] <satsu> yikes, 800kb trace
[03:57] <satsu> guess i started too soon? :P
[03:57] * @RadioSprite shrug
[03:57] <@RadioSprite> maybe, maybe not
[03:57] <satsu> k. are we going with that, then?
[03:58] <@RadioSprite> it'll be fine.
[03:58] <@RadioSprite> I just need to play with this a bit
[03:58] <@RadioSprite> see if I can find the routine
[03:59] <@RadioSprite> I might have actually started to early myself, hmm
[03:59] <satsu> i'll see if i can start a trace closer to the battle.
[04:00] <@RadioSprite> me too.
[04:00] <satsu> right on, only about 600kb this time. :P
[04:02] <@RadioSprite> heh :p
[04:02] <satsu> k, i think that's the best i'm gonna get.
[04:02] * @RadioSprite nods
[04:02] <@RadioSprite> this isn't exactly the best game to be teaching you this on
[04:03] <@RadioSprite> it's doing some weird crap
[04:03] <@RadioSprite> but I'll still do my best
[04:03] <satsu> heh, i don't think i've ever worked on a game that's normal. :P
[04:04] <@RadioSprite> hah.
[04:04] <@RadioSprite> Alright anyway, I found the routine.
[04:05] <@RadioSprite> Often, since we know that the font's getting dumped at $7F:1100, you can simply look for something like, say, $7F:11 in the trace
[04:05] <@RadioSprite> but that apparently didn't work here
[04:05] <@RadioSprite> so what I did was I searched for 1100 and tried to find a place where the game was loading $7F and putting it in a similar place
[04:06] <@RadioSprite> like, if it was storing 1100 at $00A0, it'd be storing the $7F at $00A2
[04:06] <@RadioSprite> (for example.)
[04:06] <@RadioSprite> Then I looked for subroutine jumps (JSL or JSR, typically)
[04:07] <@RadioSprite> I found one, opened up the rom, and overwrote each byte of it with $EA, which when translated into 65816 is "NOP" or "No Operation"
[04:07] <@RadioSprite> Using that information, see what you can find.
[04:07] <satsu> hm, ok...
[04:07] <@RadioSprite> We call NOP'ing a routine then testing it "Systematically breaking it."
[04:08] <@RadioSprite> If you break it and something doesn't happen that should (like the windows don't appear, for example) then you know you hit the nail on the head.
[04:08] <satsu> k.
[04:14] <@RadioSprite> moving right along
[04:15] <@RadioSprite> satsu- where was the routine you broke?
[04:15] <satsu> for the background?
[04:15] <@RadioSprite> I can tell you if you're in the right ballpark.
[04:15] <@RadioSprite> yeah.
[04:15] <satsu> hold on a sec.
[04:15] <@RadioSprite> certainly.
[04:16] <satsu> it's at 13651F.
[04:16] <@RadioSprite> I'm thinking you overshot it, but I could be wrong.
[04:16] <satsu> wait, which notation is this in? X_X
[04:16] <@RadioSprite> hmm, one sec.
[04:17] <@RadioSprite> either or
[04:17] <@RadioSprite> I can convert back and forth
[04:17] <@RadioSprite> that's $26/E51F lorom, right?
[04:17] <satsu> well, in the trace, it's at $26/E51F
[04:17] <satsu> yeah.
[04:17] <@RadioSprite> yeah, looks to me that you overshot it
[04:18] <@RadioSprite> but you have the right idea, so I'll tell you
[04:18] <@RadioSprite> you might've missed it
[04:18] <@RadioSprite> the JSL you need to break is at $02/895F in the trace.
[04:18] <@RadioSprite> Fortunately for you, it does the DMA to vram stuff after the JSL resolves, so we can do whatever the hell we please with it
[04:18] <satsu> w00t!
[04:19] <@RadioSprite> Now, if you don't have a 2bpp font pre-prepared to dump into the rom
[04:19] <@RadioSprite> you're going to have to pull the one out of ram
[04:19] <@RadioSprite> (or vram, if that's easier)
[04:19] <satsu> ok, hang on a sec.
[04:19] * satsu fires up tlp
[04:19] <@RadioSprite> use whatever means you normally use to copy fonts, tlp, hex workshop, whatever
[04:21] <@RadioSprite> Dump it into the rom at $FF000
[04:21] <satsu> k.
[04:21] <@RadioSprite> and since you're using TLP, make -sure- it's in the same format as it is in the savestate
[04:22] <satsu> damn, i wish i could get rid of those annoying toolbars/boxes of tlp's
[04:23] <@RadioSprite> Yeah, no kidding.
[04:26] <satsu> ok, it's in the rom and happy.
[04:27] <@RadioSprite> Alright, let me comment this routine for you. From this point on, it's basically a fill-in-the-blanks.
[04:27] <@RadioSprite> You're gonna have to give me a few minutes though, I don't have all the DMA regs memorized and I have to flip through my docs, and I haven't done this in a while
[04:27] <satsu> k. in the meantime, i'm gonna reconnect, because the time on this session is running low.
[04:28] <satsu> in other words, i'm going to go fill up the meter. :P
[04:28] <@RadioSprite> hahah, alright.
[04:28] *** Disconnected
[04:31] *** Attempting to rejoin...
[04:31] *** Rejoined channel #romhACKing
[04:31] <@RadioSprite> ooh, you're lucky
[04:31] <@RadioSprite> M is set on the accumulator
[04:32] <satsu> remind me what that means. ^^;
[04:32] <@RadioSprite> M is set on the status register, rather
[04:32] <@RadioSprite> that means the accumulator is always going to be reading a single byte instead of being in 16-bit (2-byte) mode.
[04:32] <@RadioSprite> In your trace, if you look at P: you can see what the status register's doing
[04:33] <@RadioSprite> if a letter is capitalized, it's set
[04:33] <satsu> k.
[04:33] <@RadioSprite> If it wasn't set, you'd have to SEP #$20 to set it
[04:34] <@RadioSprite> then you'd want to be sure to REP #$20 to clear it once you're done so it doesn't interfere with normal operations
[04:34] <@RadioSprite> (always gotta put things back the way you found them, if you want a mother's adage to go with this.)
[04:34] <satsu> k. :P
[04:42] <@RadioSprite> Almost done.
[04:43] <satsu> k.
[04:47] <@RadioSprite> Is it safe to say that you know how to load and store constants in 65816?
[04:48] <satsu> not really. let's quickly go over it.
[04:48] <@RadioSprite> alright then
[04:48] <@RadioSprite> since the M bit is set on the status register, we're working with an 8-bit accumulator
[04:48] <@RadioSprite> (which, quite frankly, is really nice for our purposes.)
[04:48] <@RadioSprite> LDA will load the accumulator with a value.
[04:49] <@RadioSprite> Since the accumulator is loaded as soon as our routine resolves (see the trace, scroll down to the RTL after the $26 bank numbers become $02s again)
[04:50] <@RadioSprite> we don't need to preserve the value in the accumulator. Hooray for us!
[04:50] <satsu> yay! we're great.
[04:50] <@RadioSprite> Now, if you wanted to load the accumulator with a value stored in the rom...
[04:50] <@RadioSprite> since we're working with LoROM, you can LDA $8000
[04:50] <@RadioSprite> that'd load A with whatever is at $(DB)/8000
[04:51] <@RadioSprite> where (DB) is the contents of the databank register, the DBR
[04:51] <@RadioSprite> or the DB: in our traces
[04:51] <satsu> ok...
[04:51] <@RadioSprite> an easy way to change that is to load A with a constant, push it onto the stack, then pull the DBR off of the stack
[04:51] <@RadioSprite> if we wanted to load the accumulator with a constant, we'd say LDA #$80
[04:52] <@RadioSprite> that'd dump the value #$80 into the accumulator
[04:52] <@RadioSprite> the # sign signifies a constant
[04:52] <@RadioSprite> (also note that we can LDA #$808000 to load directly from the rom without regard to whatever's in the DBR, I should have mentioned that earlier.)
[04:52] <@RadioSprite> er
[04:52] <@RadioSprite> LDA $808000 rather.
[04:52] <satsu> k.
[04:53] <@RadioSprite> But since that'll just load whatever's at $808000, and whatever's at $808000 is constant (Read Only Memory, remember) that's kind of pointless.
[04:53] <@RadioSprite> I won't get into indexed or indirect loading, that'll be another lecture.
[04:53] <satsu> so basically, we find where it says "get this from the ram", and change it to "get this from the rom"?
[04:53] <@RadioSprite> ...kind of, but not really.
[04:54] <@RadioSprite> We're overwriting the routine that pulls it from the rom and does the funky binary mumbo-jumbo and dumps it into ram with our own routine that just pulls it from the rom and dumps it into ram without the funky binary mumbo-jumbo.
[04:55] <satsu> ah, i understand.
[04:55] <@RadioSprite> you had the right idea
[04:55] <satsu> that was actually what i was thinking before you told me about loading direct from the rom. ^^
[04:55] <@RadioSprite> but rather than getting it from ram, we're getting it from the rom and putting it into ram.
[04:55] <@RadioSprite> Well, we could load it direct from the rom, but that's slow and tedious
[04:56] <@RadioSprite> so we're going to use the SNES' high-speed transfer capabilities!
[04:56] <satsu> and nobody likes tedium!
[04:56] <satsu> k.
[04:56] <@RadioSprite> We write a few bytes into special registers and it'll do all the stuff faster than we could with a different routine.
[04:56] <@RadioSprite> For now, all we need to know is that JSL $24-bit-address will jump us into a new subroutine at the 24-bit-address we specify
[04:57] <@RadioSprite> that RTL will return us from that subroutine
[04:57] <satsu> k.
[04:57] <@RadioSprite> that LDA #$80 will load the constat #$80 into the accumulator
[04:57] <@RadioSprite> and that STA $address will dump the contents of the accumulator into the address we specify.
[04:57] <@RadioSprite> In this case, the addresses we're specifying are special registers that control the SNES' high-speed DMA transfers.
[04:58] <satsu> (fanfare)
[04:58] <@RadioSprite> note that as asm2hex is a dos program, we're under the 8.3 filename constraints
[04:58] <@RadioSprite> which I almost always adhere to anyway
[04:59] <satsu> k.
[04:59] <@RadioSprite> I've explained how the DMA itself works in that text file, with my sample routine
[04:59] <@RadioSprite> so all you need to do is fill in the blanks, and "asm enf-dma.txt" and it should work.
[04:59] <satsu> okay!
[05:00] <@RadioSprite> Let me know if you have any problems, I'll be filling in the blanks myself.
[05:00] <satsu> alright.
[05:03] <@RadioSprite> Bingo, got mine working ^_^
[05:04] <satsu> i'll be a few minutes, i'm figuring it out. i think i'm getting a grasp on it though. ^^
[05:05] <@RadioSprite> sure thing!
[05:05] <satsu> are the last three blanks #$00, #$F0 and #$9F?
[05:07] <@RadioSprite> CLOSE.
[05:07] <@RadioSprite> Not quite.
[05:07] <@RadioSprite> Filerna's LoROM $00, not LoROM $80.
[05:07] <satsu> ah, i see.
[05:07] <@RadioSprite> (You can tell by looking at the tracelogs, if all the banks were above $80 you'd be correct.)
[05:08] <@RadioSprite> And you seem to be forgetting about the length blanks :)
[05:08] <satsu> oh yeah.
[05:08] <satsu> i didn't notice the scrollbar, oops.
[05:09] <satsu> damn, i wish i wrote down the number of bytes when i was copying and pasting it from the savestate. :P
[05:10] <satsu> want a filerna spc while you wait? :P
[05:10] <@RadioSprite> heh ^_^
[05:11] <satsu> k. are the length blanks #$30 and #$0F?
[05:11] <@RadioSprite> er, no :p
[05:11] <@RadioSprite> not even close ^^;
[05:12] <satsu> hm.
[05:12] * satsu rereads the comment
[05:13] <satsu> hm, i'm somewhat puzzled by that one. =/
[05:13] <@RadioSprite> okay then
[05:13] <@RadioSprite> how big is the chunk of data?
[05:14] <@RadioSprite> you're transferring the entire font, right
[05:14] <@RadioSprite> it starts at $FF000, and it ends where?
[05:14] <satsu> yeah.
[05:14] <satsu> $FFFD0
[05:14] <@RadioSprite> not quite
[05:14] <@RadioSprite> you must've accidentally missed some tiles
[05:15] <@RadioSprite> save state in battle, and pull the full font out of vram
[05:15] <satsu> k, hold on.
[05:17] <satsu> thank god the in-battle dialogue doesn't use a separate font.
[05:17] <@RadioSprite> hahah, yeah, that'd require some hefty magic to fix if it did
[05:18] <satsu> yeah. it doesn't get the shadow in battle, though. :(
[05:18] <@RadioSprite> I don't think that's something I could teach in a single tutorial session, this one's already lasted two hours
[05:18] <satsu> yeah, really. :P
[05:18] <@RadioSprite> ...I might be able to add the shadow for you
[05:18] <@RadioSprite> but I don't think I'd want to try it
[05:18] <satsu> ah, don't worry about it.
[05:19] <satsu> hm, it looks like i have the full font. x_x
[05:19] <@RadioSprite> weird
[05:20] <@RadioSprite> there's hmm
[05:20] <satsu> where does yours end?
[05:20] <@RadioSprite> the last few tiles should be window border
[05:20] <@RadioSprite> the very last should be blank
[05:20] <satsu> yeah, i just added two blank tiles just to make sure.
[05:20] <@RadioSprite> To make sure of what? o_O
[05:21] <@RadioSprite> that it's displaying?
[05:21] <satsu> i dunno, they're probably used somewhere. :P
[05:21] <@RadioSprite> so you're still trying to break it to make sure it works then?
[05:21] <@RadioSprite> if that's what you're doing, that's fine
[05:21] <@RadioSprite> but for the sake of argument, transfer the entire $1000 chunk of data
[05:22] <satsu> #$00 and #$10, right
[05:22] <@RadioSprite> because you'll probably need to put those tiles back in, and then you'll be wondering why they're not showing up :p
[05:22] <@RadioSprite> yes.
[05:23] <satsu> hm, hang on a sec.
[05:26] <satsu> i still need to fill in my first set of blanks. we're writing to the same address in ram as the game was before, right?
[05:28] <@RadioSprite> Correct.
[05:28] <@RadioSprite> Or, if you want, you can write elsewhere and watch the game puke.
[05:28] <satsu> maybe another time.
[05:29] <satsu> that's 7F:1121, right?
[05:29] <satsu> wait, i think i messed up again. :P
[05:29] <@RadioSprite> yep :p
[05:30] <@RadioSprite> unless you wanted to make the game puke ^_
[05:30] <@RadioSprite> ^
[05:30] * @RadioSprite mutters something about "editing this later"
[05:30] * satsu writes future messages in coded slurs against people
[05:31] <satsu> ok. so, in the savestate, the font starts at 011D33. so i subtract C12 from that first, yes?
[05:32] <@RadioSprite> subtract $C13.
[05:32] <satsu> ah, k.
[05:32] <@RadioSprite> and it doesn't really start at 011D33
[05:32] <@RadioSprite> it starts at 011D13, but there just happen to be two blank tiles in it
[05:32] <satsu> !!
[05:33] <satsu> ok, after i do this, i need to fix my rom. :P
[05:33] <@RadioSprite> generally speaking, most games like writing to addresses with at least two zeroes on the end :p
[05:33] <@RadioSprite> heheh ^^;
[05:33] <satsu> ok, so anyway, after subtracting for the header i have 011120. so i just have to convert that into a ram address, right?
[05:35] <@RadioSprite> You're working with the old address again :p
[05:35] <satsu> oh yeah.
[05:35] <@RadioSprite> You need to be working with 011D13, remember
[05:35] <satsu> ok, so after doing it right for a change, i get 011100, then.
[05:36] <satsu> which is 7f:1100, right?
[05:36] <@RadioSprite> right
[05:36] <@RadioSprite> right, but you'd better re-read the comment before plugging 7f1100 into the regs
[05:36] <satsu> yeah, gotcha
[05:36] <satsu> so what goes into the blanks is 00, 11 and 01?
[05:37] <@RadioSprite> yep!
[05:37] <satsu> yay!
[05:37] * satsu grins
[05:38] <satsu> while i'm sorting out this font, shall i send you what i have?
[05:38] <satsu> easier than reading off the blanks and copying chunks at the same time.
[05:38] <@RadioSprite> it werk?
[05:38] <@RadioSprite> nah
[05:38] <satsu> haven't tried it yet, because i have to fix the font.
[05:38] <satsu> k.
[05:38] <@RadioSprite> you'll know if it's broken
[05:38] <satsu> heh. :P
[05:42] <satsu> ok. let's hope this mother works. :P
[05:43] <satsu> so the syntax for ASM.exe is ASM enf-dma.txt filerna.smc?
[05:43] * @RadioSprite crosses fingers
[05:43] <@RadioSprite> nope
[05:44] <@RadioSprite> since there's a %filename line in enf-dma.txt
[05:44] <@RadioSprite> you can omit the filerna.smc
[05:44] <satsu> k.
[05:44] <satsu> hm, it says i have a syntax error. :P
[05:45] <satsu> "enf-dma.txt: 3: syntax error at or before '#'.
[05:45] <satsu> #ROMTYPE LOROM
[05:45] <satsu> damn, i remember this from LaL. :P
[05:46] <@RadioSprite> yeah, you apparently have an older version of asm2hex
[05:46] <@RadioSprite> and unfortunately, lordtech didn't label them
[05:46] <satsu> i grabbed it off of romhacking.com...
[05:46] <satsu> er, .org
[05:46] <@RadioSprite> let me send you the version I have, we'll pack it with the log
[05:46] <satsu> k.
[05:46] <satsu> eek, it's bright outside. i think i'm gonna sleep in a lot again today.
[05:47] <@RadioSprite> you're gonna have to dccallow.
[05:47] <satsu> $^%%$"&^%"^dccallow
[05:47] <@RadioSprite> yes
[05:47] <satsu> %$&^^%%"$^added
[05:48] <satsu> ok! let's test!
[05:49] <@RadioSprite> alright!
[05:49] <satsu> almost!
[05:49] <satsu> i seem to be missing some window borders, and the - mark.
[05:49] <@RadioSprite> the - mark?
[05:49] <satsu> for katakana.
[05:50] <satsu> hm, " mark too.
[05:50] <@RadioSprite> hmm.
[05:50] <satsu> and hiragana @_@
[05:50] <@RadioSprite> you sure you put the right length in?
[05:51] <satsu> just about to check.
[05:52] <satsu> hm. i had 0A00 as the length, which i'm pretty sure was wrong.
[05:52] <satsu> probably a morning-math-mistake.
[05:53] <@RadioSprite> heh, that'd definately do it.
[05:53] <satsu> was it 1000?
[05:55] <@RadioSprite> yep
[05:55] <satsu> hm. i have 00 and 10 in the blanks, but it's still displaying wrong.
[05:55] <satsu> maybe i have the read start address wrong, but it's getting the katakana for "filerna" ok.
[05:56] <@RadioSprite> what do you have the start address fields written as?
[05:56] <satsu> 00. F0 and 1F.
[05:57] <@RadioSprite> that should be right.
[05:57] <satsu> hmm.
[05:58] <@RadioSprite> So you have $00, $11, $01
[05:58] <@RadioSprite> $00, $F0, $1F
[05:58] <satsu> yeah.
[05:58] <@RadioSprite> $00, $10
[05:58] <satsu> yep.
[05:58] <satsu> i guess i probably just messed the actual font up again.
[05:58] <@RadioSprite> and you dumped the full $1000 byte font at $FF0000?
[05:59] <satsu> yeah, it's all there.
[06:00] <satsu> it starts with two blank tiles, right?
[06:00] <@RadioSprite> Send me a picture of your TLP window.
[06:00] <@RadioSprite> at $FF000
[06:03] <@RadioSprite> yeah, you messed up copying the font again :p
[06:03] <satsu> d'oh. where'd i go wrong?
[06:03] <@RadioSprite> the bottom but (starting with the lower part of the dialogue window) should be two tiles to the right
[06:04] <@RadioSprite> the bottom BIT rather
[06:04] <@RadioSprite> which you'll probably notice once you look at the font in vram again
[06:04] <@RadioSprite> $2CC13
[06:05] <satsu> k, thanks
[06:07] <@RadioSprite> ah, but
[06:07] <@RadioSprite> I should probably stress that it'll be your font in vram
[06:07] <@RadioSprite> so you'll want to use an old savestate or an unhacked rom to get the font from
[06:07] <satsu> yeah, that's what i'm doing...
[06:08] <@RadioSprite> okay, just checking ^_^
[06:08] <@RadioSprite> gotta cover all the bases.
[06:08] <satsu> ah, i see my slaik.
[06:09] <@RadioSprite> That's good though. You learn more through mistakes.
[06:09] <@RadioSprite> I'll not go so far as to say that you'll never learn if you don't make mistakes, as that's probably not true
[06:10] <satsu> yes. and hopefully whoever reading this is learning a lot from my mistakes.
[06:10] <@RadioSprite> but you can definately learn from mistakes, and hopefully you won't make the same mistake next time
[06:10] <@RadioSprite> or if you do, you'll be able to recognize your mistake better.
[06:10] *** Hakai-zo (ZenMaster@h0005022d946a.ne.client2.attbi.com) has joined #romhacking
[06:10] *** ChanServ sets mode: +o Hakai-zo
[06:10] <@Hakai-zo> Zen!
[06:10] *** Hakai-zo (ZenMaster@h0005022d946a.ne.client2.attbi.com) has left #romhacking
[06:11] <satsu> heh.
[06:12] <satsu> victoly!
[06:12] <@RadioSprite> Great!
[06:12] <@RadioSprite> Now that you know approximately how to do DMA transfers
[06:12] <@RadioSprite> you can go to sleep a happy man, or something.
[06:13] <satsu> well, not really.
[06:13] <@RadioSprite> Okay, maybe not, but it sure didn't hurt.
[06:13] <satsu> i think before i go to sleep i might edit the font to match up with the changes i made to the 4bpp font.
[06:13] * @RadioSprite nods
[06:13] <satsu> anyway!
[06:13] <satsu> thank you very much for the lesson. it is greatly appreciated.
[06:13] <@RadioSprite> So that's that.
[06:13] <@RadioSprite> I hope I was a decent enough teacher.
[06:13] <@RadioSprite> That's the first time I've ever really tried to do anything like that.
[06:14] <satsu> @_@
[06:14] <satsu> yeah, you did a pretty good job, i think.
[06:14] <@RadioSprite> Ideally, this particular lecture would've been part of a course, and I wouldn't have had to cover addressing modes and how to load and store and notations and such
[06:14] <@RadioSprite> nor how to find a routine
[06:15] <satsu> well, that's ok, because i didn't know any of that stuff anyway.
[06:15] <@RadioSprite> but overall, I'm happy with how it turned out.
[06:15] <satsu> damn, i just remember i really hacked up the monster names. maybe i'll just sleep before working on the game some more.
[06:15] <satsu> besdies, i can barely type good any more.
[06:15] <@RadioSprite> Hah, okay :)
[06:16] <@RadioSprite> Glad I was able to help, anyway.
[06:16] <satsu> yeah, being able to read the names of stuff in battle is probably the most important part of this patch ^^;
[06:16] <@RadioSprite> well, you're doing the dialogue next, right?
[06:17] <satsu> yeah, if i get a translator.
[06:17] <@RadioSprite> You should just dump chunks onto MO's board
[06:17] <@RadioSprite> and/or submit a whirlpool ad
[06:17] <satsu> well, i have submitted an ad...
[06:17] <@RadioSprite> hrm, oh yeah
[06:17] <@RadioSprite> that's right
[06:18] <@RadioSprite> you were the first ad after my Heian Fuuunden ad.
[06:18] <satsu> ph33r.
[06:18] <satsu> hm. was it lennus 2 or something that had all the monster data sitting between the monster names?
[06:18] <satsu> actually, was that one of the romasagas?
[06:19] <@RadioSprite> Well, it was Blue Sphere for certain :p
[06:19] <satsu> heh. i think filerna does that too. :P
[06:19] <satsu> i've noticed a lot more crap than usual between the names. :P
[06:19] <@RadioSprite> well, it makes sense, really
[06:19] <@RadioSprite> load it all in one go
[06:19] <satsu> yeah, that's true. wonder why it's less common, though. :P
[06:20] <@RadioSprite> rather than pulling pieces from 15 different places in the rom
[06:20] <@RadioSprite> Neil_ will be happy to have a new article, anyway.
[06:20] <satsu> yeah, i would imagine so.
[06:21] <satsu> i will send another filerna spc and then go to bed.
[06:21] <@RadioSprite> okay
[06:21] <@RadioSprite> I think I'll go to bed too
[06:21] <@RadioSprite> this was tiring :p
[06:21] <satsu> isn't it midnight there anyway?
[06:21] <@RadioSprite> but then again, maybe I should work on RS2 and finish fixing the last bit of intro routine
[06:21] * @RadioSprite time am Tuesday, August 6, 2002 1:29:28 AM
[06:21] <satsu> Current local Brit-time is 6:21:55AM
[06:21] <satsu> i got you beat. goal!
[06:22] <@RadioSprite> I went to bed at 7 AM last week :p
[06:22] <satsu> i went to bed at 7am yesterday. :P
[06:22] <@RadioSprite> heheh
[06:22] <@RadioSprite> anyway, adjust ye log for html display, and send or something
[06:22] <@RadioSprite> tomorrow, not right now
[06:23] <satsu> k. is there something i can run it through to make it html kosher?
[06:23] * satsu lazy
[06:23] <@RadioSprite> I have no idea, I've never posted an IRC log anywhere.
[06:23] <@RadioSprite> but the <RadioSprite> and <satsu>s will not display properly.
[06:23] <satsu> yeah, they're also all colorcoded. :P
[06:24] <@RadioSprite> hehe
[06:24] <satsu> on my mirc setup, nicks are highlighted orange. :P
[06:24] <@RadioSprite> well, they'll just not be colored, or something
[06:25] <satsu> yay, found something.
[06:25] <satsu> alright, anyway, i'm going to bed now.
[06:25] <satsu> say night night satsu.
[06:25] <@RadioSprite> k, see you.
[06:25] <satsu> and thanks again.
[06:25] *** Disconnected
Session Close: Tue Aug 06 06:25:50 2002