+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Need a bit of expertise with BoF2.
Pages: 1 [2]
Author Topic: Need a bit of expertise with BoF2.  (Read 2 times)
creaothceann
Guest
« Reply #15 on: March 23, 2008, 02:33:04 pm »

The HDMA color fade won't work - as it is it'll only work on transparent BG2 pixels, and there are none of those.

You'll have to rewrite the HDMA table (it's loaded from C6:A9E2 and modifies $2132 aka the color constant register) to modify CGRAM instead, and change palette color 0.

EDIT: Alternatively you could just put all BG2 graphics to BG3 and vice versa, and enable color math only for BG3.
« Last Edit: March 23, 2008, 03:18:29 pm by creaothceann »
Ryusui
Guest
« Reply #16 on: March 23, 2008, 03:45:57 pm »

Thanks a lot. ^_^

I've got everything working except for the gradient. I'm fairly certain I know how to convert the data for $2132 into a BGR for $2122 (just take the intensity and shift it to get the blue value; zero out the rest), and I've modified the HDMA setup to write two bytes to $2122 each time ($10 in $4310, $22 in $4311), but I've changed the first few values of the table to test, and the background's still grayscale.

Any idea what I might be doing wrong?
creaothceann
Guest
« Reply #17 on: March 23, 2008, 04:07:21 pm »

Quote from: Ryusui on March 23, 2008, 03:45:57 pm
I've modified the HDMA setup to write two bytes to $2122 each time ($10 in $4310, $22 in $4311)

Only color 0 needs to be changed, so the "CGRAM index" (register $2121) must always be reset to zero. So $4311 needs $21...
« Last Edit: March 23, 2008, 04:20:59 pm by creaothceann »
Ryusui
Guest
« Reply #18 on: March 23, 2008, 04:17:00 pm »

So it auto-increments, huh...in that case, do I simply change it back to what Anomie calls "2 registers write once" and set 2121 as the base address (so it writes 0 to 2121 and then the color value to 2122), or do I change it to "2 registers write twice each"? Anomie's doc says 2122 works like OAM access, i.e. it doesn't actually update until you write an entire word...or am I misunderstanding it?
creaothceann
Guest
« Reply #19 on: March 23, 2008, 04:27:47 pm »

$10 in $4310 means that the HDMA target address will be decremented; surely it should be incremented? (Bit 4 = 0)


Quote from: Ryusui on March 23, 2008, 04:17:00 pm
So [the CGRAM index] auto-increments, huh...

Yep.


Quote from: Ryusui on March 23, 2008, 04:17:00 pm
in that case, do I simply change it back to what Anomie calls "2 registers write once" and set 2121 as the base address (so it writes 0 to 2121 and then the color value to 2122), or do I change it to "2 registers write twice each"? Anomie's doc says 2122 works like OAM access, i.e. it doesn't actually update until you write an entire word...or am I misunderstanding it?

Transfer modes work like this:

Code:
0 = register0
1 = register0  register1
2 = register0  register0
3 = register0  register0  register1  register1
4 = register0  register1  register2  register3
5 = register0  register1  register0  register1
6 = register0  register0
7 = register0  register0  register1  register1

You could use one DMA channel to reset the index and another one to set the color values.
Or you use transfer mode 3 and write the same value to the index register.
Ryusui
Guest
« Reply #20 on: March 23, 2008, 04:41:05 pm »

I'm an idiot. You're absolutely right...I'm thinking binary but typing in decimal. XD

Anyways, expanding it to "2 registers write twice each" seems to do the trick. I just need to finish off rewriting this HDMA table, and it should all work perfectly. Thanks!
creaothceann
Guest
« Reply #21 on: March 23, 2008, 04:53:07 pm »

No problem. Wink
Tauwasser
Guest
« Reply #22 on: March 24, 2008, 04:04:49 am »

Will you actually release a seperate patch, so like the German version could also be patched?

cYa,

Tauwasser
Ryusui
Guest
« Reply #23 on: March 24, 2008, 01:27:26 pm »

You mean, patch the German version with my fixes and alterations?

...That...is an interesting suggestion. >_>
Pages: 1 [2]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC