You are not logged in.
Pages: 1
Hello!
I'm trying to restore the original town map and add a second line to it like the original green. I already changed the tileset using BGB debugger and modifying town_map.rle in order to achieve
I've checked bank_01c.asm from original green that I've decompiled using mgbdis and is the same code by far, the only difference is the hlcoord. In order to see if can be accomplished in pokered dissasembly I've modified towm_map.asm from this:
.townMapLoop
hlcoord 0, 0
lb bc, 1, 20
call ClearScreenArea
ld hl, TownMapOrder
ld a, [wWhichTownMapLocation]
ld c, a
ld b, 0
add hl, bc
ld a, [hl]
.enterLoop
ld de, wTownMapCoords
call LoadTownMapEntry
ld a, [de]
push hl
call TownMapCoordsToOAMCoords
ld a, $4
ld [wOAMBaseTile], a
ld hl, wOAMBuffer + $10
call WriteTownMapSpriteOAM ; town map cursor sprite
pop hl
ld de, wcd6d
.copyMapName
ld a, [hli]
ld [de], a
inc de
cp $50
jr nz, .copyMapName
hlcoord 1, 0
ld de, wcd6d
call PlaceString
ld hl, wOAMBuffer + $10
ld de, wTileMapBackup + 16
ld bc, $10
call CopyData
To this:
.townMapLoop
coord hl, 0, 0
lb bc, 1, 10
call ClearScreenArea
ld hl, TownMapOrder
ld a, [wWhichTownMapLocation]
ld c, a
ld b, 0
add hl, bc
ld a, [hl]
.townMapLoop1
coord hl, 0, 0
lb bc, 2, 10
call ClearScreenArea
ld hl, TownMapOrder
ld a, [wWhichTownMapLocation]
ld c, a
ld b, 0
add hl, bc
ld a, [hl]
.enterLoop
ld de, wTownMapCoords
call LoadTownMapEntry
ld a, [de]
push hl
call TownMapCoordsToOAMCoords
ld a, $4
ld [wOAMBaseTile], a
ld hl, wOAMBuffer + $10
call WriteTownMapSpriteOAM ; town map cursor sprite
pop hl
ld de, wcd6d
.copyMapName
ld a, [hli]
ld [de], a
inc de
cp $50
jr nz, .copyMapName
coord hl, 1, 0
ld de, wcd6d
call PlaceString
ld hl, wOAMBuffer + $10
ld de, wTileMapBackup + 16
ld bc, $10
call CopyData
.copyMapName1
ld a, [hli]
ld [de], a
inc de
cp $50
jr nz, .copyMapName1
coord hl, 1, 1
ld de, wcd6d
call PlaceString
ld hl, wOAMBuffer + $10
ld de, wTileMapBackup + 16
ld bc, $10
call CopyData
The result is that is showing 2 lines in the right places but I don't know how to break Pallet Town in order to show Pallet in the first line and Town in the second or how I must to change the code to do it in the propper way.
I've already checked how is done in Gold and Silver but the code is very different and I don't really understand it.
Can someone help me please?
Thx in advance
Last edited by PkMn (2020-08-16 00:19:42)
Offline
Well,design wise,it will not look good with long names,unless you will use really short names.Also,looks like a copy of the map name showing code is there.Try finding it and removing it.
Last edited by VL2M (2020-08-16 14:47:14)
Pandas sure don't like vegans...
Offline
Ok, so I started with a clean copy of pokered, and this should make it work the way you wanted. I basically copied over the control character that Pokecrystal used for the line break in Town Map names. Diffy seems to be displaying that character as jibberish though, so just copy/paste the soft linebreak character from pokecrystal when applying these changes. Let me know if it works for you. You'll want to undo whatever you already did that wasn't working, of course. Also, I commented out the part for showing "To" when flying, since there was not room in the name box for it to fit. You could un-comment it and change the coordinates it gets printed at if you want to put it back, though.
https://diffy.org/diff/hkrt77j25983bocp3ajkh85mi
EDIT: Don't worry, I didn't break the cursor or anything, I just hit the screenshot button while it was mid-blink, lol.
Last edited by Mateo (2020-08-16 18:35:49)
I am not very active on this forum. I only pop in from time to time.
Online
Ok, so I started with a clean copy of pokered, and this should make it work the way you wanted. I basically copied over the control character that Pokecrystal used for the line break in Town Map names. Diffy seems to be displaying that character as jibberish though, so just copy/paste the soft linebreak character from pokecrystal when applying these changes. Let me know if it works for you. You'll want to undo whatever you already did that wasn't working, of course. Also, I commented out the part for showing "To" when flying, since there was not room in the name box for it to fit. You could un-comment it and change the coordinates it gets printed at if you want to put it back, though.
https://diffy.org/diff/hkrt77j25983bocp3ajkh85mi
https://i.imgur.com/m3ZojrR.png
EDIT: Don't worry, I didn't break the cursor or anything, I just hit the screenshot button while it was mid-blink, lol.
Is working like a charm but still needing a few fixes.
When flying the arrow up and arrow down (▲ ▼) still showing on the right side of the screen. In order to fix that we must to change the coords from this:
call DelayFrames
hlcoord 18, 0
ld [hl], "▲"
hlcoord 19, 0
ld [hl], "▼"
pop hl
.pressedUp
decoord 18, 0
inc hl
ld a, [hl]
cp $ff
jr z, .wrapToStartOfList
cp $fe
jr z, .pressedUp ; skip past unvisited towns
jp .townMapFlyLoop
.wrapToStartOfList
ld hl, wFlyLocationsList
jp .townMapFlyLoop
.pressedDown
decoord 19, 0
dec hl
ld a, [hl]
cp $ff
jr z, .wrapToEndOfList
cp $fe
jr z, .pressedDown ; skip past unvisited towns
jp .townMapFlyLoop
to this:
call DelayFrames
hlcoord 0, 0
ld [hl], "▲"
hlcoord 0, 1
ld [hl], "▼"
pop hl
.pressedUp
decoord 0, 0
inc hl
ld a, [hl]
cp $ff
jr z, .wrapToStartOfList
cp $fe
jr z, .pressedUp ; skip past unvisited towns
jp .townMapFlyLoop
.wrapToStartOfList
ld hl, wFlyLocationsList
jp .townMapFlyLoop
.pressedDown
decoord 0, 1
dec hl
ld a, [hl]
cp $ff
jr z, .wrapToEndOfList
cp $fe
jr z, .pressedDown ; skip past unvisited towns
jp .townMapFlyLoop
But we have another problem now, since we added a tile before the name, the box is broken when choosing a town to fly. In order to fix that we must change this:
.townMapLoop
hlcoord 0, 0
lb bc, 2, 10
call ClearScreenArea
ld hl, TownMapOrder
.townMapFlyLoop
ld a, " "
ld [de], a
push hl
push hl
hlcoord 1, 0
lb bc, 2, 10
to this:
.townMapLoop
hlcoord 0, 0
lb bc, 2, 9
call ClearScreenArea
ld hl, TownMapOrder
.townMapFlyLoop
ld a, " "
ld [de], a
push hl
push hl
hlcoord 1, 0
lb bc, 2, 9
After this, you will need to fix the '''s NEST'' from the area option in the pokedex since is going to overlap the town map.
I don't have this problem because is different in my language and covers the 10 tiles but in english you will have an extra tile.
You will need to modify the town_map.rle and the coords or just change '''s NEST'' to ''NEST''. You must tweak the code adding a hlcoord before ld de, MonsNestText too
That should do the trick and restore the japanese town map 100% :)
I will edit the OP and add all the information you shared in order to archive it for the eternity.
Thank you so much Mateo
Last edited by PkMn (2020-08-17 08:45:38)
Offline
Glad you got it working. I realized after the fact that I didn't cover everything in that diff I sent, and was going to send an update if you needed it.
I am not very active on this forum. I only pop in from time to time.
Online
Glad you got it working. I realized after the fact that I didn't cover everything in that diff I sent, and was going to send an update if you needed it.
Well, is not needed, is working like I wanted but feel free to share it if you want :)
Offline
Mateo wrote:Glad you got it working. I realized after the fact that I didn't cover everything in that diff I sent, and was going to send an update if you needed it.
Well, is not needed, is working like I wanted but feel free to share it if you want :)
Haha, it would be redundant to post it, since you already posted the things I left out originally. I did them a little differently for Red++ Classic Edition, since I was mimicking Gen 2, but yeah you already covered them.
Here's how it looks in my hack (yes, this is still using pokered as the base):
Last edited by Mateo (2020-08-18 23:05:03)
I am not very active on this forum. I only pop in from time to time.
Online
Thanks for restore green map.
Is there a patch of this with fixes to apply to the rom?
Offline
Thanks for restore green map.
Is there a patch of this with fixes to apply to the rom?
The diff is gone but you can always use Rangi fixes that he added recently to his rom
Offline
Pages: 1