Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2013-04-09 22:47:22

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

R\B Flight data editing - problem, help needed

80C wrote:

I searched about Flight Data in Red\Blue.
I didn't found a topic about it.

So I tested a bit & created one topic about.
http://hax.iimarck.us/topic/3240/

Well, actually I'm testing that infamous part 2 and the peds' places as well as the other events such as warps, signposts etc. are misplaced, plus, sometimes the tiles are glitched-up.

The first byte has something to do with the Y & X position, of that I'm sure, but I must somehow refresh the original position of the map somehow:
example: if I move the flight position + 2 X down, then map & events are placed 2 tiles\blocks down as well.

the second if changed glitches up the map tiles.

3rd and 4th does apparently nothing.

5th is always 00.

Can someone, if I'm not so annoying, let me understand how that works and how it can work correctly?

Last edited by 80C (Today 21:32:02)

RB 0x01:
ld a, [$D71A]
ld b, a
ld [$D35E], a
ld hl, $6448
@6398:
ldi a, [hl]
inc hl
cp a, b
jr z, @63A1 ;; Notice: Map has to be found! Possible source of bugs.
inc hl
inc hl
jr @6398
@63A1:
ldi a, [hl]
ld h, [hl]
ld l, a
ld de, $D35F
ld c, $06
@63A9:
ldi a, [hl]
ld [de], a
inc de
dec c
jr nz, @63A9
xor a, a
ld [$D367], a
ld [$D4E2], a
ld [$D4E3], a
ld a, $FF
ld [$D42F], a
ret

So the first structure is [Map No][0x00][2b Pointer to 6b structure in RB 0x01].

RB 0x00:
@0CAA:
ld a, [$FF00 + $B8]
push af
ld a, [$D52B]
ld [$FF00 + $B8], a
ld [$2000], a
ld a, [$D35F]
ld e, a
ld a, [$D360]
ld d, a
ld hl, $C508
ld b, $05
@0CC2:
push hl
push de
ld c, $06
@0CC6:
push bc
push de
push hl
ld a, [de]
ld c, a
call $0F1D
pop hl
pop de
pop bc
inc hl
inc hl
inc hl
inc hl
inc de
dec c
jr nz, @0CC6
pop de
ld a, [$D369]
add a, $06
add a, e
ld e, a
jr nc, @0CE4
inc d
@0CE4:
pop hl
ld a, $60
add a, l
ld l, a
jr nc, @0CEC
inc h
@0CEC:
dec b
jr nz, @0CC2
ld hl, $C508
ld bc, $0000
ld a, [$D363]
and a, a
jr z, @0CFF
ld bc, $0030
add hl, bc
@0CFF:
ld a, [$D364]
and a, a
jr z, @0D09
ld bc, $0002
add hl, bc
@0D09:
ld de, $C3A0
ld b, $12
@0D0E:
ld c, $14
@0D10:
ldi a, [hl]
ld [de], a
inc de
dec c
jr nz, @0D10
ld a, $04
add a, l
ld l, a
jr nc, @0D1D
inc h
@0D1D:
dec b
jr nz, @0D0E
pop af
ld [$FF00 + $B8], a
ld [$2000], a
ret

This is where the second structure is read. So we see [2b pointer upper left block in WRAM][event Y coordinate][event X coordinate][even Y block quarter (bool)][even X block quarter (bool)].

Also, why did your threads disappear just as I was replying?

cYa,

Tauwasser

Last edited by Tauwasser (2013-04-09 22:48:18)

Offline

#2 2013-04-09 23:25:16

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 2,419/3,501

Re: R\B Flight data editing - problem, help needed

Tauwasser wrote:

Also, why did your threads disappear just as I was replying?

cYa,

Tauwasser

80C wrote:

Since more than 1 person said I'm useless, I won't post or help anyone until those people admit I'm not so useless.
Many of my "useless" question gave useful answers, not only for me, but for everyone else, and made many searches easier, so I deleted 117 of my 119 topics & posts & now some useful things & contents are lost forever unless I restore it, such as town map editing details, palette\convertion, sources and so on.
Oh, and now I'm learning asm, so I guess we'll see something not so "useless" this time.
Hurt me again and Pokemon Grape & my topics will fall somewhere where nobody wants.

Offline

#3 2013-04-10 04:55:47

Vitharix
Member
Registered: 2011-12-29
Post 285/396

Re: R\B Flight data editing - problem, help needed

Apparently we are not appreciating his genius as he sees fit.

Offline

#4 2013-04-10 11:06:58

Munchulax
Member
From: Somewhere in Johto
Registered: 2011-08-10
Post 320/410

Re: R\B Flight data editing - problem, help needed

aveneour wrote:

when r u stupid going to release this unwanted hack

And this post in his Pokemon Grape topic by aveneour probably isn't the kind of post he wants to see.


“To live is the rarest thing in the world. Most people exist, that is all.” ― Oscar Wilde

Offline

#5 2013-04-10 19:54:27

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

Re: R\B Flight data editing - problem, help needed

The original flight data post I deleted, now restored:

http://hax.iimarck.us/topic/3244/


I left this forum.

Offline

#6 2013-04-10 20:01:40

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

Re: R\B Flight data editing - problem, help needed

Mateo wrote:
Tauwasser wrote:

Also, why did your threads disappear just as I was replying?

cYa,

Tauwasser

80C wrote:

Since more than 1 person said I'm useless, I won't post or help anyone (...)
(...) so I deleted 117 of my 119 topics & posts & now some useful things & contents are lost forever unless I restore it, such as town map editing details, palette\convertion, sources and so on.

Now these important topics I deleted are restored.
The other near-100 posts weren't so important.

80C wrote:

(...) Hurt me again and Pokemon Grape & my topics will fall somewhere where nobody wants.

This won't happen.
Pokemon Grape's topic is still here but needs edit since I deleted everything but I hadn't got time to restore the storyline & the credits since I was made dumb and unable to edit\delete posts.
The topics are now here again.


I left this forum.

Offline

#7 2013-04-27 18:14:30

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

Re: R\B Flight data editing - problem, help needed

@Tauwasser

I haven't understood fully the second part of the flight data.
If I change the X block, also the peds got moved... and they're placed in wrong places as well as events.
How to avoid this?


I left this forum.

Offline

#8 2013-04-27 18:34:32

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

Re: R\B Flight data editing - problem, help needed

The X block flag has to match with the X event position. Else, you will move the events by a block quarter.

cYa,

Tauwasser

Offline

#9 2013-04-27 19:05:58

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

Re: R\B Flight data editing - problem, help needed

ehm... I didn't used disassemble to try changing the flight data, I used hex editor.

Could you show me how operates the bytes in the 2nd part of the flight data?
I have here an example, this is about Pallet town, it's between 0x647C & 0x6480:

2B C7 06 05 00


I left this forum.

Offline

Board footer

Powered by FluxBB