Welcome!
Final Burn Neo => FBN Development => Topic started by: Themaister on October 29, 2011, 01:36:40 PM
-
Me and a codev are working on multiplatform port of FBA core.
Our repo can be found here: https://github.com/twinaphex/fba-next-slim
Our current setup is mostly Linux 64-bit, and we've stumbled on some 64-bit issues.
Here are some fixes:
diff --git a/src-0.2.97.13/burn/drivers/toaplan/toa_bcu2.cpp b/src-0.2.97.13/burn/drivers/toaplan/toa_bcu2.cpp
index 9706f11..85f8cb1 100644
--- a/src-0.2.97.13/burn/drivers/toaplan/toa_bcu2.cpp
+++ b/src-0.2.97.13/burn/drivers/toaplan/toa_bcu2.cpp
@@ -358,7 +358,7 @@ int ToaInitBCU2()
nFCU2MaxSprite = (nFCU2ROMSize - 1) >> 5;
- nSize = 0x10 * 0x101 * sizeof(int);
+ nSize = 0x10 * 0x101 * sizeof(unsigned short*);
pFCU2SpriteQueueData = (unsigned short**)malloc(nSize);
memset(pFCU2SpriteQueueData, 0, nSize);
diff --git a/src-0.2.97.13/burn/drivers/toaplan/toa_gp9001.cpp b/src-0.2.97.13/burn/drivers/toaplan/toa_gp9001.cpp
index 9c4c87c..86dacfc 100644
--- a/src-0.2.97.13/burn/drivers/toaplan/toa_gp9001.cpp
+++ b/src-0.2.97.13/burn/drivers/toaplan/toa_gp9001.cpp
@@ -491,7 +491,7 @@ int ToaInitGP9001(int n)
pTileQueueData[i] = (unsigned int*)malloc(nSize);
memset(pTileQueueData[i], 0, nSize);
- nSize = 0x10 * 0x101 * sizeof(int);
+ nSize = 0x10 * 0x101 * sizeof(unsigned char*);
pSpriteQueueData[i] = (unsigned char**)malloc(nSize);
memset(pSpriteQueueData[i], 0, nSize);
diff --git a/src-0.2.97.13/burn/sound/msm6295.cpp b/src-0.2.97.13/burn/sound/msm6295.cpp
index d632672..8feea9a 100644
--- a/src-0.2.97.13/burn/sound/msm6295.cpp
+++ b/src-0.2.97.13/burn/sound/msm6295.cpp
@@ -73,13 +73,13 @@ int MSM6295Scan(int nChip, int /*nAction*/)
SCAN_VAR(nMSM6295Status[nChip]);
for (int i = 0; i < 4; i++) {
- MSM6295SampleInfo[nChip][i] -= (unsigned int)MSM6295ROM;
+ MSM6295SampleInfo[nChip][i] -= (uintptr_t)MSM6295ROM;
SCAN_VAR(MSM6295SampleInfo[nChip][i]);
- MSM6295SampleInfo[nChip][i] += (unsigned int)MSM6295ROM;
+ MSM6295SampleInfo[nChip][i] += (uintptr_t)MSM6295ROM;
- MSM6295SampleData[nChip][i] -= (unsigned int)MSM6295ROM;
+ MSM6295SampleData[nChip][i] -= (uintptr_t)MSM6295ROM;
SCAN_VAR(MSM6295SampleData[nChip][i]);
- MSM6295SampleData[nChip][i] += (unsigned int)MSM6295ROM;
+ MSM6295SampleData[nChip][i] += (uintptr_t)MSM6295ROM;
}
return 0;
--- a/src-0.2.97.13/cpu/m6502/codes.h
+++ b/src-0.2.97.13/cpu/m6502/codes.h
@@ -234,6 +234,6 @@ default:
printf
(
"[M6502 %lX] Unrecognized instruction: $%02X at PC=$%04X\n",
- (unsigned long)(R->User),Op6502(R->PC.W-1),(word)(R->PC.W-1)
+ (unsigned)(size_t)(R->User),Op6502(R->PC.W-1),(word)(R->PC.W-1)
);
break;
diff --git a/src-0.2.97.13/cpu/arm7_intf.cpp b/src-0.2.97.13/cpu/arm7_intf.cpp
index c1fdd9a..16f39dd 100644
--- a/src-0.2.97.13/cpu/arm7_intf.cpp
+++ b/src-0.2.97.13/cpu/arm7_intf.cpp
@@ -31,7 +31,7 @@ static unsigned int Arm7IdleLoop = ~0;
void Arm7Init( int num ) // only one cpu supported
{
for (int i = 0; i < 3; i++) {
- membase[i] = (unsigned char**)malloc(PAGE_COUNT * sizeof(int));
+ membase[i] = (unsigned char**)malloc(PAGE_COUNT * sizeof(unsigned char*));
}
CpuCheatRegister(0x000a, num);
/cpu/sek.{cpp,h} (rather long and boring):
http://pastebin.com/ScRci3ib
SH2: Similar:
http://pastebin.com/c6DqNbpt
Hopefully these fixes can be reviewed.
-
I can confirm that these changes are working on 32 and 64-bit visual studio builds.
-
Additional fix for YM chips.
Using unsigned int make calculations in INTERPOLATE macros overflow, which happened to work on 32-bit, but foo[0xffffffff] != foo[-1] on 64-bit.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe957ff9c in YM2610UpdateResample (pSoundBuf=0x7fffeac5fea0,
nSegmentEnd=534) at ../../burn/sound/burn_ym2610.cpp:135
135 nSample = INTERPOLATE4PS_16BIT((nFractionalPosition >> 4) & 0x0FFF,
diff --git a/src-0.2.97.13/burn/sound/burn_ym2610.cpp b/src-0.2.97.13/burn/sound/burn_ym2610.cpp
index 4a93ca7..6bd97da 100644
--- a/src-0.2.97.13/burn/sound/burn_ym2610.cpp
+++ b/src-0.2.97.13/burn/sound/burn_ym2610.cpp
@@ -17,7 +17,7 @@ static int nYM2610Position;
static int nAY8910Position;
static unsigned int nSampleSize;
-static unsigned int nFractionalPosition;
+static int nFractionalPosition;
static int bYM2610AddSignal;
static int bYM2610MixSound;
diff --git a/src-0.2.97.13/burn/sound/burn_ym2203.cpp b/src-0.2.97.13/burn/sound/burn_ym2203.cpp
index fe05824..f4aa6be 100644
--- a/src-0.2.97.13/burn/sound/burn_ym2203.cpp
+++ b/src-0.2.97.13/burn/sound/burn_ym2203.cpp
@@ -17,7 +17,7 @@ static int nYM2203Position;
static int nAY8910Position;
static unsigned int nSampleSize;
-static unsigned int nFractionalPosition;
+static int nFractionalPosition;
static int nNumChips = 0;
Alternative is to subtract the indices with -1L to force int in the evaluation.
-
Cool. That fixes some weird sound problems in 64-bit builds I noticed in the one neogeo rom I have.
-
Fixed parodius. Long type is bad, _VERY_ bad, mmkay? :p
Got clue from here: http://mametesters.org/view.php?id=2802
http://pastebin.com/KwnQG6Jy
-
I think it's time to go down the arduous road of changing the burn and cpu folders to use UINT8, UINT16 and UINT32 exclusively....
-
I agree. Set up some kind of online repo, it will be quicker/easier for all of us to do the work. Might even be able to get the fba-next big endian stuff in normal fba as well.
-
FB Alpha now compiles with MinGW64 (both 32 and 64-bit), so I've shook these issues and a few others out.
Thanks for pointing them out.
-
Finally done them all. :)