News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Der Langrisser vwf routine  (Read 1335 times)

yugisokubodai

  • Full Member
  • ***
  • Posts: 144
    • View Profile
    • Assembly
Der Langrisser vwf routine
« on: December 21, 2015, 01:11:06 pm »
I'm working on Der Langrisser (Snes).
The game use a fix width font, 12x12 pixel.
So there must be somewhere which indicates the pixels to read.

CLC
LDA....
ADC #$0C

I guess. I searched through the log and didn't find anything alike.

Please tell me where I get wrong?
I want to add a vwf to the game.

mziab

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • mteam
Re: Der Langrisser vwf routine
« Reply #1 on: December 21, 2015, 02:17:11 pm »
You have at least two possible approaches you could use:

1) Find where the font is stored in ROM, set a read breakpoint and work back from there.
This is less feasible if the font is compressed or stored in a non-standard way. AFAIR Der Langrisser's font probably is. FEIDIAN had some custom definitions to dump and insert it.

2) Find the font tiles in VRAM and set a VRAM write breakpoint and see where it's transferred from.
In most cases the font will be preloaded to a canvas in RAM and then transferred to VRAM using DMA.

In general the tiles will probably be shifted 12 times somewhere, so I'd look for a LSR/ORA combo in the trace. But using breakpoints gives you much better odds of finding where to look than blindly looking for opcodes you expect.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6909
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Der Langrisser vwf routine
« Reply #2 on: December 21, 2015, 05:27:13 pm »
Several times when I have looked at games using 12x12, it has been drawn as 16x16 fonts.
That is, it will draw the "even" characters as a 16x16 (with the right 4 pixels blank as well as two blank top and bottom rows), then on the "odd" characters, it will load the font as a 16x16 character (again as above) then shift it 4 pixels right (meaning the left 4 pixels will be blank), and use OR to make the two 16x16 tiles overlap in the center.
Code: [Select]
1st 16x16
+-----------------+
|AAAAAAAA|AAAA    |
+----------------+--------+
         |    BBBB|BBBBBBBB|
         +-----------------+
        2nd 16x16
With the middle 8pixels merged to contain AAAABBBB
"My watch says 30 chickens" Google, 2018

yugisokubodai

  • Full Member
  • ***
  • Posts: 144
    • View Profile
    • Assembly
Re: Der Langrisser vwf routine
« Reply #3 on: December 25, 2015, 07:05:00 pm »
Several times when I have looked at games using 12x12, it has been drawn as 16x16 fonts.
That is, it will draw the "even" characters as a 16x16 (with the right 4 pixels blank as well as two blank top and bottom rows), then on the "odd" characters, it will load the font as a 16x16 character (again as above) then shift it 4 pixels right (meaning the left 4 pixels will be blank), and use OR to make the two 16x16 tiles overlap in the center.
Code: [Select]
1st 16x16
+-----------------+
|AAAAAAAA|AAAA    |
+----------------+--------+
         |    BBBB|BBBBBBBB|
         +-----------------+
        2nd 16x16
With the middle 8pixels merged to contain AAAABBBB

I had a hard time struggling with Der Langrisser's font routine.
« Last Edit: December 26, 2015, 12:07:26 am by yugisokubodai »