Author Topic: Care to follow along?  (Read 11845 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: Care to follow along?
« Reply #15 on: May 12, 2014, 11:48:19 PM »
This game uses samples. let's set those up too!

Code: [Select]
static const char *const sample_names[] =
{                                               // Address triggered at
"*thehand",
"01",   /* game start tune */           // 075f
"02",   /* coin in */                   // 0074
"03",   /* eat dot */                   // 0e45
"05",   /* eat dollar sign */           // 0e45

"06",   /* door open */                 // 19e1
"07",   /* door close */                // 1965

"08",   /* theme song */                // 0821
//"09"                                  // 1569

/* one of these two is played after eating the last dot */
"0a",   /* piccolo */                   // 17af
"0b",   /* tune */                      // 17af

//"0f"                                  // 08ee
"10",   /* 'We're even. Bye Bye!' */    // 162a
"11",   /* 'You got me!' */             // 1657
"12",   /* 'You have lost out' */       // 085e

"13",   /* 'Rock' */                    // 14de
"14",   /* 'Scissors' */                // 14f3
"15",   /* 'Paper' */                   // 1508

/* one of these is played when going by the girl between levels */
"16",   /* 'Very good!' */              // 194a
"17",   /* 'Wonderful!' */              // 194a
"18",   /* 'Come on!' */                // 194a
"19",   /* 'I love you!' */             // 194a
"1a",   /* 'See you again!' */          // 194a
0
};

Just like the rom struct

Code: [Select]
static struct BurnSampleInfo thehandSampleDesc[] = {
{ "01", SAMPLE_NOLOOP },   /* game start tune */           // 075f
{ "02", SAMPLE_NOLOOP },   /* coin in */                   // 0074
{ "03", SAMPLE_NOLOOP },   /* eat dot */                   // 0e45
{ "05", SAMPLE_NOLOOP },   /* eat dollar sign */           // 0e45

{ "06", SAMPLE_NOLOOP },   /* door open */                 // 19e1
{ "07", SAMPLE_NOLOOP },   /* door close */                // 1965

{ "08", SAMPLE_NOLOOP },   /* theme song */                // 0821
//"09"                                  // 1569

/* one of these two is played after eating the last dot */
{ "0a", SAMPLE_NOLOOP },   /* piccolo */                   // 17af
{ "0b", SAMPLE_NOLOOP },   /* tune */                      // 17af

//"0f"                                  // 08ee
{ "10", SAMPLE_NOLOOP },   /* 'We're even. Bye Bye!' */    // 162a
{ "11", SAMPLE_NOLOOP },   /* 'You got me!' */             // 1657
{ "12", SAMPLE_NOLOOP },   /* 'You have lost out' */       // 085e

{ "13", SAMPLE_NOLOOP },   /* 'Rock' */                    // 14de
{ "14", SAMPLE_NOLOOP },   /* 'Scissors' */                // 14f3
{ "15", SAMPLE_NOLOOP },   /* 'Paper' */                   // 1508

/* one of these is played when going by the girl between levels */
{ "16", SAMPLE_NOLOOP },   /* 'Very good!' */              // 194a
{ "17", SAMPLE_NOLOOP },   /* 'Wonderful!' */              // 194a
{ "18", SAMPLE_NOLOOP },   /* 'Come on!' */                // 194a
{ "19", SAMPLE_NOLOOP },   /* 'I love you!' */             // 194a
{ "1a", SAMPLE_NOLOOP },   /* 'See you again!' */          // 194a
{ "", 0 } // must have this at the end!
};

STD_SAMPLE_PICK(thehand)
STD_SAMPLE_FN(thehand)
« Last Edit: May 13, 2014, 12:04:50 AM by iq_132 »


Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: Care to follow along?
« Reply #16 on: May 13, 2014, 12:48:35 AM »
Still a work in progress. That's it for tonight. ^^


Offline vbt

  • FBNeo Contributor
  • *****
  • Posts: 205
  • Karma: +9005/-0
Re: Care to follow along?
« Reply #17 on: May 13, 2014, 06:45:28 AM »
really interesting, big thanks iq !

kev

  • Guest
Re: Care to follow along?
« Reply #18 on: May 13, 2014, 03:40:48 PM »
Cool posts :)

