Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-03-02 04:45:47

lusentoj
Member
From: Sweden
Registered: 2016-02-29
Post 1/31

Pokered - Alphabet Overlay Problem

Hi, so if you edit the graphics of a normal Japanese red ROM, you find that the ° " symbols are simply images that get put on top of the normal alphabet character, ex:
へ + " = べ
へ + ° = ぺ

They can't be put on just ANY character, so somewhere in the code it's defining the rules about this. The problem is that I need to access this feature while using Pokered, ex:
G + ˆ = Ĝ

The naming_screen.asm, preprocessor.py, chars.py and charmap.asm files all have to do with the alphabet, but I don't know how to do anything... If pokered could also do the Japanese version(s) of the games, then I would just edit the alphabet from there (and that would make my life a lot easier as I'm actually trying to do a hack of Green), but it seems like everything is for the English games.

Last edited by lusentoj (2016-03-02 05:04:21)

Offline

#2 2016-03-02 15:15:00

Danny-E 33
Administrator
Registered: 2012-06-09
Post 939/1,023

Re: Pokered - Alphabet Overlay Problem

As you have noticed, pokered does not include everything needed to make Jap Green.

This shouldn't be too painfully difficult. A good place to start is debugging Green in BGB and tracing the naming screen routines.
Since the addresses between english Red and Jap Green are most likely different, you first have to find where in the rom these routines are.
The first thing I would probably try would be to find the text strings that are used on that screen in a hex editor.
After you find a text string that gets loaded on the naming screen, load Green in BGB, open the debugger and set a read access breakpoint on that text string to find the routine that loads the strings during the naming screen menu.
Then you can follow how the naming screen handles button input to see how it handles those particular characters being selected.

https://github.com/pret/pokered/blob/ma … n.asm#L128
You can look at this button input code in Red just to see how it is probably structured in Green also, even though the specifics are different.


Red Hack: Pokémon Prototype

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

Offline

#3 2016-03-03 07:19:19

lusentoj
Member
From: Sweden
Registered: 2016-02-29
Post 3/31

Re: Pokered - Alphabet Overlay Problem

I'm a n00b so I don't really know, but there's a bunch of stuff about dakuten (the " °) in namingscreen.asm, including this:

.dakutensAndHandakutens
push hl
call DakutensAndHandakutens
pop hl
ret nc
dec hl
.addLetter
ld a, [wNamingScreenLetter]
ld [hli], a
ld [hl], $50
ld a, SFX_PRESS_AB
call PlaySound
ret

Dakutens: ; 6885 (1:6885)
db "かが", "きぎ", "くぐ", "けげ", "こご"
db "さざ", "しじ", "すず", "せぜ", "そぞ"
db "ただ", "ちぢ", "つづ", "てで", "とど"
db "はば", "ひび", "ふぶ", "へべ", "ほぼ"
db "カガ", "キギ", "クグ", "ケゲ", "コゴ"
db "サザ", "シジ", "スズ", "セゼ", "ソゾ"
db "タダ", "チヂ", "ツヅ", "テデ", "トド"
db "ハバ", "ヒビ", "フブ", "へべ", "ホボ"
db $ff

Isn't there some way to just "activate" the feature in red then...?

EDIT: Seems like the same overlay feature exists in 2nd gen Korean and Japanese games, but I haven't looked at pokecrystal or anything...

Last edited by lusentoj (2016-03-04 14:23:02)

Offline

#4 2016-03-04 18:26:36

comet
Member
Registered: 2012-04-09
Post 629/673

Re: Pokered - Alphabet Overlay Problem

lusentoj wrote:

Isn't there some way to just "activate" the feature in red then...?

No. The part that puts the diacritic on top was removed.

It wouldn't be that hard to put back. pokecrystal still has the part that converts codepoints with diacritics, seen here: https://github.com/pret/pokecrystal/blo … #L272-L313. I'll also paste it here in case this link dies.

CheckDict:: ; 1087
    ...

    cp "゚"
    jr z, .place ; should be .diacritic
    cp "゙"
    jr z, .place ; should be .diacritic
    jr .not_diacritic

.diacritic
    ld b, a
    call Diacritic
    jp NextChar

.not_diacritic
    cp $60 ; Regular characters
    jr nc, .place

    cp "パ"
    jr nc, .handakuten

.dakuten
    cp $20
    jr nc, .daku1
    add "カ" - "ガ"
    jr .daku2
.daku1
    add "か" - "が"
.daku2
    ld b, "゙" ; dakuten
    call Diacritic
    jr .place

.handakuten
    cp "ぱ"
    jr nc, .han1
    add "ハ" - "パ"
    jr .han2
.han1
    add "は" - "ぱ"
.han2
    ld b, "゚" ; handakuten
    call Diacritic

.place
    ...

The only thing missing in pokecrystal is the content of the Diacritic function.

Diacritic:: ; 13c6
    ret
; 13c7

All it's supposed to do is move up a line and place char b, then move back down. For example:

Diacritic::
    push de
    ld de, -SCREEN_WIDTH
    add hl, de
    ld [hl], b
    ld de, SCREEN_WIDTH
    add hl, de
    pop de
    ret

You also want to fix the block that says this:

cp "゚"
    jr z, .place ; should be .diacritic
    cp "゙"
    jr z, .place ; should be .diacritic
    jr .not_diacritic

It should look like this:

cp "゚"
    jr z, .diacritic
    cp "゙"
    jr z, .diacritic
    jr .not_diacritic

Last edited by comet (2016-03-04 18:27:07)

Offline

#5 2016-03-05 05:02:26

lusentoj
Member
From: Sweden
Registered: 2016-02-29
Post 7/31

Re: Pokered - Alphabet Overlay Problem

Thanks a ton!!! I'll test things out soon and see if I can make it work!

Offline

Board footer

Powered by FluxBB