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

Author Topic: Changing text speed  (Read 1715 times)

Malias

  • Sr. Member
  • ****
  • Posts: 292
    • View Profile
Changing text speed
« on: December 14, 2018, 07:17:00 pm »
I'd like to change the text speed of Panorama Cotton and I'm a little lost.  I got a trace between characters being printed and I see places where the same code is repeated multiple times.  But, I'm not sure if that's timing code and if it is I don't understand how the code exits.  Does anyone have any knowledge or docs about how these games timed things like text print speed and how I might go about finding and changing it?
The great achievement is to lose one's reason for no reason, and to let my lady know that if I can do this without cause, what should I do if there were cause?
     ~Don Quixote~

Psyklax

  • Hero Member
  • *****
  • Posts: 1055
    • View Profile
    • Psyklax Translations
Re: Changing text speed
« Reply #1 on: December 14, 2018, 07:34:06 pm »
I have two things to say here.

First, the game hasn't been translated into English, as far as I can tell, so why are you worried about the speed of the text if you can't even read it? (unless you can read it, in which case this point is moot)

And secondly, the way you're talking gives me the impression that you're not exactly familiar with 68K assembly, correct? If you want to mess with text timing, you'll need to know some assembly, and it's not always as simple as it seems. :)

EDIT: I just found out that you yourself have recently translated it into English. Congrats! :)

But that does make me wonder why you're having difficulty, unless you didn't need to do any assembly hacking in your project...

Malias

  • Sr. Member
  • ****
  • Posts: 292
    • View Profile
Re: Changing text speed
« Reply #2 on: December 14, 2018, 11:37:02 pm »
Of course I know assembly and I did use it in my project.  I've just never done anything with timing before and I don't know what I'm looking for.  And, the site doesn't really have any docs on the topic from what I could see.  So, I figured I'd ask and see if anyone has dealt with it before.
The great achievement is to lose one's reason for no reason, and to let my lady know that if I can do this without cause, what should I do if there were cause?
     ~Don Quixote~

Cyneprepou4uk

  • Full Member
  • ***
  • Posts: 176
  • Самый лысый ромхакер
    • View Profile
Re: Changing text speed
« Reply #3 on: December 15, 2018, 01:27:12 am »
The game has to know how many frames left until next letter will be drawn. Basically it has to store this timer somewhere in ram, and decrease it every frame until it ends, then draw a letter and setup a timer again for the next letter. Find this address and change a value which is written into it.
I am the baldest romhacker
NES Romhacking Guide

Psyklax

  • Hero Member
  • *****
  • Posts: 1055
    • View Profile
    • Psyklax Translations
Re: Changing text speed
« Reply #4 on: December 15, 2018, 02:28:36 am »
Okay, that's what I thought. :D Well, I have more experience with the NES than the Genesis, but the typical way a game knows when to print each letter, assuming it doesn't do it once per frame, is to use a counter of some kind. So let's say they want each letter to appear every four frames. So you print a letter and add 4 to somewhere in RAM. Then the next frame, the routine decrements that part of RAM and checks if it's now zero. If it is, new letter, if not, carry on.

Looking at Panorama Cotton, it prints characters every six frames. I tried doing a bit of debugging myself to see if I could pinpoint the exact thing the game was counting on. The only thing that looked somewhat similar was a counter at $8016 that counts down from 6, and the game printed a new character at 4, but when I changed the instruction to screw around with it, the text didn't change.

I haven't done the research to know which instructions actually print the text, but obviously you do. If I knew that, I might be able to get closer to figuring it out, but as it stands, I'm not sure. :)

FAST6191

  • Hero Member
  • *****
  • Posts: 2591
    • View Profile
Re: Changing text speed
« Reply #5 on: December 15, 2018, 06:53:46 am »
Does the game have a speed selector in the options anywhere?

If I am doing such things I will tend to look at one of those, either to figure out the timings or see if I can insert a greater number than the options might theoretically account for in there to boost it.

Same might also be said if part of the game does anything fancy with the text as far as speed to produce some kind of effect. This is considerably less common on the 16 bit and older consoles but far from unknown.

I assume if you had a skip command or a fill text by pressing a button command in the game you would have looked to see if there is anything to abuse there.

After that yeah you are probably left with figuring out the character drawing routine (or character reveal routine if it goes that way) and any delays it has, or if you can stuff a couple of characters in there at once. There have been games that go full bore into subtitle/caption/timed text but I would be rather surprised to see it for a megadrive game.

Pennywise

  • Hero Member
  • *****
  • Posts: 2250
  • I'm curious
    • View Profile
    • Yojimbo's Translations
Re: Changing text speed
« Reply #6 on: December 15, 2018, 10:05:18 am »
Anytime I've ever hacked text speed, the game usually had a text speed or fast forward option for me to compare against in RAM.

Malias

  • Sr. Member
  • ****
  • Posts: 292
    • View Profile
Re: Changing text speed
« Reply #7 on: December 16, 2018, 03:45:17 am »
Looking at Panorama Cotton, it prints characters every six frames. I tried doing a bit of debugging myself to see if I could pinpoint the exact thing the game was counting on. The only thing that looked somewhat similar was a counter at $8016 that counts down from 6, and the game printed a new character at 4, but when I changed the instruction to screw around with it, the text didn't change.

Yeah, I saw that and experienced the same thing you did.  It's probably a timer for controller input or something.  I'll keep in mind to think about frame timing though.

Does the game have a speed selector in the options anywhere?

If I am doing such things I will tend to look at one of those, either to figure out the timings or see if I can insert a greater number than the options might theoretically account for in there to boost it.

Same might also be said if part of the game does anything fancy with the text as far as speed to produce some kind of effect. This is considerably less common on the 16 bit and older consoles but far from unknown.

I assume if you had a skip command or a fill text by pressing a button command in the game you would have looked to see if there is anything to abuse there.

After that yeah you are probably left with figuring out the character drawing routine (or character reveal routine if it goes that way) and any delays it has, or if you can stuff a couple of characters in there at once. There have been games that go full bore into subtitle/caption/timed text but I would be rather surprised to see it for a megadrive game.

Unfortunately, this game doesn't let you control message speed so I can't take that route.  It does have sections of text that you can display all at once with a button press though.  I'll take a look at the input handling code and see what I can find out.  Thanks!

Edit:

Well, I found the print speed timer.  And go figure, it was being set right after the code to read in the text.  It looks like it only decrements every other frame which is why I couldn't find it right away. It's not granular enough to change permanently, but I can still use this.  Thanks again, everyone.
« Last Edit: December 16, 2018, 10:17:21 pm by Malias »
The great achievement is to lose one's reason for no reason, and to let my lady know that if I can do this without cause, what should I do if there were cause?
     ~Don Quixote~