-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KERNAL] implement native-capable jsrfar #283
Merged
mooinglemur
merged 15 commits into
X16Community:65c816
from
mooinglemur:20240306-jsrfar_native
Mar 8, 2024
Merged
[KERNAL] implement native-capable jsrfar #283
mooinglemur
merged 15 commits into
X16Community:65c816
from
mooinglemur:20240306-jsrfar_native
Mar 8, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fulgen301
reviewed
Mar 7, 2024
mooinglemur
added a commit
that referenced
this pull request
Mar 8, 2024
* [KERNAL] implement native-capable jsrfar * native jsrfar falls back to old code if in emulated mode * fix off-by-one error * fix up some logic, jmpfr need only be in one place * Save a couple cycles here * save a few more cycles w/ carry assumptions * add assert for jsrfar3n * saved one more cycle * trivial changes * trivial changes * updates to comments * updates to comments * no need to preserve X in the native jsrfar * fix stack misalignment issue in a 16-bit jsrfar call * requested changes
mooinglemur
added a commit
that referenced
this pull request
Mar 11, 2024
* [KERNAL] implement native-capable jsrfar * native jsrfar falls back to old code if in emulated mode * fix off-by-one error * fix up some logic, jmpfr need only be in one place * Save a couple cycles here * save a few more cycles w/ carry assumptions * add assert for jsrfar3n * saved one more cycle * trivial changes * trivial changes * updates to comments * updates to comments * no need to preserve X in the native jsrfar * fix stack misalignment issue in a 16-bit jsrfar call * requested changes
mooinglemur
added a commit
that referenced
this pull request
Mar 11, 2024
* Proof of Concept for resolving the clash of UDTIM with the 65C816's NMIB vector. At $FFEA in the ROM is the jump table entry for UDTIM aka `jmp clock_update`. In native mode, the 65C816 reads its NMIB vector from $FFEA as well. By hardcoding the address for `clock_update`, which is an alias for `softclock_timer_update`, to an address with the low byte $XX, the NMIB handler can be hardcoded to $XX4C, as $4C is the opcode for an absolute `jmp`. This PoC uses $EEEE for `softclock_timer_update` and $EE4C for the NMIB handler as example values. * Add 65C816 support for NMI, IRQ and BRK * Add support for COP * Add native IRQ handler and make sure BASIC starts in emulation mode * Replace low RAM 65C816 detection variable with a runtime detection macro * SCREEN: Don't clobber Y * Handle DP and SP in native IRQ * Use 03 instead of 01 for CPU detection * Add native interrupt and emulated COP vectors and fully implement all interrupt types * Add native and emulated ABORT handler * Reorder segments so that C816_ABORT_NATIVE can sit at address * Add dedicated vectors in KVECTORS * Move the KERNAL signature to the SIGNATURE section (see X16Community/x16-emulator@23f1f14 * Fix COP and ABORT trampolines not being in low RAM * 65c816.s: Indent with tabs * Remove now-unused KVEC816 segment * Move 65c816.s to drivers/x16/65c816/interrupt.s * Fix SCREEN and IOBASE interrupt dispatch logic * Add first draft of stack API * fixup! Fix SCREEN and IOBASE interrupt dispatch logic * fixup! Fix SCREEN and IOBASE interrupt dispatch logic * STACK: Use an extra byte that is always for code simplification * Rename STACK_foo to stack_foo * Native IRQ: Call the KERNAL emulated IRQ code directly in native mode if the emulated IRQ vector hasn't been replaced * Add missing newline at end of files * Explicitely annotate 65C816 code with address & index width * fix minor error while rebasing * [KERNAL] add legacy/c816 extended APIs (#280) * [KERNAL] refactor, comment 65C816 native stack API * rewording comments * [KERNAL] implement native-capable jsrfar (#283) * [KERNAL] implement native-capable jsrfar * native jsrfar falls back to old code if in emulated mode * fix off-by-one error * fix up some logic, jmpfr need only be in one place * Save a couple cycles here * save a few more cycles w/ carry assumptions * add assert for jsrfar3n * saved one more cycle * trivial changes * trivial changes * updates to comments * updates to comments * no need to preserve X in the native jsrfar * fix stack misalignment issue in a 16-bit jsrfar call * requested changes * [KERNAL] typo in 816 native jsrfar RAM routine * [KERNAL] add extapi16 #0 test reflector call * [CI/CD] the first unit tests * [CI/CD] update build deps * [MONITOR] 65C816 emulation mode stack unwinding (#292) * [META] remove CODEX, move DIAG 16->7 (#293) --------- Co-authored-by: George Tokmaji <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The native RAM code is 2 bytes shorter due to the savings in size from stack-relative addressing, even with the added SEP/REP