Monday, November 15, 2021

Vintage Van Halen Code Complete

There's only one way to rock! Vintage Van Halen celebrates forty awesome riffs shred by Edward Van Halen. Built using the Sega Genesis Development Kit, Vintage Van Halen is available for free download from itch.io.

Let's check it out!

Note: Vintage Van Halen development based on SGDK Programming Setup + SGDK Programming Sample. Download source code here.


Inspiration
Eddie Van Halen is regarded as one of the greatest guitarists of all time. His innovations revolutionized guitar playing and influenced generations of guitarists. Eddie is responsible for some of the most memorable riffs in rock history and his band "Van Halen" continues to remain as one of the world's top selling artists of all time.

Instructions
Simple: move the joystick Up and Down to select a multi-choice answer: 1, 2, 3, 4. Press button A to select an answer or progress forward through any prompts. Note: Press button B to always go back. Joystick Left and Right are not used at all. Finally, Press button C during the game play to replay any riff at any time!

Tools
Here is a list of Tools, Frameworks, Utilities and Emulators that were used in development of this project:
 Programming  SGDK
 Compiler  gcc 4.9.3
 IDE  Visual Studio 2015
 Languages  C / 68000
 Graphics  Image Resizer / BMP converter
 Music  Audacity / YouTube
 Emulators  Emulicious / Gens KMod

ROM Hacking
You can hack this ROM! Download + dump VintageVanHalen into Hex Editor, e.g. HxD, and modify bytes:
 ADDRESS  VARIABLE  DESCRIPTION
 0x004F  DelaySpeed  Used to speed through any game delay.
 0x0050  Invincible  Non-zero value always enables cheating.
 0x0051  RiffSelect  Set the value to 2,3,4 index otherwise 1.
 0x0052  DiffSelect  Set value to 1=Easy otherwise 2=Hard.

hack_manager.c
#ifndef __HACK_MANAGER_H__
#define __HACK_MANAGER_H__

#define PEEK(addr)       (*(unsigned char *)(addr))
#define POKE(addr, data) (*(unsigned char *)(addr) = (data))

#define HACKER_START  0x004F
void engine_hack_manager_load()
{
  struct_hack_object *ho = &global_hack_object;
  ho->hack_delayspeed = PEEK( HACKER_START - 2 );        // 0x01DE Used to speed through any game delay.
  ho->hack_invincible = PEEK( HACKER_START - 1 );        // 0x01DF Non-zero value enables always cheats.
  ho->hack_riffselect = PEEK( HACKER_START + 1 );        // 0x01E0 Set value to 2,3,4 index otherwise 1.
  ho->hack_diffselect = PEEK( HACKER_START + 2 );        // 0x01E1 Set value to 1=Easy otherwise 2=Hard.
}
#endif//__HACK_MANAGER_H__

Cheats
Hack the ROM [above] to show the answers for every quiz during entire game session or alternatively press button C five times on Title screen when prompted to "Press Start" to show the answers to the current quiz!

Also, on Title screen press + hold joystick down while holding button B. This will show all the game statistics persisted across all game sessions. Finally, on Splash screen press and hold button B to reset all game stats.

storage_manager.c
#ifndef _STORAGE_MANAGER_H_
#define _STORAGE_MANAGER_H_

void engine_storage_manager_code()
{
  sRamOffSet = 0x0000;
  signed char byte;

  SYS_disableInts();
  SRAM_enable();

  byte = SRAM_readByte( sRamOffSet++ );        // Read.
  SRAM_writeByte( sRamOffSet++, byte );        // Write.

  SRAM_disable();
  SYS_enableInts();
}
#endif//_STORAGE_MANAGER_H_

Credits
Extra special thanks goes to @MegadriveDev for the SGDK. Plus StevePro Studios would like to give thanks: @bigevilboss, @matteusbeus, @MoonWatcherMD, @ohsat_games, @SpritesMind for SGDK support online!



Summary
Vintage Van Halen is the first 16-bit project ever built by StevePro Studios for the Sega MegaDrive / Genesis. Fortunately, like Sega Master System, the MegaDrive community provides fantastic online help and support.

After years of developing for Sega Master System, it was seamless to apply many of the programming skills acquired from 8-bit development to 16-bit thus the project was completed in a very short time. Awesome J