Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2013-05-15 22:47:29

Danny-E 33
Administrator
Registered: 2012-06-09
Post 470/1,025

Need Help Correctly Repointing to Another Bank

So I was working on an update for my graphics patch for version 1.2 that is going to include the palette table moved to another bank that has the free space for more palettes. The palette table is originally in bank 1C at 0x72660 and in version 1.1 it is still in bank 1C but at the free space at the end of the bank at 0x73BA0 and runs all the way to the end of the bank with additional palettes. My goal is to correctly load palettes while the table is in bank 2F at 0xBC010.

I'm gonna try to explain the problem as best as I can.
So there is part of a routine starting at 1C:6117 that calls 0x00B5 to copy bc bytes (0x1000) of the palette table from hl (currently $7BA0, will be $4010 after it is in bank 2F) to de (0x8800 (I have no idea what this address is for.)). The problem is that this routine is called several times when the game is starting up, not just used to copy only the palette table. It is also interesting that the destination to be copied to for this routine is 0x8800 all three times this routine is run at the start up of the game. So I had to modify the code so that it would jump to a different routine when this routine is being run for the palette table but the code would run normally when this routine is being run for anything other than the palette table. I'm sorry if this is confusing, but this is what I came up with:

; 1C:6117
call $6715    ; free space. this is free space for me because the palette table is no longer at this location.

