migrated to ACME assembler

commit 145d64aa6e78838ed07cefed372f0ad6a4687e97
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 20:16:57 2020 +0200

    ACME adaptation

commit 885209d7822286744ea53232ae7461472a01d5d6
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 19:57:25 2020 +0200

    ACME adaptation

commit 334d84486bc603551887e7cbeb59d329f2224cc7
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 18:29:15 2020 +0200

    ACME adaptation

commit b5966f49bcd8f0ca79cbec93819a31238924707e
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 18:09:31 2020 +0200

    ACME adaptation

commit 786536a93a5eab5e676fca99625b4eb094a554e7
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 17:24:48 2020 +0200

    ACME adaptation

commit 704c70dfb1f5d68775d6f3da220803b8a3990f56
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 15:07:12 2020 +0200

    ACME adaptation

commit 136874964c9083b375f151475310f9636871fc72
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 14:45:14 2020 +0200

    ACME adaptation

commit 8eca0d5700b72d04336e72c5cd3a68e18b85f96d
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 14:06:52 2020 +0200

    ACME adaptation

commit 11d29eb7ee318239d782f85498b6d0524624d5c4
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 13:56:45 2020 +0200

    ACME apaptation

commit c9b5e5e04cceb92c66bc027e6440bc0f7c5a499f
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 13:49:04 2020 +0200

    ACME adaptation

commit f5cc254cbc921f07863807468cb3fe26b410b409
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 20 13:01:18 2020 +0200

    ACME adaptation

commit e135a27bf9c30cc0965379c954564e06406303b1
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 19 21:55:01 2020 +0200

    ACME adaptation

commit e9dfddf90d9e2795e88b7da40ae050d733faeb56
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 19 21:48:47 2020 +0200

    Makefile fix

commit 07030104c65cf5e5beeacf6d629ccb9245e58657
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 19 21:42:00 2020 +0200

    ACME adaptation

commit f824362ee5bcfbffca86c430b57773b2ffd65655
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 19 20:14:56 2020 +0200

    ACME adaptation

commit 3a3c59007dcd4940d89b8669f34ca56b61c25fdf
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 18 21:51:45 2020 +0200

    ACME adaptation

commit 6790ef7bc88a41de2881c69b7524dd4ab8c74b5d
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 18 20:35:23 2020 +0200

    ACME adaptation

commit 38ad18b90e9ec713aa7ca49576b3388ce1733357
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 18 18:46:20 2020 +0200

    ACME adaptation

commit 541340371122a9702f7b2d9771c298223cffd0e9
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 18 16:49:46 2020 +0200

    ACME adaptation

commit 25cfd5e186459be1a260d3eb8cfff767838de370
Author: FeralChild64 <you@example.com>
Date:   Thu Sep 17 20:13:33 2020 +0200

    ACME adaptation

commit f61599444d5b1d03d8fd8e4a6a7c3b85069bedb3
Author: FeralChild64 <you@example.com>
Date:   Thu Sep 17 19:29:23 2020 +0200

    ACME adaptation

commit b290be31ec7bb2e5723607697da1bbc621c84429
Author: FeralChild64 <you@example.com>
Date:   Thu Sep 17 17:20:14 2020 +0200

    ACME adaptation

commit 877be9e856880d98fd4bcb25b42aaaacda9dc463
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 16 21:47:38 2020 +0200

    ACME adaptation

commit bb20edaf85d386e41d5c2f715b745b68fbd3362e
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 16 21:31:30 2020 +0200

    ACME adaptation

commit c5d31bd8685abce37c8e254d15aac20bd1570d9f
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 16 18:40:49 2020 +0200

    ACME adaptation

commit 29349826b38f8a89649171559dc8cf24c560aff1
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 23:35:47 2020 +0200

    ACME adaptation

commit 8bcd6a621c4b11766d0cf34f79858ba90a67248e
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 22:52:25 2020 +0200

    ACME adaptation

commit e87a69edc2ce4bfcc460c31e08dcc352a985f88d
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 22:43:27 2020 +0200

    ACME adaptation

commit f49a097bd52e96d00b866c02bda7121e4543233c
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 19:02:07 2020 +0200

    ACME adaptation

commit fa0e9214a633b8e8f867cc70925b390940dcd426
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 17:47:19 2020 +0200

    ACME adaptation

commit 1b763b91e7a03e426227129c7f22f0ce57a4c197
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 17:17:10 2020 +0200

    ACME adaptation

commit e92a4b57b232cd85eb1e71090b8a89c7c8461ebc
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 17:15:37 2020 +0200

    ACME adaptation

commit de3c693e8a7e73ea5289198946058e3240894e6a
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 14 17:10:05 2020 +0200

    ACME adaptation

commit f9bd7ae0f04e932d613be9ed5cb19af9be5d338e
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 13 14:34:44 2020 +0200

    ACME adaptation

commit 694dee52555dbfc2b1f7f452a9671ff51106c057
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 13 14:16:14 2020 +0200

    ACME adaptation

commit 0af2c55edfcd22942d9f25417eb0d35f55b71604
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 11 17:38:09 2020 +0200

    ACME adaptation

commit 2015e17334bd56a1e8a13a5abc098d9c2e7ea44f
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 11 16:46:05 2020 +0200

    ACME adaptation

commit b1e972162798d60f4483cd6cc261e856c20c2c8c
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 11 16:24:31 2020 +0200

    ACME adaptation

