saturnus: support 8mbit/32mbit dram cart as a syncsetting. this inflates your savestate size heavily, of course...

This commit is contained in:
goyuken 2014-02-23 17:06:24 +00:00
parent 17f64cf8f5
commit d7371fcf42
7 changed files with 240 additions and 181 deletions

View File

@ -28,226 +28,249 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButtonGL = new System.Windows.Forms.RadioButton(); this.radioButtonGL = new System.Windows.Forms.RadioButton();
this.radioButtonSoft = new System.Windows.Forms.RadioButton(); this.radioButtonSoft = new System.Windows.Forms.RadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.numericUpDown2 = new System.Windows.Forms.NumericUpDown(); this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.numericUpDownFactor = new System.Windows.Forms.NumericUpDown(); this.numericUpDownFactor = new System.Windows.Forms.NumericUpDown();
this.radioButtonFree = new System.Windows.Forms.RadioButton(); this.radioButtonFree = new System.Windows.Forms.RadioButton();
this.radioButtonFactor = new System.Windows.Forms.RadioButton(); this.radioButtonFactor = new System.Windows.Forms.RadioButton();
this.buttonOK = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox3 = new System.Windows.Forms.GroupBox();
this.groupBox2.SuspendLayout(); this.comboBoxCartType = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownFactor)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
this.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
// ((System.ComponentModel.ISupportInitialize)(this.numericUpDownFactor)).BeginInit();
// groupBox1 this.groupBox3.SuspendLayout();
// this.SuspendLayout();
this.groupBox1.Controls.Add(this.radioButtonGL); //
this.groupBox1.Controls.Add(this.radioButtonSoft); // groupBox1
this.groupBox1.Location = new System.Drawing.Point(12, 12); //
this.groupBox1.Name = "groupBox1"; this.groupBox1.Controls.Add(this.radioButtonGL);
this.groupBox1.Size = new System.Drawing.Size(111, 100); this.groupBox1.Controls.Add(this.radioButtonSoft);
this.groupBox1.TabIndex = 0; this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.TabStop = false; this.groupBox1.Name = "groupBox1";
this.groupBox1.Text = "Render Type"; this.groupBox1.Size = new System.Drawing.Size(111, 100);
// this.groupBox1.TabIndex = 0;
// radioButtonGL this.groupBox1.TabStop = false;
// this.groupBox1.Text = "Render Type";
this.radioButtonGL.AutoSize = true; //
this.radioButtonGL.Location = new System.Drawing.Point(6, 42); // radioButtonGL
this.radioButtonGL.Name = "radioButtonGL"; //
this.radioButtonGL.Size = new System.Drawing.Size(68, 17); this.radioButtonGL.AutoSize = true;
this.radioButtonGL.TabIndex = 1; this.radioButtonGL.Location = new System.Drawing.Point(6, 42);
this.radioButtonGL.TabStop = true; this.radioButtonGL.Name = "radioButtonGL";
this.radioButtonGL.Text = "Open GL"; this.radioButtonGL.Size = new System.Drawing.Size(68, 17);
this.radioButtonGL.UseVisualStyleBackColor = true; this.radioButtonGL.TabIndex = 1;
// this.radioButtonGL.TabStop = true;
// radioButtonSoft this.radioButtonGL.Text = "Open GL";
// this.radioButtonGL.UseVisualStyleBackColor = true;
this.radioButtonSoft.AutoSize = true; //
this.radioButtonSoft.Location = new System.Drawing.Point(6, 19); // radioButtonSoft
this.radioButtonSoft.Name = "radioButtonSoft"; //
this.radioButtonSoft.Size = new System.Drawing.Size(67, 17); this.radioButtonSoft.AutoSize = true;
this.radioButtonSoft.TabIndex = 0; this.radioButtonSoft.Location = new System.Drawing.Point(6, 19);
this.radioButtonSoft.TabStop = true; this.radioButtonSoft.Name = "radioButtonSoft";
this.radioButtonSoft.Text = "Software"; this.radioButtonSoft.Size = new System.Drawing.Size(67, 17);
this.radioButtonSoft.UseVisualStyleBackColor = true; this.radioButtonSoft.TabIndex = 0;
this.radioButtonSoft.CheckedChanged += new System.EventHandler(this.radioButtonSoft_CheckedChanged); this.radioButtonSoft.TabStop = true;
// this.radioButtonSoft.Text = "Software";
// groupBox2 this.radioButtonSoft.UseVisualStyleBackColor = true;
// this.radioButtonSoft.CheckedChanged += new System.EventHandler(this.radioButtonSoft_CheckedChanged);
this.groupBox2.Controls.Add(this.label1); //
this.groupBox2.Controls.Add(this.numericUpDown2); // groupBox2
this.groupBox2.Controls.Add(this.numericUpDown1); //
this.groupBox2.Controls.Add(this.numericUpDownFactor); this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.radioButtonFree); this.groupBox2.Controls.Add(this.numericUpDown2);
this.groupBox2.Controls.Add(this.radioButtonFactor); this.groupBox2.Controls.Add(this.numericUpDown1);
this.groupBox2.Location = new System.Drawing.Point(129, 12); this.groupBox2.Controls.Add(this.numericUpDownFactor);
this.groupBox2.Name = "groupBox2"; this.groupBox2.Controls.Add(this.radioButtonFree);
this.groupBox2.Size = new System.Drawing.Size(215, 100); this.groupBox2.Controls.Add(this.radioButtonFactor);
this.groupBox2.TabIndex = 1; this.groupBox2.Location = new System.Drawing.Point(129, 12);
this.groupBox2.TabStop = false; this.groupBox2.Name = "groupBox2";
this.groupBox2.Text = "Render Resolution"; this.groupBox2.Size = new System.Drawing.Size(215, 100);
// this.groupBox2.TabIndex = 1;
// label1 this.groupBox2.TabStop = false;
// this.groupBox2.Text = "Render Resolution";
this.label1.AutoSize = true; //
this.label1.Location = new System.Drawing.Point(134, 48); // label1
this.label1.Name = "label1"; //
this.label1.Size = new System.Drawing.Size(14, 13); this.label1.AutoSize = true;
this.label1.TabIndex = 5; this.label1.Location = new System.Drawing.Point(134, 48);
this.label1.Text = "X"; this.label1.Name = "label1";
// this.label1.Size = new System.Drawing.Size(14, 13);
// numericUpDown2 this.label1.TabIndex = 5;
// this.label1.Text = "X";
this.numericUpDown2.Increment = new decimal(new int[] { //
// numericUpDown2
//
this.numericUpDown2.Increment = new decimal(new int[] {
8, 8,
0, 0,
0, 0,
0}); 0});
this.numericUpDown2.Location = new System.Drawing.Point(154, 44); this.numericUpDown2.Location = new System.Drawing.Point(154, 44);
this.numericUpDown2.Maximum = new decimal(new int[] { this.numericUpDown2.Maximum = new decimal(new int[] {
1024, 1024,
0, 0,
0, 0,
0}); 0});
this.numericUpDown2.Minimum = new decimal(new int[] { this.numericUpDown2.Minimum = new decimal(new int[] {
224, 224,
0, 0,
0, 0,
0}); 0});
this.numericUpDown2.Name = "numericUpDown2"; this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Size = new System.Drawing.Size(53, 20); this.numericUpDown2.Size = new System.Drawing.Size(53, 20);
this.numericUpDown2.TabIndex = 4; this.numericUpDown2.TabIndex = 4;
this.numericUpDown2.Value = new decimal(new int[] { this.numericUpDown2.Value = new decimal(new int[] {
224, 224,
0, 0,
0, 0,
0}); 0});
// //
// numericUpDown1 // numericUpDown1
// //
this.numericUpDown1.Increment = new decimal(new int[] { this.numericUpDown1.Increment = new decimal(new int[] {
8, 8,
0, 0,
0, 0,
0}); 0});
this.numericUpDown1.Location = new System.Drawing.Point(75, 44); this.numericUpDown1.Location = new System.Drawing.Point(75, 44);
this.numericUpDown1.Maximum = new decimal(new int[] { this.numericUpDown1.Maximum = new decimal(new int[] {
2048, 2048,
0, 0,
0, 0,
0}); 0});
this.numericUpDown1.Minimum = new decimal(new int[] { this.numericUpDown1.Minimum = new decimal(new int[] {
320, 320,
0, 0,
0, 0,
0}); 0});
this.numericUpDown1.Name = "numericUpDown1"; this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(53, 20); this.numericUpDown1.Size = new System.Drawing.Size(53, 20);
this.numericUpDown1.TabIndex = 3; this.numericUpDown1.TabIndex = 3;
this.numericUpDown1.Value = new decimal(new int[] { this.numericUpDown1.Value = new decimal(new int[] {
320, 320,
0, 0,
0, 0,
0}); 0});
// //
// numericUpDownFactor // numericUpDownFactor
// //
this.numericUpDownFactor.Location = new System.Drawing.Point(119, 19); this.numericUpDownFactor.Location = new System.Drawing.Point(119, 19);
this.numericUpDownFactor.Maximum = new decimal(new int[] { this.numericUpDownFactor.Maximum = new decimal(new int[] {
4, 4,
0, 0,
0, 0,
0}); 0});
this.numericUpDownFactor.Minimum = new decimal(new int[] { this.numericUpDownFactor.Minimum = new decimal(new int[] {
1, 1,
0, 0,
0, 0,
0}); 0});
this.numericUpDownFactor.Name = "numericUpDownFactor"; this.numericUpDownFactor.Name = "numericUpDownFactor";
this.numericUpDownFactor.Size = new System.Drawing.Size(64, 20); this.numericUpDownFactor.Size = new System.Drawing.Size(64, 20);
this.numericUpDownFactor.TabIndex = 2; this.numericUpDownFactor.TabIndex = 2;
this.numericUpDownFactor.Value = new decimal(new int[] { this.numericUpDownFactor.Value = new decimal(new int[] {
1, 1,
0, 0,
0, 0,
0}); 0});
// //
// radioButtonFree // radioButtonFree
// //
this.radioButtonFree.AutoSize = true; this.radioButtonFree.AutoSize = true;
this.radioButtonFree.Location = new System.Drawing.Point(6, 46); this.radioButtonFree.Location = new System.Drawing.Point(6, 46);
this.radioButtonFree.Name = "radioButtonFree"; this.radioButtonFree.Name = "radioButtonFree";
this.radioButtonFree.Size = new System.Drawing.Size(63, 17); this.radioButtonFree.Size = new System.Drawing.Size(63, 17);
this.radioButtonFree.TabIndex = 1; this.radioButtonFree.TabIndex = 1;
this.radioButtonFree.TabStop = true; this.radioButtonFree.TabStop = true;
this.radioButtonFree.Text = "Specific"; this.radioButtonFree.Text = "Specific";
this.radioButtonFree.UseVisualStyleBackColor = true; this.radioButtonFree.UseVisualStyleBackColor = true;
// //
// radioButtonFactor // radioButtonFactor
// //
this.radioButtonFactor.AutoSize = true; this.radioButtonFactor.AutoSize = true;
this.radioButtonFactor.Location = new System.Drawing.Point(6, 19); this.radioButtonFactor.Location = new System.Drawing.Point(6, 19);
this.radioButtonFactor.Name = "radioButtonFactor"; this.radioButtonFactor.Name = "radioButtonFactor";
this.radioButtonFactor.Size = new System.Drawing.Size(107, 17); this.radioButtonFactor.Size = new System.Drawing.Size(107, 17);
this.radioButtonFactor.TabIndex = 0; this.radioButtonFactor.TabIndex = 0;
this.radioButtonFactor.TabStop = true; this.radioButtonFactor.TabStop = true;
this.radioButtonFactor.Text = "Multiple of Native"; this.radioButtonFactor.Text = "Multiple of Native";
this.radioButtonFactor.UseVisualStyleBackColor = true; this.radioButtonFactor.UseVisualStyleBackColor = true;
this.radioButtonFactor.CheckedChanged += new System.EventHandler(this.radioButtonFactor_CheckedChanged); this.radioButtonFactor.CheckedChanged += new System.EventHandler(this.radioButtonFactor_CheckedChanged);
// //
// buttonOK // buttonOK
// //
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK; this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.Location = new System.Drawing.Point(187, 122); this.buttonOK.Location = new System.Drawing.Point(188, 178);
this.buttonOK.Name = "buttonOK"; this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23); this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 2; this.buttonOK.TabIndex = 2;
this.buttonOK.Text = "OK"; this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
// //
// buttonCancel // buttonCancel
// //
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(268, 122); this.buttonCancel.Location = new System.Drawing.Point(269, 178);
this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 3; this.buttonCancel.TabIndex = 3;
this.buttonCancel.Text = "Cancel"; this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.UseVisualStyleBackColor = true;
// //
// SaturnPrefs // groupBox3
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.groupBox3.Controls.Add(this.comboBoxCartType);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.groupBox3.Location = new System.Drawing.Point(12, 118);
this.ClientSize = new System.Drawing.Size(355, 155); this.groupBox3.Name = "groupBox3";
this.Controls.Add(this.buttonCancel); this.groupBox3.Size = new System.Drawing.Size(332, 54);
this.Controls.Add(this.buttonOK); this.groupBox3.TabIndex = 4;
this.Controls.Add(this.groupBox2); this.groupBox3.TabStop = false;
this.Controls.Add(this.groupBox1); this.groupBox3.Text = "Cartridge Type";
this.Name = "SaturnPrefs"; //
this.ShowIcon = false; // comboBoxCartType
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; //
this.Text = "Preferences"; this.comboBoxCartType.FormattingEnabled = true;
this.groupBox1.ResumeLayout(false); this.comboBoxCartType.Location = new System.Drawing.Point(6, 19);
this.groupBox1.PerformLayout(); this.comboBoxCartType.Name = "comboBoxCartType";
this.groupBox2.ResumeLayout(false); this.comboBoxCartType.Size = new System.Drawing.Size(320, 21);
this.groupBox2.PerformLayout(); this.comboBoxCartType.TabIndex = 0;
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit(); //
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); // SaturnPrefs
((System.ComponentModel.ISupportInitialize)(this.numericUpDownFactor)).EndInit(); //
this.ResumeLayout(false); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(356, 213);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "SaturnPrefs";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Preferences";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownFactor)).EndInit();
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
} }
@ -265,5 +288,7 @@
private System.Windows.Forms.RadioButton radioButtonFactor; private System.Windows.Forms.RadioButton radioButtonFactor;
private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.ComboBox comboBoxCartType;
} }
} }

View File

@ -17,6 +17,7 @@ namespace BizHawk.Client.EmuHawk
public SaturnPrefs() public SaturnPrefs()
{ {
InitializeComponent(); InitializeComponent();
comboBoxCartType.Items.AddRange(Enum.GetNames(typeof(LibYabause.CartType)));
try try
{ {
var ss = (Yabause.SaturnSyncSettings)Global.Emulator.GetSyncSettings(); var ss = (Yabause.SaturnSyncSettings)Global.Emulator.GetSyncSettings();
@ -28,6 +29,7 @@ namespace BizHawk.Client.EmuHawk
numericUpDownFactor.Value = ss.DispFactor; numericUpDownFactor.Value = ss.DispFactor;
numericUpDown1.Value = ss.GLW; numericUpDown1.Value = ss.GLW;
numericUpDown2.Value = ss.GLH; numericUpDown2.Value = ss.GLH;
comboBoxCartType.SelectedItem = Enum.GetName(typeof(LibYabause.CartType), ss.CartType);
} }
catch (ArgumentOutOfRangeException) catch (ArgumentOutOfRangeException)
{ {
@ -53,6 +55,7 @@ namespace BizHawk.Client.EmuHawk
ss.DispFactor = (int)numericUpDownFactor.Value; ss.DispFactor = (int)numericUpDownFactor.Value;
ss.GLW = (int)numericUpDown1.Value; ss.GLW = (int)numericUpDown1.Value;
ss.GLH = (int)numericUpDown2.Value; ss.GLH = (int)numericUpDown2.Value;
ss.CartType = (LibYabause.CartType)Enum.Parse(typeof(LibYabause.CartType), (string)comboBoxCartType.SelectedItem);
GlobalWin.MainForm.PutCoreSyncSettings(ss); GlobalWin.MainForm.PutCoreSyncSettings(ss);
} }
} }

