Unused Game Content Unfinished Super Game Boy SNES OBJ_TRN C1 Function Programming Code DATA_SND 79
http://gamehacking.org/vb/threads/12747-nensondubois-codes?p=94008#post94008
http://gamehacking.org/vb/threads/12747-nensondubois-codes?p=95485#post95485
Code 18 OBJ_TRN C1. SNES Object Transfer Mode. Register file data. Used to display up to 24 entries of scrollable 8×8 or 16×16 Objects on the screen, comprising a total onscreen palette of 256.
The official NOA/NOE Game Boy programming document defines OBJ_TRN as "Use prohibited" and only lists CHR_TRN and PCT_TRN information because OBJ_TRN was never finished and has no function even when it is setup. Assumed to have been in Japanese official Nintendo docs(?)
SNES Game Genie
D560-070D
PAR Pro Action Replay MK3 ROM Patch
00814D07
RAM
7E0F0601
DATA_SND Game Boy Command Set:
To toggle this in any game, at any time set the following DATA_SND commands in GB/GBC ROM:
[CODE]
79060F007E0100000000000000000000 - Enable OBJ_TRN mode
79060F007E0000000000000000000000 - Disable OBJ_TRN mode
[/CODE]
youtube.com/watch?v=r0mtcZ3UHnc - 熱闘リアルバウト餓狼伝説SPECIAL OBJ_TRN partially implemented in a commercial game.
Also listed in various ROMs as unused SDK code remnants or a default library listing tables.
If the game does send CHR to the SNES, contents of the masked screen area is read out sending invalid writes to SNES VRAM registers (glitched graphic data) since games obviously weren't programmed with OBJ_TRN information. That is what is happening during this demonstration.
Palette swap resets graphics with X button
Here are the unused OBJ_TRN caveats {pandocs and my own research}
Used to transfer tile data (characters) to SNES Tile memory in VRAM. This normally used to define BG tiles for the SGB Border (see PCT_TRN), but might be also used to define moveable SNES foreground sprites (see OBJ_TRN).
Byte - Content
0 Command*8+Length (fixed length=1)
1 Tile Transfer Destination
Bit 0 Tile Numbers (0=Tiles 00h-7Fh, 1=Tiles 80h-FFh)
Bit 1 Tile Type (0=BG Tiles, 1=OBJ Tiles)
Bit 2-7 Not used (zero)
2-F Not used (zero)
The tile data is sent by VRAM-Transfer (4 KBytes).
000-FFF Bitmap data for 128 Tiles
Each tile occupies 16bytes (8x8 pixels, 16 colours each). When intending to transfer more than 128 tiles, call this function twice (once for tiles 00h-7Fh, and once for tiles 80h-FFh). Note: The BG/OBJ Bit seems to have no effect and writes to the same VRAM addresses for both BG and OBJ ???
Byte: Setting:
0 Command*8+Length (fixed length=1)
1 Control Bits
Bit 0 - SNES OBJ Mode enable (0=Cancel, 1=Enable)
Bit 1 - Change OBJ Colour (0=No, 1=Use definitions below)
Bit 2-7 - Not used (zero)
2-3 System Colour Palette Number for OBJ Palette 4 (0-511)
4-5 System Colour Palette Number for OBJ Palette 5 (0-511)
6-7 System Colour Palette Number for OBJ Palette 6 (0-511)
8-9 System Colour Palette Number for OBJ Palette 7 (0-511)
Palette entrees are ignored if above Control Bit 1 is zero.
Because each OBJ palette consists of 16 coluors, four system
palette entries (of 4 colours each) are transferred into each
OBJ palette. Specific system palette numbers are not required to be aligned to a multiple of four, and will wrap to palette number
0 when exceeding 511. For example, a value of 511 would copy
system palettes 511, 0, 1, 2 to the SNES OBJ palette.
A-F Not used (zero)
The recommended method is to "display" Game Boy BG tiles from F9h-FFh left to right as the first 7 characters of the bottom-most character line of the Game Boy screen. As for normal 4KByte VRAM transfers, this area should not be scrolled, should not be overlapped by Game Boy OBJs, and the Game Boy GBP palette register should be set up to avoid conflicting with the normal in-game palettes. SNES OAM data can be defined in the 70h bytes of the Game Boy BG tile memory at following addresses:
8F90-8FEF SNES OAM, 24 Entries of 4 bytes each (96 bytes)
8FF0-8FF5 SNES OAM MSBs, 24 Entries of 2 bits each (6 bytes)
8FF6-8FFF Not used, don't care (10 bytes)
The format of SNES OAM Entrees are:
Byte 0 OBJ X-Position (0-511, MSB is separately stored, see below)
Byte 1 OBJ Y-Position (0-255)
Byte 2-3 Attributes (16bit)
Bit 0-8 Tile Number (use only 00h-FFh, upper bit zero)
Bit 9-11 Palette Number (use only 4-7)
Bit 12-13 OBJ Priority (use only 3)
Bit 14 X-Flip (0=Normal, 1=Mirror horizontally)
Bit 15 Y-Flip (0=Normal, 1=Mirror vertically)
The format of SNES OAM MSB Entrees are unknown. However, 2 bits are used per entry: One bit is the most significant bit of the OBJ X-Position. The other bit specifies the OBJ size (8×8 or 16×16 pixels).
I also wrote a tech demo .gb ROM that enables the unused and unfinished SNES Super Nintendo OBJ_TRN mode in any game!
If you have a flash cartridge such as the GB Everdrive then just load the demo and swap in desired cartridge.
tinyurl.com/j9rbgvz
Follow me on twitter: https://twitter.com/nensondubois_
Please rate, comment, like, share, and subscribe to support this channel and content!
Also, Google wallet donations accepted: pm me for details if interested.
eof