; 1C:6715
ld a, $40     ; value of h in pointer hl to palette table at 2F:4010
cp h          ; this is what checks if this routine is currently being run to copy the palette table and not something else. crude, I know.
jr nz $0E     ; if this is not being used to copy the palette table (if hl doesn't contain the pointer to the palette table) go forward E bytes
ld b, $2F     ; bank to switch to
push hl       ; preserve pointer to palette table
ld hl, $4000  ; pointer for after BankSwitch
call $35D6    ; BankSwitch. the flow of code does not come back to read the next few lines until after all the code at 2F:4000 has been read and returns.
pop hl        ; **These three lines overwrite the next address in the stack so that when the code returns to the original routine,
ld hl, $6128  ; **it goes to the address after the original call to $00B5 that is still used to other two times the routine is read.
push hl       ; **These lines are not read if the jr nz command did jump, in which case, the address in the stack to return to is still 1C:611A
ld a, [$CF2D] ; this is the line originally at 1C:6117 that got replaced with the call. this is also where the code jumps to from the jr nz $0E command.
ret           ; returns to 1C:611A if jr nz did jump. jumps to 1C:6128 if jr nz did not jump.

; 2F:4000
pop bc        ; 
pop af        ; 
pop de        ; 
pop hl        ; these few lines retrieve the address of the palette table from the stack and return all necessary pointers
push de       ; 
push af       ; 
push bc       ; 
ld bc, $1000  ; mimicking the original code, this copies bc bytes ($1000) from hl to de (which still contains $8800 at this point)
jp $00B5      ; the jump goes to copy the code and when the return line is read, it returns to the BankSwitch routine to switch back to bank 1C and
              ; continues reading at "pop hl" above, immediately after the call to BankSwitch

The problem is that when the game is run, it apparently reads garbage data for the palettes and results in a very odd looking game. I would really appreciate it if someone could tell me what you may think could fix this problem.

Last edited by Danny-E 33 (2013-05-16 10:16:19)


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#2 2013-05-15 23:29:37

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

Re: Need Help Correctly Repointing to Another Bank

di
push de       ;; pointer to sgb command
call $0061
ld a, $E4
ld [$FF00 + $47], a
ld de, $8800  ;; target tile space
ld a, [$CF2D] ;; check copy mode
and a, a
jr z, @6122
call $6188    ;; copy 0x80 2bpp tiles and upconvert to 4bpp
jr @6128
@6122:
ld bc, $1000  ;; straight copy of 0x1000 bytes from hl to 0x8800
call $00B5
@6128:
ld hl, $9800  ;; fill screen with tiles for transfer to sgb
ld de, $000C
ld a, $80
ld c, $0D
@6132:
ld b, $14
@6134:
ldi [hl], a
inc a
dec b
jr nz, @6134
add hl, de
dec c
jr nz, @6132
ld a, $E3
ld [$FF00 + $40], a
pop hl       ;; pointer to sgb command
call $5FEB   ;; do sgb command
xor a, a
ld [$FF00 + $47], a
ei
ret

This is what the original code does. IMHO, this is the wrong location to do this kind of hackery. If you alrady know what source pointers the table is in, then you could easily edit all calls to this subroutine to just call your routine, instead of hacking the original routine to death. Anyway. I'll inline your code, so you see what's going wrong:

di
push de       ;; pointer to sgb command
call $0061
ld a, $E4
ld [$FF00 + $47], a
ld de, $8800  ;; target tile space
call $6715    ;; !!! de = 0x8800 !!!

    ; 1C:6715
    ld a, $40
    cp h
    jr nz, @1
    ld b, $2F
    push hl
    ld hl, $4000
    call $35D6  ;; jp 2F:4000;

        pop bc  ;; return address0 (0x35E4)
        pop af  ;; return bank
        pop de  ;; return address1 (1C:6123)
                ;; !!! de = 0x6123, not 0x8800 !!!
        pop hl  ;; source pointer
        push de ;; restore stack
        push af
        push bc
        ld bc, $1000
        jp $00B5 ;; !!! copy 0x1000 from hl to de, which is supposed to be 0x8800, but is 0x6123 instead !!!

    pop hl
    ld hl, $6128 ;; this will likely introduce bugs.
                 ;; This routine should never be called
                 ;; in tile mode for a palette copy anyways.
    push hl
    @1:
    ld a, [$CF2D]
    ret

;; check copy mode
and a, a      ;; if h was != 0x40: de = 0x8800, else this code is skipped
jr z, @6122
call $6188    ;; copy 0x80 2bpp tiles and upconvert to 4bpp
jr @6128
@6122:
ld bc, $1000  ;; straight copy of 0x1000 bytes from hl to 0x8800
call $00B5
@6128:       ;; !!! if h was != 0x40: de = 0x8800, else de = 0x6123 !!!
ld hl, $9800  ;; fill screen with tiles for transfer to sgb
ld de, $000C
ld a, $80
ld c, $0D
@6132:
ld b, $14
@6134:
ldi [hl], a
inc a
dec b
jr nz, @6134
add hl, de
dec c
jr nz, @6132
ld a, $E3
ld [$FF00 + $40], a
pop hl       ;; pointer to sgb command
call $5FEB   ;; do sgb command
xor a, a
ld [$FF00 + $47], a
ei
ret

Notice how you mistreat the de register, which will be different when your routine is run. So you copy some random crap as palette data and write a few times to the MBC...
EDIT: I just noticed my comments were at the wrong line, so I fixed them.

@2F:4000
ld hl, sp + $06
ldi a,[hl]
ld h, [hl]
ld l, a
ld bc, $1000
jp $00B5

Then insert one more pop hl after the call to 35D6.

cYa,

Tauwasser

Last edited by Tauwasser (2013-05-16 09:13:21)

Offline

#3 2013-05-15 23:39:23

Danny-E 33
Administrator
Registered: 2012-06-09
Post 472/1,025

Re: Need Help Correctly Repointing to Another Bank

Hahaha, oh, so it was as simple as me accidentally messing with de's value?

And do you think you could help me decide a more logical place to perform this kind of hackery? I would love to make the code as clean and logical as possible! Thank you Tauwasser! :)

Last edited by Danny-E 33 (2013-05-16 00:31:52)


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#4 2013-05-15 23:55:46

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

Re: Need Help Correctly Repointing to Another Bank

Well, you will just have to find all places where 610B is called with a palette offset. Then you change this call. Or you could make CF2D have more than two states. CF2D seems to be a generic-use register anyway.

di
push de       ;; pointer to sgb command
call $0061
ld a, $E4
ld [$FF00 + $47], a
ld de, $8800  ;; target tile space
ld a, [$CF2D] ;; check copy mode
dec a
jr c, @6122   ;; case 0x00
jr z, @1      ;; case 0x01
ld a, $2F     ;; default
ld bc, $1000
call $009D    ;; copy 0x1000 bytes from a:hl to de
jr @6128
@1:
call $6188    ;; copy 0x80 2bpp tiles and upconvert to 4bpp
jr @6128
@6122:
ld bc, $1000  ;; straight copy of 0x1000 bytes from hl to 0x8800
call $00B5
@6128:
ld hl, $9800  ;; fill screen with tiles for transfer to sgb
ld de, $000C
ld a, $80
ld c, $0D
@6132:
ld b, $14
@6134:
ldi [hl], a
inc a
dec b
jr nz, @6134
add hl, de
dec c
jr nz, @6132
ld a, $E3
ld [$FF00 + $40], a
pop hl       ;; pointer to sgb command
call $5FEB   ;; do sgb command
xor a, a
ld [$FF00 + $47], a
ei
ret

