Super Game Boy 2 DATA_SND DATA_TRN JUMP Programming Example 3 Setting New Program Counter Address

Channel:
Subscribers:
1,440
Published on ● Video Link: https://www.youtube.com/watch?v=VSJ2kp9W9kU



Duration: 4:40
1,172 views
11


Showing that it is possible to set the SNES NMI counter to a new bank (or any specified destination address or bank) using the JUMP and supplementary DATA_SND (controls, sets, and sends data to SNES WRAM) commands to jump to the new destination from a Game Boy ROM program game. I wrote a piece of code that jumps to the credits screen instantly without needing to enter the button code. This code will now work with the original Super Game Boy BIOS since code was shifted around, causing the JUMP command to jump to a different location in memory between the SGB/SGB2 BIOS revisions.

This is part of the code I wrote to jump to the SGB/2 BIOS credits/staff roll. the DATA_SND will set RAM in the SNES WRAM resolve the graphical glitches that occur when setting the SNES program counter to a new location. the DATA_TRN is just a program loop function and the JUMP sets the program counter to a new bank at the original vector. (The demo does not actually send data to the SGB BIOS)

JUMP can be programmed to take control away from the SGB/2 BIOS directly accessing SNES RAM contents, and or allowing BIOS functions to coexist with custom SNES 65816 side code, or read RAM bank contents and data directly from the Game Boy ROM code via JOYPAD registers and screen buffer and waiting 4 frames for the SNES to receive the contents of Game Boy VRAM signal transfer as data.

DATA_SND can set any SNES WRAM 7E0000-7EFFFF address allowing you to use it as a code injector, or a Pro Action Replay cheat device to gain direct access to various functions such as Enabling SNES OBJ_TRN mode or TEST_EN speed functions, and even send custom data to that RAM address.

Here is an example video showcasing and setting DATA_SND to enable the unused and unfinished SNES OBJ_TRN mode
https://www.youtube.com/watch?v=V4pYy2lIz5E
[CODE]
1 11 MLT_REQ 89000000000000000000000000000000
1 11 MLT_REQ 89010000000000000000000000000000
1 0F DATA_SND 790B18000BA90F8F002100A9018F0360
1 0F DATA_SND 791618000B006CFCFF00000000000000
1 0F DATA_SND 790018000BEA18FBE220C210A90048AB
1 0F DATA_SND 792608000B39CD480CD034A5C9C980D0
1 0F DATA_SND 791B08000BEAEAEAEAEAA901CD4F0CD0
1 0F DATA_SND 791008000B4C2008EAEAEAEAEA60EAEA
1 10 DATA_TRN 81000B000B0000000000000000000000
1 12 JUMP 91000B000B1800000000000000000000

SNES Bank WRAM locations for DATA_TRN and DATA_SND:
SGB Command 0Fh - DATA_SND
Used to write one or more bytes directly into SNES Work RAM.
Byte Content
0 Command*8+Length (fixed length=1)
1 SNES Destination Address, low
2 SNES Destination Address, high
3 SNES Destination Address, bank number
4 Number of bytes to write (01h-0Bh)
5 Data Byte #1
6 Data Byte #2 (if any)
7 Data Byte #3 (if any)
etc.

Unused bytes at the end of the packet should be set to zero, this function is restricted to a single packet, so that not more than 11 bytes can be defined at once.
Free Addresses in SNES memory are Bank 0 1800h-1FFFh, Bank 7Fh 0000h-FFFFh.

SGB Command 10h - DATA_TRN
Used to transfer binary code or data directly into SNES RAM.

Byte Content
0 Command*8+Length (fixed length=1)
1 SNES Destination Address, low
2 SNES Destination Address, high
3 SNES Destination Address, bank number
4-F Not used (zero)

The data is sent by VRAM-Transfer (4 KBytes)
000-FFF Data

Free Addresses in SNES memory are Bank 0 1800h-1FFFh, Bank 7Fh 0000h-FFFFh. The transfer length is fixed at 4KBytes ???, so that directly writing to the free 2KBytes at 0:1800h would be a not so good idea ???

Further, the original Super Game Boy instruction manual stated that there were surprises in future games. There was very little in the way of surprises as game developers refused to touch any of the impressive Super Game Boy programming. Nintendo didn't care themselves only covered the barebones minimum.

Programming this required Game Boy Z-80 and SNES 65816 assembly knowledge; I had to reverse engineer the SGB/2 BIOS in order to find out where the credits are loaded and set the NMI to jump to the address. Took a total of about 15 minutes to complete this demonstration.

Download my original tech demo:
http://www.mediafire.com/download/na1tvj7nb88t2c2/SGB+JUMP+to+Credits+Tech+Demo+%28nensondubois%29.gb

Here is something to read regarding my shared thoughts on the Super Game Boy and how developers did not give a shit.
http://loveconquersallgam.es/tagged/super_game_boy/chrono

I have for several years reverse-engineered thousands of videogames to find unused content and I have found quite a few interesting pieces of code that developers have used to test various Super Game Boy functions (mostly sound functions) and remnants of an official Super Game Boy SDK found in several games in varying degrees of functional and alterations. I have also worked with other consoles to find different items of interest by mostly by myself.

http://gamehacking.org/vb/threads/12747-nensondubois-codes


Hopefully other people will start programming Super Game Boy tech demos.

*See you again on next project.




Other Videos By nensondubois


2013-11-02Unused Game Content ~ From TV Animation Slam Dunk 2 Zenkoku e no Tip Off - Super Game Boy SOUND TEST
2013-10-31Unused Game Content ~ From TV Animation Slam Dunk 2: Zenkoku e no Tip Off ~ II TURBO Hidden UFO Game
2013-10-14Replace Game Soundtracks ~ Marios Picross with Picross 2 Game Boy
2013-10-13Games with Super Game Boy SOUND programming ~ Vegas Stakes Ending (Game Genie Code Provided)
2013-10-04Dr Mario Virus Prototype Unused Song 2 (0A) Game Genie Code
2013-10-04Dr Mario Virus Prototype Unused Song 1 (02) Game Genie Code
2013-09-30Super Mario Bros. 3 NES Control Music Using D-PAD A B buttons Game Genie
2013-09-30Tetris NES Nintendo 1989 Unused Unfinished 2-Player Mode Game Genie Code
2013-09-30Tetris NES Nintendo 1989 Unused Music Game Genie Code
2013-09-30Unused Game Content ~ Advance Guardian Heroes DEBUG Menu GBA Game Boy Advance
2013-09-20Super Game Boy 2 DATA_SND DATA_TRN JUMP Programming Example 3 Setting New Program Counter Address
2013-09-20Super Game Boy 2 DATA_SND JUMP Example 2
2013-09-20Super Game Boy DATA_SND JUMP Example 2
2013-09-20Super Game Boy 2 DATA_SND JUMP Example 1
2013-09-20Super Game Boy DATA_SND JUMP Example 1
2013-09-08Unused Game Content ~ PokoNyan! Yume no Daibouken ポコニャン!夢の大冒険 Super Game Boy ATTRC_EN 01
2013-09-08Unused Game Content ~ PokoNyan! Yume no Daibouken ポコニャン!夢の大冒険 Super Game Boy ICON_EN 03
2013-08-27Unused Game Content ~ Bomberman Quest Super Game Boy ATTRC_EN 01 Disable border screensavers
2013-08-27Bomberman Quest Unused SGB Super Game Boy PAL_PRI 01
2013-08-25Unused Game Content ~ Bomberman Quest Super Game Boy ICON_EN 00 Enable Palette Selection Menu Option
2013-08-25Unused Game Content ~ Bomberman Quest Unused SGB Super Game Boy SOUND ''Nintendo'' 41.01.00.03.00



Tags:
SGB2
Super Game Boy
Super Game Boy Tech Demo
DATA_SND
JUMP
nensondubois
Rom hacking
Game Boy programming
Nintendo
Z-80
Asssembly
65c816
SNES
Iwatasan
Iwata
hammer
nails
chalk
cake
cats
meow
nyan
3ds
wiiu
wii u
nx
wii
vc
Super Mario Maker
SGB
Tech Demo
2015
Game Boy Gangnam
Remix
Arbitrary Code
Debugger
write
DMA
NMI
memory array
RAM
setting
world
record
stamp
jamba
bazinga
brie
cheese
picture
bieber
chess
jump
movement
snap
time
watch
WRAM
Mario
Luigi
Peach
Toad
Treasure