Offline destronger

  • Newbies
  • *
  • Posts: 43
  • Karma: +7/-3
Re: Care to follow along?
« Reply #19 on: May 13, 2014, 11:37:21 PM »
nice post...

my brain hurts.  :confused:
+ T +: Every time you mention Midway games in Final Burn, iq_132 kills a kitten!

Offline Arcadez

  • Expert
  • *****
  • Posts: 558
  • Karma: +15/-0
  • Arcade Addict
Re: Care to follow along?
« Reply #20 on: October 13, 2014, 05:34:23 PM »
Bump  :wink:

Nice guide you created here IQ_132 was wondering if you get a spare moment could you explain what this code does
is it save state related

Quote
static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
{
   struct BurnArea ba;

   if (pnMin) {
      *pnMin = 0x029707;
   }

   if (nAction & ACB_VOLATILE) {      
      memset(&ba, 0, sizeof(ba));

      ba.Data     = AllRam;
      ba.nLen     = RamEnd - AllRam;
      ba.szName = "All Ram";
      BurnAcb(&ba);

      ZetScan(nAction);

      beast_scan(nAction);

      BurnYM2203Scan(nAction, pnMin);
      MSM6295Scan(0, nAction);
      MSM6295Scan(1, nAction);

      SCAN_VAR(nBankAddress0);
      SCAN_VAR(nBankAddress1);
      SCAN_VAR(nBankAddress2);
      SCAN_VAR(videoreg);
      SCAN_VAR(scrollx);
      SCAN_VAR(scrolly);
   }

      if (nAction & ACB_WRITE)
   {
      ZetOpen(0);
      cpu0_bankswitch(nBankAddress0);
      ZetClose();

      ZetOpen(1);
      cpu1_bankswitch(nBankAddress1);
      ZetClose();

      ZetOpen(2);
      cpu2_bankswitch(nBankAddress2);
      ZetClose();
   }

   
   return 0;
}

Im still trying to get a certain game playable the sound is there it controls coins and starts it just has no graphics for some reason
just plodding away trying to track down a possible cause i just wondered what the above is for in the driver
« Last Edit: October 13, 2014, 05:59:57 PM by gamez fan »

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: Care to follow along?
« Reply #21 on: October 13, 2014, 07:14:22 PM »
Yes - the Scan() function is called when saving or loading a savestate.

The function tells the driver which modules need scanning, which variables and anything that needs doing on top (in this case bankswitching the CPUs after restoring the bankswitch address variables).
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline Arcadez

  • Expert
  • *****
  • Posts: 558
  • Karma: +15/-0
  • Arcade Addict
Re: Care to follow along?
« Reply #22 on: October 13, 2014, 07:25:44 PM »
Yes - the Scan() function is called when saving or loading a savestate.

The function tells the driver which modules need scanning, which variables and anything that needs doing on top (in this case bankswitching the CPUs after restoring the bankswitch address variables).

Thanks for your reply im wondering if the fact FBL uses an older save state handling and this driver i assume uses a newer
type of save and loading routine could this affect the games graphics eg make them not work any input guys would be appreciated
im trying to rule this out before i focus again on the Zet handling as the cause of course there was some changes in pandora.cpp/h

so last question from me here has the generic tiles.cpp/h had any changes since the last FBA release and the addition of djboy
« Last Edit: October 13, 2014, 07:30:47 PM by gamez fan »

Offline Arcadez

  • Expert
  • *****
  • Posts: 558
  • Karma: +15/-0
  • Arcade Addict
