cap5lut
cap5lut
CC#
Created by Kiliu on 1/5/2025 in #help
Project suggestion for XP
but the best would be to find some passion project where u are also interested in the topic to not lose interest
5 replies
CC#
Created by Kiliu on 1/5/2025 in #help
Project suggestion for XP
$projects has a nice list, imo
5 replies
CC#
Created by Tyler on 12/13/2024 in #help
Advice for learning C# (Beginner - New to C# not programming)
MSDN has a little road map for python developers, maybe that can help ya as well: https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/tips-for-python-developers
5 replies
CC#
Created by Impulsive on 11/23/2024 in #help
.NET 8.0, PostgreSql and left over Idle sessions
not sure what npgsql doesn if u new up ur own NpgsqlConnections tho
19 replies
CC#
Created by Impulsive on 11/23/2024 in #help
.NET 8.0, PostgreSql and left over Idle sessions
u probably dont see any increase in db connections because the datasource is using connection pooling by default.
19 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
or write a recompiler ;p
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
thats always "fun" 😂
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
dont scare me like that 😂
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
aaah
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
wait, so its actually slower than the old version?
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
the "low" is the latter byte of both in little endian
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
the hi/lo of SP and following are in wrong order
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
uhhmmm
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
hmm looks weird for sure, especially as u dont touch PCs as byte registers
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
the only difference is the program counter right?
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
indeed xD
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
yeah on its own it looks quite big, but the actual inlined code is much smaller, if u use constants:
public class Cpu
{
private RegisterSet _registers = new();

public void LD_R_R(ref byte dst, ref byte src) => dst = src;
public void LD_R_R(ref ushort dst, ref ushort src) => dst = src;

public void LD_C_A() => LD_R_R(ref _registers.C, ref _registers.A);

public void Test()
{
LD_R_R(ref _registers.GetR16FromIndex(1), ref _registers.GetR16FromIndex(2));
}
}
public class Cpu
{
private RegisterSet _registers = new();

public void LD_R_R(ref byte dst, ref byte src) => dst = src;
public void LD_R_R(ref ushort dst, ref ushort src) => dst = src;

public void LD_C_A() => LD_R_R(ref _registers.C, ref _registers.A);

public void Test()
{
LD_R_R(ref _registers.GetR16FromIndex(1), ref _registers.GetR16FromIndex(2));
}
}
Cpu.Test()
L0000: add ecx, 4
L0003: mov eax, ecx
L0005: cmp [eax], al
L0007: add eax, 2
L000a: movzx edx, word ptr [ecx+4]
L000e: mov [eax], dx
L0011: ret
Cpu.Test()
L0000: add ecx, 4
L0003: mov eax, ecx
L0005: cmp [eax], al
L0007: add eax, 2
L000a: movzx edx, word ptr [ecx+4]
L000e: mov [eax], dx
L0011: ret
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
but iirc then u will really have to do all 256 cases
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
if u have methods like LD_C_A that call LD_R_R internally, it might be better if there is no inlining, because then its basically all about keeping this in a register and the switch will become a hug jump table
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
well, since u will have mostly a switch over almost the whole byte range, i doubt there will be much inlining
259 replies