+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  How I make a game support one byte characters?
Pages: 1 ... 3 4 [5]
Author Topic: How I make a game support one byte characters?  (Read 3969 times)
Suzaku
Guest
« Reply #60 on: February 02, 2007, 10:58:24 pm »

Quote from: Rai
Okay, so assuming there are no documents out there that would even tell use as much as the program to use to make a demo, I apperently need to make my own NES demo making program, and figure out on my own how you would build an NES game from scratch.

Grab a text editor (Windows conveniently ships with Notepad) and a NES assembler. Write the code in your text editor, and run it through the assembler.

At least, that's how we did it in college. I'd imagine the process would be pretty much the same for this.
Disch
Guest
« Reply #61 on: February 03, 2007, 12:00:26 am »

http://nesdev.parodius.com/bbs/viewtopic.php?t=2615

http://nesdev.parodius.com/bbs/viewforum.php?f=10

When you include the forums, NESdev has everything you need.  Look through the newbie help forum and read old threads.  A lot of people had the same questions you do.  You might find answers and doc recommendations.

That said -- nesdev is a complicated area.  6502 is the easy part... the hard part is interacting with the hardware to make it do what you want.  Learning how to do both at the same time is a double-whammy, but is far from impossible.
hippiejake
Guest
« Reply #62 on: February 03, 2007, 07:53:31 pm »

5 pages of pure dumb questions, answers, ignorance, and the resulting flaming.
As much as I'm enjoying this, by the time I got to the end of this thread, I expected to find that one of the mods had locked it.
Nope. :police:
KaioShin
Guest
« Reply #63 on: February 03, 2007, 08:35:42 pm »

Quote from: hippiejake on February 03, 2007, 07:53:31 pm
5 pages of pure dumb questions, answers, ignorance, and the resulting flaming.
As much as I'm enjoying this, by the time I got to the end of this thread, I expected to find that one of the mods had locked it.
Nope. :police:

We know what we do, telling us how to do our job is rude -_-
Weedle
Guest
« Reply #64 on: February 04, 2007, 04:13:47 pm »

Quote from: Lenophis on February 02, 2007, 02:02:02 pm

Code:
C3/8746: 209C87  JSR $879C
C3/8749: 20EB87  JSR $87EB
C3/874C: A92C    LDA #$2C
C3/874E: 8529    STA $29         (set text color to blue)
C3/8750: A01D8E  LDY #$8E1D      (position of positioning of word "Attack")
C3/8753: 20F902  JSR $02F9       (display "Attack")
C3/8756: 20A088  JSR $88A0
C3/8759: A920    LDA #$20
C3/875B: 8529    STA $29         (set text color to white)
C3/875D: AE3421  LDX $2134
C3/8760: BF1350D8 LDA $D85013,X (Load item X weapon properties)
C3/8764: 1008    BPL $876E
C3/8766: A0308E  LDY #$8E30      (position of and word "Runic")
C3/8769: 84E7    STY $E7
C3/876B: 209587  JSR $8795
C3/876E: AE3421  LDX $2134
C3/8771: BF1350D8 LDA $D85013,X (Load item X weapon properties)
C3/8775: 2940    AND #$40
C3/8777: F008    BEQ $8781
C3/8779: A0388E  LDY #$8E38      (position of and word "2-hand")
C3/877C: 84E7    STY $E7
C3/877E: 209587  JSR $8795
C3/8781: AE3421  LDX $2134
C3/8784: BF1350D8 LDA $D85013,X (Load item X weapon properties)
C3/8788: 2902    AND #$02
C3/878A: F008    BEQ $8794
C3/878C: A0268E  LDY #$8E26      (position of and word "SwdTech")
C3/878F: 84E7    STY $E7
C3/8791: 209587  JSR $8795
C3/8794: 60      RTS             (This routine is badly written. It's something Lenophis would write! :P)
 
C3/8795: A9C3    LDA #$C3        (The bank to look in)
C3/8797: 85E9    STA $E9
C3/8799: 4CFF02  JMP $02FF       (display text at $E7 - $E9)


A question for Lenophis on his 'exam'.

Is the code at $8795 a subroutine?  What I mean is, in the code it's called using JSR but there's no RTS at the end, just 'JMP $02FF'.  Will the code at $02FF return or am I way off track?
Lenophis
Guest
« Reply #65 on: February 04, 2007, 05:51:58 pm »

Yeah, it jumps there by JSR. The routine at 02FF ends with RTS.
Shadowless
Guest
« Reply #66 on: February 22, 2007, 10:35:55 pm »

POSTING IN EPIC THREAD
granitor
Guest
« Reply #67 on: April 14, 2007, 03:47:59 pm »

Quote from: Rai on January 30, 2007, 07:40:19 pm
Quote from: Spikeman on January 30, 2007, 06:30:46 pm
Do you mean a VWF or changing the actual characters so they are one byte rather than two? From what you're explaining it seems like the latter, but from you're pictures it seems like the former. Roll Eyes
The latter, you see every character takes up two bytes of space, but I want them to take up one byte of space, so when I type in uncompressed one byte English letters, they view in the game(Currently when I try using one byte English letters, the text comes up blank). Any docs out there that would help me understand PSX ASM, maybe even do something like this?

It seems to me that the next four plus pages, though quite amusing, jumped off from a mis-understanding at this point. I'm not yet a ROM-Hacker, but I have done some programming (nothing recent or worth noticing, really), so feel free to ignore my advice/comments.

What he seems to want, judging from his opening post and screenshot, is a vwf routine which will allow him to squeeze "Please enter your name." onto one line.

However, he's limited in two ways:

1) the original file allocates a fixed area of memory for the Japanese script. He believes that if he changes from dual-byte encoding to single-byte encoding, he'll have twice as much effective text space in the ROM.

The problem needs to be redefined here. It's not how to get twice as much space, but rather, how to use arbitrarily long strings in the ROM, rather than the original, fixed length strings. In order to do that, you'd have to understand how the text routines work, and perhaps alter a pointer table, but there's no way of knowing with disassembling and understanding the original code.

2) the text routine used a fixed-width font which doesn't give English words, which are longer than the Japanese, enough room to display the longer lines, which is what he seems to be getting at when he said something "even if I could make it fit, it just looks bad".

The thing is, whether you read docs on 6502 or PSX ASM, you might not understand the nature of pointers and storage; but both ASM knowledge to disassemble the code, and  more... systems-level... for want of better words... knowledge are needed, I don't think that can be learnt easily; and the fastest way to learn it nowadays would probally be to learn C, esp. from a book or guide with a section explaining memory management, pointers, and why fixed buffers for strings can be bad (as they're giving Rai such headaches).

Well, I've never hacked a ROM, but I did do some assembly work back in the 8-bit generation, and this is what I'd advise:

1) write a tool to extract the script; in doing so you'll need to find the pointer table, if there is on, and dump it, and all of the script with index numbers. i.e. you'd want a file with stuff like:

index:1 location:$1234 kana:[weird looking stuff]

although there's a standard format in the docs which looks more like:

1
"weird looking kana stuff here"

2
"more weird looking kana stuff"

I notice most script dumps use the ROM offsets, rather than an index number. I'm here assuming that the code contains a pointer table and you will alter the offset on re-insertion as needed, and thus the index number is the only guaranteed invariant of the process. Might be a silly assumption, but the only way to see is to disassemble the program.

2) edit the script separate from the program, i.e. in a text editor or so, to generate the English phrases.

3) write a tool to re-insert the script, which would have to manage empty space in the ROM, and alter the pointer table as needed.

The details, I can't say... I haven't used any recent tools and just to get the dust out of my mind, I'd probally write my own as much as practical (I might write a 6502 asm/disassembler, but for PSX I'd just use whatever one was recommended -- R3000 ASM is much too much work to write an assembler for just for fun), but that's because I like to do unecessary things just to feel smart.

They may be tools that are more helpful in extracting scripts and whatnot, but I can't imagine gaining enough knowledge of ASM or programming in general without writing at least one extractor/insertion tool, also the script might be partially written in code (ASM) rather than just passive data so... the experience won't be put to waste.

I wouldn't recommend learning 6502 ASM and NES Arch.; his goals isn't to become a programmer,  his goal is to edit the script. Since no-one has written an extractor then he might as well learn R3000a ASM and PSX Architecture enough to disassemble and trace the code enough to find the text routines, and write an extractor/insertion tool.

 
« Last Edit: April 14, 2007, 04:05:28 pm by granitor »
snesmaster40
Guest
« Reply #68 on: April 15, 2007, 05:35:56 am »

Actually I thought he wanted to use ASCII instead of SJIS so he could save space for the script
granitor
Guest
« Reply #69 on: April 15, 2007, 11:50:15 am »

Quote from: snesmaster40 on April 15, 2007, 05:35:56 am
Actually I thought he wanted to use ASCII instead of SJIS so he could save space for the script

Yeah, but, what happens if the new script is more than twice as large as the old script?
KaioShin
Guest
« Reply #70 on: April 15, 2007, 12:07:29 pm »

Quote from: granitor on April 15, 2007, 11:50:15 am
Quote from: snesmaster40 on April 15, 2007, 05:35:56 am
Actually I thought he wanted to use ASCII instead of SJIS so he could save space for the script

Yeah, but, what happens if the new script is more than twice as large as the old script?


Pointers can still make it happen.

Anyway, this thread is OLD. He propably moved on to twenty new projects in the meanwhile  Roll Eyes
Pages: 1 ... 3 4 [5]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC