flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > RDTSC Timer Goto page Previous 1, 2 |
Author |
|
sinsi 26 Feb 2023, 20:42
It's more so the game has a "heartbeat", a consistent amount of time between actions. Try playing old DOS games on a new computer, a lot of them did their actions as fast as code would allow, on a modern computer they are unplayable because of the speed at which they run.
|
|||
26 Feb 2023, 20:42 |
|
bitRAKE 26 Feb 2023, 21:27
Any integration across frames benefits from higher precision. Users are expecting products to operate across a dynamic range of performance characteristics. 60-300 fps, 1080p - 2160p (multiple displays) in some cases; with smooth, believable effects.
I'm getting older - can't tell any difference; but my nephew claims it effects his gameplay. |
|||
26 Feb 2023, 21:27 |
|
Furs 27 Feb 2023, 12:49
I don't know. I don't particularly care about high resolutions with my 30" screen, 1080p is fine (probably because I'm getting older as well), but fps is another thing.
Obviously you'll need a 120Hz or 240Hz monitor to see its effects. But I can't go back to a standard 60Hz display anymore. It just feels sluggish in games. It's a subconscious thing. For VR it's even more important apparently, with anything below 120Hz (and even that is cutting it close), you'll get sickness and nausea and etc. This is especially important in games with high motion like shooting games, or others where you rotate camera fast. |
|||
27 Feb 2023, 12:49 |
|
donn 27 Feb 2023, 21:44
QueryPerformanceCounter also works on Win. I didn't do any rigorous testing with it, but it worked.
https://learn.microsoft.com/en-us/windows/win32/sysinfo/acquiring-high-resolution-time-stamps |
|||
27 Feb 2023, 21:44 |
|
daniel02 27 Feb 2023, 22:57
QueryPerformanceCounter never worked on my pc QueryPerformanceFrequency worked its return 10000000mhz
rdtsc return to 1ns so i think QueryPerformanceCounter is very slow compare to rdtsc |
|||
27 Feb 2023, 22:57 |
|
DimonSoft 28 Feb 2023, 07:13
daniel02 wrote: rdtsc return to 1ns so i think QueryPerformanceCounter is very slow compare to rdtsc Not as slow as the code that renders the graphics. And I really doubt one has at least half a billion of pixels in either direction (width/height) to see the difference between a nanosecond-perfect and 1–2-ns-off image. Additional system requirements or multiple code paths that should later be tested and maintained for no useful output. What are we chasing for? |
|||
28 Feb 2023, 07:13 |
|
daniel02 22 Apr 2023, 04:26
I wrote:
i would like to read IA32_TSC_DEADLINE in windows but seems its return to value 0 in debugview Code: #define IA32_APIC_BASE_MSR 0x1B #define IA32_TSC_DEADLINE_MSR 0x6E0 #define LOCAL_APIC_LVT_TIMER_OFFSET 0x320 #define LOCAL_APIC_TIMER_MODE_MASK (1 << 17) NTSTATUS ReadLocalApicBaseAddress(ULONG64* apic_base_address) { ULONG64 ia32_apic_base = __readmsr(IA32_APIC_BASE_MSR); *apic_base_address = ia32_apic_base & 0xFFFFFFFFF000ULL; return STATUS_SUCCESS; } NTSTATUS MapLocalApicMmio(PVOID* apic_base_virtual, ULONG64 apic_base_address) { PHYSICAL_ADDRESS apic_physical_base; apic_physical_base.QuadPart = apic_base_address; *apic_base_virtual = MmMapIoSpace(apic_physical_base, PAGE_SIZE, MmNonCached); return *apic_base_virtual ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } VOID UnmapLocalApicMmio(PVOID apic_base_virtual) { MmUnmapIoSpace(apic_base_virtual, PAGE_SIZE); } NTSTATUS ReadTscDeadlineValue(ULONG64* tsc_deadline_value) { ULONG64 apic_base_address; NTSTATUS status = ReadLocalApicBaseAddress(&apic_base_address); if (!NT_SUCCESS(status)) { return status; } PVOID apic_base_virtual; status = MapLocalApicMmio(&apic_base_virtual, apic_base_address); if (!NT_SUCCESS(status)) { return status; } ULONG timer_lvt = *(volatile ULONG*)((PUCHAR)apic_base_virtual + LOCAL_APIC_LVT_TIMER_OFFSET); if (timer_lvt & LOCAL_APIC_TIMER_MODE_MASK) { *tsc_deadline_value = __readmsr(IA32_TSC_DEADLINE_MSR); } else { status = STATUS_NOT_SUPPORTED; } UnmapLocalApicMmio(apic_base_virtual); return status; } code to print if deadline accessible Code: ULONG64 tsc_deadline_value; status = ReadTscDeadlineValue(&tsc_deadline_value); if (NT_SUCCESS(status)) { DbgPrint("TSC_DEADLINE value: %llu\n", tsc_deadline_value); } else { DbgPrint("Failed to read TSC_DEADLINE value, status: %08X\n", status); } |
|||
22 Apr 2023, 04:26 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.