cYa,

Tauwasser

Offline

#5 2013-05-16 03:53:37

Danny-E 33
Administrator
Registered: 2012-06-09
Post 473/1,025

Re: Need Help Correctly Repointing to Another Bank

Tauwasser wrote:
pop hl
ld hl, $6128 ;; this will likely introduce bugs.
             ;; This routine should never be called
             ;; in tile mode for a palette copy anyways.
push hl

Why do you say this way of overwriting the stack will introduce bugs? Is there a more legitimate way to overwrite the stack? That specific location is only used because it is the next line to be read after the original call to 0x00B5 that was skipped for copying the palette table. And what do you mean by tile mode?

Tauwasser wrote:
@2F:4000
ld hl, sp + $06
ldi a,[hl]
ld h, [hl]
ld l, a
ld bc, $1000
jp $00B5

Then insert one more pop hl after the call to 35D6.

How does this code work? I've never used the "ld hl, sp + db" before. Why $06? Is that loading the 16 bit address 6 bytes up the stack into hl? That would be much more efficient than what I'm doing :p
Also, I don't understand the three ld commands that come next..

Tauwasser wrote:

Well, you will just have to find all places where 610B is called with a palette offset. Then you change this call. Or you could make CF2D have more than two states. CF2D seems to be a generic-use register anyway.

di
push de       ;; pointer to sgb command
call $0061
ld a, $E4
ld [$FF00 + $47], a
ld de, $8800  ;; target tile space
ld a, [$CF2D] ;; check copy mode
dec a
jr c, @6122   ;; case 0x00
jr z, @1      ;; case 0x01
ld a, $2F     ;; default
ld bc, $1000
call $009D    ;; copy 0x1000 bytes from a:hl to de
jr @6128
@1:
call $6188    ;; copy 0x80 2bpp tiles and upconvert to 4bpp
jr @6128
@6122:
ld bc, $1000  ;; straight copy of 0x1000 bytes from hl to 0x8800
call $00B5
@6128:
ld hl, $9800  ;; fill screen with tiles for transfer to sgb
ld de, $000C
ld a, $80
ld c, $0D
@6132:
ld b, $14
@6134:
ldi [hl], a
inc a
dec b
jr nz, @6134
add hl, de
dec c
jr nz, @6132
ld a, $E3
ld [$FF00 + $40], a
pop hl       ;; pointer to sgb command
call $5FEB   ;; do sgb command
xor a, a
ld [$FF00 + $47], a
ei
ret

So $009D is a routine that can be called from a bank other than bank 00 and copy data from an entirely separate bank? That really simplifies things!!

You have too many bytes in between $610B and $6122. I'll post again when I've straightened it out.


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#6 2013-05-16 04:55:10

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 632/649

Re: Need Help Correctly Repointing to Another Bank

I think it would be great if you released a third version with my revamped sprites. I'm sorry but fighting the gym leaders and them having their 2nd gen sprites has turned me away from this hack.


Pokemon Blue DX is reborn!

Offline

#7 2013-05-16 06:21:05

Danny-E 33
Administrator
Registered: 2012-06-09
Post 474/1,025

Re: Need Help Correctly Repointing to Another Bank

k82aDNO.png
Seriously? The GSC sprites don't make them look older, just better. Also, my hack Pokemon Prototype uses the Yellow sprite for Misty because the GSC sprite is stupid, but this graphics patch is strict Gen. II.
Besides Misty, the GSC sprites are just fine. Erika, Koga, Sabrina, and Blaine are just updates. Poketto's revamp of Giovanni is wonderful.
The only ones that are really different are Brock and Lt. Surge but they're just different poses and of much better quality. If anything, the GSC sprites make Koga and Blaine look younger.

To be clear, I'm not bashing your revamping skill. I'm expressing my deep distastfullness towards the original gen I sprites. If that turns you away from this hack, that's your loss.


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#8 2013-05-16 06:23:10

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

Re: Need Help Correctly Repointing to Another Bank

Danny-E 33 wrote:
Tauwasser wrote:
@2F:4000
ld hl, sp + $06
ldi a,[hl]
ld h, [hl]
ld l, a
ld bc, $1000
jp $00B5

Then insert one more pop hl after the call to 35D6.

