[Translation] Nazo no Masquerade
Posted: Sun Oct 02, 2011 12:51 pm
Hi there!
I just took a quick look at this game and here are the cool stuffs. The games has 2 fonts, an 8x8 one with numbers, symbols, upper case and 8x8 kanji (I think), and a 16x16 one. The text for the introduction starts at $4dc49. The date 1921 is stored in plain ascii. So I brutally wrote some stupid text in upper case and voilà!
I identified 2 special chars : $fc for newline $fb which indicates that the next byte is one of the 16x16 symbol.
About the code: I made a quick read and it seems that it comes in 2 part. First the text is read from ROM and put in an array in BSS ($9bb6 to 9bc5). The drawing parts happens around $9d84 ($2a $2b are set at $9bd5).
It seems that all the strings are contiguous. Let's call this area "the string space". So this space is divided in blocs. Each bloc seems to start with a 3 bytes header. The introduction one ($4dc46) starts with $01 $fe $fb. If you look a little bit farther in the ROM you'll find $02 $fe $fb and so one. So there must be some place telling the game which bloc to use. If we put a read breakpoint on $4dc46 (use *8dc46 on Mednafen), we end up at $9b13.
In order to make things short, this codes scans the area pointed by $06 until it finds #$fe. Remember our header ($01 $fe $fb). So it first read $01. Stores it in $0e and jump to next byte (that's what the routine located at $9c74 do). Next #$fe is read. We are out of the loop. Then comes the interesting part. It checks the value of $0e against $33dd (it's in RAM). If they are not equal, it will resume the bloc scan until a matching header is found. The next logical task is to put a write breakpoint at $33dd. And we may consider ourselves lucky because this is what we get when we restarts the game:If you keep the write breakpoint at $33dd, skip the intro and start a new game, you'll get:
So if you modified the text for the 2nd string bloc, you may see something like this:
The string table (or what's close to it) is getting closer!
Next items on the todo list:
I just took a quick look at this game and here are the cool stuffs. The games has 2 fonts, an 8x8 one with numbers, symbols, upper case and 8x8 kanji (I think), and a 16x16 one. The text for the introduction starts at $4dc49. The date 1921 is stored in plain ascii. So I brutally wrote some stupid text in upper case and voilà!
I identified 2 special chars : $fc for newline $fb which indicates that the next byte is one of the 16x16 symbol.
About the code: I made a quick read and it seems that it comes in 2 part. First the text is read from ROM and put in an array in BSS ($9bb6 to 9bc5).
Code: Select all
9bb6: cly
clx
9bb8: lda ($06),y
sta $2220,x
beq $9bc5
inx
jsr $9c74
bra $9bb8
rts
Code: Select all
9d84: lda $10
sta $0002
lda $11
sta $0003
lda ($2a),y
cmp #$de
beq $9d98
cmp #$df
bne $9da9
9d98: iny
Code: Select all
9b13: lda ($06),y
cmp #$fe
beq $9b20
sta $0e
9b1b: jsr $9c74
bra $9b13
9b20: lda $0e
cmp $33dd
bne $9b1b
; ...
Code: Select all
ae55: lda #$01
sta $33dd
lda #$05
clx
jsr $9f1b
; ...
Code: Select all
8012: ldx #$02
stx $33dd
jsr $80f6
; ...
The string table (or what's close to it) is getting closer!
Next items on the todo list:
- String tables.
- Font data.
- Extract script.