Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
fbalpha
Commits
834282a4
Commit
834282a4
authored
Apr 27, 2019
by
dinkc64
Browse files
cave/d_guwange & d_esprade: fix unintended extra frame of lag
parent
44f06b5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/burn/drv/cave/d_esprade.cpp
View file @
834282a4
...
...
@@ -16,7 +16,6 @@ static UINT8 *Ram01;
static
UINT8
*
DefaultEEPROM
=
NULL
;
static
UINT8
DrvReset
=
0
;
static
UINT8
bDrawScreen
;
static
bool
bVBlank
;
static
INT8
nVideoIRQ
;
...
...
@@ -200,7 +199,6 @@ void __fastcall espradeWriteWord(UINT32 sekAddress, UINT16 wordValue)
nCaveYOffset
=
wordValue
;
return
;
case
0x800008
:
CaveSpriteBuffer
();
nCaveSpriteBank
=
wordValue
;
return
;
...
...
@@ -292,14 +290,13 @@ static INT32 DrvDoReset()
EEPROMReset
();
nVideoIRQ
=
1
;
YMZ280BReset
();
nVideoIRQ
=
1
;
nSoundIRQ
=
1
;
nUnknownIRQ
=
1
;
nIRQPending
=
0
;
YMZ280BReset
();
nCyclesExtra
=
0
;
HiscoreReset
();
...
...
@@ -312,24 +309,15 @@ static INT32 DrvDraw()
CavePalUpdate8Bit
(
0
,
128
);
// Update the palette
CaveClearScreen
(
CavePalette
[
0x0000
]);
if
(
bDrawScreen
)
{
// CaveGetBitmap();
CaveTileRender
(
1
);
// Render tiles
}
return
0
;
}
CaveTileRender
(
1
);
// Render tiles
inline
static
INT32
CheckSleep
(
INT32
)
{
return
0
;
}
static
INT32
DrvFrame
()
{
INT32
nCyclesVBlank
;
INT32
nInterleave
=
8
;
INT32
nInterleave
=
32
;
if
(
DrvReset
)
{
// Reset machine
DrvDoReset
();
...
...
@@ -377,38 +365,28 @@ static INT32 DrvFrame()
nNext
=
i
*
nCyclesTotal
[
nCurrentCPU
]
/
nInterleave
;
// See if we need to trigger the VBlank interrupt
if
(
!
bVBlank
&&
nNext
>
nCyclesVBlank
)
{
if
(
!
bVBlank
&&
nNext
>
=
nCyclesVBlank
)
{
if
(
nCyclesDone
[
nCurrentCPU
]
<
nCyclesVBlank
)
{
nCyclesSegment
=
nCyclesVBlank
-
nCyclesDone
[
nCurrentCPU
];
if
(
!
CheckSleep
(
nCurrentCPU
))
{
// See if this CPU is busywaiting
nCyclesDone
[
nCurrentCPU
]
+=
SekRun
(
nCyclesSegment
);
}
else
{
nCyclesDone
[
nCurrentCPU
]
+=
SekIdle
(
nCyclesSegment
);
}
}
if
(
pBurnDraw
!=
NULL
)
{
DrvDraw
();
// Draw screen if needed
nCyclesDone
[
nCurrentCPU
]
+=
SekRun
(
nCyclesSegment
);
}
bVBlank
=
true
;
nVideoIRQ
=
0
;
UpdateIRQStatus
();
CaveSpriteBuffer
();
}
nCyclesSegment
=
nNext
-
nCyclesDone
[
nCurrentCPU
];
if
(
!
CheckSleep
(
nCurrentCPU
))
{
// See if this CPU is busywaiting
nCyclesDone
[
nCurrentCPU
]
+=
SekRun
(
nCyclesSegment
+
nCyclesExtra
);
nCyclesExtra
=
0
;
}
else
{
nCyclesDone
[
nCurrentCPU
]
+=
SekIdle
(
nCyclesSegment
);
}
nCyclesDone
[
nCurrentCPU
]
+=
SekRun
(
nCyclesSegment
-
nCyclesExtra
);
nCyclesExtra
=
0
;
nCurrentCPU
=
-
1
;
}
// Make sure the buffer is entirely filled.
{
// Make sure the buffer is entirely filled.
if
(
pBurnSoundOut
)
{
INT32
nSegmentLength
=
nBurnSoundLen
-
nSoundBufferPos
;
INT16
*
pSoundBuf
=
pBurnSoundOut
+
(
nSoundBufferPos
<<
1
);
...
...
@@ -421,6 +399,10 @@ static INT32 DrvFrame()
nCyclesExtra
=
SekTotalCycles
()
-
nCyclesTotal
[
0
];
SekClose
();
if
(
pBurnDraw
!=
NULL
)
{
DrvDraw
();
// Draw screen if needed
}
return
0
;
}
...
...
@@ -534,8 +516,6 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
SCAN_VAR
(
bVBlank
);
CaveScanGraphics
();
SCAN_VAR
(
DrvInput
);
}
if
(
nAction
&
ACB_WRITE
)
{
...
...
@@ -607,8 +587,6 @@ static INT32 DrvInit()
YMZ280BSetRoute
(
BURN_SND_YMZ280B_YMZ280B_ROUTE_2
,
1.00
,
BURN_SND_ROUTE_RIGHT
);
bESPRaDeMixerKludge
=
true
;
bDrawScreen
=
true
;
DrvDoReset
();
// Reset machine
return
0
;
...
...
src/burn/drv/cave/d_guwange.cpp
View file @
834282a4
...
...
@@ -15,7 +15,6 @@ static UINT8 *Ram01;
static
UINT8
*
DefaultEEPROM
=
NULL
;
static
UINT8
DrvReset
=
0
;
static
UINT8
bDrawScreen
;
static
bool
bVBlank
;
static
INT8
nVideoIRQ
;
...
...
@@ -183,7 +182,6 @@ void __fastcall guwangeWriteWord(UINT32 sekAddress, UINT16 wordValue)
nCaveYOffset
=
wordValue
;
return
;
case
0x300008
:
CaveSpriteBuffer
();
nCaveSpriteBank
=
wordValue
;
return
;
...
...
@@ -299,11 +297,7 @@ static INT32 DrvDraw()
CavePalUpdate8Bit
(
0
,
128
);
// Update the palette
CaveClearScreen
(
CavePalette
[
0x7F00
]);
if
(
bDrawScreen
)
{
// CaveGetBitmap();
CaveTileRender
(
1
);
// Render tiles
}
CaveTileRender
(
1
);
// Render tiles
return
0
;
}
...
...
@@ -318,15 +312,10 @@ inline static void guwangeClearOpposites(UINT8* nJoystickInputs)
}
}
inline
static
INT32
CheckSleep
(
INT32
)
{
return
0
;
}
static
INT32
DrvFrame
()
{
INT32
nCyclesVBlank
;
INT32
nInterleave
=
8
;
INT32
nInterleave
=
32
;
if
(
DrvReset
)
{
// Reset machine
DrvDoReset
();
...
...
@@ -372,32 +361,22 @@ static INT32 DrvFrame()
nNext
=
i
*
nCyclesTotal
[
nCurrentCPU
]
/
nInterleave
;
// See if we need to trigger the VBlank interrupt
if
(
!
bVBlank
&&
nNext
>
nCyclesVBlank
)
{
if
(
!
bVBlank
&&
nNext
>
=
nCyclesVBlank
)
{
if
(
nCyclesDone
[
nCurrentCPU
]
<
nCyclesVBlank
)
{
nCyclesSegment
=
nCyclesVBlank
-
nCyclesDone
[
nCurrentCPU
];
if
(
!
CheckSleep
(
nCurrentCPU
))
{
// See if this CPU is busywaiting
nCyclesDone
[
nCurrentCPU
]
+=
SekRun
(
nCyclesSegment
);
}
else
{
nCyclesDone
[
nCurrentCPU
]
+=
SekIdle
(
nCyclesSegment
);
}
}
if
(
pBurnDraw
!=
NULL
)
{
DrvDraw
();
// Draw screen if needed
nCyclesDone
[
nCurrentCPU
]
+=
SekRun
(
nCyclesSegment
);
}
bVBlank
=
true
;
nVideoIRQ
=
0
;
UpdateIRQStatus
();
CaveSpriteBuffer
();
}
nCyclesSegment
=
nNext
-
nCyclesDone
[
nCurrentCPU
];
if
(
!
CheckSleep
(
nCurrentCPU
))
{
// See if this CPU is busywaiting
nCyclesDone
[
nCurrentCPU
]
+=
SekRun
(
nCyclesSegment
+
nCyclesExtra
);
nCyclesExtra
=
0
;
}
else
{
nCyclesDone
[
nCurrentCPU
]
+=
SekIdle
(
nCyclesSegment
);
}
nCyclesDone
[
nCurrentCPU
]
+=
SekRun
(
nCyclesSegment
-
nCyclesExtra
);
nCyclesExtra
=
0
;
nCurrentCPU
=
-
1
;
}
...
...
@@ -412,10 +391,14 @@ static INT32 DrvFrame()
}
}
}
nCyclesExtra
=
SekTotalCycles
()
-
nCyclesTotal
[
0
];
nCyclesExtra
=
SekTotalCycles
()
-
nCyclesTotal
[
0
];
SekClose
();
if
(
pBurnDraw
!=
NULL
)
{
DrvDraw
();
// Draw screen if needed
}
return
0
;
}
...
...
@@ -483,26 +466,7 @@ static INT32 LoadRoms()
BurnLoadRom
(
CaveSpriteROM
+
0x1000001
,
5
,
2
);
NibbleSwap3
(
CaveSpriteROM
,
0xC00000
);
#if 0
// I don't think this is needed anymore, dink aug 14 2016.
// note: if enabled-this causes the screen fade-in effect after starting
// a game @ the character selection screen to display garbage sprite data.
for (INT32 i = 0; i < 0x100000; i++) {
UINT16 nValue = rand() & 0x0101;
if (nValue & 0x0001) {
nValue |= 0x00FF;
}
if (nValue & 0x0100) {
nValue |= 0xFF00;
}
((UINT16*)(CaveSpriteROM + 0x1800000))[i] = nValue;
((UINT16*)(CaveSpriteROM + 0x1A00000))[i] = nValue;
((UINT16*)(CaveSpriteROM + 0x1C00000))[i] = nValue;
((UINT16*)(CaveSpriteROM + 0x1E00000))[i] = nValue;
}
#else
memcpy
(
CaveSpriteROM
+
0x1800000
,
CaveSpriteROM
+
0x1000000
,
0x800000
);
#endif
BurnLoadRom
(
CaveTileROM
[
0
]
+
0x000000
,
6
,
1
);
NibbleSwap4
(
CaveTileROM
[
0
],
0x400000
);
...
...
@@ -548,8 +512,6 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
SCAN_VAR
(
bVBlank
);
CaveScanGraphics
();
SCAN_VAR
(
DrvInput
);
}
if
(
nAction
&
ACB_WRITE
)
{
...
...
@@ -622,8 +584,6 @@ static INT32 DrvInit()
YMZ280BSetRoute
(
BURN_SND_YMZ280B_YMZ280B_ROUTE_1
,
1.00
,
BURN_SND_ROUTE_LEFT
);
YMZ280BSetRoute
(
BURN_SND_YMZ280B_YMZ280B_ROUTE_2
,
1.00
,
BURN_SND_ROUTE_RIGHT
);
bDrawScreen
=
true
;
DrvDoReset
();
// Reset machine
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment