Andrew Culver ([info]prezninja) wrote,
@ 2005-02-04 12:14:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Fixed!
All done. I reimplemented the substring decompression routine to another location (when each byte is read from the buffer) and now it works like a charm, allowing 1 byte of text to represent substrings up to 256 characters long. The best part is, the routine is incredibly more simplistic than before.

Here is the assembler code for those who care.

So the old, bloated, and time consuming substring modifications below have been thrown out, but at least I've become more comfortable with 6502 assembler and NES hardware.

In the screenshot, the strings retrieved from the substring table are represented by an arrow and the index number for now.



Again, thanks zooka :p



(6 comments) - (Post a new comment)


[info]shiikusu
2005-02-04 11:54 pm UTC (link)
Hey, nice work prez. I was kinda disappointed that the code didn't have comments though. There's some stuff I don't quite understand specifically where the code writes to different parts of the ROM.

Oh yeah, is it possible to write code that'll read substring entries from different places from the ROM while maintaining the values of the other substrings? I would think so, but my guess would probably be through a plethora of code.

(Reply to this) (Thread)


[info]prezninja
2005-02-05 03:06 am UTC (link)
I can comment the code a bit later if you want. I didn't think anyone would actually find it useful for anything more than seeing how simple it can be to implement both DTE and Substring.

And yeah, you can. I'm already with you: Toward the end of the day I started implementing the same routine in KGS1, and I noticed how little spare space there is at the end of the main code bank, certainly not enough to have a useful substring table. My solution is very much what you were thinking. It would actually be very simple to implement the substring table at the end of each code bank, and also that way each substring table could be even more relevant to that particular bank. It's possible though that it would take up more space than it saves. At the very least though, DTE usually already has table space allocated, so that shouldn't be a problem to implement.

The screenshots above don't show the DTE implemented, but it is now and works like a charm.

Pretty exciting times in the Gundam Knight Story translation scene. :p

(Reply to this) (Parent)(Thread)


[info]prezninja
2005-02-05 03:08 am UTC (link)
Oh, and like you suggested, it would be possible and quite easy in my opinion to split the tables up. For example, common names used throughout the entire game could be stored in the main code banks remaining bytes, and then less frequent strings that are only popular in particular text banks could be stored in that banks substring compression. That way C0-CF could be global substrings and D0-FF could be local substrings.

Good thinking.

(Reply to this) (Parent)(Thread)


[info]shiikusu
2005-02-05 04:30 am UTC (link)
Yeah, due to the small amount of space that's allotted in the ROM, I've had to think about ways of getting around it. But the local/global substrings method would probably work best. That example you gave totally reminded me of how variables in a C++ program work. Hopefully going through 6502 ASM will help me out in the future when I have to take that ASM class that I've been dreading. :D

Well, it looks like I have some free time this weekend so I'm probably going to go through as many KGS scripts as I can. Things are starting to move along again after about, what, 4-5 years now? :P

(Reply to this) (Parent)(Thread)


[info]prezninja
2005-02-05 03:16 pm UTC (link)
Things are starting to move along again after about, what, 4-5 years now?

*Shrug* The main thing I'd like to see done are Tom's scripts put into the game properly, bug free, and released. He put a lot of work into them, and was much more skilled at his part of the project than I was at mine. Our previous DTE hack was buggy, crashed at certain points, but I never had the skill to do the hack myself. Scripts were being inserted, but just barely fitting, usually within a couple of bytes, which posed an annoyance when I realized that most of the control codes weren't properly dumped and wouldn't fit back into the ROM once they were restored. Hopefully the new substring compression will allow for those scripts to be fixed, and still fit back into the ROM very comfortably.

(Reply to this) (Parent)


[info]prezninja
2005-02-05 03:33 pm UTC (link)
At the very least though, DTE usually already has table space allocated, so that shouldn't be a problem to implement.

I was wrong, KGS1 doesn't have a table. At least it may be possible to just remove the Dakuten/Handakuten routines and use the space for new routines/table space.

(Reply to this) (Parent)


(6 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…