How does this code work? I've never used the "ld hl, sp + db" before. Why $06? Is that loading the 16 bit address 6 bytes up the stack into hl? That would be much more efficient than what I'm doing :p
Also, I don't understand the three ld commands that come next.

You're making hl point to the address that's inside the stack, six bytes away from the top of it. Thus, you can look for data inside the stack without having to pop all the other stuff above it first.

The next three instructions are used to transfer a 16-bit value from the address hl is pointing to. This is kind of a method is used always when working with pointer tables for instance.
(hl = "address XXYY" --> hl = "2-byte little-endian value in address XXYY")

Last edited by Miksy91 (2013-05-16 06:25:50)

Offline

#9 2013-05-16 06:27:20

Danny-E 33
Administrator
Registered: 2012-06-09
Post 476/1,025

Re: Need Help Correctly Repointing to Another Bank

Miksy91 wrote:

The next three instructions are used to transfer a 16-bit value from the address hl is pointing to. This is kind of a method is used always when working with pointer tables for instance.
(hl = "address XXYY" --> hl = "2-byte little-endian value in address XXYY")

But why is this useful if the address in hl is the beginning of the palette table? Why importance does the first byte of the first palette in the table have?


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#10 2013-05-16 07:26:59

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

Re: Need Help Correctly Repointing to Another Bank

That method there (= "those three instructions") is "looking" for the value of a certain index.
hl is first loaded to contain the address of the palette table (and palettes are 2-byte values in little-endian format there, at least most likely). Then you could for example use register a so that it first contains the value of the "palette index".

ld hl, tableAddress
push bc
dec a
ld c, a
ld b, 00
add hl, bc
add hl, bc
pop bc

--> hl contains the 16-bit value of the palette determined by "index register" a (in big endian format)

Other than that, I haven't been paying much attention to what you've been writing here, but this here is totally use of those three instructions there.
And it sounds like sometime earlier, the "tableAddress" was pushed onto stack and after it, there were three other "push" instructions (and "call" could be one of them since it pushed PC). Thus, the tableAddress can be accessed 6 bytes away from the top of the stack.

Last edited by Miksy91 (2013-05-16 07:30:17)

Offline

#11 2013-05-16 09:02:35

stag019
Idea Killer
Registered: 2011-01-05
Post 426/630

Re: Need Help Correctly Repointing to Another Bank

Danny-E 33 wrote:

k82aDNO.png
Seriously? The GSC sprites don't make them look older, just better. Also, my hack Pokemon Prototype uses the Yellow sprite for Misty because the GSC sprite is stupid, but this graphics patch is strict Gen. II.
Besides Misty, the GSC sprites are just fine. Erika, Koga, Sabrina, and Blaine are just updates. Poketto's revamp of Giovanni is wonderful.
The only ones that are really different are Brock and Lt. Surge but they're just different poses and of much better quality. If anything, the GSC sprites make Koga and Blaine look younger.

To be clear, I'm not bashing your revamping skill. I'm expressing my deep distastfullness towards the original gen I sprites. If that turns you away from this hack, that's your loss.

Random thought, but the GSC Lt. Surge sucks. The rest are fine though.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#12 2013-05-16 09:26:02

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

Re: Need Help Correctly Repointing to Another Bank

When you enter 2F:4000, the data on the stack is as follows:

Address: n-6 | n-5 | n-4 | n-3 | n-2 | n-1 |  n  | n+1 |
Data   :  c  |  b  |  f  |  a  |  e  |  d  |  l  |  h  |
          ↑
          sp

Where bc is the return vector from routine 35D6. a:de is the return vector that 35D6 pushes to the stack (and will restore after 2F:4000 returns), which points to 1C:6123 in my first example. hl is the pointer to your table, which you pushed to the stack.

Notice the register names here are arbitrary, I also could have simply numbered the bytes. So de does not mean that at some point in time there was a push de done. (In fact, that return vector was put there by the CPU itself when you used call 35D6).

Notice how the stack grows downward and points to the low bytes of the register that was pushed to the stack last. Therefore, we want to read hl from address n (l) and n+1 (h). We do not want to clobber any other register but hl.

I just noticed that my original comments were mistakenly placed at the wrong call to 0x00B5. I fixed that in my post.

Miksy91 wrote:

That method there (= "those three instructions") is "looking" for the value of a certain index.

Danny-E 33 wrote:

