From: Oliver Schmidt Date: Sat, 1 Jun 2013 09:03:14 +0000 (+0200) Subject: Added library reference ser_libref to SER interface. X-Git-Tag: V2.15~271 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ae409e497851d1bc5bdb7cbec853bdeddf6f8750;p=cc65 Added library reference ser_libref to SER interface. --- diff --git a/asminc/ser-kernel.inc b/asminc/ser-kernel.inc index 7fc5bf9c2..fff9b1440 100644 --- a/asminc/ser-kernel.inc +++ b/asminc/ser-kernel.inc @@ -39,16 +39,17 @@ .struct SER_HDR ID .byte 3 ; Contains 0x73, 0x65, 0x72 ("ser") VERSION .byte 1 ; Interface version + LIBREF .addr ; Library reference JUMPTAB .struct - INSTALL .word ; INSTALL routine - UNINSTALL .word ; UNINSTALL routine - OPEN .word ; OPEN routine - CLOSE .word ; CLOSE routine - GET .word ; GET routine - PUT .word ; PUT routine - STATUS .word ; STATUS routine - IOCTL .word ; IOCTL routine - IRQ .word ; IRQ routine + INSTALL .addr ; INSTALL routine + UNINSTALL .addr ; UNINSTALL routine + OPEN .addr ; OPEN routine + CLOSE .addr ; CLOSE routine + GET .addr ; GET routine + PUT .addr ; PUT routine + STATUS .addr ; STATUS routine + IOCTL .addr ; IOCTL routine + IRQ .addr ; IRQ routine .endstruct .endstruct @@ -56,7 +57,7 @@ ;------------------------------------------------------------------------------ ; The SER API version, stored SER_HDR::VERSION -SER_API_VERSION = $00 +SER_API_VERSION = $01 ;------------------------------------------------------------------------------ ; ser_params diff --git a/libsrc/apple2/libref.s b/libsrc/apple2/libref.s index 09bdb057c..898a92f18 100644 --- a/libsrc/apple2/libref.s +++ b/libsrc/apple2/libref.s @@ -2,9 +2,10 @@ ; Oliver Schmidt, 2013-05-31 ; - .export em_libref, joy_libref, mouse_libref + .export em_libref, joy_libref, mouse_libref, ser_libref .import _exit em_libref := _exit joy_libref := _exit mouse_libref := _exit +ser_libref := _exit diff --git a/libsrc/apple2/ser/a2.ssc.s b/libsrc/apple2/ser/a2.ssc.s index 374505638..19deefd39 100644 --- a/libsrc/apple2/ser/a2.ssc.s +++ b/libsrc/apple2/ser/a2.ssc.s @@ -34,7 +34,10 @@ .byte $73, $65, $72 ; "ser" .byte SER_API_VERSION ; Serial API version number - ; Jump table. + ; Library reference + .addr $0000 + + ; Jump table .addr INSTALL .addr UNINSTALL .addr OPEN diff --git a/libsrc/atmos/libref.s b/libsrc/atmos/libref.s index e4afa7eb1..0bda1e7e8 100644 --- a/libsrc/atmos/libref.s +++ b/libsrc/atmos/libref.s @@ -2,7 +2,8 @@ ; Oliver Schmidt, 2013-05-31 ; - .export joy_libref + .export joy_libref, ser_libref .import _exit joy_libref := _exit +ser_libref := _exit diff --git a/libsrc/atmos/ser/atmos-acia.s b/libsrc/atmos/ser/atmos-acia.s index 36071c32a..9d742bf66 100644 --- a/libsrc/atmos/ser/atmos-acia.s +++ b/libsrc/atmos/ser/atmos-acia.s @@ -35,7 +35,10 @@ .byte $73, $65, $72 ; "ser" .byte SER_API_VERSION ; Serial API version number - ; Jump table. + ; Library reference + .addr $0000 + + ; Jump table .addr INSTALL .addr UNINSTALL .addr OPEN diff --git a/libsrc/c128/libref.s b/libsrc/c128/libref.s index 09bdb057c..898a92f18 100644 --- a/libsrc/c128/libref.s +++ b/libsrc/c128/libref.s @@ -2,9 +2,10 @@ ; Oliver Schmidt, 2013-05-31 ; - .export em_libref, joy_libref, mouse_libref + .export em_libref, joy_libref, mouse_libref, ser_libref .import _exit em_libref := _exit joy_libref := _exit mouse_libref := _exit +ser_libref := _exit diff --git a/libsrc/c128/ser/c128-swlink.s b/libsrc/c128/ser/c128-swlink.s index 347452e85..02336d688 100644 --- a/libsrc/c128/ser/c128-swlink.s +++ b/libsrc/c128/ser/c128-swlink.s @@ -37,7 +37,11 @@ .byte $73, $65, $72 ; "ser" .byte SER_API_VERSION ; Serial API version number -; Jump table. +; Library reference + + .addr $0000 + +; Jump table .word INSTALL .word UNINSTALL diff --git a/libsrc/c64/libref.s b/libsrc/c64/libref.s index 09bdb057c..898a92f18 100644 --- a/libsrc/c64/libref.s +++ b/libsrc/c64/libref.s @@ -2,9 +2,10 @@ ; Oliver Schmidt, 2013-05-31 ; - .export em_libref, joy_libref, mouse_libref + .export em_libref, joy_libref, mouse_libref, ser_libref .import _exit em_libref := _exit joy_libref := _exit mouse_libref := _exit +ser_libref := _exit diff --git a/libsrc/c64/ser/c64-swlink.s b/libsrc/c64/ser/c64-swlink.s index f9121b8b6..d95e63d9c 100644 --- a/libsrc/c64/ser/c64-swlink.s +++ b/libsrc/c64/ser/c64-swlink.s @@ -37,7 +37,11 @@ .byte $73, $65, $72 ; "ser" .byte SER_API_VERSION ; Serial API version number -; Jump table. +; Library reference + + .addr $0000 + +; Jump table .word INSTALL .word UNINSTALL diff --git a/libsrc/cbm510/libref.s b/libsrc/cbm510/libref.s index 933eb5911..515c62d19 100644 --- a/libsrc/cbm510/libref.s +++ b/libsrc/cbm510/libref.s @@ -2,8 +2,9 @@ ; Oliver Schmidt, 2013-05-31 ; - .export em_libref, joy_libref + .export em_libref, joy_libref, ser_libref .import _exit em_libref := _exit joy_libref := _exit +ser_libref := _exit diff --git a/libsrc/cbm510/ser/cbm510-std.s b/libsrc/cbm510/ser/cbm510-std.s index 9b721bd41..be17a027b 100644 --- a/libsrc/cbm510/ser/cbm510-std.s +++ b/libsrc/cbm510/ser/cbm510-std.s @@ -38,7 +38,11 @@ .byte $73, $65, $72 ; "ser" .byte SER_API_VERSION ; Serial API version number -; Jump table. +; Library reference + + .addr $0000 + +; Jump table .word INSTALL .word UNINSTALL diff --git a/libsrc/cbm610/libref.s b/libsrc/cbm610/libref.s index 507c9887b..9c6994a5d 100644 --- a/libsrc/cbm610/libref.s +++ b/libsrc/cbm610/libref.s @@ -2,7 +2,8 @@ ; Oliver Schmidt, 2013-05-31 ; - .export em_libref + .export em_libref, ser_libref .import _exit em_libref := _exit +ser_libref := _exit diff --git a/libsrc/cbm610/ser/cbm610-std.s b/libsrc/cbm610/ser/cbm610-std.s index 671698a28..2d090bf41 100644 --- a/libsrc/cbm610/ser/cbm610-std.s +++ b/libsrc/cbm610/ser/cbm610-std.s @@ -38,7 +38,11 @@ .byte $73, $65, $72 ; "ser" .byte SER_API_VERSION ; Serial API version number -; Jump table. +; Library reference + + .addr $0000 + +; Jump table .word INSTALL .word UNINSTALL diff --git a/libsrc/lynx/libref.s b/libsrc/lynx/libref.s index e4afa7eb1..0bda1e7e8 100644 --- a/libsrc/lynx/libref.s +++ b/libsrc/lynx/libref.s @@ -2,7 +2,8 @@ ; Oliver Schmidt, 2013-05-31 ; - .export joy_libref + .export joy_libref, ser_libref .import _exit joy_libref := _exit +ser_libref := _exit diff --git a/libsrc/lynx/ser/lynx-comlynx.s b/libsrc/lynx/ser/lynx-comlynx.s index 7035787c9..acd91a999 100644 --- a/libsrc/lynx/ser/lynx-comlynx.s +++ b/libsrc/lynx/ser/lynx-comlynx.s @@ -18,7 +18,10 @@ .byte $73, $65, $72 ; "ser" .byte SER_API_VERSION ; Serial API version number - ; Jump table. + ; Library reference + .addr $0000 + + ; Jump table .addr INSTALL .addr UNINSTALL .addr OPEN diff --git a/libsrc/plus4/libref.s b/libsrc/plus4/libref.s index e4afa7eb1..0bda1e7e8 100644 --- a/libsrc/plus4/libref.s +++ b/libsrc/plus4/libref.s @@ -2,7 +2,8 @@ ; Oliver Schmidt, 2013-05-31 ; - .export joy_libref + .export joy_libref, ser_libref .import _exit joy_libref := _exit +ser_libref := _exit diff --git a/libsrc/plus4/ser/plus4-stdser.s b/libsrc/plus4/ser/plus4-stdser.s index ed33aa8c7..86377b89c 100644 --- a/libsrc/plus4/ser/plus4-stdser.s +++ b/libsrc/plus4/ser/plus4-stdser.s @@ -37,7 +37,11 @@ .byte $73, $65, $72 ; "ser" .byte SER_API_VERSION ; Serial API version number -; Jump table. +; Library reference + + .addr $0000 + +; Jump table .word INSTALL .word UNINSTALL diff --git a/libsrc/serial/ser-kernel.s b/libsrc/serial/ser-kernel.s index 7a91e5e4b..438189edb 100644 --- a/libsrc/serial/ser-kernel.s +++ b/libsrc/serial/ser-kernel.s @@ -4,7 +4,7 @@ ; Common functions of the serial drivers ; - .import return0 + .import return0, ser_libref .importzp ptr1 .interruptor ser_irq, 29 ; Export as high priority IRQ handler @@ -58,6 +58,15 @@ _ser_install: dey bpl @L0 +; Set the library reference + + ldy #SER_HDR::LIBREF + lda #ser_libref + sta (ptr1),y + ; Copy the jump vectors ldy #SER_HDR::JUMPTAB