View File

@ -163,6 +163,14 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
[DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)] [DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void libyabause_glsetnativefactor(int n); public static extern void libyabause_glsetnativefactor(int n);
public enum CartType : int
{
NONE = 0,
DRAM8MBIT = 6,
DRAM32MBIT = 7
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -171,7 +179,7 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
/// <param name="usegl">true for opengl</param> /// <param name="usegl">true for opengl</param>
/// <returns></returns> /// <returns></returns>
[DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)] [DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool libyabause_init(ref CDInterface intf, string biosfn, bool usegl); public static extern bool libyabause_init(ref CDInterface intf, string biosfn, bool usegl, CartType carttype);
public struct CDInterface public struct CDInterface
{ {

View File

@ -82,7 +82,7 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
string BiosPipe = fp.GetPipeNameNative(); string BiosPipe = fp.GetPipeNameNative();
fp.Offer(bios); fp.Offer(bios);
if (!LibYabause.libyabause_init(ref CDInt, BiosPipe, GL)) if (!LibYabause.libyabause_init(ref CDInt, BiosPipe, GL, SyncSettings.CartType))
throw new Exception("libyabause_init() failed!"); throw new Exception("libyabause_init() failed!");
fp.Finish(); fp.Finish();
@ -670,10 +670,11 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
public bool DispFree = false; public bool DispFree = false;
public int GLW = 640; public int GLW = 640;
public int GLH = 480; public int GLH = 480;
public LibYabause.CartType CartType = LibYabause.CartType.NONE;
public static bool NeedsReboot(SaturnSyncSettings x, SaturnSyncSettings y) public static bool NeedsReboot(SaturnSyncSettings x, SaturnSyncSettings y)
{ {
return x.UseGL != y.UseGL; return x.UseGL != y.UseGL || x.CartType != y.CartType;
} }
public SaturnSyncSettings Clone() public SaturnSyncSettings Clone()
{ {

Binary file not shown.

View File

@ -1479,6 +1479,15 @@ int CartSaveState(FILE * fp)
fwrite((void *)&CartridgeArea->carttype, 4, 1, fp); fwrite((void *)&CartridgeArea->carttype, 4, 1, fp);
// Write the areas associated with the cart type here // Write the areas associated with the cart type here
switch (CartridgeArea->carttype)
{
case CART_DRAM8MBIT:
fwrite(CartridgeArea->dram, 1, 0x100000, fp);
break;
case CART_DRAM32MBIT:
fwrite(CartridgeArea->dram, 1, 0x400000, fp);
break;
}
return StateFinishHeader(fp, offset); return StateFinishHeader(fp, offset);
} }
@ -1494,6 +1503,19 @@ int CartLoadState(FILE * fp, UNUSED int version, int size)
// Check to see if old cart type and new cart type match, if they don't, // Check to see if old cart type and new cart type match, if they don't,
// reallocate memory areas // reallocate memory areas
if (CartridgeArea->carttype != newtype)
{
// ...
}
switch (CartridgeArea->carttype)
{
case CART_DRAM8MBIT:
fread(CartridgeArea->dram, 1, 0x100000, fp);
break;
case CART_DRAM32MBIT:
fread(CartridgeArea->dram, 1, 0x400000, fp);
break;
}
// Read the areas associated with the cart type here // Read the areas associated with the cart type here

View File

@ -507,7 +507,7 @@ void vdp2newhook(u16 v)
} }
} }
extern "C" __declspec(dllexport) int libyabause_init(CDInterface *_CD, const char *biosfn, int usegl) extern "C" __declspec(dllexport) int libyabause_init(CDInterface *_CD, const char *biosfn, int usegl, int carttype)
{ {
usinggl = usegl; usinggl = usegl;
if (usegl && (!StartGLContext() || !LoadExtensions())) if (usegl && (!StartGLContext() || !LoadExtensions()))
@ -544,7 +544,7 @@ extern "C" __declspec(dllexport) int libyabause_init(CDInterface *_CD, const cha
yinit.cdpath = "Saturnus"; //NULL; yinit.cdpath = "Saturnus"; //NULL;
yinit.buppath = NULL; yinit.buppath = NULL;
yinit.mpegpath = NULL; yinit.mpegpath = NULL;
yinit.cartpath = NULL; yinit.carttype = carttype;
yinit.netlinksetting = NULL; yinit.netlinksetting = NULL;
yinit.videoformattype = VIDEOFORMATTYPE_NTSC; yinit.videoformattype = VIDEOFORMATTYPE_NTSC;