How does this code work? I've never used the "ld hl, sp + db" before. Why $06? Is that loading the 16 bit address 6 bytes up the stack into hl? That would be much more efficient than what I'm doing :p

I'm afraid you're mistaken. I think this is due to your earlier statement:

Miksy91 wrote:
Tauwasser wrote:
@2F:4000
ld hl, sp + $06
ldi a,[hl]
ld h, [hl]
ld l, a
ld bc, $1000
jp $00B5

You're making hl point to the address that's inside the stack, six bytes away from the top of it. Thus, you can look for data inside the stack without having to pop all the other stuff above it first.

The next three instructions are used to transfer a 16-bit value from the address hl is pointing to. This is kind of a method is used always when working with pointer tables for instance.
(hl = "address XXYY" --> hl = "2-byte little-endian value in address XXYY")

ld hl, sp + $06 doesn't "make hl point to the address that's inside the stack". What you textually described would be ld hl, [sp] or ld hl, [sp + $06] -- which is not a valid command.
ld hl, sp + $06 simply adds 0x06 to the stack pointer and stores this result in hl. There is no indirect load operation here. Maybe you meant "stack pointer register" and I'm just being pedantic here, though.

Danny-E 33 wrote:

Why do you say this way of overwriting the stack will introduce bugs? Is there a more legitimate way to overwrite the stack?

The most legitimate way would be to not overwrite the stack. Basically, when you see code like

ld a, [hl]
call $1234
ld [hl], a

You expect call $1234 to return to "ld [hl], a". Instead you make it go somewhere else. This is basically why the use of "goto" is so frowned upon in modern-day programming. There are legitimate uses, but IMHO this isn't one of them.

Danny-E 33 wrote:

That specific location is only used because it is the next line to be read after the original call to 0x00B5 that was skipped for copying the palette table. And what do you mean by tile mode?

By tile mode I meant the copy mode when CF2D is set in the original code, i.e. when the bpp-converting tile copy code is executed. In theory, you now broke tile copying when the pointer hl in the 0x40XX range, which is not desirable.



cYa,

Tauwasser

Offline

#13 2013-05-16 11:19:44

Danny-E 33
Administrator
Registered: 2012-06-09
Post 478/1,025

Re: Need Help Correctly Repointing to Another Bank

Alright, I got my very clean solution! First I reverted the entire routine at 1C:610B back to its original state and then only modified the necessary code. I also erased the code I made at 1C:6715 to start fresh and also put the palette table right at 2F:4000 instead of 2F:4010 because I don't need any code in that bank at all! Here's all I had to change:

; 1C:611A
dec a        ;
jr c, @6122  ; case 00 continues to unmodified code
call 6715    ; call to free space

; 1C:6715
jr nz, @671A ; go to case 02
jp $6188     ; case 01. after the ret command, returns to unmodified code at 1C:6120
ld a, $2F    ; case 02, copies the palette table
ld bc, $1000 ;
jp $009D     ; after the ret command, returns to unmodified code at 1C:6120

Short, simple, and it works great!
Thank you, Tauwasser, for helping me think to use "dec a" in order to give the register at $CF2D more possible cases and for reminding me of $009D so I never have to switch to bank 2F!


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#14 2013-05-16 11:42:42

80C
Banned
Registered: 2013-03-16
Post 538/1,257

Re: Need Help Correctly Repointing to Another Bank

Great! So you did it?

With that repoint I guess it's possible add more palettes for more pokemon.
Anyway, I'm interested in this too.
I saved the page and I'll look at that after July, but I must let u know,
I'll repoint the Palette Table near adress $120000 (I expanded my ROM) so I could have all the space I need\want for the new pokemon (I calculated... Pokedex will go up near 230 or if possible near 240).

So, if I'm correct, I must do the process described before and then simply put as bank the bank of $120000 instead of the bank used by Danny-E, am I correct?


I left this forum.

Offline

#15 2013-05-16 11:48:25

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

Re: Need Help Correctly Repointing to Another Bank

Tauwasser wrote:

ld hl, sp + $06 doesn't "make hl point to the address that's inside the stack". What you textually described would be ld hl, [sp] or ld hl, [sp + $06] -- which is not a valid command.
ld hl, sp + $06 simply adds 0x06 to the stack pointer and stores this result in hl. There is no indirect load operation here. Maybe you meant "stack pointer register" and I'm just being pedantic here, though.