Re: Care to follow along?
« Reply #23 on: October 14, 2014, 08:24:19 PM »
Soted the missing graphics in  DJ Boy sometimes a lucky guess works better than weeks of studying code looking for the solution

i noticed this in Airbuster.cpp

Quote
   ZetMapArea(0xc000, 0xcfff, 0, DrvSprRAM);
//   ZetMapArea(0xc000, 0xcfff, 1, DrvSprRAM); // handler
   ZetMapArea(0xc000, 0xcfff, 2, DrvSprRAM);

so noticed 2 of the defines had handler written after em in the dj boy driver so i thought id try this since air buster had this way
Quote
   ZetMapArea(0xb000, 0xbfff, 0, DrvSprRAM);
//   ZetMapArea(0xb000, 0xbfff, 1, DrvSprRAM); // handler...
   ZetMapArea(0xb000, 0xbfff, 2, DrvSprRAM);

And

   ZetMapArea(0xd000, 0xd8ff, 0, DrvPalRAM);
//   ZetMapArea(0xd000, 0xd8ff, 1, DrvPalRAM); // handler...
   ZetMapArea(0xd000, 0xd8ff, 2, DrvPalRAM);

I wish i tried the above weeks ago was gonna but assumed dj boy needed them enabled why the driver does in FBA
but doesn't in FBL will remain a mystery at least the game works now i played through level 1 everything seems fine
« Last Edit: October 14, 2014, 08:27:55 PM by gamez fan »

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: Care to follow along?
« Reply #24 on: October 14, 2014, 08:56:48 PM »
Soted the missing graphics in  DJ Boy sometimes a lucky guess works better than weeks of studying code looking for the solution

i noticed this in Airbuster.cpp

so noticed 2 of the defines had handler written after em in the dj boy driver so i thought id try this since air buster had this way
I wish i tried the above weeks ago was gonna but assumed dj boy needed them enabled why the driver does in FBA
but doesn't in FBL will remain a mystery at least the game works now i played through level 1 everything seems fine

Ah! Your palette wasn't be calculated, I bet.


Offline Arcadez

  • Expert
  • *****
  • Posts: 558
  • Karma: +15/-0
  • Arcade Addict
Re: Care to follow along?
« Reply #25 on: October 15, 2014, 10:27:14 AM »
Ah! Your palette wasn't be calculated, I bet.

Im sure your right i had no idea it needed calculated ;) i assumed i could just drop the driver into FBL and it would work off the bat
thats why your a top developer and im a wee guesser LOL
« Last Edit: October 15, 2014, 10:30:13 AM by gamez fan »

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: Care to follow along?
« Reply #26 on: October 15, 2014, 02:49:10 PM »
Im sure your right i had no idea it needed calculated ;) i assumed i could just drop the driver into FBL and it would work off the bat
thats why your a top developer and im a wee guesser LOL
I definitely wouldn't say that! We're all just hobbyists looking for something to keep us busy. I think the only professional programmer on the team is Barry!


Offline Arcadez

  • Expert
  • *****
  • Posts: 558
  • Karma: +15/-0
  • Arcade Addict
Re: Care to follow along?
« Reply #27 on: October 25, 2014, 05:15:29 PM »
Another last roll of the dice and a lucky guess and ive finally found out what was causing the issues with the games in
the nemesis driver loading the wrong way up and being reversed in game again though it's a mystery to me why
this being disabled in the dips was causing this

//   {0   , 0xfe, 0   ,    2, "Flip Screen"      },
//   {0x16, 0x01, 0x01, 0x01, "Off"         },
//   {0x16, 0x01, 0x01, 0x00, "On"         },

i take it from the above flip screen isn't available in the games but after enabling it salamander etc now load the correct way up
and are graphically 100% as i can disable the flip screen in the dips  i assume the flip was get set to on by default for some reason
in FBL
« Last Edit: October 25, 2014, 07:21:18 PM by gamez fan »