rs1re

rs1re, source codes,dokumenty
[ Pobierz całość w formacie PDF ]
Romancing Saga1: Tech Notes
RS1E Trans’ Team
Romancing Saga1 ‘Quick Notes’
Forward
Hello there! Thanks for taking the time to check out our document, ‘Romancing Saga 1 Quick notes’.
This document covers some of the processes involved to understand and alter code, thus bypassing
constraints sometimes met when translating games from Japanese to English. It’s built from my own
notes, so it may not be the most comforting read!
-
It is also far from finished/structured/coherent. I
felt, what with the minimal feedback from my last document, I’ll wait to see if there’s any response
before turning the notes into something that’s more of a tutorial/learning resource.
I have a few reasons for releasing this information. Primarily, I hope it encourages others to venture
into this field or, at least, get people to think or ask questions about this stuff.
Other reasons would be in the general decline in ‘creativity’(?) in translations, and opting for ‘off-the-
shelf’ tools. I’m sure a lot of tool writers/ASM programmers out there will agree with me in that
there’s no greater feelin’ when you write your first Script Dumper!!
-
Kudos to J3d! for his document
all those years ago which taught me! ;)
Another reason is that it justifies why Translation projects such as RS1 go quiet for periods!! This is
the kind of thing that is being worked on in those silent times.
The not-so-great point in releasing this information is the rise in Retranslations, using off-the-shelf
editors to write over other people’s translation projects. I promised myself I’d keep this sore point out
of the document, so… I hope you get something from it too (though not as a guide to retranslating RS1
=D ).
If you have any questions about anything covered in the document, you’re welcome to drop me an
email at
Anyways, I hope you do get something useful out of it. Thanks again
for reading!!!
-- FH: RS1 English Translation Project member:
Sincere Greetings and Thanks to:
David Mullen, Jason Li, Nocomply, Darkforce, all members of the Translation Projects I’ve been
involved with, Spinner8, Skeud, and all my regular website visitors!
-
23/04/04
1
Ver 1.0 FH/DM
 Romancing Saga1: Tech Notes