commit 9d027e868466901ba53bf074a79ec8cf16273021
Author: FeralChild64 <you@example.com>
Date:   Fri Sep 11 15:04:31 2020 +0200

    ACME adaptation

commit 957186deddd1aa4f3b4f1aa1f421e4239a584e57
Author: FeralChild64 <you@example.com>
Date:   Thu Sep 10 22:49:07 2020 +0200

    ACME adaptation

commit b8060f67a455cfac109f08d96b62c360d693b931
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 23:07:28 2020 +0200

    ACME adaptation

commit e54d004568f44bbfe5c070ef1d7cf3544112e497
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 22:58:20 2020 +0200

    ACME adaptation

commit f90b77f073c5a605cb31c6ee451f65c8a8aff7d8
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 22:12:09 2020 +0200

    ACME adaptation

commit b211bb4afcd9c58fe1f5c92f3007717d611cd531
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 22:01:40 2020 +0200

    ACME adaptation

commit 8d7ea343b07e9e08e5f77f3c414758a6cffd0440
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 21:38:34 2020 +0200

    ACME adaptation

commit 46413eb0d92d6400aba0ff8dfe556e61e8a44d78
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 21:07:47 2020 +0200

    ACME adaptation

commit 9f98f69ecc21f7b74a5eb89e247f5a2c6fcb655d
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 20:05:03 2020 +0200

    ACME adaptation

commit 7bb9f1cadc682c7e0a4a6796739d860d473ca110
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 19:55:12 2020 +0200

    ACME adaptation

commit 5fc115392b5bdca6b56f67ad866b1884d2d2bdf8
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 19:31:10 2020 +0200

    ACME adaptation

commit b7940fc60e568d859df9e3156f6bacc6d685b2cc
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 19:16:09 2020 +0200

    ACME adaptation

commit 56288cb97197561afa0816b29c134ec1190e8eab
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 18:48:23 2020 +0200

    ACME adaptation

commit 10401a60fc7922a53d782120ef6795d889140218
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 16:34:16 2020 +0200

    ACME adaptation

commit 8ce76e4d2b56837a691ae84b1a412a2ae32a157b
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 16:20:44 2020 +0200

    ACME adaptation

commit 33fade899fa6172ea6b5b5f6683bb61f544429fd
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 15:28:46 2020 +0200

    ACME adaptation

commit a416f04734402fcfbc57a933731376df2e0180a1
Author: FeralChild64 <you@example.com>
Date:   Wed Sep 9 12:40:03 2020 +0200

    ACME adaptation

commit f8daee005b1d29f6912723be2ac94bc5fbeb0508
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 7 23:29:54 2020 +0200

    ACME adaptation

commit 83fe6bdd0b08a44fdbfc6eefe323a4b194ccaf5b
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 7 22:23:16 2020 +0200

    ACME adaptation

commit cb1f75620b9c83000a15c9c7f7acefdfee79a979
Author: FeralChild64 <you@example.com>
Date:   Mon Sep 7 19:23:12 2020 +0200

    ACME adaptation

commit e524d517c933ae1f0aeb49764d307fadb4845025
Author: FeralChild64 <you@example.com>
Date:   Sun Sep 6 08:24:25 2020 +0200

    ACME adaptation - replaced comments

commit 2ab572c3a21f4a78a7312d0e684bc11d91d1717a
Author: FeralChild64 <you@example.com>
Date:   Sat Sep 5 17:59:10 2020 +0200

    ACME adaptation - replaced the assembler
This commit is contained in:
FeralChild64 committed 2020-09-20 20:22:36 +02:00
1 parent bfc8291e41
commit c8d255130c
685 files changed
+15835 -16296

No files matched your search

