NovaSquirrel / Mesen-SX

Homebrew development oriented fork of Mesen-S - a cross-platform (Windows & Linux) SNES emulator built in C++ and C#. Deprecated; see https://github.com/SourMesen/Mesen2/
GNU General Public License v3.0
92 stars 21 forks source link

Fix BGE/BLT confusion #104

Closed vivi168 closed 1 year ago

vivi168 commented 1 year ago

on the GSU, BGE and BLT are VERY confusing

In the official documentation, they are exchanged.

According to nocash documentation, BGE branches if SF ^ VF == 0 (eg: SF == VF) BLT branches if SF ^ VF == 1 (eg: SF != VF)

The conditions are thus inverted in Mesen-S BUT the opcode were inverted as well so there were no bugs. (they were also inverted in the debugger, and stepping through a program made no sense at all)

I restored the truth. According to my testing, the branches now makes perfect sense.

EG:

; R5 = $001F
; R6 = $005F
FROM R5                  
ALT3                     
CMP R6                   
BGE $02006C              

Doesn't take the jump as expected.