RS1E Trans’ Team
Overview
A point was reached in the Romancing Saga1 (RS1) Translation, David pointed out we had not
translated the Map Text in the game. The Map Screen is show below:
Town String
Country String
and Town Symbol
Compass
Using snes9x to locate how the S-NES was displaying the text (Keys 1~5), it was found that the Town
String, Compass, Country String and Town Symbol were being displayed as Objects.
This document will go into detail on the following game code routines, which are used to create the
above screen:
BuildCompass()
// Place the Compass on the Map.
BuildCountryStr()
// Place Country string and add the Town Symbol.
BuildTownString()
// Place the Town String.
RS1E_BuildTownString()
// Our code to place the Town String.
Discussion of Objects
Objects.
As RS1 is using Objects (or ‘Sprites’) to display text, it is
important to cover the rudiments of Objects, how the S-NES
displays them and how RS1 updates them.
Description of an Object.
An Object could be described as a ‘movable graphic’, such as the
character ‘Mario’, or a bullet from a space ship. An individual
Object has properties such as Horizontal and Vertical position on
the screen, orientation (say, upside down or mirror flipped) or the
number (‘name’) of the object, which indicates whether is, say, a
turtle shell or Mario.
S-NES OAM (‘Object Attribute Memory’).
The S-NES hardware can render up to 128 Objects. Object properties are held in S-NES’ Graphics
Memory known as the OAM. The format of the OAM looks like this:
23/04/04
2
Ver 1.0 FH/DM
Romancing Saga1: Tech Notes
RS1E Trans’ Team
OAM
(544-Bytes)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Object V-Postion
Object H-Position
7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
Object Entry
(4-bytes)
Object 0
Object 1
Object 2
Object 3
Flip
HV
Prio Colour
1 0 2 1 0
Name (0x000 ~ 0x1ff)
8 7 6 5 4 3 2 1 0
Object Data
(512 Bytes)
…..
Object 127
Object Size
and MSB (Horz)
Table (32-Bytes)
Object Table 2
OAM Buffer.
The OAM can only be accessed and updated when the S-NES is
not writing a picture to the television screen. The period when most
games change OAM data is known as the ‘Vertical Blank’.
Since the Vertical Blank is a short space of time to alter positions,
Object data is built whilst the screen is displaying, and stored in an
‘OAM Buffer’ in Work RAM. This buffer is a mirror image of the
544-Byte OAM layout; this means, when the Vertical Blank
occurs, we transfer a ‘carbon copy’ of our OAM Buffer to the
OAM (thus only taking a short time to transfer).
What the following text routines will show, is the manipulation of
the OAM Buffer for text display.
Map Routines
Compass
Description
This routine Fetches Horizontal and Vertical components for the Compass. It will then construct a 3*4
Object grid which will be the compass.
23/04/04
3
Ver 1.0 FH/DM
Romancing Saga1: Tech Notes
RS1E Trans’ Team
Disassembly
; === Subroutine: Generate Compass =====
; This function starts from fixed Object
; name $01f3, and will build a 3*4 tile
; grid to display the compass at the
; Designated H/V Position.
00ebc6 ad 81 16 LDA $1681 ; Fetch Map number.
00ebc9 c2 20 REP #$20 ; Accum (16 bit)
00ebcb 29 ff 00 AND #$00ff ; Mask extraneous data.
00ebce 0a ASL ; Mult by 4.
00ebcf 0a ASL ; ...
00ebd0 aa TAX ; Use as index.
00ebd1 bf 02 80 19 LDA $198002,X ; Fetch H/V tile pos (th=lowbyte, tv=highbyte).
00ebd5 20 b8 ec JSR $ecb8 ; TilePos2Pixelpos.
00ebd8 e2 20 SEP #$20 ; Accum (8 bit)
00ebda 20 de eb JSR $ebde ; SetupFixedOamEntry.
00ebdd 60 RTS ; Return.
; ======= End of GenerateCompass =======
; === Function: Tile2PixelPos ==========
00ecb8 18 CLC ; Clear Carry for addition.
00ecb9 69 04 ADC #$0304 ; Offset 3 Vertical tiles, 4 Horizontal tiles.
AND #$1f1f ; Mask to 0~31 tile range.
ASL ; Mult by 8 to give pixel position
ASL ; ...
00ecc1 0a ASL ; ...
00ecc2 85 1c STA $1c ; Store in this temp.
00ecc4 60 RTS ; Return.
;======= End of Tile2PixelPos ==========
; === Function: SetupFixedOamEntry =====
00ebde a9 f3 LDA #$f3
; Fixed OAM name??
00ebe0 85 22 STA $22
; Store in temp.
00ebe2 a9 04 LDA #$04
; Setup a count of 4.
00ebe4 85 20 STA $20
; Store in V-Row Counter.
00ebe6 a6 31 LDX $31
; Load X with OAM index.
00ebe8 a9 03 LDA #$03
; Setup count of 3.
00ebea 85 1f STA $1f
; Store in H-Row counter.
00ebec a5 1c LDA $1c
; Load H-Pos of Object.
00ebee 48 PHA
; Push onto stack.
00ebef 20 a1 ec JSR $eca1
; AddObj2Buffer
00ebf2 68 PLA
; Restore H-Pos.
00ebf3 18 CLC
; Clear carry for addition.
00ebf4 69 08 ADC #$08
; Add 8-pixels to horizontal position of Obj.
00ebf6 e6 22 INC $22
; Increment OAM Name.
00ebf8 c6 1f DEC $1f
; Decrement loop count.
00ebfa d0 f2 BNE $ebee
; Branch back if not done for all.
00ebfc a5 1d LDA $1d
; Load V-Pos.
00ebfe 18 CLC
; Clear carry for addition.
00ebff 69 08 ADC #$08
; offset by 8 pixels.
00ec01 85 1d STA $1d
; Update V-Pos.
00ec03 c6 20 DEC $20
; Decrement V-Row counter.
00ec05 d0 e1 BNE $ebe8
; Branch back if not done for all.
00ec07 86 31 STX $31 ; Done for all: Update current OamBuffer index.
00ec09 60 RTS ; Return.
; ======= End of SetupFixedOamentry ====
; === Function: AddObj2Buffer ==========
; Accum has ObjHPos value upon entry.
00eca1 9d 00 00 STA $0000,X ; Store ObjHPos.
00eca4 a5 1d LDA $1d ; Fetch.
00eca6 9d 01 00 STA $0001,X ; Store ObjVPos.
00eca9 a5 22 LDA $22 ; Fetch.
00ecab 9d 02 00 STA $0002,X ; Store ObjName.
00ecae a9 25 LDA #$25 ; %00-10-010-1
00ecb0 9d 03 00 STA $0003,X ; Store ObjAttrib (Flip,Prio,Pal,TNameMSB)
00ecb3 e8 INX
; Adjust Index to next ObjEntry.
00ecb4 e8 INX
; ...
00ecb5 e8 INX ; ...
00ecb6 e8 INX ; ...
00ecb7 60 RTS ; Return.
;===== End of AddObj2Buffer ============
23/04/04
4
Ver 1.0 FH/DM
Romancing Saga1: Tech Notes
RS1E Trans’ Team
Country/Town Symbol
Description
Description of a Country Block
String Type/Terminator
Display Condition Mask or
String Length
Horizontal Position
Vertical Position
Object Name
Country Block Table
Country Block
Pointers
5-Bytes
Country Block #00
Country Block #01
Country Ptr #00
Country Ptr #01
Current
Map #
16 Pointers
to sets of
Country
Blocks
...
...
Country Block #nn
Country Ptr #15
Memory Structures
23/04/04
5
Ver 1.0 FH/DM
[ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • lemansa.htw.pl
  • Tematy
    Powered by wordpress | Theme: simpletex | © Smętna dusza może nas zabić prędzej, o wiele prędzej niż zarazek.