nv2a: Ptimer fixes (#113)

Set NV2A_CRYSTAL_FREQ to Retail speed
Fix ptimer_get_clock() behaviour
This commit is contained in:
Lucas 2018-09-26 10:01:28 +02:00 committed by espes
parent 337e1fa114
commit 7960ffe466
2 changed files with 7 additions and 5 deletions

View File

@ -1292,7 +1292,7 @@
#define NV2A_VERTEX_ATTR_RESERVED2 14
#define NV2A_VERTEX_ATTR_RESERVED3 15
#define NV2A_CRYSTAL_FREQ 13500000
#define NV2A_CRYSTAL_FREQ 16666666
#define NV2A_NUM_CHANNELS 32
#define NV2A_NUM_SUBCHANNELS 8
#define NV2A_CACHE1_SIZE 128

View File

@ -19,12 +19,14 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/* PIMTER - time measurement and time-based alarms */
/* PTIMER - time measurement and time-based alarms */
static uint64_t ptimer_get_clock(NV2AState *d)
{
return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL),
d->pramdac.core_clock_freq * d->ptimer.numerator,
NANOSECONDS_PER_SECOND * d->ptimer.denominator);
return muldiv64(muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL),
d->pramdac.core_clock_freq,
NANOSECONDS_PER_SECOND),
d->ptimer.denominator,
d->ptimer.numerator);
}
uint64_t ptimer_read(void *opaque, hwaddr addr, unsigned int size)