Author Topic: Can I get a little help with this?  (Read 3246 times)

0 Members and 1 Guest are viewing this topic.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Can I get a little help with this?
« on: May 16, 2021, 11:48:41 am »
So I have a rom dump of the dialog from Phantasy Star.
problem is its in a bizarre format that needs cleaned up.

which I guess I could always do manually but theres 1857 lines of this stuff and that would take an absurd amount of time. I was hoping to write some code that would "re-write" the lines for me to save time, but I'm not sure just how to approach this.

he is a sample of what I need to work with,

Code: [Select]
Dialogue_Index_0002:
.db "I", Dialogue_Apostrophe, "M SUELO. I ", Word_Know, Dialogue_NewLine
.db "HOW ", Word_You_Must, " FEEL,", Dialogue_NewPage
.db "DEAR,NO ", Word_One, " CAN", Dialogue_NewLine
.db "STOP ", Word_You, Word_From, Dialogue_NewPage
.db "DOING WHAT ", Word_You, Dialogue_NewLine
.db Word_Know, " ", Word_You_Must, " DO.", Dialogue_NewPage

Dialogue_Index_0004:
.db "BUT IF ", Word_You, "SHOULD", Dialogue_NewLine
.db "EVER BE WOUNDED", Dialogue_NewPage
.db "IN BATTLE,COME", Dialogue_NewLine
.db Word_Here, " TO ", Word_Rest, ".", Dialogue_Terminator65


I don't need to worry about the NewLine, NewPage  stuff just everything else. Just not sure how to get started, was wondering if anybody else here had any nifty ideas. otherwise I'll have to attack this by just manually doing all the conversion.
Granted after becoming radioactive I only have a half-life!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Can I get a little help with this?
« Reply #1 on: May 16, 2021, 12:32:26 pm »
Isn’t this a case of IF a fragment starts with Word_, then you just strip that off, capitalize the rest, and turn underscores into spaces?

Word_Know = “KNOW”
Word_You_Must = “YOU MUST”
Word_One = “ONE”
Word_You = “YOU”

https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Can I get a little help with this?
« Reply #2 on: May 16, 2021, 12:45:38 pm »
Isn’t this a case of IF a fragment starts with Word_, then you just strip that off, capitalize the rest, and turn underscores into spaces?

Word_Know = “KNOW”
Word_You_Must = “YOU MUST”
Word_One = “ONE”
Word_You = “YOU”

how would I pull just those segments? Comma de-limited? Need to remove the extra quotations too.
I may just not be looking at this in the simplistic way its needs to be, and that is why its confounding me.
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Can I get a little help with this?
« Reply #3 on: May 16, 2021, 01:23:25 pm »
Seems like StrReplace$() function would fix most, eg replace "," and chr$(34) and "Word_" with nothing.

Could you show what dialogs are supposed to look like?

Here is that dialog in QB64 IDE using StrReplace$ (Search > Change Dialog):
Quote
Dialogue_Index_0002:
 I ' M SUELO. I  Know
 HOW  You_Must  FEEL
 DEARNO  One  CAN
 STOP  You From
 DOING WHAT  You
 Know   You_Must  DO.

Dialogue_Index_0004:
 BUT IF  You SHOULD
 EVER BE WOUNDED
 IN BATTLECOME
 Here  TO  Rest . Dialogue_Terminator65



Fix the rest in a text editor oh heck do the whole with text editor!
« Last Edit: May 16, 2021, 01:33:53 pm by bplus »

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Can I get a little help with this?
« Reply #4 on: May 16, 2021, 02:02:28 pm »
Seems like StrReplace$() function would fix most, eg replace "," and chr$(34) and "Word_" with nothing.

Could you show what dialogs are supposed to look like?

Here is that dialog in QB64 IDE using StrReplace$ (Search > Change Dialog):
Fix the rest in a text editor oh heck do the whole with text editor!

Yeah the text is supposed to be displayed 2 lines at a time, displaying "typewriter" style from left to right.
Image attached of layout.

Yeah I may have to manually do this, though gawd I don't want to spend the next 8-12 hours translating 1800+ lines! course if it take 8 to 12 hours writing a conversion program(s) whats the difference?
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Can I get a little help with this?
« Reply #5 on: May 16, 2021, 02:09:22 pm »
Yeah the text is supposed to be displayed 2 lines at a time, displaying "typewriter" style from left to right.
Image attached of layout.

Yeah I may have to manually do this, though gawd I don't want to spend the next 8-12 hours translating 1800+ lines! course if it take 8 to 12 hours writing a conversion program(s) whats the difference?

I think you can do 80% of work with mass removals, then I would CAPs the whole thing in another stroke ( Notepad++ can do that) or a filter sweep through a little Basic program.

I assume you have a StrReplace$ function, there is one that comes with QB64 in source files if you don't, or Steve or I have our versions.

I say 1 maybe 2 cups of coffee and you will be done. :-))
« Last Edit: May 16, 2021, 02:14:12 pm by bplus »