Klarth
Klarth
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
Maybe the pointer route, but I'm not really sure.
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
I'd try to skip the shift + or in favor of a single 2-byte read. I'm assuming these registers are contiguous in the array. Then all you need to do is use BinaryPrimitives to ensure the correct endian.
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
An exterior array on the heap*
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
A type will otherwise hold a pointer to an array.
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
I assume it's that way because they didn't want to worry about endianness on big endian systems.
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
You can't do this across the entire software being emulated, but you can for stretches if you have good detection. Software also tends to codegen in RAM, so you need to ensure that it's the same when you rerun cached x64 output.
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
I mean to codegen the z80 into x64 assembly and then run x64 assembly. Sometimes called dynamic recompilation.
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
I don't mean AOT. That's going to run slower at steady state than a very warm JIT.
259 replies
CC#
Created by Pdawg on 11/17/2024 in #help
Micro-optimizing a Z80 emulators' pipeline. **Unsafe code**
I'd say that anything around an order of magnitude loss is expected for CPU emulation. Pushing much further than you are will probably require codegen to native.
259 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
If you wrap and automatically sync VM and Model state...then you're going to run into issues.
22 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
Like I said elsewhere, the VM state is just a temporary, editable copy of Model(s) state. You have to copy because you aren't binding to directly to the Model.
22 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
🤷‍♂️
22 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
public static class YViewModelMapper
{
public static YViewModel ToViewModel(this Y model)
{
return new YViewModel
{
Name = model.Name,
ListOfX = new(model.ListOfX)
};
}
}

public partial class YViewModel : ObservableObject {
[ObservableProperty] private string _name;
[ObservableProperty] ObservableCollection<X> _listOfX;
}
public static class YViewModelMapper
{
public static YViewModel ToViewModel(this Y model)
{
return new YViewModel
{
Name = model.Name,
ListOfX = new(model.ListOfX)
};
}
}

public partial class YViewModel : ObservableObject {
[ObservableProperty] private string _name;
[ObservableProperty] ObservableCollection<X> _listOfX;
}
22 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
Then what's the big deal about mapping it to something View-friendly?
22 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
Otherwise, you call a service to do some domain work...and you have no idea what happens if you don't do one of those two steps.
22 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
If you have an in-memory domain, you're either: 1. notifying of changes (not INPC, but events/messages) or 2. leaking logic of when and what to synchronize to the ViewModel.
22 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
If they're immutable, then just map them (ie. copy) to a new ViewModel type with an observable collection, use CollectionViewSource, and move on.
22 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
No, this part. Does it ever change?
22 replies
CC#
Created by Rodonies on 9/26/2024 in #help
WPF CollectionView Filter on Property of Model?
class Y {
string Name;
List<X> ListOfX;
}
class Y {
string Name;
List<X> ListOfX;
}
22 replies