-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
32x: uninitialised hInt vector should read 0 (tp)
- Loading branch information
Federico Berti
committed
Oct 10, 2023
1 parent
8701f49
commit ae0860d
Showing
2 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package s32x; | ||
|
||
import omegadrive.util.Size; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import s32x.dict.S32xDict; | ||
import s32x.util.MarsLauncherHelper; | ||
|
||
import static s32x.MarsRegTestUtil.*; | ||
import static s32x.util.S32xUtil.CpuDeviceAccess.M68K; | ||
|
||
/** | ||
* Federico Berti | ||
* <p> | ||
* Copyright 2023 | ||
*/ | ||
public class HIntVectorRomTest { | ||
|
||
private MarsLauncherHelper.Sh2LaunchContext lc; | ||
|
||
@BeforeEach | ||
public void before() { | ||
lc = createTestInstance(); | ||
} | ||
|
||
//testpico expects 0x70 to be 0 when the hintvector is not set, ie. it is not reading the data stored in the bios. | ||
@Test | ||
public void testVector() { | ||
int addr = S32xDict.M68K_START_HINT_VECTOR_WRITEABLE; | ||
//defaults to 0 | ||
checkAden(lc, 0); | ||
//enable 32x, RV = 1 | ||
MarsRegTestUtil.setAdenMdSide(lc, 1); | ||
setRv(lc, 1); | ||
int res = readBus(lc, M68K, addr, Size.LONG); | ||
Assertions.assertEquals(0, res); | ||
int vector = 0xAABBCCDD; | ||
writeBus(lc, M68K, addr, vector, Size.LONG); | ||
res = readBus(lc, M68K, addr, Size.LONG); | ||
Assertions.assertEquals(vector, res); | ||
writeBus(lc, M68K, addr, 0, Size.LONG); | ||
res = readBus(lc, M68K, addr, Size.LONG); | ||
Assertions.assertEquals(0, res); | ||
} | ||
} |