Page 1 of 1

Emulator-dependant bug

Posted: Wed Aug 06, 2014 2:58 pm
by tryphon
Hello,

I try to implement a Variable Width (Proportionnal) Font in the game "Phantasy Star III", and I bump into something quite frightening for me that I describe :

sometimes, some letters are garbled, but :
* it occurs on some NPCs' dialogues, but not on others.
* it doesn't occur everytime on a given NPC
* length of the dialogues, or particular letters, don't seem relevant
* it doesn't occur on the same NPCs if I use Regen or Fusion
* it doesn't occur at all if I use Gens

I have no idea if it occurs on a real Megadrive. I have no idea if Regen or Fusion are more likely to tell the truth than Gens. And if it's a bug from Regen and Fusion, I don't know how to avoid it.

To be true, I have no idea if I am doing something wrong, or if the emulators do. I thought someone more experimented could know this kind of problem.

If you want, I can post the code of the text rendering routine, and screenshots. I can also provide the entire ROM, or just a patch if forum rules forbid it.

Basically, it build patterns by shifting 2bpp images and gluing them, and write in RAM the list of tiles attributes values for the plane.

Posted: Wed Aug 06, 2014 3:28 pm
by djcouchycouch
Are they really garbled or they're pointing to other tiles?

Is there enough room in the VDP for the tiles you're building?

Posted: Wed Aug 06, 2014 3:39 pm
by tryphon
First question needs investigation.
Answer to the second is Yes (I build less than 32 tiles from position 0)

Posted: Wed Aug 06, 2014 4:20 pm
by tryphon
After investigation, the pattern pointed is right, but the pattern info is wrong.

Here are some screenshots from the same scene, but with different emulators :

With Gens :

Image

Posted: Wed Aug 06, 2014 4:24 pm
by tryphon
With fusion :

Image

Posted: Wed Aug 06, 2014 4:30 pm
by tryphon
With Regen (the two were taken during the same gameplay) :

Image

and

Image

(and I understood why img tag didn't work, sorry for the inconvenience)

Posted: Wed Aug 06, 2014 5:41 pm
by Gigasoft
Looks like you are failing to synchronize accesses to the VDP. Make sure that you don't get interrupted in the middle of accessing the VDP by code that also accesses the VDP. Data uploads should preferably happen during blanking.

Posted: Thu Aug 07, 2014 7:32 am
by tryphon
You were right. VBLANK was interfering.

Edit : I forgot to say "Thank you !" :)