Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2013-06-20 09:06:08

bobie
Member
Registered: 2010-11-06
Post 11/16

[Crystal]Little question about Bank and Sprite.

I was testing inserting some sprites,
but encountered a weird thing.

If I insert a sprite to bank over 0x60, it will not work correctly.
It shows weird picture, or crashes and then becomes black.

Do I need to do anything else?

I used debugger to see what' s going on.
I supposed it might not change to bank 64(where I inserted sprite) when loading.
And actually, it changed to 0x40.
I don' t know why, because everything works fine when I insert it below bank 60.

Last edited by bobie (2013-06-22 04:17:33)

Offline

#2 2013-06-20 11:35:46

Miksy91
Member
Registered: 2010-10-16
Post 1,761/2,311

Re: [Crystal]Little question about Bank and Sprite.

There is most likely a reason for not being able to load sprites from banks that are higher than 0x40 or something like that.
You could most likely avoid that problem easily by adjusting the code a little bit.

Anyway, why not just debug the routine throughly and see when it changes and why?

Offline

#3 2013-06-20 15:36:01

bobie
Member
Registered: 2010-11-06
Post 12/16

Re: [Crystal]Little question about Bank and Sprite.

You' re right, Misky.
Also, if I don' t solve this, there will be no enough space for me to insert images.
I should try to find out the cause maybe next week, when summer vacation begins.

Offline

#4 2013-06-21 03:41:56

677/701

Re: [Crystal]Little question about Bank and Sprite.

How are you inserting? Are you sure it’s not a bug in the program you’re using (say, Agixp)?

#5 2013-06-22 00:28:43

bobie
Member
Registered: 2010-11-06
Post 13/16

Re: [Crystal]Little question about Bank and Sprite.

Well, I use Agixp to insert sprite.
I always do repointing myself, since it doesn't support Crystal Version.
I think the sprite data should be no problem.

Offline

#6 2013-06-22 02:42:05

Tauwasser
Member
Registered: 2010-10-16
Post 399/448

Re: [Crystal]Little question about Bank and Sprite.

Did you adapt the translation tables for the sprite ROM banks?

cYa,

Tauwasser

Offline

#7 2013-06-22 02:50:46

bobie
Member
Registered: 2010-11-06
Post 14/16

Re: [Crystal]Little question about Bank and Sprite.

Tauwasser wrote:

Did you adapt the translation tables for the sprite ROM banks?

cYa,

Tauwasser

Hmm.. What do translation tables mean?

Offline

#8 2013-06-22 03:34:49

comet
Member
Registered: 2012-04-09
Post 265/679

Re: [Crystal]Little question about Bank and Sprite.

bobie wrote:

I supposed it might not change to bank 64(where I inserted sprite) when loading.
And actually, it changed to 40.

64 is 0x40. Could AGIXP take banks in decimal?

Offline

#9 2013-06-22 04:20:54

bobie
Member
Registered: 2010-11-06
Post 15/16

Re: [Crystal]Little question about Bank and Sprite.

comet wrote:
bobie wrote:

I supposed it might not change to bank 64(where I inserted sprite) when loading.
And actually, it changed to 40.

64 is 0x40. Could AGIXP take banks in decimal?

OK. I'm sorry I didn't write it clearly.
They are all in heximal.
So It is not 0x40(64), it is 0x64.
But it will changed to 0x40 when loading.

Last edited by bobie (2013-06-22 04:21:29)

Offline

#10 2013-06-22 12:20:47

Tauwasser
Member
Registered: 2010-10-16
Post 400/448

Re: [Crystal]Little question about Bank and Sprite.

There is a table at 14:51D4 that translates ROM bank numbers used in the Pokémon Picture Pointer table to actual GameBoy ROM bank numbers.

@14:51C5:
push hl
push bc
sub a, $12
ld c, a
ld b, $00
ld hl, @51D4
add hl, bc
ld a, [hl]
pop bc
pop hl
ret
@51D4:
48
49
4A
4B
4C
4D
4E
4F
50
51
52
53
54
55
56
57
58
59
5A
5B
5C
5D
5E
5F

So your 0x64 indexes outside of the array.

cYa,

Tauwasser

Last edited by Tauwasser (2013-06-22 12:21:37)

Offline

#11 2013-06-22 13:00:02

bobie
Member
Registered: 2010-11-06
Post 16/16

Re: [Crystal]Little question about Bank and Sprite.

Tauwasser wrote:

There is a table at 14:51D4 that translates ROM bank numbers used in the Pokémon Picture Pointer table to actual GameBoy ROM bank numbers.

@14:51C5:
push hl
push bc
sub a, $12
ld c, a
ld b, $00
ld hl, @51D4
add hl, bc
ld a, [hl]
pop bc
pop hl
ret
@51D4:
48
49
4A
4B
4C
4D
4E
4F
50
51
52
53
54
55
56
57
58
59
5A
5B
5C
5D
5E
5F

So your 0x64 indexes outside of the array.

cYa,

Tauwasser

Wow, I didn't know this before!!
Thank you Tauwasser!!!!

So what I should I do next?
Do I need to insert bank numbers?
Or just modify one of them?

OK, I found there' s some space,
I think I only have to repoint the table to there.
Let me take a try and see.

And thanks to anyone who helps me :D

Last edited by bobie (2013-06-22 13:16:35)

Offline

Board footer

Powered by FluxBB