-
Notifications
You must be signed in to change notification settings - Fork 43
Fix emulation accuracy: resolution, 68K instructions, events, RAM init, logging #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
af04f22
2962266
99c7317
b9e49a7
a34fde4
adf6b80
8b6b8a7
e49e3f6
fe0557a
3e0a4e7
f104fc2
6729162
fa33737
bf0bf6b
3a99830
eab12be
1bf83ef
a5c368d
255598f
11213c1
15f2b69
098e7f7
bfa51d6
63bc6b6
7be74a5
47408b0
551473d
dd66981
4f0c54a
f84b043
28787dd
c45f594
15c8b51
cca761f
b454d9a
b09f264
8f7efda
01c6c4b
fed33ce
722dccd
7276720
9f2d7dc
361c071
4931a25
7bdb574
616a6bd
b175dea
22431af
915d32a
ee8c582
96f9bcf
71cc308
6128add
48123cc
b37e626
8b859aa
54ca486
1b7130d
c7936aa
a20dfd6
cbe88f7
7f84d7c
6d34365
b09d214
81f1dd9
fbe0418
e7ce343
f6e3235
705d4d8
3770975
0c3d3f8
cf52227
c2703f8
3fe9ddd
720f6ea
ddb9a01
46b5438
2b1ffbb
95d31b5
5a50de9
c138e3b
6491ef1
0f2ff7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,21 @@ | ||
| { | ||
| global: retro_*; | ||
| global: | ||
| retro_*; | ||
| DSP*; | ||
| dsp_*; | ||
| m68k_*; | ||
| jaguarMainRAM; | ||
| jaguarMainROM; | ||
| jagMemSpace; | ||
| pcQueue; | ||
| pcQPtr; | ||
| a6Queue; | ||
| d0Queue; | ||
| GPU*; | ||
| gpu_*; | ||
| JERRY*; | ||
| TOM*; | ||
| tomRam8; | ||
| local: *; | ||
| }; | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,7 @@ | |
| #include "event.h" | ||
| #include "jerry.h" | ||
| #include "jaguar.h" | ||
| #include "log.h" | ||
| #include "m68000/m68kinterface.h" | ||
| #include "settings.h" | ||
|
|
||
|
|
@@ -72,6 +73,10 @@ static int bufferIndex = 0; | |
| static int numberOfSamples = 0; | ||
| static bool bufferDone = false; | ||
|
|
||
| // Audio diagnostics | ||
| static uint32_t dacLtxdWriteCount = 0; | ||
| static uint32_t dacDiagFrameCount = 0; | ||
|
|
||
| // Private function prototypes | ||
|
|
||
| void DACInit(void) | ||
|
|
@@ -89,6 +94,8 @@ void DACReset(void) | |
| { | ||
| *ltxd = 0; | ||
| lrxd = 0; | ||
| dacLtxdWriteCount = 0; | ||
| dacDiagFrameCount = 0; | ||
| } | ||
|
|
||
| void DACDone(void) | ||
|
|
@@ -138,6 +145,13 @@ void SoundCallback(void * userdata, uint16_t * buffer, int length) | |
| buffer[i + 1] = *rtxd; | ||
| } | ||
|
|
||
| if (dacDiagFrameCount++ % 60 == 0) | ||
| { | ||
| uint32_t ctrl, flags; | ||
| DSPGetAudioDiagnostics(&ctrl, &flags); | ||
| LOG_WRN("[AUDIO] DSP NOT running ctrl=%04X flags=%04X sclk=%u smode=%04X ltxd=%04X rtxd=%04X writes=%u\n", | ||
| ctrl, flags, (unsigned)*sclk, (unsigned)*smode, (unsigned)*ltxd, (unsigned)*rtxd, dacLtxdWriteCount); | ||
| } | ||
|
||
| return; | ||
| } | ||
|
|
||
|
|
@@ -169,6 +183,26 @@ void SoundCallback(void * userdata, uint16_t * buffer, int length) | |
| HandleNextEvent(EVENT_JERRY); | ||
| } | ||
| while (!bufferDone); | ||
|
|
||
| if (dacDiagFrameCount++ % 60 == 0) | ||
| { | ||
| uint32_t ctrl, flags; | ||
| int nonZero = 0; | ||
| int i; | ||
| for (i = 0; i < length; i++) | ||
| { | ||
| if (sampleBuffer[i] != 0) | ||
| { | ||
| nonZero++; | ||
| break; | ||
| } | ||
| } | ||
| DSPGetAudioDiagnostics(&ctrl, &flags); | ||
| LOG_INF("[AUDIO] DSP running ctrl=%04X flags=%04X sclk=%u smode=%04X ltxd=%04X rtxd=%04X writes=%u samples=%s\n", | ||
| ctrl, flags, (unsigned)*sclk, (unsigned)*smode, (unsigned)*ltxd, (unsigned)*rtxd, | ||
| dacLtxdWriteCount, nonZero ? "NON-ZERO" : "ALL-ZERO"); | ||
| } | ||
|
|
||
|
||
| audio_batch_cb((int16_t*)sampleBuffer, length / 2); | ||
| } | ||
|
|
||
|
|
@@ -183,7 +217,10 @@ void DACWriteByte(uint32_t offset, uint8_t data, uint32_t who) | |
| void DACWriteWord(uint32_t offset, uint16_t data, uint32_t who) | ||
| { | ||
| if (offset == LTXD + 2) | ||
| { | ||
| *ltxd = data; | ||
| dacLtxdWriteCount++; | ||
| } | ||
| else if (offset == RTXD + 2) | ||
| *rtxd = data; | ||
| else if (offset == SCLK + 2) // Sample rate | ||
|
|
@@ -194,7 +231,9 @@ void DACWriteWord(uint32_t offset, uint16_t data, uint32_t who) | |
| JERRYI2SCallback(); | ||
| } | ||
| else if (offset == SMODE + 2) | ||
| { | ||
| *smode = data; | ||
| } | ||
| } | ||
|
|
||
| uint8_t DACReadByte(uint32_t offset, uint32_t who) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.