Source Code accidently compiled into games

Discussion in 'Technical Discussion' started by evilhamwizard, Feb 11, 2010.

  1. Chilly Willy

    Chilly Willy

    Tech Member
    746
    0
    0
    Doom 32X
    Code (Text):
    1. move #$0305,r0;105 set control register
    Lord Almighty! An interrupt for every three audio samples! And at 22kHz, that's over 7000 interrupts per second. Talk about overhead! :flunked:

    I don't know why programmers used interrupt driven audio on the 32X when SEGA went to all the trouble of giving them DMA driven PWM. Just set channel 1 of the DMA in either SH2 and let it rip! If anyone is contemplating 32X homebrew with audio, I released an example of double-buffered DMA driven PWM for the 32X over at SpritesMind. If folks are interested, I could post that here as well.
    :eng101:
     
  2. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    18,394
    431
    63
    Berkshire, England
    Learning Cymraeg
    You have to wonder just how much of it was down to lack of hardware knowledge. I mean, 32X didn't exactly have the longest shelf life.
     
  3. Quickman

    Quickman

    be attitude for gains Tech Member
    5,590
    4
    18
    :x
    omg porjcet
    Alternatively, same reason they never used CSM and rarely ever went near SSG-EG on the Megadrive - the documentation didn't mention it or said "don't do this, leave it alone".
     
  4. Chilly Willy

    Chilly Willy

    Tech Member
    746
    0
    0
    Doom 32X
    <!--quoteo(post=414404:date=Feb 21 2010, 05:36 PM:name=Overlord)--><div class='quotetop'>QUOTE (Overlord @ Feb 21 2010, 05:36 PM) <a href="index.php?act=findpost&pid=414404">[​IMG]</a></div><div class='quotemain'><!--quotec-->You have to wonder just how much of it was down to lack of hardware knowledge. I mean, 32X didn't exactly have the longest shelf life.<!--QuoteEnd--></div><!--QuoteEEnd-->

    This is most likely the main reason. They just used whatever "sample" code SEGA provided. Most of the effort was probably spent trying to squeeze the memory requirements down.
     
  5. SegaLoco

    SegaLoco

    W)(at did you say? Misfit
    I have this sample code actually, anyone want it (although I'm surprised that it isn't talked about much, its been in the "public domain" unofficially for quite a while).
     
  6. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    <!--quoteo(post=414328:date=Feb 21 2010, 04:30 PM:name=Chilly Willy)--><div class='quotetop'>QUOTE (Chilly Willy @ Feb 21 2010, 04:30 PM) <a href="index.php?act=findpost&pid=414328">[​IMG]</a></div><div class='quotemain'><!--quotec-->I don't know why programmers used interrupt driven audio on the 32X when SEGA went to all the trouble of giving them DMA driven PWM. Just set channel 1 of the DMA in either SH2 and let it rip! If anyone is contemplating 32X homebrew with audio, I released an example of double-buffered DMA driven PWM for the 32X over at SpritesMind. If folks are interested, I could post that here as well.
    :eng101:<!--QuoteEnd--></div><!--QuoteEEnd-->
    I wouldn't know if this has anything to do with it, but it could also have to do with, for example, Space Harrier's sound driver allowing simultaneous FM and PWM. The chords at the beginning of the main song are FM.

    Also Chaotix seems to have its PWM routine run as a routine in the slave SH-2 main loop.
     
  7. Quickman

    Quickman

    be attitude for gains Tech Member
    5,590
    4
    18
    :x
    omg porjcet
    <!--quoteo(post=415850:date=Feb 24 2010, 04:10 AM:name=SegaLoco)--><div class='quotetop'>QUOTE (SegaLoco @ Feb 24 2010, 04:10 AM) <a href="index.php?act=findpost&pid=415850">[​IMG]</a></div><div class='quotemain'><!--quotec-->I have this sample code actually, anyone want it (although I'm surprised that it isn't talked about much, its been in the "public domain" unofficially for quite a while).<!--QuoteEnd--></div><!--QuoteEEnd-->
    Yes please.
     
  8. SegaLoco

    SegaLoco

    W)(at did you say? Misfit
    <a href="http://segaloco.spinfxrocks.com/Sega_32X_SDK.7z" target="_blank">http://segaloco.spinfxrocks.com/Sega_32X_SDK.7z</a>

    Have fun ;)

    Has sample code for doing a lot of cool things.
     
  9. Chilly Willy

    Chilly Willy

    Tech Member
    746
    0
    0
    Doom 32X
    The DMA PWM in the SDK isn't that great - it's meant to be test code, not example code. A better example would be the demo I made.

    Here's the main part:

    Code (Text):
    1. void FillSoundBuff(int offset)
    2. {
    3. &nbsp;&nbsp; int ix;
    4. &nbsp;&nbsp; short samp;
    5. &nbsp;&nbsp; short *buf = (short *)(((unsigned long)sndbuf + offset * 4) | 0x20000000);
    6. &nbsp;&nbsp; volatile int *aud_len = (int *)((unsigned int)&gAudioLen | 0x20000000);
    7. &nbsp;&nbsp; volatile int *aud_buf = (int *)((unsigned int)&gAudioBuf | 0x20000000);
    8. &nbsp;&nbsp; unsigned char *buffer = (unsigned char *)*aud_buf;
    9. &nbsp;&nbsp; int iy = *aud_len;
    10.  
    11. &nbsp;&nbsp; if (iy >= NUM_SAMPS)
    12. &nbsp;&nbsp; {
    13. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (ix=0; ix<NUM_SAMPS; ix++)
    14. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
    15. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; samp = buffer[0] | (buffer[1] << 8);
    16. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf[0] = (samp >> 7) + 258;
    17. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; samp = buffer[2] | (buffer[3] << 8);
    18. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf[1] = (samp >> 7) + 258;
    19. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buffer += 4;
    20. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf += 2;
    21. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
    22. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*aud_buf += NUM_SAMPS * 4;
    23. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*aud_len -= NUM_SAMPS;
    24. &nbsp;&nbsp; }
    25. &nbsp;&nbsp; else
    26. &nbsp;&nbsp; {
    27. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (ix=0; ix<iy; ix++)
    28. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
    29. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; samp = buffer[0] | (buffer[1] << 8);
    30. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf[0] = (samp >> 7) + 258;
    31. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; samp = buffer[2] | (buffer[3] << 8);
    32. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf[1] = (samp >> 7) + 258;
    33. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buffer += 4;
    34. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf += 2;
    35. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
    36. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (ix=iy; ix<NUM_SAMPS; ix++)
    37. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
    38. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf[0] = 258;
    39. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf[1] = 258;
    40. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf += 2;
    41. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
    42. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*aud_len = 0;
    43. &nbsp;&nbsp; }
    44. }
    45.  
    46. void slave(void)
    47. {
    48. &nbsp;&nbsp; // init DMA
    49. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_SAR0 = 0;
    50. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_DAR0 = 0;
    51. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_TCR0 = 0;
    52. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_CHCR0 = 0;
    53. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_DRCR0 = 0;
    54. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_SAR1 = 0;
    55. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_DAR1 = 0;
    56. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_TCR1 = 0;
    57. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_CHCR1 = 0;
    58. &nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_DRCR1 = 0;
    59. &nbsp;&nbsp; SH2_DMA_DMAOR = 1; // enable DMA
    60.  
    61. &nbsp;&nbsp;&nbsp;&nbsp;// init the sound hardware
    62. &nbsp;&nbsp;&nbsp;&nbsp;MARS_PWM_CTRL = 0x0185; // TM = 1, RTP, RMD = right, LMD = left
    63. &nbsp;&nbsp;&nbsp;&nbsp;if (MARS_VDP_DISPMODE & MARS_NTSC_FORMAT)
    64. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MARS_PWM_CYCLE = 23011361/44100 + 1; // 44.1kHz for NTSC clock
    65. &nbsp;&nbsp;&nbsp;&nbsp;else
    66. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MARS_PWM_CYCLE = 22801467/44100 + 1; // 44.1kHz for PAL clock
    67.  
    68. &nbsp;&nbsp;&nbsp;&nbsp;while (1)
    69. &nbsp;&nbsp;&nbsp;&nbsp;{
    70. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// only do sound when sound subsytem initialized
    71. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while (MARS_SYS_COMM4 != 0)
    72. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
    73. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (MARS_SYS_COMM4 == 1)
    74. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
    75. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MARS_SYS_COMM4 = 2;
    76. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MARS_PWM_MONO = 1;
    77. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MARS_PWM_MONO = 1;
    78. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MARS_PWM_MONO = 1;
    79. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
    80.  
    81. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// start DMA on first buffer and fill second
    82. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_SAR1 = (unsigned long)sndbuf | 0x20000000;
    83. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_DAR1 = 0x20004034; // storing a long here will set left and right
    84. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_TCR1 = NUM_SAMPS; // number longs
    85. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_CHCR1 = 0x18E1; // dest fixed, src incr, size long, ext req, dack mem to dev, dack hi, dack edge, dreq rising edge, cycle-steal, dual addr, intr disabled, clear TE, dma enabled
    86.  
    87. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FillSoundBuff(NUM_SAMPS);
    88.  
    89. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// wait on DMA
    90. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while (!(SH2_DMA_CHCR1 & 2)); // wait on TE
    91. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_CHCR1 = 0x18E0; // clear TE, dma disabled
    92.  
    93. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// start DMA on second buffer and fill first
    94. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_SAR1 = ((unsigned long)sndbuf + NUM_SAMPS * 4) | 0x20000000;
    95. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_DAR1 = 0x20004034; // storing a long here will set left and right
    96. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_TCR1 = NUM_SAMPS; // number longs
    97. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_CHCR1 = 0x18E1; // dest fixed, src incr, size long, ext req, dack mem to dev, dack hi, dack edge, dreq rising edge, cycle-steal, dual addr, intr disabled, clear TE, dma enabled
    98.  
    99. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FillSoundBuff(0);
    100.  
    101. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// wait on DMA
    102. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while (!(SH2_DMA_CHCR1 & 2)); // wait on TE
    103. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SH2_DMA_CHCR1 = 0x18E0; // clear TE, dma disabled
    104. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
    105. &nbsp;&nbsp;&nbsp;&nbsp;}
    106. }
    and here's an archive of the demo... the code above is newer... I trimmed the demo code a bit, but didn't make a new archive.

    <a href="http://www.fileden.com/files/2009/2/3/2304902/DMAAudioTest32X.zip" target="_blank">http://www.fileden.com/files/2009/2/3/2304...udioTest32X.zip</a>
     
  10. evilhamwizard

    evilhamwizard

    Researcher
    1,354
    306
    63
    Time for some bumpage.

    I checked out the PS2 port of Sonic R PC for Sonic Gems Collection (NTSC-J) and there's some remnants of some Maya source code for something related to editing. Not sure, can you figure it out?

    *note there's some stuff that might not be part of this file, but whatever

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>// Maya Mel UI Configuration File.
    //
    // This script is machine generated. Edit at your own risk.
    //
    //

    global string $gMainPane;
    if (`paneLayout -exists $gMainPane`) {

    global int $gUseScenePanelConfig;
    int $useSceneConfig = $gUseScenePanelConfig;
    int $menusOkayInPanels = `optionVar -q allowMenusInPanels`; int $nVisPanes = `paneLayout -q -nvp $gMainPane`;
    int $nPanes = 0;
    string $editorName;
    string $panelName;
    string $itemFilterName;
    string $panelConfig;

    //
    // get current state of the UI
    //
    sceneUIReplacement -update $gMainPane;

    $panelName = `sceneUIReplacement -getNextPanel "modelPanel" "Top View"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `modelPanel -unParent -l "Top View" -mbv $menusOkayInPanels `;
    $editorName = $panelName;
    modelEditor -e
    -camera "top"
    -useInteractiveMode 0
    -displayLights "default"
    -displayAppearance "wireframe"
    -activeOnly 0
    -wireframeOnShaded 0
    -bufferMode "double"
    -twoSidedLighting 1
    -backfaceCulling 0
    -xray 0
    -displayTextures 0
    -smoothWireframe 0
    -textureAnisotropic 0
    -textureHilight 1
    -textureSampling 2
    -textureDisplay "modulate"
    -textureMaxSize 1024
    -fogging 0
    -fogSource "fragment"
    -fogMode "linear"
    -fogStart 0
    -fogEnd 100
    -fogDensity 0.1
    -fogColor 0.5 0.5 0.5 1
    -sortTransparent 1
    -nurbsCurves 1
    -nurbsSurfaces 1
    -polymeshes 1
    -subdivSurfaces 1
    -planes 1
    -lights 1
    -cameras 1
    -controlVertices 1
    -hulls 1
    -grid 1
    -joints 1
    -ikHandles 1
    -deformers 1
    -dynamics 1
    -fluids 1
    -locators 1
    -dimensions 1
    -handles 1
    -pivots 1
    -textures 1
    -strokes 1
    -shadows 0
    $editorName;
    modelEditor -e -viewSelected 0 $editorName;
    }
    } else {
    $label = `panel -q -label $panelName`;
    modelPanel -edit -l "Top View" -mbv $menusOkayInPanels $panelName;
    $editorName = $panelName;
    modelEditor -e
    -camera "top"
    -useInteractiveMode 0
    -displayLights "default"
    -displayAppearance "wireframe"
    -activeOnly 0
    -wireframeOnShaded 0
    -bufferMode "double"
    -twoSidedLighting 1
    -backfaceCulling 0
    -xray 0
    -displayTextures 0
    -smoothWireframe 0
    -textureAnisotropic 0
    -textureHilight 1
    -textureSampling 2
    -textureDisplay "modulate"
    -textureMaxSize 1024
    -fogging 0
    -fogSource "fragment"
    -fogMode "linear"
    -fogStart 0
    -fogEnd 100
    -fogDensity 0.1
    -fogColor 0.5 0.5 0.5 1
    -sortTransparent 1
    -nurbsCurves 1
    -nurbsSurfaces 1
    -polymeshes 1
    -subdivSurfaces 1
    -planes 1
    -lights 1
    -cameras 1
    -controlVertices 1
    -hulls 1
    -grid 1
    -joints 1
    -ikHandles 1
    -deformers 1
    -dynamics 1
    -fluids 1
    -locators 1
    -dimensions 1
    -handles 1
    -pivots 1
    -textures 1
    -strokes 1
    -shadows 0
    $editorName;
    modelEditor -e -viewSelected 0 $editorName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextPanel "modelPanel" "Side View"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `modelPanel -unParent -l "Side View" -mbv $menusOkayInPanels `;
    $editorName = $panelName;
    modelEditor -e
    -camera "side"
    -useInteractiveMode 0
    -displayLights "default"
    -displayAppearance "wireframe"
    -activeOnly 0
    -wireframeOnShaded 0
    -bufferMode "double"
    -twoSidedLighting 1
    -backfaceCulling 0
    -xray 0
    -displayTextures 0
    -smoothWireframe 0
    -textureAnisotropic 0
    -textureHilight 1
    -textureSampling 2
    -textureDisplay "modulate"
    -textureMaxSize 1024
    -fogging 0
    -fogSource "fragment"
    -fogMode "linear"
    -fogStart 0
    -fogEnd 100
    -fogDensity 0.1
    -fogColor 0.5 0.5 0.5 1
    -sortTransparent 1
    -nurbsCurves 1
    -nurbsSurfaces 1
    -polymeshes 1
    -subdivSurfaces 1
    -planes 1
    -lights 1
    -cameras 1
    -controlVertices 1
    -hulls 1
    -grid 1
    -joints 1
    -ikHandles 1
    -deformers 1
    -dynamics 1
    -fluids 1
    -locators 1
    -dimensions 1
    -handles 1
    -pivots 1
    -textures 1
    -strokes 1
    -shadows 0
    $editorName;
    modelEditor -e -viewSelected 0 $editorName;
    }
    } else {
    $label = `panel -q -label $panelName`;
    modelPanel -edit -l "Side View" -mbv $menusOkayInPanels $panelName;
    $editorName = $panelName;
    modelEditor -e
    -camera "side"
    -useInteractiveMode 0
    -displayLights "default"
    -displayAppearance "wireframe"
    -activeOnly 0
    -wireframeOnShaded 0
    -bufferMode "double"
    -twoSidedLighting 1
    -backfaceCulling 0
    -xray 0
    -displayTextures 0
    -smoothWireframe 0
    -textureAnisotropic 0
    -textureHilight 1
    -textureSampling 2
    -textureDisplay "modulate"
    -textureMaxSize 1024
    -fogging 0
    -fogSource "fragment"
    -fogMode "linear"
    -fogStart 0
    -fogEnd 100
    -fogDensity 0.1
    -fogColor 0.5 0.5 0.5 1
    -sortTransparent 1
    -nurbsCurves 1
    -nurbsSurfaces 1
    -polymeshes 1
    -subdivSurfaces 1
    -planes 1
    -lights 1
    -cameras 1
    -controlVertices 1
    -hulls 1
    -grid 1
    -joints 1
    -ikHandles 1
    -deformers 1
    -dynamics 1
    -fluids 1
    -locators 1
    -dimensions 1
    -handles 1
    -pivots 1
    -textures 1
    -strokes 1
    -shadows 0
    $editorName;
    modelEditor -e -viewSelected 0 $editorName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextPanel "modelPanel" "Front View"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `modelPanel -unParent -l "Front View" -mbv $menusOkayInPanels `;
    $editorName = $panelName;
    modelEditor -e
    -camera "front"
    -useInteractiveMode 0
    -displayLights "default"
    -displayAppearance "wireframe"
    -activeOnly 0
    -wireframeOnShaded 0
    -bufferMode "double"
    -twoSidedLighting 1
    -backfaceCulling 0
    -xray 0
    -displayTextures 0
    -smoothWireframe 0
    -textureAnisotropic 0
    -textureHilight 1
    -textureSampling 2
    -textureDisplay "modulate"
    -textureMaxSize 1024
    -fogging 0
    -fogSource "fragment"
    -fogMode "linear"
    -fogStart 0
    -fogEnd 100
    -fogDensity 0.1
    -fogColor 0.5 0.5 0.5 1
    -sortTransparent 1
    -nurbsCurves 1
    -nurbsSurfaces 1
    -polymeshes 1
    -subdivSurfaces 1
    -planes 1
    -lights 1
    -cameras 1
    -controlVertices 1
    -hulls 1
    -grid 1
    -joints 1
    -ikHandles 1
    -deformers 1
    -dynamics 1
    -fluids 1
    -locators 1
    -dimensions 1
    -handles 1
    -pivots 1
    -textures 1
    -strokes 1
    -shadows 0
    $editorName;
    modelEditor -e -viewSelected 0 $editorName;
    }
    } else {
    $label = `panel -q -label $panelName`;
    modelPanel -edit -l "Front View" -mbv $menusOkayInPanels $panelName;
    $editorName = $panelName;
    modelEditor -e
    -camera "front"
    -useInteractiveMode 0
    -displayLights "default"
    -displayAppearance "wireframe"
    -activeOnly 0
    -wireframeOnShaded 0
    -bufferMode "double"
    -twoSidedLighting 1
    -backfaceCulling 0
    -xray 0
    -displayTextures 0
    -smoothWireframe 0
    -textureAnisotropic 0
    -textureHilight 1
    -textureSampling 2
    -textureDisplay "modulate"
    -textureMaxSize 1024
    -fogging 0
    -fogSource "fragment"
    -fogMode "linear"
    -fogStart 0
    -fogEnd 100
    -fogDensity 0.1
    -fogColor 0.5 0.5 0.5 1
    -sortTransparent 1
    -nurbsCurves 1
    -nurbsSurfaces 1
    -polymeshes 1
    -subdivSurfaces 1
    -planes 1
    -lights 1
    -cameras 1
    -controlVertices 1
    -hulls 1
    -grid 1
    -joints 1
    -ikHandles 1
    -deformers 1
    -dynamics 1
    -fluids 1
    -locators 1
    -dimensions 1
    -handles 1
    -pivots 1
    -textures 1
    -strokes 1
    -shadows 0
    $editorName;
    modelEditor -e -viewSelected 0 $editorName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextPanel "modelPanel" "Persp View"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `modelPanel -unParent -l "Persp View" -mbv $menusOkayInPanels `;
    $editorName = $panelName;
    modelEditor -e
    -camera "persp"
    -useInteractiveMode 0
    -displayLights "default"
    -displayAppearance "smoothShaded"
    -activeOnly 0
    -wireframeOnShaded 0
    -bufferMode "double"
    -twoSidedLighting 1
    -backfaceCulling 0
    -xray 0
    -displayTextures 1
    -smoothWireframe 0
    -textureAnisotropic 0
    -textureHilight 1
    -textureSampling 2
    -textureDisplay "modulate"
    -textureMaxSize 1024
    -fogging 0
    -fogSource "fragment"
    -fogMode "linear"
    -fogStart 0
    -fogEnd 100
    -fogDensity 0.1
    -fogColor 0.5 0.5 0.5 1
    -sortTransparent 1
    -nurbsCurves 1
    -nurbsSurfaces 1
    -polymeshes 1
    -subdivSurfaces 1
    -planes 1
    -lights 1
    -cameras 1
    -controlVertices 1
    -hulls 1
    -grid 1
    -joints 1
    -ikHandles 1
    -deformers 1
    -dynamics 1
    -fluids 1
    -locators 1
    -dimensions 1
    -handles 1
    -pivots 1
    -textures 1
    -strokes 1
    -shadows 0
    $editorName;
    modelEditor -e -viewSelected 0 $editorName;
    }
    } else {
    $label = `panel -q -label $panelName`;
    modelPanel -edit -l "Persp View" -mbv $menusOkayInPanels $panelName;
    $editorName = $panelName;
    modelEditor -e
    -camera "persp"
    -useInteractiveMode 0
    -displayLights "default"
    -displayAppearance "smoothShaded"
    -activeOnly 0
    -wireframeOnShaded 0
    -bufferMode "double"
    -twoSidedLighting 1
    -backfaceCulling 0
    -xray 0
    -displayTextures 1
    -smoothWireframe 0
    -textureAnisotropic 0
    -textureHilight 1
    -textureSampling 2
    -textureDisplay "modulate"
    -textureMaxSize 1024
    -fogging 0
    -fogSource "fragment"
    -fogMode "linear"
    -fogStart 0
    -fogEnd 100
    -fogDensity 0.1
    -fogColor 0.5 0.5 0.5 1
    -sortTransparent 1
    -nurbsCurves 1
    -nurbsSurfaces 1
    -polymeshes 1
    -subdivSurfaces 1
    -planes 1
    -lights 1
    -cameras 1
    -controlVertices 1
    -hulls 1
    -grid 1
    -joints 1
    -ikHandles 1
    -deformers 1
    -dynamics 1
    -fluids 1
    -locators 1
    -dimensions 1
    -handles 1
    -pivots 1
    -textures 1
    -strokes 1
    -shadows 0
    $editorName;
    modelEditor -e -viewSelected 0 $editorName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextPanel "outlinerPanel" "Outliner"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `outlinerPanel -unParent -l "Outliner" -mbv $menusOkayInPanels `;
    $editorName = $panelName;
    outlinerEditor -e
    -mainListConnection "worldList"
    -selectionConnection "modelList"
    -showShapes 0
    -showAttributes 0
    -showConnected 0
    -showAnimCurvesOnly 0
    -autoExpand 0
    -showDagOnly 1
    -ignoreDagHierarchy 0
    -expandConnections 0
    -showUnitlessCurves 1
    -showCompounds 1
    -showLeafs 1
    -showNumericAttrsOnly 0
    -highlightActive 1
    -autoSelectNewObjects 0
    -doNotSelectNewObjects 0
    -dropIsParent 1
    -transmitFilters 0
    -setFilter "defaultSetFilter"
    -showSetMembers 1
    -allowMultiSelection 1
    -alwaysToggleSelect 0
    -directSelect 0
    -displayMode "DAG"
    -expandObjects 0
    -setsIgnoreFilters 1
    -editAttrName 0
    -showAttrValues 0
    -highlightSecondary 0
    -showUVAttrsOnly 0
    -showTextureNodesOnly 0
    -sortOrder "none"
    -longNames 0
    -niceNames 1
    $editorName;
    }
    } else {
    $label = `panel -q -label $panelName`;
    outlinerPanel -edit -l "Outliner" -mbv $menusOkayInPanels $panelName;
    $editorName = $panelName;
    outlinerEditor -e
    -mainListConnection "worldList"
    -selectionConnection "modelList"
    -showShapes 0
    -showAttributes 0
    -showConnected 0
    -showAnimCurvesOnly 0
    -autoExpand 0
    -showDagOnly 1
    -ignoreDagHierarchy 0
    -expandConnections 0
    -showUnitlessCurves 1
    -showCompounds 1
    -showLeafs 1
    -showNumericAttrsOnly 0
    -highlightActive 1
    -autoSelectNewObjects 0
    -doNotSelectNewObjects 0
    -dropIsParent 1
    -transmitFilters 0
    -setFilter "defaultSetFilter"
    -showSetMembers 1
    -allowMultiSelection 1
    -alwaysToggleSelect 0
    -directSelect 0
    -displayMode "DAG"
    -expandObjects 0
    -setsIgnoreFilters 1
    -editAttrName 0
    -showAttrValues 0
    -highlightSecondary 0
    -showUVAttrsOnly 0
    -showTextureNodesOnly 0
    -sortOrder "none"
    -longNames 0
    -niceNames 1
    $editorName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "graphEditor" "Graph Editor"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "graphEditor" -l "Graph Editor" -mbv $menusOkayInPanels `;

    $editorName = ($panelName+"OutlineEd");
    outlinerEditor -e
    -mainListConnection "graphEditorList"
    -selectionConnection "graphEditor1FromOutliner"
    -highlightConnection "keyframeList"
    -showShapes 1
    -showAttributes 1
    -showConnected 1
    -showAnimCurvesOnly 1
    -autoExpand 1
    -showDagOnly 0
    -ignoreDagHierarchy 0
    -expandConnections 1
    -showUnitlessCurves 1
    -showCompounds 0
    -showLeafs 1
    -showNumericAttrsOnly 1
    -highlightActive 0
    -autoSelectNewObjects 1
    -doNotSelectNewObjects 0
    -dropIsParent 1
    -transmitFilters 1
    -setFilter "0"
    -showSetMembers 0
    -allowMultiSelection 1
    -alwaysToggleSelect 0
    -directSelect 0
    -displayMode "DAG"
    -expandObjects 0
    -setsIgnoreFilters 1
    -editAttrName 0
    -showAttrValues 0
    -highlightSecondary 0
    -showUVAttrsOnly 0
    -showTextureNodesOnly 0
    -sortOrder "none"
    -longNames 0
    -niceNames 1
    $editorName;

    $editorName = ($panelName+"GraphEd");
    animCurveEditor -e
    -mainListConnection "graphEditor1FromOutliner"
    -displayKeys 1
    -displayTangents 0
    -displayActiveKeys 0
    -displayActiveKeyTangents 1
    -displayInfinities 0
    -autoFit 0
    -snapTime "integer"
    -snapValue "none"
    -showResults "off"
    -showBufferCurves "off"
    -smoothness "fine"
    -resultSamples 1
    -resultScreenSamples 0
    -resultUpdate "delayed"
    $editorName;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Graph Editor" -mbv $menusOkayInPanels $panelName;

    $editorName = ($panelName+"OutlineEd");
    outlinerEditor -e
    -mainListConnection "graphEditorList"
    -selectionConnection "graphEditor1FromOutliner"
    -highlightConnection "keyframeList"
    -showShapes 1
    -showAttributes 1
    -showConnected 1
    -showAnimCurvesOnly 1
    -autoExpand 1
    -showDagOnly 0
    -ignoreDagHierarchy 0
    -expandConnections 1
    -showUnitlessCurves 1
    -showCompounds 0
    -showLeafs 1
    -showNumericAttrsOnly 1
    -highlightActive 0
    -autoSelectNewObjects 1
    -doNotSelectNewObjects 0
    -dropIsParent 1
    -transmitFilters 1
    -setFilter "0"
    -showSetMembers 0
    -allowMultiSelection 1
    -alwaysToggleSelect 0
    -directSelect 0
    -displayMode "DAG"
    -expandObjects 0
    -setsIgnoreFilters 1
    -editAttrName 0
    -showAttrValues 0
    -highlightSecondary 0
    -showUVAttrsOnly 0
    -showTextureNodesOnly 0
    -sortOrder "none"
    -longNames 0
    -niceNames 1
    $editorName;

    $editorName = ($panelName+"GraphEd");
    animCurveEditor -e
    -mainListConnection "graphEditor1FromOutliner"
    -displayKeys 1
    -displayTangents 0
    -displayActiveKeys 0
    -displayActiveKeyTangents 1
    -displayInfinities 0
    -autoFit 0
    -snapTime "integer"
    -snapValue "none"
    -showResults "off"
    -showBufferCurves "off"
    -smoothness "fine"
    -resultSamples 1
    -resultScreenSamples 0
    -resultUpdate "delayed"
    $editorName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "dopeSheetPanel" "Dope Sheet"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "dopeSheetPanel" -l "Dope Sheet" -mbv $menusOkayInPanels `;

    $editorName = ($panelName+"OutlineEd");
    outlinerEditor -e
    -mainListConnection "animationList"
    -selectionConnection "dopeSheetPanel1OutlinerSelection"
    -highlightConnection "keyframeList"
    -showShapes 1
    -showAttributes 1
    -showConnected 1
    -showAnimCurvesOnly 1
    -autoExpand 0
    -showDagOnly 0
    -ignoreDagHierarchy 0
    -expandConnections 1
    -showUnitlessCurves 0
    -showCompounds 1
    -showLeafs 1
    -showNumericAttrsOnly 1
    -highlightActive 0
    -autoSelectNewObjects 0
    -doNotSelectNewObjects 1
    -dropIsParent 1
    -transmitFilters 0
    -setFilter "0"
    -showSetMembers 0
    -allowMultiSelection 1
    -alwaysToggleSelect 0
    -directSelect 0
    -displayMode "DAG"
    -expandObjects 0
    -setsIgnoreFilters 1
    -editAttrName 0
    -showAttrValues 0
    -highlightSecondary 0
    -showUVAttrsOnly 0
    -showTextureNodesOnly 0
    -sortOrder "none"
    -longNames 0
    -niceNames 1
    $editorName;

    $editorName = ($panelName+"DopeSheetEd");
    dopeSheetEditor -e
    -mainListConnection "dopeSheetPanel1FromOutliner"
    -highlightConnection "dopeSheetPanel1OutlinerSelection"
    -displayKeys 1
    -displayTangents 0
    -displayActiveKeys 0
    -displayActiveKeyTangents 0
    -displayInfinities 0
    -autoFit 0
    -snapTime "integer"
    -snapValue "none"
    -outliner "dopeSheetPanel1OutlineEd"
    -showSummary 1
    -showScene 0
    -hierarchyBelow 0
    $editorName;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Dope Sheet" -mbv $menusOkayInPanels $panelName;

    $editorName = ($panelName+"OutlineEd");
    outlinerEditor -e
    -mainListConnection "animationList"
    -selectionConnection "dopeSheetPanel1OutlinerSelection"
    -highlightConnection "keyframeList"
    -showShapes 1
    -showAttributes 1
    -showConnected 1
    -showAnimCurvesOnly 1
    -autoExpand 0
    -showDagOnly 0
    -ignoreDagHierarchy 0
    -expandConnections 1
    -showUnitlessCurves 0
    -showCompounds 1
    -showLeafs 1
    -showNumericAttrsOnly 1
    -highlightActive 0
    -autoSelectNewObjects 0
    -doNotSelectNewObjects 1
    -dropIsParent 1
    -transmitFilters 0
    -setFilter "0"
    -showSetMembers 0
    -allowMultiSelection 1
    -alwaysToggleSelect 0
    -directSelect 0
    -displayMode "DAG"
    -expandObjects 0
    -setsIgnoreFilters 1
    -editAttrName 0
    -showAttrValues 0
    -highlightSecondary 0
    -showUVAttrsOnly 0
    -showTextureNodesOnly 0
    -sortOrder "none"
    -longNames 0
    -niceNames 1
    $editorName;

    $editorName = ($panelName+"DopeSheetEd");
    dopeSheetEditor -e
    -mainListConnection "dopeSheetPanel1FromOutliner"
    -highlightConnection "dopeSheetPanel1OutlinerSelection"
    -displayKeys 1
    -displayTangents 0
    -displayActiveKeys 0
    -displayActiveKeyTangents 0
    -displayInfinities 0
    -autoFit 0
    -snapTime "integer"
    -snapValue "none"
    -outliner "dopeSheetPanel1OutlineEd"
    -showSummary 1
    -showScene 0
    -hierarchyBelow 0
    $editorName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "clipEditorPanel" "Trax Editor"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "clipEditorPanel" -l "Trax Editor" -mbv $menusOkayInPanels `;

    $editorName = ($panelName+"ClipEditor");
    clipEditor -e
    -characterOutline "clipEditorPanel1OutlineEditor"
    -menuContext "track"
    $editorName;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Trax Editor" -mbv $menusOkayInPanels $panelName;

    $editorName = ($panelName+"ClipEditor");
    clipEditor -e
    -characterOutline "clipEditorPanel1OutlineEditor"
    -menuContext "track"
    $editorName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "hyperGraphPanel" "Hypergraph"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "hyperGraphPanel" -l "Hypergraph" -mbv $menusOkayInPanels `;

    $editorName = ($panelName+"HyperGraphEd");
    hyperGraph -e
    -orientation "horiz"
    -zoom 1
    -animateTransition 0
    -showShapes 0
    -showDeformers 0
    -showExpressions 0
    -showConstraints 0
    -showUnderworld 0
    -showInvisible 0
    -transitionFrames 1
    -freeform 0
    -imageEnabled 0
    -graphType "DAG"
    -updateSelection 1
    -updateNodeAdded 1
    $editorName;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Hypergraph" -mbv $menusOkayInPanels $panelName;

    $editorName = ($panelName+"HyperGraphEd");
    hyperGraph -e
    -orientation "horiz"
    -zoom 1
    -animateTransition 0
    -showShapes 0
    -showDeformers 0
    -showExpressions 0
    -showConstraints 0
    -showUnderworld 0
    -showInvisible 0
    -transitionFrames 1
    -freeform 0
    -imageEnabled 0
    -graphType "DAG"
    -updateSelection 1
    -updateNodeAdded 1
    $editorName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "hyperShadePanel" "Hypershade"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "hyperShadePanel" -l "Hypershade" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Hypershade" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "visorPanel" "Visor"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "visorPanel" -l "Visor" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Visor" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "polyTexturePlacementPanel" "UV Texture Editor"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "polyTexturePlacementPanel" -l "UV Texture Editor" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "UV Texture Editor" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "multiListerPanel" "Multilister"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "multiListerPanel" -l "Multilister" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Multilister" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "renderWindowPanel" "Render View"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "renderWindowPanel" -l "Render View" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Render View" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextPanel "blendShapePanel" "Blend Shape"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    blendShapePanel -unParent -l "Blend Shape" -mbv $menusOkayInPanels ;
    }
    } else {
    $label = `panel -q -label $panelName`;
    blendShapePanel -edit -l "Blend Shape" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "dynRelEdPanel" "Dynamic Relationships"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "dynRelEdPanel" -l "Dynamic Relationships" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Dynamic Relationships" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextPanel "devicePanel" "Devices"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    devicePanel -unParent -l "Devices" -mbv $menusOkayInPanels ;
    }
    } else {
    $label = `panel -q -label $panelName`;
    devicePanel -edit -l "Devices" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "relationshipPanel" "Relationship Editor"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "relationshipPanel" -l "Relationship Editor" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Relationship Editor" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "referenceEditorPanel" "Reference Editor"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "referenceEditorPanel" -l "Reference Editor" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Reference Editor" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "componentEditorPanel" "Component Editor"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "componentEditorPanel" -l "Component Editor" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Component Editor" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    $panelName = `sceneUIReplacement -getNextScriptedPanel "dynPaintScriptedPanelType" "Paint Effects"`;
    if ("" == $panelName) {
    if ($useSceneConfig) {
    $panelName = `scriptedPanel -unParent -type "dynPaintScriptedPanelType" -l "Paint Effects" -mbv $menusOkayInPanels `;
    }
    } else {
    $label = `panel -q -label $panelName`;
    scriptedPanel -edit -l "Paint Effects" -mbv $menusOkayInPanels $panelName;
    if (!$useSceneConfig) {
    panel -e -l $label $panelName;
    }
    }


    if ($useSceneConfig) {
    string $configName = `getPanel -cwl "Current Layout"`;
    if ("" != $configName) {
    panelConfiguration -edit -label "Current Layout"
    -defaultImage ""
    -image ""
    -sc false
    -configString "global string $gMainPane; paneLayout -e -cn \"single\" -ps 1 100 100 $gMainPane;"
    -removeAllPanels
    -ap false
    "Persp View"
    "modelPanel"
    "$panelName = `modelPanel -unParent -l \"Persp View\" -mbv $menusOkayInPanels `;\n$editorName = $panelName;\nmodelEditor -e \n -cam `findStartUpCamera persp` \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"smoothShaded\" \n -activeOnly 0\n -wireframeOnShaded 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 1\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 1024\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -locators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName"
    "modelPanel -edit -l \"Persp View\" -mbv $menusOkayInPanels $panelName;\n$editorName = $panelName;\nmodelEditor -e \n -cam `findStartUpCamera persp` \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"smoothShaded\" \n -activeOnly 0\n -wireframeOnShaded 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 1\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 1024\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -locators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName"
    $configName;

    setNamedPanelLayout "Current Layout";
    }

    panelHistory -e -clear mainPanelHistory;
    setFocus `paneLayout -q -p1 $gMainPane`;
    sceneUIReplacement -deleteRemaining;
    sceneUIReplacement -clear;
    }


    grid -spacing 5 -size 150 -divisions 5 -displayAxes yes -displayGridLines yes -displayDivisionLines yes -displayPerspectiveLabels no -displayOrthographicLabels no -displayAxesBold yes -perspectiveLabelPosition axis -orthographicLabelPosition edge;</div>

    This might be for this, which is supposed to be for an entirely different game:

    /Dev3/drive/projects/rally/maya/WRC'04 Cars/Ford focus bp/TEXTURES/player00.tga

    Beats me.

    Anyways, here's something not really related to source code, but I decided to throw it in anyway. Just a directory listing:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> Volume in drive H is FHD-1 Serial number is 15F6:3851
    Directory of H:\projects\SonicR.Win\sonicpc_disc\ps2audio\*.vag

    17/08/2004 12:56 4,864 AMY.VAG
    17/08/2004 12:56 10,224 AMYSKID.VAG
    17/08/2004 12:56 4,320 AMYWATER.VAG
    17/08/2004 12:56 27,440 BEACH.VAG
    17/08/2004 12:56 15,136 BONUS.VAG
    17/08/2004 12:56 5,904 BUBBLE.VAG
    17/08/2004 12:56 7,616 BUMPER1.VAG
    17/08/2004 12:56 9,008 BUMPER2.VAG
    17/08/2004 12:56 7,072 CHOOSE.VAG
    17/08/2004 12:56 18,880 DOOR.VAG
    17/08/2004 12:56 17,424 EXPLODE.VAG
    17/08/2004 12:56 12,080 FIRE.VAG
    17/08/2004 12:56 36,384 FLAME.VAG
    17/08/2004 12:56 30,544 GETCHAOS.VAG
    17/08/2004 12:56 22,048 GETTOKEN.VAG
    17/08/2004 12:56 11,936 GO.VAG
    17/08/2004 12:56 26,288 GOTALL.VAG
    17/08/2004 12:56 4,480 HITCHAR.VAG
    17/08/2004 12:56 8,496 JET.VAG
    17/08/2004 12:56 6,528 JUMP.VAG
    17/08/2004 12:56 16,096 PAUSE.VAG
    17/08/2004 12:56 5,536 POP.VAG
    17/08/2004 12:56 9,296 READY.VAG
    17/08/2004 12:56 21,712 RECORD.VAG
    17/08/2004 12:56 71,936 REPLAY1.VAG
    17/08/2004 12:56 42,688 REPLAY2.VAG
    17/08/2004 12:56 64,240 REPLAY3.VAG
    17/08/2004 12:56 93,344 REPLAY4.VAG
    17/08/2004 12:56 48,864 REPLAY5.VAG
    17/08/2004 12:56 47,936 REPLAY6.VAG
    17/08/2004 12:56 8,096 RING1.VAG
    17/08/2004 12:56 3,856 RUNLEFT.VAG
    17/08/2004 12:56 3,968 RUNRIGHT.VAG
    17/08/2004 12:56 10,560 SELECT.VAG
    17/08/2004 12:56 8,832 SET.VAG
    17/08/2004 12:56 7,504 SKID1.VAG
    17/08/2004 12:56 2,640 SKID2.VAG
    17/08/2004 12:56 27,344 SPIN.VAG
    17/08/2004 12:56 10,576 SPINGO.VAG
    17/08/2004 12:56 25,984 SPINREV.VAG
    17/08/2004 12:56 22,064 SPLASH.VAG
    17/08/2004 12:56 16,512 SPRING.VAG
    17/08/2004 12:56 19,264 TAG.VAG
    17/08/2004 12:56 195,936 TAILS.VAG
    17/08/2004 12:56 0 THUNDER.VAG
    17/08/2004 12:56 22,448 WARP.VAG
    17/08/2004 12:56 4,624 WATERRUN.VAG
    1,098,528 bytes in 47 files and 0 dirs 1,966,080 bytes allocated
    12,820,217,856 bytes free</div>

    It's the only listing in sonicr.dat.

    I have stuff from other games but let's see what you guys can come up with...for once. :P
     
  11. evilhamwizard

    evilhamwizard

    Researcher
    1,354
    306
    63
    Yay, bump.

    This page is really getting big with the previous code copypasta, but whatever.

    I found this a while a go, and for some reason I don't know why I didn't post it earlier.

    This comes from Rise of the Robots for the SNES:

    EUROPE

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> lda >win_msg_table+2,x
    sta results_win+window_text+2

    !loop2: jsr wait_frame

    ldy #results_win
    jsr window_process

    lda results_win+window_text
    ora results_win+window_text+2
    bne !loop2

    rts

    print_gmess: jsr gfx_mess
    jsr check_gfx_mess
    jsr wait_frame

    rts

    if cine
    cine_list: dl wn_cb_mc

    dl fly_mc

    dl cn_ld_mc
    dl ds_ld_mc

    dl wn_cb_mc
    dl cn_ap_mc
    dl ds_ap_mc

    dl wn_cb_mc
    dl cn_cr_mc
    dl ds_cr_mc

    dl wn_cb_mc
    dl cn_ml_mc
    dl ds_ml_mc

    dl wn_cb_mc
    dl cn_jp_mc
    dl ds_jp_mc

    dl wn_cb_mc
    dl cn_sp_mc
    dl ds_sp_mc
    dl 0
    endif


    end_sequence:
    if en_sound!rom
    jsr play_brian
    endif

    jsr clr_palette_2
    lda #0
    ldx #256
    jsr fade_it
    stz flash_palette
    stz flash_colour
    jsr clr_pal_buff
    jsr death_hdma_on

    jsr clear_screen

    ldx #10
    jsr delay
    jsr wait_frame


    jsr screen_off
    stz nrg_dsp_flg
    stz split_mode

    lda #29
    a08
    sta w_bg1hofs
    xba
    sta w_bg1hofs
    lda #$03
    sta |w_tm
    lda #(sc_1b_scrn/2)>>8
    sta w_bg1sc
    lda #(sc_2c_scrn/2)>>8
    sta w_bg2sc
    a16
    jsr screen_on

    lea window2_table,<a0
    jsr init_windows

    lea font_dat,<a0
    jsr init_window_text

    lea wind_mission,<a0
    ldy #window_1
    jsr create_window

    lea mission_info,window_1+window_nexttext

    jsr wait_log_finish

    stz play_time

    if en_which_logo<>1
    jsr replay_up
    endif

    if cine


    win_cine_r: lea cine_list,cine_list_ptr

    win_cine: lda cine_list_ptr
    ldx cine_list_ptr+2
    sta a0
    stx a0+2
    ldy #2
    lda [a0]
    ora [a0],y
    beq win_cine_r

    lda [a0]
    sta cine_add
    lda [a0],y
    sta cine_add+2

    lda cine_list_ptr
    clc
    adc #4
    sta cine_list_ptr

    lda [cine_add]
    sta cine_size

    inc cine_add
    inc cine_add

    ldx #$200
    stx charc_set
    stz cine_count

    lda #112
    sta cine_pal_size

    lea unpack_b1,<a1

    win_loop:
    lda cine_count
    cmp cine_size
    bcs end_win

    lda [cine_add]
    tax
    inc cine_add
    inc cine_add
    lda [cine_add]
    inc cine_add
    inc cine_add

    stx a0
    sta a0+2

    lda #sc_1b_scrn/2+7*32+8+3
    sta d0

    jsr cine_frame

    jsr wait_frame

    ldy #window_1
    jsr window_process

    inc play_time

    inc cine_count
    jmp win_loop

    end_win:

    jsr clr_palette_2
    lda #16
    ldx #112
    jsr fade_it

    lda #sc_1b_scrn/2+6*32
    sta blit_dest
    lda #12*32
    sta blit_lenth
    jsr clear_ppu

    jmp win_cine

    endif

    !wloop: jsr wait_frame
    bra !wloop

    ;*******************************************************************************
    *****
    ;*
    ;* Game Message Process
    ;*
    game_mess_process:
    lda bouts_total
    cmp bouts_selected
    beq !no_final
    cmp bout_number
    bne !no_final
    lda #0
    bra !final
    !no_final: lda bout_number
    !final: asl
    tax
    lda >round_table,x
    ldx #$40
    jsr gfx_mess
    jsr check_gfx_mess
    jsr wait_frame

    jsr game_mess
    lda >rest_after_mess
    sta rest

    jmp game_loop_end


    ;*******************************************************************************
    *****************
    ;*
    ;* Bout over process
    ;*

    bout_over_process:
    ; jsr clear_top

    jsr print_results

    jsr bout_over_mess
    no_game_mess:
    jsr fade_screen_off
    jsr screen_off
    jsr hdma_off

    jsr clear_sprites

    jsr clear_screen

    ;****************************************************************************
    ;** Check here for replay
    ;**

    ldx winner_amp
    bne !player_won
    ;Last game was a draw
    lda bout_number
    cmp bouts_total
    bra !not_next_opponent
    !player_won:
    lda robot_won,x
    cmp bouts_toplay
    bcc !not_next_opponent

    ldx mission
    dex
    bne !new_select
    lda dead_type
    beq !dead
    ldx players
    dex
    bne !dead
    lda #robot_sup
    cmp robot_opponent
    bne !next_robot
    jmp !new_robot
    !next_robot:
    inc robot_opponent
    jmp !new_robot
    !not_next_opponent:
    jmp !new_bout
    !dead:
    jmp !new_game

    !new_robot: lda #gs_new_robot
    sta game_state
    jmp game_loop_end

    !new_bout: lda #gs_new_bout
    sta game_state
    jmp game_loop_end

    !new_game: lda #gs_new_game
    sta game_state
    jmp game_loop_end

    !new_select: lda #gs_new_select
    sta game_state
    jmp game_loop_end


    ;*******************************************************************************
    *****
    ;*
    ;* Game over process
    ;*

    ;****************************************************
    ;* Print results

    ;RESULT (overall)=0 for
    game_over_process:

    stz result ;default to draw

    jsr print_results ;print the result of last bout

    teletype results_win,finalr_msg

    lda robot_2+robot_won ;see who won overall
    cmp robot_1+robot_won ;If there is a winner bypass draw
    bne !not_draw

    ;******************************** OVERALL DRAW **********************************

    teletype results_win,draw_msg

    jsr game_end_mess ;fade to red etc.

    lda #gs_new_game ;go play new game
    sta game_state
    jmp game_loop_end

    ;*******************************************************************************
    *

    !not_draw: ldy robot_2+robot_type ;decide who is the winner
    lda #0
    ldx robot_1+robot_won
    cpx robot_2+robot_won
    bcs !r0_win ;bypass if it is cyborg

    ldy #0
    lda robot_2+robot_type ;else get type of oppponent
    bra !opp_win
    !r0_win:
    ldx #1 ;cyborg win result
    stx result
    bra !cont_win
    !opp_win:
    ldx #2 ;opponent win
    stx result
    !cont_win:
    sty dead_type ;who is dead

    asl
    asl
    tax
    lda >winv_msg_table,x
    sta results_win+window_text
    lda >winv_msg_table+2,x
    sta results_win+window_text+2
    !loop3: jsr wait_frame
    ldy #results_win
    jsr window_process
    lda results_win+window_text+2
    ora results_win+window_text
    bne !loop3



    ldx mission ;decide on conditions to display GAME OVER
    dex
    bne !no_game_over ;Not if TRAINING

    ldx players ;Not if 2 Player
    dex
    bne !no_game_over

    lda result ;Not if Cyborg win
    cmp #1
    beq !no_game_over

    teletype results_win,gameover_msg ;print GAME OVER

    !no_game_over:
    jsr game_end_mess ;Fade to red print message
    jsr dead_frame ;Death cinematic

    lda result
    cmp #1 ;Cyborg victory
    beq victory
    ;
    ;************************ Overall result draw or lose ***********************************
    ;

    ldx mission ;if die on mission go back to intro screen
    dex ;else go back to select screen
    bne !ns

    ldx players
    dex
    bne !ns

    !ng: lda #gs_new_game
    sta game_state
    jmp game_loop_end
    !ns:
    lda #gs_new_select
    sta game_state
    jmp game_loop_end

    ;************************ Cyborg Victory *************************************************
    victory:

    ldx players ;2 Players - so select
    dex
    bne !new_select

    ldx mission ;Training - so new game
    dex
    bne !new_select

    lda robot_2+robot_type
    cmp #robot_sup
    bne !new_robot

    ;*******************************************************************************
    *****
    ;
    ; M I S S I O N C O M P L E T E hurray , the end of the game
    ;
    jsr end_sequence ;Victory

    lda #gs_complete
    sta game_state
    jmp game_loop_end

    !new_robot:
    inc robot_opponent
    lda #gs_new_robot
    sta game_state
    jmp game_loop_end

    !new_game:
    lda #gs_new_game
    sta game_state
    jmp game_loop_end

    !new_select:
    lda #gs_new_select
    sta game_state
    jmp game_loop_end

    ;*******************************************************************************
    *****



    set_scroll: jsr wait_frame
    lda scroll_pos
    a08
    sta |w_bg2vofs
    xba
    sta |w_bg2vofs
    a16
    rts

    init_new_robot:
    jsr hdma_off
    lda #1
    sta tele_flag

    lda #1
    sta split_mode

    jsr wait_frame
    jsr clear_screen

    jsr screen_off

    lda #$0000
    sta robot_2+robot_score

    stz robot_1+robot_won
    stz robot_2+robot_won

    lda #1
    sta bout_number
    lda demo_mode
    bne no_select
    !sel_again: jsr select_screen
    lda cancel_sel
    bne !sel_again

    no_select: jsr hdma_off
    jsr wait_frame

    lda players
    sta players_g
    lda bouts
    sta bouts_g
    lda timer
    sta timer_g

    lda difficulty
    sta difficulty_g

    lda demo_mode
    beq !no_demo


    lda #0
    sta players_g
    lda #1
    sta bouts_g
    lda #4
    sta timer_g
    lda #2
    sta difficulty_g
    !no_demo:

    lda bouts_g
    dec a
    asl
    tax
    lda >bouts_table,x
    sta bouts_total
    sta bouts_selected
    lsr
    inc a
    sta bouts_toplay
    rts
    init_bout:
    jsr hdma_off

    jsr clear_screen
    jsr clear_sprites
    jsr init_sprites
    jsr init_robots
    jsr init_background
    jsr init_vars

    jsr inipix

    jsr init_energy

    jsr init_schedule



    jsr wait_frame
    jsr wait_frame
    jsr wait_frame

    lda #sc_2n_scrn/2
    sta wind_screen

    lea window_table,<a0
    jsr init_windows
    lea font_dat,<a0
    jsr init_window_text

    lea robot1_window,<a0
    ldy #window_1
    jsr create_window

    lea robot2_window,<a0
    ldy #window_2
    jsr create_window

    ; jsr players_won

    jsr hdma_off
    jsr para_init

    jsr hdma_on

    jsr fade_screen_on
    jsr screen_on

    jsr setup_collisions

    lda #%01010010
    sta m_cgadsub
    lda #%10000010
    sta m_cgswsel

    a08
    lda timer_value
    sta timer_count
    ldx timer_g
    dex
    lda >timer_table,x
    sta timer_count+1
    a16
    lda >timer_table,x
    and #$ff
    sta timer_mode
    lda #2
    sta game_mode
    lda #10
    sta num_frames

    if en_sound!rom
    lda robot_opponent
    asl
    asl
    tax
    lda >robot_table,x
    sta a2
    lda >robot_table+2,x
    sta a2+2
    ldy #ri_music
    lda [a2],y
    jsr play_tune
    endif

    jsr wait_frame
    a08
    lda #%01010000
    sta |w_cgadsub
    lda #%10000010
    sta |w_cgswsel
    a16

    lda #2
    sta spr_blit_flag
    stz shake
    lda #4
    sta sprite_blit_count

    stz result

    lda >rest_before_mess
    sta rest


    stz time_over_flag
    rts


    init_sprite_blit:
    stz blit_oam
    lda #0
    ldx #4*8/2
    ldy #0

    !lp: sta blit_tables,y
    iny
    iny
    dex
    bne !lp

    rts

    ;*******************************************************************************
    ********
    ;*
    ;* Pause
    Pause_It:
    lda game_mode
    bne !exit

    lda #but_start
    bit |joy_0
    bne !start_it
    ldx players
    dex
    beq !exit
    bit |joy_1
    bne !start_it
    bra !exit
    !start_it:
    jsr sprite_log_blit

    lda #Pause_table&$ffff
    ldx #$2
    jsr gfx_mess
    jsr check_gfx_mess

    lda #but_start
    jsr wait_button_down_up

    lda #but_start
    jsr wait_button_down_up

    !exit:
    rts



    wait_button_down_up:
    tax
    !s0 jsr wait_frame
    txa
    ldy players
    dey
    beq !p11
    bit |joy_1
    bne !s1
    !p11: bit |joy_0
    beq !s0

    !s1: jsr wait_frame
    txa
    ldy players
    dey
    beq !p12
    bit |joy_1
    bne !s1
    !p12: bit |joy_0
    bne !s1

    rts


    wbdu:
    tax
    !s0
    lda |frame_count
    !s0a: cmp |frame_count
    beq !s0a
    txa
    bit |joy_0
    bne !s1
    bit |joy_1
    beq !s0

    !s1:
    lda |frame_count
    !s1a: cmp |frame_count
    beq !s1a
    txa
    bit |joy_0
    bne !s1
    bit |joy_1
    bne !s1

    rts

    make_joystick_config
    ldx #j_config_1
    ldy #0

    !loop: lda 0,x
    sta j_config,y
    inx
    inx
    iny
    iny
    cpy #12
    bcc !loop

    rts

    delay:
    !wl: jsr wait_frame
    dex
    bne !wl

    rts


    gfx_mess_delay:
    !wl: phx
    jsr wait_frame
    jsr clear_sprite_buf
    jsr csp
    jsr check_gfx_mess
    jsr sprite_log_blit
    plx
    dex
    bne !wl

    rts

    sect_2_exit:
    jsr fade_screen_off
    jsr vbl_vect_off

    jsr screen_off
    jsr hdma_off

    jsr clear_sprites


    !loop jmp !loop



    which_logo:
    if en_which_logo!rom
    jml (logo_vect)
    endif
    rtl


    check_timer_out:
    lda timer_mode
    beq cto_exit
    lda game_mode
    bne cto_exit
    lda timer_count
    cmp #2
    bcs cto_exit
    stz timer_count
    ldy #robot_1
    lda robot_1+robot_energylost
    cmp robot_2+robot_energylost
    bcs kill_game
    ldy #robot_2
    kill_game:
    lda #1
    sta time_over_flag
    jsr end_bout
    cto_exit:
    rts


    game_end_mess:
    if en_sound!rom
    jsr fade_tune
    endif

    lda #2000
    sta |spr_blit_flag
    stz nrg_dsp_flg
    jsr wait_frame
    jsr wait_frame

    lea palette_str,<a0
    lda #0
    ldx #256
    jsr copy_palette_2

    ldx #256-16
    ldy #16*2
    !lp: lda palette_str2,y
    and #%0000000000011111
    sta palette_str2,y
    iny
    iny
    dex
    bne !lp

    lda #16
    ldx #256-16-16-16
    jsr fade_it

    jsr wait_frame
    ldy #window_1
    jsr create_window_matrix
    jsr wait_frame
    ldy #window_2
    jsr create_window_matrix
    stz nrg_dsp_flg

    !loop1: jsr wait_frame

    ldy #window_1
    jsr window_process

    ldy #window_2
    jsr window_process

    lda window_1+window_text
    ora window_1+window_text+2
    ora window_2+window_text
    ora window_2+window_text+2

    bne !loop1

    stz game_mode

    lda #4
    sta game_mode
    lda #1
    sta num_frames

    rts


    bout_over_mess:

    ldy #window_1
    jsr create_window_matrix
    jsr wait_frame
    ldy #window_2
    jsr create_window_matrix
    stz nrg_dsp_flg

    !loop1: jsr wait_frame

    ldy #window_1
    jsr window_process

    ldy #window_2
    jsr window_process

    lda window_1+window_text
    ora window_1+window_text+2
    ora window_2+window_text
    ora window_2+window_text+2

    bne !loop1

    lda #100
    lda #end_time
    sta num_frames

    rts



    game_mess:

    !loop1: jsr wait_frame

    ldy #window_1
    jsr window_process

    ldy #window_2
    jsr window_process

    lda window_1+window_text
    ora window_1+window_text+2
    ora window_2+window_text
    ora window_2+window_text+2

    bne !loop1

    lda #r0a&$ffff
    sta window_1+window_text
    lda #r0a>>16
    sta window_1+window_text+2
    lda robot_opponent
    inc a
    asl
    asl
    tax
    lda >plrtab,x
    sta window_2+window_text
    lda >plrtab+2,x
    sta window_2+window_text+2

    jsr print_windows

    lda #scr_1_mess&$ffff
    sta window_1+window_text
    lda #scr_1_mess>>16
    sta window_1+window_text+2

    lda #scr_2_mess&$ffff
    sta window_2+window_text
    lda #scr_2_mess>>16
    sta window_2+window_text+2

    jsr print_windows

    stz game_mode
    lda #-1
    sta nrg_dsp_flg

    !exit:
    jsr players_won
    rts



    print_windows:

    !loop: jsr wait_frame

    ldy #window_2
    jsr window_process
    ldy #window_1
    jsr window_process

    lda window_1+window_text
    ora window_1+window_text+2
    ora window_2+window_text
    ora window_2+window_text+2

    bne !loop
    rts

    set_win_lose_text:
    phy
    phx
    tya
    ldy #window_1
    ldx #window_2
    cmp #robot_1
    beq !r1
    ldy #window_2
    ldx #window_1
    !r1:
    lda #player_matchlost&$ffff
    sta window</div>

    Cuts off, but here's another portion from the same region/build:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> rts


    schedule_process:
    lea schedule,<a1
    ldx #sch_len
    ldy #0
    !loop: lda [a1],y
    bne !s1
    iny
    iny
    lda [a1],y
    dey
    dey
    sta [a1],y
    bra !s2
    !s1: sec
    sbc #1
    sta [a1],y
    !s2: iny
    iny
    iny
    iny
    dex
    bne !loop
    rts



    init_robots:
    ; if en_sp1
    lea robot_1,<a2
    lda #Robot_Cyb

    ldx #2

    jsr irs
    ; endif

    ; if en_sp2
    lea robot_2,<a2
    lda robot_opponent

    ldx difficulty_g

    jsr irs


    ; endif


    ldx players_g
    bne !n1
    lda robot_1+robot_flags
    ora #1<<Bit_CPU
    sta robot_1+robot_flags
    !n1:
    cpx #2
    beq !n2
    lda robot_2+robot_flags
    ora #1<<Bit_CPU
    sta robot_2+robot_flags
    !n2:
    rts

    init_background:

    if en_back

    lda robot_2+robot_type
    sta d8

    lda #2
    sta charc_set
    lda #32
    lda #0
    clc
    adc #sc_1n_scrn/2
    sta d0
    lda d8
    clc
    ; adc #1
    asl
    asl
    tax
    lda >robot_table,x
    sta a0
    sta a4
    lda >robot_table+2,x
    sta a0+2
    sta a4+2
    ldy #ri_room
    lda [a0],y
    tax
    iny
    iny
    lda [a0],y
    stx a0
    sta a0+2
    stz d8+2
    jsr back_frame
    endif

    rts



    irs:
    ;Profile index
    pha
    txa
    dec a
    and #3
    ldx #7
    jsr mult_xa
    clc
    adc bout_number
    dec a
    ldx #6
    jsr mult_xa
    sta d4
    pla



    if 0
    pha

    ldx #(robot_parm_size)/2
    lda #0
    tay
    !clp:
    sta [a2],y
    iny
    iny
    dex
    bne !clp

    pla
    endif

    ldy #robot_type
    sta [a2],y
    asl
    asl
    tax
    lda >robot_table,x
    sta a6
    lda >robot_table+2,x
    sta a6+2
    ldy #ri_gfx
    lda [a6],y
    pha
    iny
    iny
    lda [a6],y
    ldy #robot_gfx+2
    sta [a2],y
    dey
    dey
    pla
    sta [a2],y

    ldx a2
    cpx #robot_1
    bne p2_set
    p1_set:
    lda #sjoy0
    sta robot_joyval,x
    ldy #ri_xstartl
    lda [a6],y
    sta robot_x,x
    sta robot_x_origin,x

    lda #robot_2
    sta robot_other,x
    lda #0
    sta robot_other+2,x

    lda #rob_gbuff_1&$ffff
    sta robot_graphics,x
    lda #rob_gbuff_1>>16
    sta robot_graphics+2,x

    lda #0
    sta robot_overdelay,x

    bra set_ok
    p2_set:
    lda #sjoy1
    sta robot_joyval,x
    ldy #ri_xstartr
    lda [a6],y
    s</div>

    Same thing. Here's more:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>;

    ldx mission ;if die on mission go back to intro screen
    dex ;else go back to select screen
    bne !ns

    ldx players
    dex
    bne !ns

    !ng: lda #gs_new_game
    sta game_state
    jmp game_loop_end
    !ns:
    lda #gs_new_select
    sta game_state
    jmp game_loop_end

    ;************************ Cyborg Victory *************************************************
    victory:

    ldx players ;2 Players - so select
    dex
    bne !new_select

    ldx mission ;Training - so new game
    dex
    bne !new_select

    lda robot_2+robot_type
    cmp #robot_sup
    bne !new_robot

    ;*******************************************************************************
    *****
    ;
    ; M I S S I O N C O M P L E T E hurray , the end of the game
    ;
    jsr end_sequence ;Victory

    lda #gs_complete
    sta game_state
    jmp game_loop_end

    !new_robot:
    inc robot_opponent
    lda #gs_new_robot
    sta game_state
    jmp game_loop_end

    !new_game:
    lda #gs_new_game
    sta game_state
    jmp game_loop_end

    !new_select:
    lda #gs_new_select
    sta game_state
    jmp game_loop_end

    ;*******************************************************************************
    *****



    set_scroll: jsr wait_frame
    lda scroll_pos
    a08
    sta |w_bg2vofs
    xba
    sta |w_bg2vofs
    a16
    rts

    init_new_robot:
    jsr hdma_off
    lda #1
    sta tele_flag

    lda #1
    sta split_mode

    jsr wait_frame
    jsr clear_screen

    jsr screen_off

    lda #$0000
    sta robot_2+robot_score

    stz robot_1+robot_won
    stz robot_2+robot_won

    lda #1
    sta bout_number
    lda demo_mode
    bne no_select
    !sel_again: jsr select_screen
    lda cancel_sel
    bne !sel_again

    no_select: jsr hdma_off
    jsr wait_frame

    lda players
    sta players_g
    lda bouts
    sta bouts_g
    lda timer
    sta timer_g

    lda difficulty
    sta difficulty_g

    lda demo_mode
    beq !no_demo


    lda #0
    sta play</div>

    More:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> dec d0 ;any more shards to create ?
    beq !exit ;end if not

    !na: lda a4
    clc
    adc #shard_parm_size
    sta a4
    dec d1
    beq !exit
    jmp !lp
    !exit:
    rts

    create_spark:
    lda #no_sparks
    sta d0

    ldx #spark_buff
    !spl:
    lda spark_y,x
    bne !not_clear

    lda shard_coordx
    sta spark_x,x

    lda shard_coordy
    sta spark_y,x

    stz spark_frame,x

    rts
    !not_clear:
    txa
    clc
    adc #spark_parm_size
    tax
    dec d0
    bne !spl
    rts




    vert_on:
    if en_vert
    sei
    a08
    lda #%10110001
    sta |w_nmitimen

    a16

    lda >htv
    sta |w_htimel

    cli
    endif
    rts



    np_set:
    ldx #max_dma_p
    ldy #50

    a08
    lda r_stat78
    a16
    bit #1<<4
    bne !pal
    ldx #max_dma_n
    ldy #60
    !pal:
    if en_ntsc
    ldx #max_dma_n
    ldy #60
    endif

    stx max_dma
    sty timer_value
    rts


    vert_off:
    if en_vert
    jsr wait_frame

    sei

    a08

    lda #%10000001
    sta |w_nmitimen

    a16

    cli
    endif
    rts


    ;0978 266333

    debug:
    if en_debug
    if rom=0


    if 0
    pv robot_2+robot_aioverride,0
    pv robot_2+robot_aioverridemode,3
    pv robot_2+robot_mode,6
    pv robot_2+robot_int,9
    pv robot_2+robot_motivation,12
    pv robot_2+robot_speed,15
    pv robot_2+robot_firepowerdelay,18
    pv robot_2+robot_aitimer,21
    pv robot_2+robot_aimoveaddr,24
    pv robot_2+robot_aimoveaddr+2,27
    pv robot_2+robot_aimoveaddr+4,30
    endif


    if 0
    pv robot_2+robot_mode,0
    pv robot_2+robot_frame,3
    pv robot_2+robot_y,6
    pv robot_2+robot_ymax,9
    endif


    if 1
    pv robot_1+robot_frame,0
    pv robot_2+robot_frame,3
    pw cur_col_pos,6
    pw cur_col_diff,11
    pw cur_col_xy,16
    pw cur_col_xy+2,21

    pv robot_1+robot_cur_hit+2,26
    pv robot_2+robot_cur_hit+2,29
    endif
    endif
    endif

    rts
    reset_energy:
    ldy a2
    lda robot_type,y
    asl</div>

    MORE:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> SET16
    lda #(MusicDriver&$ffff) ;download driver (24 bit address)
    sta <SonyAddr lda #RamII
    lda #MusicDriver>>16
    sta <SonyAddr+2
    jsr SONY_send

    CLR16
    lda #$82 ;DOWNLOAD data (music)
    sta >APU_PORT0
    SET16
    lda mus_data
    sta <SonyAddr
    lda mus_data+2
    sta <SonyAddr+2
    jsr SONY_send

    CLR16
    lda #$82 ;DOWNLOAD data (samples)
    sta >APU_PORT0
    SET16
    lda samp_1
    sta <SonyAddr
    lda samp_1+2
    sta <SonyAddr+2
    jsr SONY_send

    CLR16
    lda #$82 ;DOWNLOAD data (samples)
    sta >APU_PORT0
    SET16
    lda samp_2
    sta <SonyAddr
    lda samp_2+2
    sta <SonyAddr+2
    jsr SONY_send

    CLR16
    sta >APU_PORT3
    plp ;restore any interrupts
    SET16
    rts


    ;-----------------------------------------------------------------------------
    SONY_send: jsr Boot_APU
    CLR16
    !wait0: lda >APU_PORT0 ;wait for handshake
    bne !wait0
    dec a
    sta >APU_PORT2 ;acknowledge handshake
    sta <callnum ;init call number to $FF
    rts


    ;-------------------------------------------------------------------------------
    ; Once the Sound_Init routine has been called, the following routine can be
    ; used to download additional music data (or sample data with '#Musicdata'
    ; replaced by '#Samples') which is required for later levels of the game.
    ;-------------------------------------------------------------------------------

    Send_Data:
    stx mus_data
    sta mus_data+2
    send_mus_data:
    CLR16
    php
    sei ;disable any other interrupts
    S_D0: lda >APU_PORT0 ;latest value sent by SOUND CPU
    cmp <callnum
    bne S_D0 ;previous call still not finished

    lda #$82 ;DOWNLOAD data (music)
    sta >APU_PORT0
    inc <callnum
    lda <callnum
    sta >APU_PORT3 ;forces a new call
    SET16
    lda mus_data
    sta <SonyAddr
    lda mus_data+2
    sta <SonyAddr+2
    jsr SONY_send

    sta >AP</div>

    More:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>code: incbin abslogo.bin
    endif


    dr


    hctab:
    hct = 0
    rept 6
    dw hct,hct+$10
    hct = hct+$43
    endr

    endif

    dtune_time: dw 400
    hit_scale:
    dw $80

    reverse_off: db $2f,$2f,$2f,$2f,$2f,$2f,$2f,$2f,$2f

    power_table:
    dw robot_min_power-2
    dw robot_mid_power-2
    dw robot_max_power-2


    sel_ts: dw %00000000
    sel_adsub dw %01010010
    sel_swel dw %00010010

    option_table: dw 3,2,3,4,2,2,3


    if en_sound!rom
    music_table: dl music1,music1,music2,music3,music4,musict</div>


    The USA BETA version has some fragments as well, but besides that and the European version - these are the only two versions with source code references.
     
  12. Bibin

    Bibin

    DON'T LET THE SUN LAUGH AT YOU. Member
    882
    0
    0
    New York City
    Ghost in the Machine
    <!--quoteo(post=429471:date=Mar 21 2010, 06:25 PM:name=evilhamwizard)--><div class='quotetop'>QUOTE (evilhamwizard @ Mar 21 2010, 06:25 PM) <a href="index.php?act=findpost&pid=429471">[​IMG]</a></div><div class='quotemain'><!--quotec-->Just a directory listing:
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>17/08/2004 12:56 4,864 AMY.VAG.</div><!--QuoteEnd--></div><!--QuoteEEnd-->
    I chuckled.
     
  13. SegaLoco

    SegaLoco

    W)(at did you say? Misfit
    <!--quoteo(post=464114:date=Jun 6 2010, 10:23 PM:name=Bibin)--><div class='quotetop'>QUOTE (Bibin @ Jun 6 2010, 10:23 PM) <a href="index.php?act=findpost&pid=464114">[​IMG]</a></div><div class='quotemain'><!--quotec--><!--quoteo(post=429471:date=Mar 21 2010, 06:25 PM:name=evilhamwizard)--><div class='quotetop'>QUOTE (evilhamwizard @ Mar 21 2010, 06:25 PM) <a href="index.php?act=findpost&pid=429471">[​IMG]</a></div><div class='quotemain'><!--quotec-->Just a directory listing:
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>17/08/2004 12:56 4,864 AMY.VAG.</div><!--QuoteEnd--></div><!--QuoteEEnd-->
    I chuckled.
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    Damn you, I was gonna say that. Seems they searched for *.vag files, maybe a little joke to mess with the other devs XD... (Probably not though)