Added cx16.edkeyvec and cx16.set_chrin_keyhandler(). mention the Github actions builds.

This commit is contained in:
Irmen de Jong 2023-11-08 22:47:05 +01:00
parent 3b0d7ea960
commit ecca854c7c
4 changed files with 33 additions and 4 deletions

View File

@ -1,5 +1,5 @@
; Emulator debug interface. ; Emulator debug interface.
; Docs: https://github.com/X16Community/x16-emulator#debug-io-registers ; Docs: https://github.com/X16Community/x16-emulator#emulator-io-registers
emudbg { emudbg {
@ -29,6 +29,7 @@ emudbg {
} }
asmsub console_write(str isoString @R0) clobbers(Y) { asmsub console_write(str isoString @R0) clobbers(Y) {
; note: make sure the text is in Iso encoding.
%asm {{ %asm {{
ldy #0 ldy #0
- lda (cx16.r0),y - lda (cx16.r0),y
@ -41,6 +42,7 @@ emudbg {
} }
asmsub console_chrout(ubyte char @A) { asmsub console_chrout(ubyte char @A) {
; note: make sure the character is in Iso encoding.
%asm {{ %asm {{
sta p8_EMU_CPUCLK_U sta p8_EMU_CPUCLK_U
}} }}

View File

@ -120,6 +120,9 @@ cx16 {
&uword RESET_VEC = $FFFC ; 65c02 reset vector, determined by the kernal if banked in &uword RESET_VEC = $FFFC ; 65c02 reset vector, determined by the kernal if banked in
&uword IRQ_VEC = $FFFE ; 65c02 interrupt vector, determined by the kernal if banked in &uword IRQ_VEC = $FFFE ; 65c02 interrupt vector, determined by the kernal if banked in
&uword edkeyvec = $ac03 ; for intercepting BASIN/CHRIN key strokes. See set_basin_handler()
&uword edkeybk = $ac05 ; ...the RAM bank of this routine if not in low ram
; the sixteen virtual 16-bit registers in both normal unsigned mode and signed mode (s) ; the sixteen virtual 16-bit registers in both normal unsigned mode and signed mode (s)
&uword r0 = $0002 &uword r0 = $0002
@ -828,6 +831,24 @@ asmsub restore_vera_context() clobbers(A) {
}} }}
} }
asmsub set_chrin_keyhandler(ubyte handlerbank @A, uword handler @XY) clobbers(A) {
; Install a custom CHRIN (BASIN) key handler. Call this before each line you want to read.
; See https://github.com/X16Community/x16-docs/blob/master/X16%20Reference%20-%2002%20-%20Editor.md#custom-basin-petscii-code-override-handler
%asm {{
sei
sta cx16.edkeybk
lda $00
pha
stz $00
stx cx16.edkeyvec
sty cx16.edkeyvec+1
pla
sta $00
cli
rts
}}
}
} }
sys { sys {

View File

@ -11,12 +11,18 @@ Before you can compile Prog8 programs, you'll have to download or build the comp
First make sure you have installed the :ref:`requirements`. First make sure you have installed the :ref:`requirements`.
Then you can choose a few ways to get a compiler: Then you can choose a few ways to get a compiler:
**Download a precompiled version from github:** **Download an official release version from Github:**
#. download a recent "fat-jar" (called something like "prog8compiler-all.jar") from `the releases on Github <https://github.com/irmen/prog8/releases>`_ #. download a recent "fat-jar" (called something like "prog8compiler-all.jar") from `the releases on Github <https://github.com/irmen/prog8/releases>`_
#. run the compiler with "java -jar prog8compiler.jar" to see how you can use it (use the correct name and version of the jar file you've downloaded). #. run the compiler with "java -jar prog8compiler.jar" to see how you can use it (use the correct name and version of the jar file you've downloaded).
**Using the Gradle build system to build it yourself:** **Or, download a bleeding edge development version from Github:**
#. find the latest CI build on `the actions page on Github <https://github.com/irmen/prog8/actions>`_
#. download the zipped jar artifact from that build, and unzip it.
#. run the compiler with "java -jar prog8compiler.jar" (use the correct name and version of the jar file you've downloaded).
**Or, use the Gradle build system to build it yourself from source:**
The Gradle build system is used to build the compiler. The Gradle build system is used to build the compiler.
The most interesting gradle commands to run are probably the ones listed below. The most interesting gradle commands to run are probably the ones listed below.

View File

@ -171,7 +171,7 @@ It's easy to compile yourself, but a recent precompiled .exe (only for Windows)
`the files section <https://sourceforge.net/projects/tass64/files/binaries/>`_ in the official project on sourceforge. `the files section <https://sourceforge.net/projects/tass64/files/binaries/>`_ in the official project on sourceforge.
*You need at least version 1.58.0 of this assembler.* *You need at least version 1.58.0 of this assembler.*
If you are on a Debian based Linux, there's a "64tass" package in the repositories, which is a bit old, but it seems to work. If you are on a Debian based Linux, there's a "64tass" package in the repositories, which is a bit old, but it seems to work.
It's possible to use old versions of 64tass, but it is likely that certain things will break. It might be possible to use old versions of 64tass, but it is likely that you'll run into assembler errors later.
A **Java runtime (jre or jdk), version 11 or newer** is required to run the prog8 compiler itself. A **Java runtime (jre or jdk), version 11 or newer** is required to run the prog8 compiler itself.
If you're scared of Oracle's licensing terms, most Linux distributions ship OpenJDK or similar in their packages repository instead. If you're scared of Oracle's licensing terms, most Linux distributions ship OpenJDK or similar in their packages repository instead.