Sometimes, it's difficult to find the most "understandable" words in english...
Yeah, I meant you can load hl with the value of SP (not [SP] but SP) + $06 (so you it holds an address that is "in the stack"). That's what it does, right?

Anyways, good to hear you got the problem fixed Danny.

Last edited by Miksy91 (2013-05-16 11:49:20)

Offline

#16 2013-05-16 11:55:42

80C
Banned
Registered: 2013-03-16
Post 539/1,257

Re: Need Help Correctly Repointing to Another Bank

I've read this thread fast because I'm working on internet 4 my final school exam 4 a work I must show 2 the commissioners, I was curious & I looked also here, this is why I've said "I'll read that after July"... I'll continue hacking & I'll do that repointing too after my school year is finished cuz now'm busy.


I left this forum.

Offline

#17 2013-05-16 18:20:04

Danny-E 33
Administrator
Registered: 2012-06-09
Post 479/1,025

Re: Need Help Correctly Repointing to Another Bank

Yep, just add this short code at these two locations and change '2F' to whatever bank fits your needs and you can delete the palette table at $73BA0 to get back the free space in that bank.

; 1C:611A
dec a        ; 3D
jr c, @6122  ; 38 05
call 6715    ; CD 15 67

; 1C:6715
jr nz, @671A ; 20 03
jp $6188     ; C3 88 61
ld a, $2F    ; 3E 2F
ld bc, $1000 ; 01 00 10
jp $009D     ; C3 9D 00

Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#18 2013-05-16 19:41:54

80C
Banned
Registered: 2013-03-16
Post 544/1,257

Re: Need Help Correctly Repointing to Another Bank

I've got a problem too.

I moved the palette table from $73BA0 to $120000 (Bank 48), and I inserted Danny-E\Tauwasser's routines with BGB Debugger, but when I play the game the game has a "black out" and in fact there's no palette loaded.

Maybe it's because I moved only a part of the palette table.
I know in GenII Graphic patch it's located at $73BA0, but where the table finishes?

Also, if the problem isn't caused by that, were I'm doing wrong then?


I left this forum.

Offline

#19 2013-05-16 21:34:58

Danny-E 33
Administrator
Registered: 2012-06-09
Post 484/1,025

Re: Need Help Correctly Repointing to Another Bank

80C wrote:

Maybe it's because I moved only a part of the palette table.

Why would you only copy part of the palette table? You should copy from $73BA0 to $73FFF.

Also, what do you mean you inserted the routines in bgb? Does bgb save changes to roms?


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#20 2013-05-16 21:37:35

80C
Banned
Registered: 2013-03-16
Post 550/1,257

Re: Need Help Correctly Repointing to Another Bank

oh, so I copied correctly, from 73ba0 to 73fff.

Probabilly there's another problem.

Yes, BGB Debugger saves changes, otherwise I didn't had noted the problem since it would may have loaded the previous adress (I didn't deleted the original palette table yet, I just copied it).


I left this forum.

Offline

#21 2013-05-16 21:39:16

Danny-E 33
Administrator
Registered: 2012-06-09
Post 486/1,025

Re: Need Help Correctly Repointing to Another Bank

Did you remember to change:

ld a, $2F

to:

ld a, $48

Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#22 2013-05-16 21:40:41

80C
Banned
Registered: 2013-03-16
Post 551/1,257

Re: Need Help Correctly Repointing to Another Bank

yes.


I left this forum.

Offline

#23 2013-05-16 21:42:28

Danny-E 33
Administrator
Registered: 2012-06-09
Post 487/1,025

Re: Need Help Correctly Repointing to Another Bank

I don't know, man. Double check you bytes and addresses here.


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#24 2013-05-16 21:47:53

80C
Banned
Registered: 2013-03-16
Post 554/1,257

Re: Need Help Correctly Repointing to Another Bank

Hmm... my bank is 48, your is 2F... but your adress doesn't end with $00, am I right?
it ends with $10... my adress ends with $00

That's the source of the problem I think.


I left this forum.

Offline

#25 2013-05-16 21:49:04

Danny-E 33
Administrator
Registered: 2012-06-09
Post 488/1,025

Re: Need Help Correctly Repointing to Another Bank

Nope. After Tauwasser helped me improve my code so that no asm had to be in bank 2F, I scooted the palette table up to 2F:4000 instead of 2F:4010.

Even if that were true, your game would not be black. The colours would just be really wacky.

Last edited by Danny-E 33 (2013-05-16 21:50:09)


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

Board footer

Powered by FluxBB