Skip to content

Commit

Permalink
Fixes MINC issue for Ogre Battle. Fix from upstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
gameblabla committed Apr 17, 2020
1 parent 42aa013 commit edb9daa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mednafen/ngp/TLCS-900h/TLCS900h_interpret_reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ void regMINC1()
{
uint16 num = fetch16() + 1;

if (size_cpu_interpreter == 1)
if (size_cpu_interpreter == 1 && num)
{
if ((rCodeW(rCode) % num) == (num - 1))
rCodeW(rCode) -= (num - 1);
Expand All @@ -755,7 +755,7 @@ void regMINC2()
{
uint16 num = fetch16() + 2;

if (size_cpu_interpreter == 1)
if (size_cpu_interpreter == 1 && num)
{
if ((rCodeW(rCode) % num) == (num - 2))
rCodeW(rCode) -= (num - 2);
Expand All @@ -771,7 +771,7 @@ void regMINC4()
{
uint16 num = fetch16() + 4;

if (size_cpu_interpreter == 1)
if (size_cpu_interpreter == 1 && num)
{
if ((rCodeW(rCode) % num) == (num - 4))
rCodeW(rCode) -= (num - 4);
Expand All @@ -787,7 +787,7 @@ void regMDEC1()
{
uint16 num = fetch16() + 1;

if (size_cpu_interpreter == 1)
if (size_cpu_interpreter == 1 && num)
{
if ((rCodeW(rCode) % num) == 0)
rCodeW(rCode) += (num - 1);
Expand All @@ -803,7 +803,7 @@ void regMDEC2()
{
uint16 num = fetch16() + 2;

if (size_cpu_interpreter == 1)
if (size_cpu_interpreter == 1 && num)
{
if ((rCodeW(rCode) % num) == 0)
rCodeW(rCode) += (num - 2);
Expand All @@ -819,7 +819,7 @@ void regMDEC4()
{
uint16 num = fetch16() + 4;

if (size_cpu_interpreter == 1)
if (size_cpu_interpreter == 1 && num)
{
if ((rCodeW(rCode) % num) == 0)
rCodeW(rCode) += (num - 4);
Expand Down

0 comments on commit edb9daa

Please sign in to comment.