Wikifang:Telefang 1 Translation Patch/RAM map

From Wikifang, a definitive guide to Telefang, Dino Device and Bugsite
Revision as of 17:22, 18 September 2011 by Kmeisthax (talk | contribs) (Created page with "{|class=wikitable cellpadding=5 |- ! Location ! Length ! Symbolic name ! Purpose ! Typical values ! Added in patch? |- | C3C2 | 1 | Regstor_SCX | Shadow register | | No |- | C3C3...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Location Length Symbolic name Purpose Typical values Added in patch?
C3C2 1 Regstor_SCX Shadow register No
C3C3 1 Regstor_SCY Shadow register No
C3C4 1 Regstor_WX Shadow register No
C3C5 1 Regstor_WY Shadow register No
C3C6 1 Regstor_BGP Shadow register No
C3C7 1 Regstor_OBP0 Shadow register No
C3C8 1 Regstor_OBP1 Shadow register No
C3C9 1 Regstor_LCDC Shadow register No
C3CA 1 Regstor_LYC Shadow register No
These are registers to hold the values of things that need to be modified at Vblank time, either because they can't be touched during render time or because it makes more sense for it to be touched there.

Every Gameboy project will have at least one of these kinds of locations, since it's the only safe (non hardware-damaging) way to turn off the LCD.

C3E0 1 SystemState Game state table index No
C3E1 1 SystemSubState Game state table index No
C3E2 1 SystemSubSubState Game state table index No
Per-frame functions are managed with state machines throughout Telefang, especially the main gameloop. There are three State bytes, because there can be up to three levels of state machines to reach a particular per-frame function.

Please note that this is not the only state machine in Telefang, though it is the largest.

C3E8 1 GameboyType Internal hardware detection 01 (DMG), 11 (MGB), FF (CGB) No
This is another "every project has one" location. It is the contents of the A register on startup, which can be used to distinguish between operation on a DMG (brick) gameboy, MGB (pocket) gameboy, or Gameboy Color. This is needed to determine if CGB features are available.

This does NOT tell you if you're on a Super Gameboy, that's different.

C423 1 SPILL_TempBank Returning to previous banks No
C425 1 CurrentBank Bankswitching No
These variables are in use for managing bankswitching. There are two RST routines available for using these values:
  • rst $10, which switches to the bank in A and records that bank ID in CurrentBank
  • rst $18, which reads the value from SPILL_TempBank and calls rst $10
C7C1 1 VWF_CurrentLetter Text rendering Yes
This stores the current letter being rendered in the VWF routines.
C7C2 1 VWF_LetterShift Text rendering Yes
This stores the current Y pixel location of in-progress text renders, modulo 8.

It's used specifically to track how many shifts are needed when drawing text in the VWF routine.

C7C3 2 VWF_CompositeArea Text rendering $D0CF Not sure
Pointer to the compositing area used to store in-progress text rendering.

I am not sure if the compositing area is used in the original game.

C7C5 1 VWF_OldTileMode Text rendering 0, 1, 2 Yes
Internal VWF bookkeeping variable used to manage the contents of the compositing area.

When 0, the current drawing progress has not yet crossed a tile boundary, and the compositing area is drawn to freely. When 1, the current drawing progress has crossed a tile boundary, and the compositing area is globally moved left by one tile during drawing so that drawing can continue. State 2 is never set by the VWF itself, only other code. It indicates that a newline or other disruption in normal text flow has occured and thus the entire contents of the compositing area should be treated as garbage.

C7C6 1 VWF_MainScriptHack Text rendering 0, 1 Yes
This is a boolean value historically (in terms of the patch) used to track the main script state and enable some hacks which made newlines work properly. Most of the reason for this value's existence has been moved away since the main script was later hacked to properly manage it's own tiles in the face of a VWF.