+8 -8
View File
@@ -1,21 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Common part of CHKIN and CKOUT
//
;
; Common part of CHKIN and CKOUT
;
chkinout_device_not_present:
ply_trash_a
+ply_trash_a
pla
jsr kernalstatus_DEVICE_NOT_FOUND
jmp kernalerror_DEVICE_NOT_FOUND
chkinout_file_not_open:
ply_trash_a
+ply_trash_a
pla
jmp kernalerror_FILE_NOT_OPEN
+24 -24
View File
@@ -1,38 +1,38 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 281
// - [CM64] Computes Mapping the Commodore 64 - page 230
//
// CPU registers that has to be preserved (see [RG64]): .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 281
; - [CM64] Computes Mapping the Commodore 64 - page 230
;
; CPU registers that has to be preserved (see [RG64]): .Y
;
clall_real:
// Store .Y register
phy_trash_a
; Store .Y register
+phy_trash_a
// Original routine probably just sets LDTND to 0, but this is not really safe,
// so we actually close all the channels; at least IDE64 does the same for
// its channels, see CLALL description in the IDE64 Users Guide
!:
; Original routine probably just sets LDTND to 0, but this is not really safe,
; so we actually close all the channels; at least IDE64 does the same for
; its channels, see CLALL description in the IDE64 Users Guide
@1:
ldy LDTND
beq !+
beq @2
dey
lda LAT, y
jsr JCLOSE
jmp !-
!:
// Restore .Y register
ply_trash_a
jmp @1
@2:
; Restore .Y register
+ply_trash_a
// 'C64 Programmers Reference Guide', page 281, claims it calls CLRCHN too
; 'C64 Programmers Reference Guide', page 281, claims it calls CLRCHN too
jsr CLRCHN
// Not sure whether original Kernal does so, but it seems sane to also clear possible errors
; Not sure whether original Kernal does so, but it seems sane to also clear possible errors
jmp kernalstatus_reset
+16 -16
View File
@@ -1,25 +1,25 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 290
// - [CM64] Computes Mapping the Commodore 64 - page 215
//
// CPU registers that has to be preserved (see [RG64]): none
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 290
; - [CM64] Computes Mapping the Commodore 64 - page 215
;
; CPU registers that has to be preserved (see [RG64]): none
;
PLOT:
bcs plot_get
// Note: the 'set' part has to start from $E50C, as this is a known address
// - https://www.lemon64.com/forum/viewtopic.php?t=3296&amp%3Bstart=15
// - https://sys64738.org/2019/05/c64-bedtime-coding-eng-printing-08/
// - 'Duotris' game calls $E50C during startup screen initialization
; Note: the 'set' part has to start from $E50C, as this is a known address
; - https://www.lemon64.com/forum/viewtopic.php?t=3296&amp%3Bstart=15
; - https://sys64738.org/2019/05/c64-bedtime-coding-eng-printing-08/
; - 'Duotris' game calls $E50C during startup screen initialization
plot_set:
@@ -28,7 +28,7 @@ plot_set:
jsr screen_calculate_pointers
// FALLTROUGH to save one byte on RTS
; FALLTROUGH to save one byte on RTS
plot_get:
+11 -11
View File
@@ -1,15 +1,15 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 283
// - [CM64] Computes Mapping the Commodore 64 - page 227/228
//
// CPU registers that has to be preserved (see [RG64]): for RS-232: .X, .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 283
; - [CM64] Computes Mapping the Commodore 64 - page 227/228
;
; CPU registers that has to be preserved (see [RG64]): for RS-232: .X, .Y
;
GETIN:
+30 -30
View File
@@ -1,51 +1,51 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 277/278
// - [CM64] Computes Mapping the Commodore 64 - page 228
//
// CPU registers that has to be preserved (see [RG64]): .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 277/278
; - [CM64] Computes Mapping the Commodore 64 - page 228
;
; CPU registers that has to be preserved (see [RG64]): .Y
;
// Reads a byte of input, unless from keyboard.
// If from keyboard, then it gets a whole line of input, and returns the first char.
// Repeated calls after that read out the successive bytes of the line of input.
; Reads a byte of input, unless from keyboard.
; If from keyboard, then it gets a whole line of input, and returns the first char.
; Repeated calls after that read out the successive bytes of the line of input.
CHRIN:
// Determine the device number
; Determine the device number
lda DFLTN
// Try $00 - keyboard
beq_16 chrin_keyboard
; Try $00 - keyboard
+beq chrin_keyboard
// XXX Try $03 - screen
// cmp #$03
// beq_16 chrin_screen
; XXX Try $03 - screen
; cmp #$03
; +beq chrin_screen
#if HAS_RS232
!ifdef HAS_RS232 {
// Try $02 - RS-232
; Try $02 - RS-232
cmp #$02
beq_16 chrin_rs232
+beq chrin_rs232
#endif // HAS_RS232
} ; HAS_RS232
chrin_getin: // jump entry for GETIN
chrin_getin: ; jump entry for GETIN
#if CONFIG_IEC
!ifdef CONFIG_IEC {
// Try IEC devices
; Try IEC devices
jsr iec_check_devnum_oc
bcc_16 chrin_iec
+bcc chrin_iec
#endif // CONFIG_IEC
} ; CONFIG_IEC
// Not a supported device
; Not a supported device
jmp lvs_device_not_found_error
+41 -41
View File
@@ -1,80 +1,80 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 278/279
// - [CM64] Computes Mapping the Commodore 64 - page 228
//
// CPU registers that has to be preserved (see [RG64]): .Y
// Additionally we have to preserve .X for out CHRIN and implementation
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 278/279
; - [CM64] Computes Mapping the Commodore 64 - page 228
;
; CPU registers that has to be preserved (see [RG64]): .Y
; Additionally we have to preserve .X for out CHRIN and implementation
;
CHROUT:
sta SCHAR
// Save X and Y values
// (Confirmed by writing a test program that X and Y
// do not get modified, in agreement with C64 PRG
// description of CHROUT)
; Save X and Y values
; (Confirmed by writing a test program that X and Y
; do not get modified, in agreement with C64 PRG
; description of CHROUT)
phx_trash_a
phy_trash_a
+phx_trash_a
+phy_trash_a
php
// Determine the device number
; Determine the device number
lda DFLTO
cmp #$03 // screen
beq_16 chrout_screen
cmp #$03 ; screen
+beq chrout_screen
#if HAS_RS232
!ifdef HAS_RS232 {
cmp #$02
beq_16 chrout_rs232
#endif
+beq chrout_rs232
}
#if CONFIG_IEC
!ifdef CONFIG_IEC {
jsr iec_check_devnum_oc
bcc_16 chrout_iec
#endif
+bcc chrout_iec
}
// FALLTROUGH
; FALLTROUGH
chrout_done_fail:
plp
// Restore X and Y
ply_trash_a
plx_trash_a
; Restore X and Y
+ply_trash_a
+plx_trash_a
sec // indicate failure
sec ; indicate failure
rts
chrout_done_unknown_device:
plp
// Restore X and Y
ply_trash_a
plx_trash_a
; Restore X and Y
+ply_trash_a
+plx_trash_a
// End wioth error
; End wioth error
jmp lvs_device_not_found_error
chrout_done_success:
plp
cli // needed for screen (checked calling the routine on original ROMs), XXX what about other devices?
cli ; needed for screen (checked calling the routine on original ROMs), XXX what about other devices?
// Restore X and Y
ply_trash_a
plx_trash_a
; Restore X and Y
+ply_trash_a
+plx_trash_a
lda SCHAR
clc // indicate success
clc ; indicate success
rts
+33 -34
View File
@@ -1,74 +1,73 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routines, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 275
// - [CM64] Computes Mapping the Commodore 64 - page 229
//
// CPU registers that has to be preserved (see [RG64]): .Y, .A (see [CM64], page 213)
//
;
; Official Kernal routines, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 275
; - [CM64] Computes Mapping the Commodore 64 - page 229
;
; CPU registers that has to be preserved (see [RG64]): .Y, .A (see [CM64], page 213)
;
CHKIN:
// Store registers for preservation
; Store registers for preservation
pha
phy_trash_a
+phy_trash_a
// Reset status
; Reset status
jsr kernalstatus_reset
// First retrieve the FAT/LAT/SAT table index (and check if file is open)
; First retrieve the FAT/LAT/SAT table index (and check if file is open)
txa
jsr find_fls
bcs_16 chkinout_file_not_open
+bcs chkinout_file_not_open
// Now we have table index in Y
; Now we have table index in Y
lda FAT,Y
// Handle all the devices
; Handle all the devices
beq chkin_set_device // 0 - keyboard
beq chkin_set_device ; 0 - keyboard
// Tape not supported here
; Tape not supported here
#if HAS_RS232
!ifdef HAS_RS232 {
cmp #$02
beq_16 chkin_rs232
+beq chkin_rs232
}
#endif // HAS_RS232
#if CONFIG_IEC
!ifdef CONFIG_IEC {
jsr iec_check_devnum_oc
bcc_16 chkin_iec
+bcc chkin_iec
}
#endif // CONFIG_IEC
cmp #$03 // screen - only legal one left
bne_16 chkinout_device_not_present
cmp #$03 ; screen - only legal one left
+bne chkinout_device_not_present
chkin_set_device:
lda FAT,Y
sta DFLTN
// FALLTROUGH
; FALLTROUGH
chkinout_end:
ply_trash_a
+ply_trash_a
pla
clc // indicate success
clc ; indicate success
rts
chkin_file_not_input:
ply_trash_a
+ply_trash_a
pla
jmp kernalerror_FILE_NOT_INPUT
+31 -31
View File
@@ -1,65 +1,65 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routines, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 276
// - [CM64] Computes Mapping the Commodore 64 - page 229
//
// CPU registers that has to be preserved (see [RG64]): .Y, .A (see [CM64], page 213)
//
;
; Official Kernal routines, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 276
; - [CM64] Computes Mapping the Commodore 64 - page 229
;
; CPU registers that has to be preserved (see [RG64]): .Y, .A (see [CM64], page 213)
;
CKOUT:
// Store registers for preservation
; Store registers for preservation
pha
phy_trash_a
+phy_trash_a
// Reset status
; Reset status
jsr kernalstatus_reset
// First retrieve the FAT/LAT/SAT table index (and check if file is open)
; First retrieve the FAT/LAT/SAT table index (and check if file is open)
txa
jsr find_fls
bcs_16 chkinout_file_not_open
+bcs chkinout_file_not_open
// Now we have table index in Y
; Now we have table index in Y
lda FAT,Y
// Handle all the devices
; Handle all the devices
beq ckout_file_not_output // 0 - keyboard
beq ckout_file_not_output ; 0 - keyboard
// Tape not supported here
; Tape not supported here
#if HAS_RS232
!ifdef HAS_RS232 {
cmp #$02
beq_16 ckout_rs232
+beq ckout_rs232
}
#endif // HAS_RS232
#if CONFIG_IEC
!ifdef CONFIG_IEC {
jsr iec_check_devnum_oc
bcc_16 ckout_iec
+bcc ckout_iec
}
#endif // CONFIG_IEC
cmp #$03 // screen - only legal one left
bne_16 chkinout_device_not_present
cmp #$03 ; screen - only legal one left
+bne chkinout_device_not_present
ckout_set_device:
lda FAT,Y
sta DFLTO
jmp chkinout_end
ckout_file_not_output:
ply_trash_a
+ply_trash_a
pla
jmp kernalerror_FILE_NOT_OUTPUT
+28 -28
View File
@@ -1,48 +1,48 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 281/282
// - [CM64] Computes Mapping the Commodore 64 - page 229/230
// - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc (IEC command)
//
// CPU registers that has to be preserved (see [RG64]): none
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 281/282
; - [CM64] Computes Mapping the Commodore 64 - page 229/230
; - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc (IEC command)
;
; CPU registers that has to be preserved (see [RG64]): none
;
CLOSE:
// Find the LAT / SAT / FAT entry which LAT corresponds to A
; Find the LAT / SAT / FAT entry which LAT corresponds to A
jsr find_fls
bcs close_end // XXX can we report error in IOSTATUS here?
bcs close_end ; XXX can we report error in IOSTATUS here?
// We have the entry index in .Y
; We have the entry index in .Y
lda FAT, y
// Perform device-specific actions
; Perform device-specific actions
#if HAS_RS232
!ifdef HAS_RS232 {
cmp #$02
beq_16 close_rs232
#endif
+beq close_rs232
}
#if CONFIG_IEC
!ifdef CONFIG_IEC {
jsr iec_check_devnum_oc
bcc_16 close_iec
#endif
+bcc close_iec
}
// FALLTROUGH
; FALLTROUGH
close_remove_from_table:
// Remove channel from the table
; Remove channel from the table
iny
cpy #$0A
bpl !+
bpl @1
lda LAT, y
sta LAT-1, y
lda FAT, y
@@ -50,11 +50,11 @@ close_remove_from_table:
lda SAT, y
sta SAT-1, y
jmp close_remove_from_table
!:
// Decrement the list size variable
@1:
; Decrement the list size variable
dec LDTND
clc // report success - not sure if original CLOSE does this, but it is nevertheless a good practice
clc ; report success - not sure if original CLOSE does this, but it is nevertheless a good practice
close_end:
rts
+5 -5
View File
@@ -1,10 +1,10 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
// Our implementation is longer than the original one,
// placing it here would cause a collision with CLRCHN
; Our implementation is longer than the original one,
; placing it here would cause a collision with CLRCHN
CLALL:
+17 -19
View File
@@ -1,34 +1,32 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 282
// - [CM64] Computes Mapping the Commodore 64 - page 230
//
// CPU registers that has to be preserved (see [RG64]): .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 282
; - [CM64] Computes Mapping the Commodore 64 - page 230
;
; CPU registers that has to be preserved (see [RG64]): .Y
;
CLRCHN:
#if CONFIG_IEC
!ifdef CONFIG_IEC {
jsr clrchn_iec
#else
nop // just to prevent double label
#endif
// FALLTROUGH
; FALLTROUGH
clrchn_reset: // entry needed by vicii_init
clrchn_reset: ; entry needed by vicii_init
}
// Set input device number to keyboard
; Set input device number to keyboard
lda #$00
sta DFLTN
// Set output device number to screen
; Set output device number to screen
lda #$03
sta DFLTO
+33 -35
View File
@@ -1,51 +1,52 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 289
// - [CM64] Computes Mapping the Commodore 64 - page 230/231
//
// CPU registers that has to be preserved (see [RG64]): none
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 289
; - [CM64] Computes Mapping the Commodore 64 - page 230/231
;
; CPU registers that has to be preserved (see [RG64]): none
;
OPEN:
// Reset status
; Reset status
jsr kernalstatus_reset
// Check if the logical file number is unique
; Check if the logical file number is unique
ldy LDTND
!:
beq !+
@1:
beq @3
dey
lda LAT, y
cmp LA
bne open_not_yet_open
bne @2
jmp kernalerror_FILE_ALREADY_OPEN
open_not_yet_open:
@2: ; not yet open
cpy #$00
jmp !-
!:
// Check if we have space in tables
jmp @1
@3:
; Check if we have space in tables
ldy LDTND
cpy #$0A
bcc open_has_space
!:
// Table is full
; Table is full
jmp kernalerror_TOO_MANY_OPEN_FILES
open_has_space:
// Update the tables
; Update the tables
// LAT / FAT / SAT support implemented according to
// 'Computes Mapping the Commodore 64', page 52
; LAT / FAT / SAT support implemented according to
; 'Computes Mapping the Commodore 64', page 52
lda LA
sta LAT, y
@@ -59,21 +60,18 @@ open_has_space:
lda FA
#if HAS_RS232
!ifdef HAS_RS232 {
cmp #$02
beq_16 open_rs232
+beq open_rs232
}
#endif
#if CONFIG_IEC
!ifdef CONFIG_IEC {
jsr iec_check_devnum_oc
bcc_16 open_iec
#endif
// FALLTROUGH
+bcc open_iec
}
; FALLTROUGH
open_done_success:
+16 -16
View File
@@ -1,22 +1,22 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// LOAD preparation routine
//
;
; LOAD preparation routine
;
//
// Input (according to http://sta.c64.org/cbm64krnfunc.html)
// .A - 0 for load, non-0 for verify
// .X and .Y - load address (if secondary address is 0)
//
;
; Input (according to http://sta.c64.org/cbm64krnfunc.html)
; .A - 0 for load, non-0 for verify
; .X and .Y - load address (if secondary address is 0)
;
//
// Note: Although the vector at $330 points to $F4A5, the Kernal jump table points to $F49E
// (see also Mapping the C64, page 76). By experimenting I have discovered that $F49E performs
// indirect jump via ($0330) vector, after setting MEMUSS.
//
;
; Note: Although the vector at $330 points to $F4A5, the Kernal jump table points to $F49E
; (see also Mapping the C64, page 76). By experimenting I have discovered that $F49E performs
; indirect jump via ($0330) vector, after setting MEMUSS.
;
LOAD_PREP:
+39 -41
View File
@@ -1,74 +1,72 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 286
// - [CM64] Computes Mapping the Commodore 64 - page 231
// - IEC reference at http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
//
// CPU registers that has to be preserved (see [RG64]): none
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 286
; - [CM64] Computes Mapping the Commodore 64 - page 231
; - IEC reference at http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
;
; CPU registers that has to be preserved (see [RG64]): none
;
// Expects that SETLFS and SETNAM are called before hand.
// $YYXX = load address.
// (ignored if SETLFS channel = 1, i.e., like ,8,1)
// If A=1 then VERIFY instead of LOAD.
// On exit, $YYXX is the highest address into which data
// will have been placed.
; Expects that SETLFS and SETNAM are called before hand.
; $YYXX = load address.
; (ignored if SETLFS channel = 1, i.e., like ,8,1)
; If A=1 then VERIFY instead of LOAD.
; On exit, $YYXX is the highest address into which data
; will have been placed.
LOAD:
// Are we loading or verifying?
; Are we loading or verifying?
sta VERCKK
// Store start address of LOAD
; Store start address of LOAD
lda MEMUSS+0
sta STAL+0
lda MEMUSS+1
sty STAL+1
// Reset status
; Reset status
jsr kernalstatus_reset
#if CONFIG_MEMORY_MODEL_60K
// We need our helpers to get to filenames under ROMs or IO area
!ifdef CONFIG_MEMORY_MODEL_60K {
; We need our helpers to get to filenames under ROMs or IO area
jsr install_ram_routines
#endif
}
// Check whether we support the requested device
; Check whether we support the requested device
lda FA
#if !CONFIG_TAPE_AUTODETECT
!ifndef CONFIG_TAPE_AUTODETECT {
#if CONFIG_TAPE_NORMAL
!ifdef CONFIG_TAPE_NORMAL {
cmp #$01
beq_16 load_tape_normal
#endif
#if CONFIG_TAPE_TURBO
+beq load_tape_normal
}
!ifdef CONFIG_TAPE_TURBO {
cmp #$07
beq_16 load_tape_turbo
#endif
+beq load_tape_turbo
}
#else // CONFIG_TAPE_AUTODETECT
} else { ; CONFIG_TAPE_AUTODETECT
cmp #$01
beq_16 load_tape_auto
+beq load_tape_auto
cmp #$07
beq_16 load_tape_auto
#endif
+beq load_tape_auto
}
#if CONFIG_IEC
!ifdef CONFIG_IEC {
jsr iec_check_devnum_lvs
bcc_16 load_iec
#endif
+bcc load_iec
}
jmp lvs_illegal_device_number
+15 -15
View File
@@ -1,21 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// SAVE preparation routine
//
;
; SAVE preparation routine
;
//
// Input (according to http://sta.c64.org/cbm64krnfunc.html)
// .A - address of zero page register holding start address of memory area to save
// .X and .Y - end address of memory area plus 1
//
;
; Input (according to http://sta.c64.org/cbm64krnfunc.html)
; .A - address of zero page register holding start address of memory area to save
; .X and .Y - end address of memory area plus 1
;
//
// Note: Experimenting can easily confirm that SAVE preparation routine does similar
// actions as LOAD preparation routine.
//
;
; Note: Experimenting can easily confirm that SAVE preparation routine does similar
; actions as LOAD preparation routine.
;
SAVE_PREP:
+20 -20
View File
@@ -1,33 +1,33 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 293/294
// - [CM64] Computes Mapping the Commodore 64 - page 231/232
// - IEC reference at http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
//
// CPU registers that has to be preserved (see [RG64]): none
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 293/294
; - [CM64] Computes Mapping the Commodore 64 - page 231/232
; - IEC reference at http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
;
; CPU registers that has to be preserved (see [RG64]): none
;
SAVE:
// Reset status
; Reset status
jsr kernalstatus_reset
#if CONFIG_MEMORY_MODEL_60K
// We need our helpers to get to filenames under ROMs or IO area
!ifdef CONFIG_MEMORY_MODEL_60K {
; We need our helpers to get to filenames under ROMs or IO area
jsr install_ram_routines
#endif
}
// Check whether we support the requested device
; Check whether we support the requested device
lda FA
#if CONFIG_IEC
!ifdef CONFIG_IEC {
jsr iec_check_devnum_lvs
bcc_16 save_iec
#endif
+bcc save_iec
}
jmp lvs_illegal_device_number
+9 -9
View File
@@ -1,20 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
// Just a helper routine
; Just a helper routine
// Find the LAT / SAT / FAT entry index where LAT corresponds to A, returns index in Y
// Carry flag set means not found
; Find the LAT / SAT / FAT entry index where LAT corresponds to A, returns index in Y
; Carry flag set means not found
find_fls:
ldy LDTND
!:
@1:
dey
bmi find_fls_not_found // no more entries
bmi find_fls_not_found ; no more entries
cmp LAT, y
bne !- // does not match, try the next one
bne @1 ; does not match, try the next one
clc
rts
+18 -19
View File
@@ -1,31 +1,30 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 283
// - [CM64] Computes Mapping the Commodore 64 - page 227/228
//
// CPU registers that has to be preserved (see [RG64]): for RS-232: .X, .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 283
; - [CM64] Computes Mapping the Commodore 64 - page 227/228
;
; CPU registers that has to be preserved (see [RG64]): for RS-232: .X, .Y
;
getin_real:
// Determine the device number
; Determine the device number
lda DFLTN
// Try $00 - keyboard
beq_16 getin_keyboard
; Try $00 - keyboard
+beq getin_keyboard
#if HAS_RS232
!ifdef HAS_RS232 {
// Try $02 - RS-232
; Try $02 - RS-232
cmp #$02
beq_16 getin_rs232
#endif // HAS_RS232
+beq getin_rs232
}
jmp chrin_getin
+63 -72
View File
@@ -1,10 +1,10 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Helper functions for various LOAD/VERIFY/SAVE routine variants (IEC / U64 / etc.)
//
;
; Helper functions for various LOAD/VERIFY/SAVE routine variants (IEC / U64 / etc.)
;
lvs_handle_byte_load_verify:
@@ -12,14 +12,14 @@ lvs_handle_byte_load_verify:
ldy VERCKK
bne lvs_handle_byte_verify
// As with our BASIC, we want to enable LOADing
// anywhere in memory, including over the IO space.
// Thus we have to use a helper routine in low memory
// to do the memory access
; As with our BASIC, we want to enable LOADing
; anywhere in memory, including over the IO space.
; Thus we have to use a helper routine in low memory
; to do the memory access
#if CONFIG_MEMORY_MODEL_60K
!ifdef CONFIG_MEMORY_MODEL_60K {
// Save byte under ROMs and IO if required
; Save byte under ROMs and IO if required
php
sei
ldx #$33
@@ -30,14 +30,13 @@ lvs_handle_byte_load_verify:
stx $01
plp
#else
} else {
ldy #0
sta (EAL),y
}
#endif
// FALLTROUGH
; FALLTROUGH
lvs_handle_byte_load_verify_end:
@@ -47,12 +46,12 @@ lvs_handle_byte_load_verify_end:
lvs_handle_byte_verify:
#if CONFIG_MEMORY_MODEL_60K
!ifdef CONFIG_MEMORY_MODEL_60K {
// Store byte for comparing
; Store byte for comparing
sta TBTCNT
// Retrieve byte from under ROMs and IO if required
; Retrieve byte from under ROMs and IO if required
php
sei
ldx #$33
@@ -63,33 +62,32 @@ lvs_handle_byte_verify:
stx $01
plp
// Compare with stored byte
; Compare with stored byte
cmp TBTCNT
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
} else ifdef CONFIG_MEMORY_MODEL_46K_OR_50K {
// Store byte for comparing
; Store byte for comparing
sta TBTCNT
ldy #0
jsr peek_under_roms_via_EAL
// Compare with stored byte
; Compare with stored byte
cmp TBTCNT
#else // CONFIG_MEMORY_MODEL_38K
} else { ; CONFIG_MEMORY_MODEL_38K
ldy #0
cmp (EAL),y
#endif
}
beq lvs_handle_byte_load_verify_end
sec
rts
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO || CONFIG_IEC
!ifdef HAS_TAPE_OR_IEC {
lvs_STAL_to_MEMUSS:
@@ -99,33 +97,28 @@ lvs_STAL_to_MEMUSS:
sta MEMUSS+1
rts
#endif
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO || CONFIG_IEC
#if !HAS_OPCODES_65CE02
!ifndef HAS_OPCODES_65CE02 {
lvs_advance_MEMUSS:
// Advance pointer
; Advance pointer
inc MEMUSS+0
bne !+
bne @1
inc MEMUSS+1
!:
@1:
rts
#endif
}
lvs_check_EAL:
lda MEMUSS+1
cmp EAL+1
bne !+
bne @2
lda MEMUSS+0
cmp EAL+0
!:
@2:
rts
@@ -138,22 +131,22 @@ lvs_display_searching_for:
jsr print_kernal_message
ldy #$00
!:
@3:
cpy FNLEN
beq lvs_display_end
#if CONFIG_MEMORY_MODEL_60K
!ifdef CONFIG_MEMORY_MODEL_60K {
ldx #<FNADDR+0
jsr peek_under_roms
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
} else ifdef CONFIG_MEMORY_MODEL_46K_OR_50K {
jsr peek_under_roms_via_FNADDR
#else // CONFIG_MEMORY_MODEL_38K
} else { ; CONFIG_MEMORY_MODEL_38K
lda (FNADDR),y
#endif
}
jsr JCHROUT
iny
jmp !-
jmp @3
lvs_display_end:
rts
@@ -161,40 +154,40 @@ lvs_display_end:
lvs_display_loading_verifying:
// Display LOADING / VERIFYING and start address
; Display LOADING / VERIFYING and start address
lda MSGFLG
bpl lvs_display_end
ldx #__MSG_KERNAL_LOADING
lda VERCKK
beq !+
beq @4
ldx #__MSG_KERNAL_VERIFYING
!:
@4:
jsr print_kernal_message
// FALLTHROUGH
; FALLTHROUGH
lvs_display_start_addr:
ldx #__MSG_KERNAL_FROM_HEX
jsr print_kernal_message
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
!ifdef HAS_TAPE {
lda FA
#if CONFIG_TAPE_NORMAL
!ifdef CONFIG_TAPE_NORMAL {
cmp #$01
beq lvs_display_addr_STAL
#endif
#if CONFIG_TAPE_TURBO
}
!ifdef CONFIG_TAPE_TURBO {
cmp #$07
beq lvs_display_addr_STAL
#endif
}
#endif
}
// FALLTROUGH
; FALLTROUGH
lvs_display_addr_EAL:
@@ -212,7 +205,7 @@ lvs_display_addr_STAL:
lvs_display_done:
// Display end address
; Display end address
lda MSGFLG
bpl lvs_display_end
@@ -222,7 +215,7 @@ lvs_display_done:
lvs_display_saving:
// Display SAVING and file name
; Display SAVING and file name
lda MSGFLG
bpl lvs_display_end
@@ -230,14 +223,14 @@ lvs_display_saving:
jsr print_kernal_message
ldy #$00
!:
@5:
cpy FNLEN
beq !+
beq @6
lda (FNADDR), y
jsr JCHROUT
iny
bne !- // jump always
!:
bne @5 ; jump always
@6:
rts
lvs_error_end:
@@ -247,18 +240,17 @@ lvs_error_end:
lvs_return_last_address:
// Return last address - Computes Mapping the 64 says without the '+1',
// checked (short test program) on original ROMs that this is really the case
; Return last address - Computes Mapping the 64 says without the '+1',
; checked (short test program) on original ROMs that this is really the case
ldx EAL+0
ldy EAL+1
// FALLTHROUGH
; FALLTHROUGH
lvs_success_end:
clc
rts
#endif
}
lvs_device_not_found_error:
@@ -270,19 +262,18 @@ lvs_illegal_device_number:
jsr kernalstatus_DEVICE_NOT_FOUND
jmp kernalerror_ILLEGAL_DEVICE_NUMBER
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO || CONFIG_IEC
!ifdef HAS_TAPE_OR_IEC {
lvs_load_verify_error:
// XXX should we really return BASIC error code here?
; XXX should we really return BASIC error code here?
lda VERCKK
bne lvs_verify_error
lda #B_ERR_LOAD
bne lvs_error_end
// FALLTHROUGH
; FALLTHROUGH
lvs_verify_error:
lda #B_ERR_VERIFY
sec
rts
#endif
}
+12 -11
View File
@@ -1,24 +1,25 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
// Pop key out of keyboard buffer
// Disable interrupts while reading from keyboard buffer
// so that no race conditions can occur
//
// CPU registers that has to be preserved: .X
//
; Pop key out of keyboard buffer
; Disable interrupts while reading from keyboard buffer
; so that no race conditions can occur
;
; CPU registers that has to be preserved: .X
;
pop_keyboard_buffer:
ldy #$01
sei
!: lda KEYD,y
@1:
lda KEYD,y
sta KEYD-1,y
iny
cpy XMAX
bne !-
bne @1
dec NDX
cli
+20 -20
View File
@@ -1,34 +1,34 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 292
// - [CM64] Computes Mapping the Commodore 64 - page 239
//
// CPU registers that has to be preserved (see [RG64]): .X, .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 292
; - [CM64] Computes Mapping the Commodore 64 - page 239
;
; CPU registers that has to be preserved (see [RG64]): .X, .Y
;
READST:
// Check the current device number
; Check the current device number
lda FA
cmp #$02
bne !+
bne @1
// This is RS-232 device - according to 'Computes Mapping the Commodore 64' page 239
// it reads status from RSSTAT
// XXX 'lda RSSTAT' not possible due to extended scnkey, fix it!
; This is RS-232 device - according to 'Computes Mapping the Commodore 64' page 239
; it reads status from RSSTAT
; XXX 'lda RSSTAT' not possible due to extended scnkey, fix it!
lda #$FF
rts
!:
// According to 'Computes Mapping the Commodore 64' page 239, it usually retrieves
// status from IOSTATUS
@1:
; According to 'Computes Mapping the Commodore 64' page 239, it usually retrieves
; status from IOSTATUS
// XXX is it always the case if device is not RS-232 ?
; XXX is it always the case if device is not RS-232 ?
lda IOSTATUS
rts
+12 -12
View File
@@ -1,21 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
SELDEV:
// Take last device number, make sure it is a drive - 8 or above. Above 30,
// although illegal for IEC we also consider a drive, as they exists
// drivers assigning these numbers to CBM-DOS capable devices - like some
// IEEE-488 carts.
//
// If current device is not a drive, set device to 8 (first drive number)
// Device number is left in X, for SETFLS Kernal routine
; Take last device number, make sure it is a drive - 8 or above. Above 30,
; although illegal for IEC we also consider a drive, as they exists
; drivers assigning these numbers to CBM-DOS capable devices - like some
; IEEE-488 carts.
;
; If current device is not a drive, set device to 8 (first drive number)
; Device number is left in X, for SETFLS Kernal routine
ldx FA
cpx #$08
bcs !+
bcs @1
ldx #$08
!:
@1:
rts
+13 -13
View File
@@ -1,20 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 297
// - [CM64] Computes Mapping the Commodore 64 - page 238
//
// CPU registers that has to be preserved (see [RG64]): .A, .X, .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 297
; - [CM64] Computes Mapping the Commodore 64 - page 238
;
; CPU registers that has to be preserved (see [RG64]): .A, .X, .Y
;
SETFLS:
// There are 6 sane ways to implement this routine,
// I hope this one will not cause similarity to CBM code
; There are 6 sane ways to implement this routine,
; I hope this one will not cause similarity to CBM code
sta LA
sty SA
+11 -11
View File
@@ -1,15 +1,15 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 298
// - [CM64] Computes Mapping the Commodore 64 - page 239
//
// CPU registers that has to be preserved (see [RG64]): .A, .X, .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 298
; - [CM64] Computes Mapping the Commodore 64 - page 239
;
; CPU registers that has to be preserved (see [RG64]): .A, .X, .Y
;
SETMSG:
+13 -13
View File
@@ -1,20 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 298/299
// - [CM64] Computes Mapping the Commodore 64 - page 238
//
// CPU registers that has to be preserved (see [RG64]): .A, .X, .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 298/299
; - [CM64] Computes Mapping the Commodore 64 - page 238
;
; CPU registers that has to be preserved (see [RG64]): .A, .X, .Y
;
SETNAM:
// There are 6 sane ways to implement this routine,
// I hope this one will not cause similarity to CBM code
; There are 6 sane ways to implement this routine,
; I hope this one will not cause similarity to CBM code
sta FNLEN
sty FNADDR + 1
+11 -11
View File
@@ -1,15 +1,15 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmers Reference Guide - page 300
// - [CM64] Computes Mapping the Commodore 64 - page 239
//
// CPU registers that has to be preserved (see [RG64]): .A, .X, .Y
//
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 300
; - [CM64] Computes Mapping the Commodore 64 - page 239
;
; CPU registers that has to be preserved (see [RG64]): .A, .X, .Y
;
SETTMO: