add jp, jnp, jo, jno - #19
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
I love this, and would love to help you however I can! Thanks for the patch! |
| } | ||
|
|
||
| pub fn jp(&mut self, from: Cont, x: Cont) -> Cont { | ||
| if self.cpu.flags.contains(Flags::PF) { |
There was a problem hiding this comment.
BTW, note that none of the operations that affect parity currently set this flag, so these instructions won't do the right thing 😬
There was a problem hiding this comment.
Parity is really annoying because in principle all the arithmetic operations compute it, and then it's almost never actually needed.
Originally what I did in retrowin32 was a hack where if the decoder saw a jp/jnp, it would panic if the previous instruction wasn't some specific thing, so then when it hit the jnp it could retroactively compute parity. (In both links I'm talking about the deleted code)
In my ideal world in theseus we could statically analyze the code enough that we would know when we actually need parity computation or not, similar to this hack but principled and covering all the cases. But I think until we hit that world, just computing parity always (like the added code in the above diff) is probably fine, and I can think of the static analysis thing as an optimization. (Lately I've been working on the static analysis bit of things, which is why I haven't committed to Theseus in a bit!)
|
That's so fun to hear! I just got sound working in Moto Racer and got to complete an entire race, so fun to see it working on modern hardware 🤩 |
Hey again @evmar, long time no see! 👋
I've been setting loose a number of different models to go nuts on my childhood games to see what comes of it. And I saw that they did a lot of overlapping work, and I would also love to contribute things upstream to you!
If you want this, my plan is to continue sending bite sized, hopefully somewhat easy for you to review, PRs. But I do 100% understand if this is not something that you would appreciate.
Anyhow, if you want it, here is the first one. I just adds some jump instructions that were missing.
Clauds description of the changes: