128 files changed
+706
-296
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
SRC_COMMON = $(wildcard c64/aliases/*.s)
|
SRC_COMMON = $(wildcard c64/aliases/*.s)
|
||||||
SRC_BASIC_COMMON = $(SRC_COMMON) $(wildcard c64/basic/*.s)
|
SRC_BASIC_COMMON = $(SRC_COMMON) $(wildcard c64/basic/*.s)
|
||||||
SRC_KERNAL_COMMON = $(SRC_COMMON) $(wildcard c64/kernal/*.s c64/kernal/jumptable/*.s c64/kernal/iec/*.s)
|
SRC_KERNAL_COMMON = $(SRC_COMMON) $(wildcard c64/kernal/*.s c64/kernal/jumptable/*.s c64/kernal/iec/*.s c64/kernal/interrupts/*.s)
|
||||||
|
|
||||||
SRC_BASIC_generic = $(SRC_BASIC_COMMON) $(wildcard c64/basic/,target_generic/*.s)
|
SRC_BASIC_generic = $(SRC_BASIC_COMMON) $(wildcard c64/basic/,target_generic/*.s)
|
||||||
SRC_BASIC_mega65 = $(SRC_BASIC_COMMON) $(wildcard c64/basic/,target_mega65/*.s)
|
SRC_BASIC_mega65 = $(SRC_BASIC_COMMON) $(wildcard c64/basic/,target_mega65/*.s)
|
||||||
@@ -23,6 +23,10 @@ TOOL_SIMILARITY = build/tools/similarity
|
|||||||
|
|
||||||
TOOLS_LIST = $(TOOL_COLLECT_DATA) $(TOOL_COMPRESS_TEXT) $(TOOL_PNGPREPARE) $(TOOL_PREPROCESS) $(TOOL_SIMILARITY)
|
TOOLS_LIST = $(TOOL_COLLECT_DATA) $(TOOL_COMPRESS_TEXT) $(TOOL_PNGPREPARE) $(TOOL_PREPROCESS) $(TOOL_SIMILARITY)
|
||||||
|
|
||||||
|
# GIT commit
|
||||||
|
|
||||||
|
GIT_COMMIT:= $(shell git log -1 --pretty='%h' | tr '[:lower:]' '[:upper:]')
|
||||||
|
|
||||||
# Rules - main
|
# Rules - main
|
||||||
|
|
||||||
.PHONY: all clean updatebin
|
.PHONY: all clean updatebin
|
||||||
@@ -147,7 +151,7 @@ test: build/newkern_generic build/newbasic_generic
|
|||||||
x64 -kernal build/newkern_generic -basic build/newbasic_generic -8 empty.d64
|
x64 -kernal build/newkern_generic -basic build/newbasic_generic -8 empty.d64
|
||||||
|
|
||||||
testremote: build/newkern_generic build/newbasic_generic
|
testremote: build/newkern_generic build/newbasic_generic
|
||||||
x64 -kernal build/newkern-generic -basic build/newbasic-generic -remotemonitor
|
x64 -kernal build/newkern_generic -basic build/newbasic_generic -remotemonitor
|
||||||
|
|
||||||
testm65: build/newc65
|
testm65: build/newc65
|
||||||
m65 -b ../mega65-core/bin/mega65r1.bit -k ../mega65-core/bin/KICKUP.M65 -R build/newc65 -4
|
m65 -b ../mega65-core/bin/mega65r1.bit -k ../mega65-core/bin/KICKUP.M65 -R build/newc65 -4
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8
|
|||||||
* improved keyboard scanning, supports multi-key roll-over and rejection of spurious joystick input
|
* improved keyboard scanning, supports multi-key roll-over and rejection of spurious joystick input
|
||||||
* joystick (port 1) can be used to move text cursor
|
* joystick (port 1) can be used to move text cursor
|
||||||
* uses RAM under ROM and I/O: 61436 bytes free
|
* uses RAM under ROM and I/O: 61436 bytes free
|
||||||
|
* cold/warm start silences 4 SID chips - assumes addresses $D400, $D420, $D440, $D460
|
||||||
* extended `LOAD` command
|
* extended `LOAD` command
|
||||||
* start/end addresses are displayed, in the Final cartridge style
|
* start/end addresses are displayed, in the Final cartridge style
|
||||||
* command with just the file name tries to use the last device if it's number seems sane; otherwise uses 8
|
* command with just the file name tries to use the last device if it's number seems sane; otherwise uses 8
|
||||||
@@ -25,12 +26,12 @@ The following ROM features are currently missing:
|
|||||||
* floating point routines
|
* floating point routines
|
||||||
* tape support
|
* tape support
|
||||||
* RS-232 support
|
* RS-232 support
|
||||||
* warm start (RUN/STOP + RESTORE) - NMI is not implemented at all
|
|
||||||
* breaking Kernal routines with RUN/STOP key
|
* breaking Kernal routines with RUN/STOP key
|
||||||
|
* BRK handling; NMI/IRQ handling is incomplete
|
||||||
|
|
||||||
Features currently being worked on:
|
Features currently being worked on:
|
||||||
|
|
||||||
* IEC support needs more testing ang bugfixing; alternative drive ROMs (JiffyDOS, DolphinDOS, etc) usually don't work with current implementation, `@$` leaves the drive led on, most likely other problems can be found
|
* IEC support needs more work; alternative drive ROMs (JiffyDOS, DolphinDOS, etc) usually don't work with current implementation, SAVE / VERIFY are not implemented, etc.
|
||||||
|
|
||||||
# API status
|
# API status
|
||||||
|
|
||||||
@@ -70,10 +71,10 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
|
|||||||
|
|
||||||
| Address | Name | Status | Remarks |
|
| Address | Name | Status | Remarks |
|
||||||
| --------- | :------- | :------: | :------------------------------------------------: |
|
| --------- | :------- | :------: | :------------------------------------------------: |
|
||||||
| `$FF81` | `CINT` | PARTIAL | at least PAL/NTSC detection is missing |
|
| `$FF81` | `CINT` | DONE | |
|
||||||
| `$FF84` | `IOINIT` | PARTIAL | at least SID volume handling is missing |
|
| `$FF84` | `IOINIT` | PARTIAL | CIA initialization incomplete |
|
||||||
| `$FF87` | `RAMTAS` | DONE | |
|
| `$FF87` | `RAMTAS` | DONE | |
|
||||||
| `$FF8A` | `RESTOR` | PARTIAL | CBINV, NMINV, and USRCMD missing |
|
| `$FF8A` | `RESTOR` | DONE | |
|
||||||
| `$FF8D` | `VECTOR` | DONE | |
|
| `$FF8D` | `VECTOR` | DONE | |
|
||||||
| `$FF90` | `SETMSG` | DONE | |
|
| `$FF90` | `SETMSG` | DONE | |
|
||||||
| `$FF93` | `SECOND` | DONE | |
|
| `$FF93` | `SECOND` | DONE | |
|
||||||
@@ -81,7 +82,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
|
|||||||
| `$FF99` | `MEMTOP` | DONE | |
|
| `$FF99` | `MEMTOP` | DONE | |
|
||||||
| `$FF9C` | `MEMBOT` | DONE | |
|
| `$FF9C` | `MEMBOT` | DONE | |
|
||||||
| `$FF9F` | `SCNKEY` | DONE | could be better integrated with ROM (aliases) |
|
| `$FF9F` | `SCNKEY` | DONE | could be better integrated with ROM (aliases) |
|
||||||
| `$FFA2` | `SETTMO` | NOT DONE | |
|
| `$FFA2` | `SETTMO` | DONE | |
|
||||||
| `$FFA5` | `ACPTR` | DONE | |
|
| `$FFA5` | `ACPTR` | DONE | |
|
||||||
| `$FFA8` | `CIOUT` | DONE | |
|
| `$FFA8` | `CIOUT` | DONE | |
|
||||||
| `$FFAB` | `UNTLK` | DONE | |
|
| `$FFAB` | `UNTLK` | DONE | |
|
||||||
@@ -92,20 +93,20 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
|
|||||||
| `$FFBA` | `SETFLS` | DONE | |
|
| `$FFBA` | `SETFLS` | DONE | |
|
||||||
| `$FFBD` | `SETNAM` | DONE | |
|
| `$FFBD` | `SETNAM` | DONE | |
|
||||||
| `$FFC0` | `OPEN` | DONE | |
|
| `$FFC0` | `OPEN` | DONE | |
|
||||||
| `$FFC3` | `CLOSE` | PARTIAL | most likely incompleete, @$ doesn't end properly |
|
| `$FFC3` | `CLOSE` | DONE | |
|
||||||
| `$FFC6` | `CHKIN` | DONE | |
|
| `$FFC6` | `CHKIN` | DONE | |
|
||||||
| `$FFC9` | `CHKOUT` | PARTIAL | |
|
| `$FFC9` | `CHKOUT` | PARTIAL | |
|
||||||
| `$FFCC` | `CLRCHN` | DONE | |
|
| `$FFCC` | `CLRCHN` | DONE | |
|
||||||
| `$FFCF` | `CHRIN` | PARTIAL | |
|
| `$FFCF` | `CHRIN` | PARTIAL | |
|
||||||
| `$FFD2` | `CHROUT` | PARTIAL | |
|
| `$FFD2` | `CHROUT` | PARTIAL | |
|
||||||
| `$FFD5` | `LOAD` | PARTIAL | no VERIFY support yet |
|
| `$FFD5` | `LOAD` | PARTIAL | no VERIFY support yet, no STOP key support |
|
||||||
| `$FFD8` | `SAVE` | NOT DONE | |
|
| `$FFD8` | `SAVE` | NOT DONE | |
|
||||||
| `$FFDB` | `SETTIM` | NOT DONE | |
|
| `$FFDB` | `SETTIM` | NOT DONE | |
|
||||||
| `$FFDE` | `RDTIM` | NOT DONE | |
|
| `$FFDE` | `RDTIM` | NOT DONE | |
|
||||||
| `$FFE1` | `STOP` | PARTIAL | no connection with UDTIM |
|
| `$FFE1` | `STOP` | DONE | |
|
||||||
| `$FFE4` | `GETIN` | PARTIAL | only some devices supported |
|
| `$FFE4` | `GETIN` | PARTIAL | only some devices supported |
|
||||||
| `$FFE7` | `CLALL` | DONE | |
|
| `$FFE7` | `CLALL` | DONE | |
|
||||||
| `$FFEA` | `UDTIM` | NOT DONE | |
|
| `$FFEA` | `UDTIM` | NOT DONE | checking for STOP key present in SCNKEY instead |
|
||||||
| `$FFED` | `SCREEN` | DONE | |
|
| `$FFED` | `SCREEN` | DONE | |
|
||||||
| `$FFF0` | `PLOT` | NOT DONE | |
|
| `$FFF0` | `PLOT` | NOT DONE | |
|
||||||
| `$FFF3` | `IOBASE` | DONE | |
|
| `$FFF3` | `IOBASE` | DONE | |
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
;; CPU memory registers
|
;; CPU memory registers
|
||||||
|
|
||||||
.alias CPU_D6510 $0000
|
.alias CPU_D6510 $00
|
||||||
.alias CPU_R6510 $0001
|
.alias CPU_R6510 $01
|
||||||
|
|
||||||
;; VIC-II registers
|
;; VIC-II registers
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
.alias VIC_SP7Y $D00F
|
.alias VIC_SP7Y $D00F
|
||||||
|
|
||||||
.alias VIC_MSIGX $D010
|
.alias VIC_MSIGX $D010
|
||||||
.alias VIC_SCROLLY $D011
|
.alias VIC_SCROLY $D011
|
||||||
.alias VIC_RASTER $D012
|
.alias VIC_RASTER $D012
|
||||||
.alias VIC_LPENX $D013
|
.alias VIC_LPENX $D013
|
||||||
.alias VIC_LPENY $D014
|
.alias VIC_LPENY $D014
|
||||||
@@ -60,46 +60,40 @@
|
|||||||
.alias VIC_SP6COL $D02D
|
.alias VIC_SP6COL $D02D
|
||||||
.alias VIC_SP7COL $D02E
|
.alias VIC_SP7COL $D02E
|
||||||
|
|
||||||
;; SID #1 registers
|
;; SID registers
|
||||||
|
|
||||||
.alias SID1_FRELO1 $D400
|
.alias SID_FRELO1 $D400
|
||||||
.alias SID1_FREHI1 $D401
|
.alias SID_FREHI1 $D401
|
||||||
.alias SID1_PWLO1 $D402
|
.alias SID_PWLO1 $D402
|
||||||
.alias SID1_PWHI1 $D403
|
.alias SID_PWHI1 $D403
|
||||||
.alias SID1_VCREG1 $D404
|
.alias SID_VCREG1 $D404
|
||||||
.alias SID1_ATDCY1 $D405
|
.alias SID_ATDCY1 $D405
|
||||||
.alias SID1_SUREL1 $D406
|
.alias SID_SUREL1 $D406
|
||||||
|
|
||||||
.alias SID1_FRELO2 $D407
|
.alias SID_FRELO2 $D407
|
||||||
.alias SID1_FREHI2 $D408
|
.alias SID_FREHI2 $D408
|
||||||
.alias SID1_PWLO2 $D409
|
.alias SID_PWLO2 $D409
|
||||||
.alias SID1_PWHI2 $D40A
|
.alias SID_PWHI2 $D40A
|
||||||
.alias SID1_VCREG2 $D40B
|
.alias SID_VCREG2 $D40B
|
||||||
.alias SID1_ATDCY2 $D40C
|
.alias SID_ATDCY2 $D40C
|
||||||
.alias SID1_SUREL2 $D40D
|
.alias SID_SUREL2 $D40D
|
||||||
|
|
||||||
.alias SID1_FRELO3 $D40E
|
.alias SID_FRELO3 $D40E
|
||||||
.alias SID1_FREHI3 $D40F
|
.alias SID_FREHI3 $D40F
|
||||||
.alias SID1_PWLO3 $D410
|
.alias SID_PWLO3 $D410
|
||||||
.alias SID1_PWHI3 $D411
|
.alias SID_PWHI3 $D411
|
||||||
.alias SID1_VCREG3 $D412
|
.alias SID_VCREG3 $D412
|
||||||
.alias SID1_ATDCY3 $D413
|
.alias SID_ATDCY3 $D413
|
||||||
.alias SID1_SUREL3 $D414
|
.alias SID_SUREL3 $D414
|
||||||
|
|
||||||
.alias SID1_CUTLO $D415
|
.alias SID_CUTLO $D415
|
||||||
.alias SID1_CUTHI $D416
|
.alias SID_CUTHI $D416
|
||||||
.alias SID1_RESON $D417
|
.alias SID_RESON $D417
|
||||||
.alias SID1_SIGVOL $D418
|
.alias SID_SIGVOL $D418
|
||||||
.alias SID1_POTX $D419
|
.alias SID_POTX $D419
|
||||||
.alias SID1_POTY $D41A
|
.alias SID_POTY $D41A
|
||||||
.alias SID1_RANDOM $D41B
|
.alias SID_RANDOM $D41B
|
||||||
.alias SID1_ENV3 $D41C
|
.alias SID_ENV3 $D41C
|
||||||
|
|
||||||
;; SID #2, #3, #4 registers
|
|
||||||
|
|
||||||
.alias SID2_SIGVOL $D438
|
|
||||||
.alias SID3_SIGVOL $D458
|
|
||||||
.alias SID4_SIGVOL $D478
|
|
||||||
|
|
||||||
;; CIA #1 registers
|
;; CIA #1 registers
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
.alias FNADDR $BB ; $BB-$BC, current file name pointer
|
.alias FNADDR $BB ; $BB-$BC, current file name pointer
|
||||||
|
|
||||||
.alias STAL $C1 ; $C1-$C2 LOAD/SAVE start address
|
.alias STAL $C1 ; $C1-$C2 LOAD/SAVE start address
|
||||||
|
.alias MEMUS $C3 ; $C3-$C4 temporary address for tape LOAD/SAVE
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Other low memory addresses
|
;; Other low memory addresses
|
||||||
@@ -60,6 +61,8 @@
|
|||||||
.alias MEMSTR $281
|
.alias MEMSTR $281
|
||||||
.alias MEMSIZ $283 ; NOTE: Mapping the 64 erroniously has the hex as $282, while the DEC is correct
|
.alias MEMSIZ $283 ; NOTE: Mapping the 64 erroniously has the hex as $282, while the DEC is correct
|
||||||
|
|
||||||
|
.alias TIMOUT $285 ; IEEE-488 timeout
|
||||||
|
|
||||||
.alias HIBASE $288 ; high byte of start of screen
|
.alias HIBASE $288 ; high byte of start of screen
|
||||||
|
|
||||||
.alias RSSTAT $297 ; RS-232 status
|
.alias RSSTAT $297 ; RS-232 status
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
;; BASIC startup vector
|
||||||
|
|
||||||
|
.alias IBASIC_COLD_START $A000
|
||||||
|
.alias IBASIC_WARM_START $A002
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
;; Cartridge ROM locations
|
||||||
|
.alias ICART_COLD_START $8000 ; $8000-$8001, cartridge cold start vector
|
||||||
|
.alias ICART_WARM_START $8002 ; $8002-$8003, cartridge warm start vector (RESTORE key)
|
||||||
|
.alias CART_SIG $8004 ; 5 bytes, signature for cartridge detection
|
||||||
@@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
.macro TARGET_HOOK_BANNER
|
.macro TARGET_HOOK_BANNER
|
||||||
|
|
||||||
.byte $05, " OPEN ROMS, ", $00
|
.byte " OPEN ROMS, ", $00
|
||||||
|
|
||||||
.macend
|
.macend
|
||||||
@@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
.macro TARGET_HOOK_BANNER
|
.macro TARGET_HOOK_BANNER
|
||||||
|
|
||||||
.byte $05, " OPEN ROMS FOR ULTIMATE 64", $0D, $0D, " ", $00
|
.byte " OPEN ROMS FOR ULTIMATE 64", $0D, $0D, " ", $00
|
||||||
|
|
||||||
.macend
|
.macend
|
||||||
@@ -20,7 +20,7 @@ print_string_loop:
|
|||||||
lda (temp_string_ptr),y
|
lda (temp_string_ptr),y
|
||||||
beq print_string_end
|
beq print_string_end
|
||||||
|
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
|
|
||||||
txa
|
txa
|
||||||
tay
|
tay
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ startup_banner:
|
|||||||
|
|
||||||
`TARGET_HOOK_BANNER
|
`TARGET_HOOK_BANNER
|
||||||
|
|
||||||
|
;; Print PAL/NTSC
|
||||||
|
ldx #30 ; NTSC
|
||||||
|
lda PALNTSC
|
||||||
|
beq +
|
||||||
|
ldx #31 ; PAL
|
||||||
|
*
|
||||||
|
jsr print_packed_message
|
||||||
|
|
||||||
;; Work out free bytes, and display
|
;; Work out free bytes, and display
|
||||||
jsr basic_do_new
|
jsr basic_do_new
|
||||||
lda basic_top_of_memory_ptr+0
|
lda basic_top_of_memory_ptr+0
|
||||||
@@ -29,7 +37,7 @@ startup_banner:
|
|||||||
jsr print_integer
|
jsr print_integer
|
||||||
|
|
||||||
lda #$20
|
lda #$20
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
|
|
||||||
;; Print the rest of the start up message
|
;; Print the rest of the start up message
|
||||||
ldx #34
|
ldx #34
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ basic_do_error:
|
|||||||
|
|
||||||
;; Print ? at start
|
;; Print ? at start
|
||||||
lda #$0d
|
lda #$0d
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
lda #$3f
|
lda #$3f
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
|
|
||||||
;; Print main part of error message
|
;; Print main part of error message
|
||||||
pla
|
pla
|
||||||
@@ -18,7 +18,7 @@ basic_do_error:
|
|||||||
|
|
||||||
;; Print ERROR at end
|
;; Print ERROR at end
|
||||||
lda #$20
|
lda #$20
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
ldx #33
|
ldx #33
|
||||||
jsr print_packed_message
|
jsr print_packed_message
|
||||||
|
|
||||||
@@ -27,9 +27,9 @@ basic_do_error:
|
|||||||
;; XXX print line number if not in direct mode
|
;; XXX print line number if not in direct mode
|
||||||
|
|
||||||
lda #$0d
|
lda #$0d
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
lda #$0d
|
lda #$0d
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
|
|
||||||
;; Reset stack, and go back to main loop
|
;; Reset stack, and go back to main loop
|
||||||
ldx #$fe
|
ldx #$fe
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ rsl_l1: lda $0200,x
|
|||||||
*
|
*
|
||||||
;; Do printing of the new line
|
;; Do printing of the new line
|
||||||
lda #$0d
|
lda #$0d
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
|
|
||||||
;; Ignore empty lines
|
;; Ignore empty lines
|
||||||
lda tokenise_work1
|
lda tokenise_work1
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ basic_do_break:
|
|||||||
|
|
||||||
*
|
*
|
||||||
lda #$0d
|
lda #$0d
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
cmd_end:
|
cmd_end:
|
||||||
jmp basic_main_loop
|
jmp basic_main_loop
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ list_single_line: ; entry point needed by DOS wedge
|
|||||||
pla
|
pla
|
||||||
jsr print_integer
|
jsr print_integer
|
||||||
lda #$20
|
lda #$20
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
|
|
||||||
;; Iterate through printing out the line
|
;; Iterate through printing out the line
|
||||||
;; contents
|
;; contents
|
||||||
@@ -111,16 +111,16 @@ list_not_rem:
|
|||||||
bne list_print_loop
|
bne list_print_loop
|
||||||
|
|
||||||
list_is_literal:
|
list_is_literal:
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
iny
|
iny
|
||||||
bne list_print_loop
|
bne list_print_loop
|
||||||
|
|
||||||
list_end_of_line:
|
list_end_of_line:
|
||||||
;; Clear reverse flag
|
;; Clear reverse flag
|
||||||
lda #$92
|
lda #$92
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
;; Print end of line
|
;; Print end of line
|
||||||
lda #$0d
|
lda #$0d
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@@ -191,6 +191,7 @@ end_of_line_search:
|
|||||||
pla
|
pla
|
||||||
sta basic_current_line_ptr+0
|
sta basic_current_line_ptr+0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jmp basic_relink_loop
|
jmp basic_relink_loop
|
||||||
|
|
||||||
|
via_ILOAD:
|
||||||
|
jmp (ILOAD)
|
||||||
@@ -115,7 +115,7 @@ found_start_of_number:
|
|||||||
;; Print digits
|
;; Print digits
|
||||||
* lda $0100,y
|
* lda $0100,y
|
||||||
ora #$30
|
ora #$30
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
iny
|
iny
|
||||||
cpy #5
|
cpy #5
|
||||||
bne -
|
bne -
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ found_message_in_token_stream:
|
|||||||
beq +
|
beq +
|
||||||
jsr print_packed_word
|
jsr print_packed_word
|
||||||
lda #$20
|
lda #$20
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
pla
|
pla
|
||||||
tay
|
tay
|
||||||
iny
|
iny
|
||||||
@@ -47,7 +47,7 @@ found_message_in_token_stream:
|
|||||||
pla
|
pla
|
||||||
;; Rub out space at the end
|
;; Rub out space at the end
|
||||||
lda #$14
|
lda #$14
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
rts
|
rts
|
||||||
|
|
||||||
print_packed_word:
|
print_packed_word:
|
||||||
@@ -144,7 +144,7 @@ next_packed_word_char:
|
|||||||
|
|
||||||
;; X=1-14 = first 14 chars, so subtract one
|
;; X=1-14 = first 14 chars, so subtract one
|
||||||
lda packed_message_chars-1,x
|
lda packed_message_chars-1,x
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
|
|
||||||
;; See if there is a char in the low nybl to print
|
;; See if there is a char in the low nybl to print
|
||||||
pla
|
pla
|
||||||
@@ -171,7 +171,7 @@ has_nybl:
|
|||||||
|
|
||||||
;; X=1-14 = first 14 chars, so subtract one
|
;; X=1-14 = first 14 chars, so subtract one
|
||||||
lda packed_message_chars-1,x
|
lda packed_message_chars-1,x
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
*
|
*
|
||||||
pla
|
pla
|
||||||
tay
|
tay
|
||||||
@@ -207,7 +207,7 @@ unpack_literal_char:
|
|||||||
tya
|
tya
|
||||||
pha
|
pha
|
||||||
lda (temp_string_ptr),y
|
lda (temp_string_ptr),y
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
pla
|
pla
|
||||||
tay
|
tay
|
||||||
rts
|
rts
|
||||||
|
|||||||
+3
-3
@@ -112,7 +112,7 @@ not_hexword:
|
|||||||
|
|
||||||
not_pointer:
|
not_pointer:
|
||||||
;; Print character
|
;; Print character
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
|
|
||||||
printf_nextchar:
|
printf_nextchar:
|
||||||
jsr printf_advance
|
jsr printf_advance
|
||||||
@@ -148,11 +148,11 @@ printf_printhexbyte:
|
|||||||
cmp #$3A
|
cmp #$3A
|
||||||
bcc +
|
bcc +
|
||||||
adc #6
|
adc #6
|
||||||
* jsr via_IBSOUT
|
* jsr JCHROUT
|
||||||
pla
|
pla
|
||||||
and #$0f
|
and #$0f
|
||||||
ora #$30
|
ora #$30
|
||||||
cmp #$3A
|
cmp #$3A
|
||||||
bcc +
|
bcc +
|
||||||
adc #6
|
adc #6
|
||||||
* jmp via_IBSOUT
|
* jmp JCHROUT
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
|
|
||||||
;;
|
|
||||||
;; Helper routines for jumping via vectors, to be used with JSR
|
|
||||||
;;
|
|
||||||
;; Note: they are not in the order of low memory vectors, to avoid
|
|
||||||
;; similarity with the original ROMs
|
|
||||||
|
|
||||||
via_ISAVE:
|
|
||||||
jmp (ISAVE)
|
|
||||||
|
|
||||||
via_ILOAD:
|
|
||||||
jmp (ILOAD)
|
|
||||||
|
|
||||||
via_ICLOSE:
|
|
||||||
jmp (ICLOSE)
|
|
||||||
|
|
||||||
via_IOPEN:
|
|
||||||
jmp (IOPEN)
|
|
||||||
|
|
||||||
via_ICHKIN:
|
|
||||||
jmp (ICHKIN)
|
|
||||||
|
|
||||||
via_IBASIN:
|
|
||||||
jmp (IBASIN)
|
|
||||||
|
|
||||||
via_IGETIN:
|
|
||||||
jmp (IGETIN)
|
|
||||||
|
|
||||||
via_ICKOUT:
|
|
||||||
jmp (ICKOUT)
|
|
||||||
|
|
||||||
via_IBSOUT:
|
|
||||||
jmp (IBSOUT)
|
|
||||||
|
|
||||||
via_ICLRCH:
|
|
||||||
jmp (ICLRCH)
|
|
||||||
|
|
||||||
via_ICLALL:
|
|
||||||
jmp (ICLALL)
|
|
||||||
|
|
||||||
via_ISTOP:
|
|
||||||
jmp (ISTOP)
|
|
||||||
+15
-15
@@ -4,7 +4,7 @@
|
|||||||
wedge_dos:
|
wedge_dos:
|
||||||
|
|
||||||
;; Close all the channels, so that wedge has full control
|
;; Close all the channels, so that wedge has full control
|
||||||
jsr via_ICLALL
|
jsr JCLALL
|
||||||
|
|
||||||
;; Set file parameters, channel 15 is a typical one for commands
|
;; Set file parameters, channel 15 is a typical one for commands
|
||||||
jsr select_device ; sets X register
|
jsr select_device ; sets X register
|
||||||
@@ -41,11 +41,11 @@ wedge_dos_command:
|
|||||||
jsr wedge_dos_setnam
|
jsr wedge_dos_setnam
|
||||||
|
|
||||||
jsr JSETNAM
|
jsr JSETNAM
|
||||||
jsr via_IOPEN
|
jsr JOPEN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
|
|
||||||
;; Retrieve status, print it if not OK
|
;; Retrieve status, print it if not OK
|
||||||
jsr via_ICLALL
|
jsr JCLALL
|
||||||
jsr wedge_dos_status_get
|
jsr wedge_dos_status_get
|
||||||
lda BUF+0
|
lda BUF+0
|
||||||
cmp #$30 ; '0'
|
cmp #$30 ; '0'
|
||||||
@@ -82,12 +82,12 @@ wedge_dos_status_get:
|
|||||||
;; Set remaining file parameters, open the channel
|
;; Set remaining file parameters, open the channel
|
||||||
lda #$00 ; empty file name
|
lda #$00 ; empty file name
|
||||||
jsr JSETNAM
|
jsr JSETNAM
|
||||||
jsr via_IOPEN
|
jsr JOPEN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
|
|
||||||
;; Set channel for input
|
;; Set channel for input
|
||||||
ldx #$0F
|
ldx #$0F
|
||||||
jsr via_ICHKIN
|
jsr JCHKIN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
|
|
||||||
ldy #$00
|
ldy #$00
|
||||||
@@ -98,7 +98,7 @@ wedge_dos_status_get:
|
|||||||
;; XXX error in case of status != EOF
|
;; XXX error in case of status != EOF
|
||||||
;; Print out everything retrieved from the drive
|
;; Print out everything retrieved from the drive
|
||||||
bne +
|
bne +
|
||||||
jsr via_IBASIN
|
jsr JCHRIN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
sta BUF, y
|
sta BUF, y
|
||||||
iny
|
iny
|
||||||
@@ -118,7 +118,7 @@ wedge_dos_status_print:
|
|||||||
dey
|
dey
|
||||||
bmi +
|
bmi +
|
||||||
lda BUF, x
|
lda BUF, x
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
inx
|
inx
|
||||||
bne -
|
bne -
|
||||||
*
|
*
|
||||||
@@ -139,18 +139,18 @@ wedge_dos_directory:
|
|||||||
jsr wedge_dos_setnam
|
jsr wedge_dos_setnam
|
||||||
|
|
||||||
;; Open the file
|
;; Open the file
|
||||||
jsr via_IOPEN
|
jsr JOPEN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
|
|
||||||
;; Set channel for file reading
|
;; Set channel for file reading
|
||||||
ldx #$00
|
ldx #$00
|
||||||
jsr via_ICHKIN
|
jsr JCHKIN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
|
|
||||||
;; Ignore start address (2 first bytes) - XXX check for errors
|
;; Ignore start address (2 first bytes) - XXX check for errors
|
||||||
jsr via_IBASIN
|
jsr JCHRIN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
jsr via_IBASIN
|
jsr JCHRIN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
|
|
||||||
wedge_dos_directory_line:
|
wedge_dos_directory_line:
|
||||||
@@ -159,7 +159,7 @@ wedge_dos_directory_line:
|
|||||||
ldy #$FF
|
ldy #$FF
|
||||||
*
|
*
|
||||||
iny
|
iny
|
||||||
jsr via_IBASIN
|
jsr JCHRIN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
sta BUF, y
|
sta BUF, y
|
||||||
cpy #$50
|
cpy #$50
|
||||||
@@ -199,15 +199,15 @@ wedge_dos_directory_display:
|
|||||||
;; FALLTROUGH
|
;; FALLTROUGH
|
||||||
|
|
||||||
wedge_dos_clean_exit:
|
wedge_dos_clean_exit:
|
||||||
jsr via_ICLALL
|
jsr JCLALL
|
||||||
;; Print new line
|
;; Print new line
|
||||||
lda #$0D
|
lda #$0D
|
||||||
jsr via_IBSOUT
|
jsr JCHROUT
|
||||||
jmp basic_end_of_line
|
jmp basic_end_of_line
|
||||||
|
|
||||||
wedge_dos_basic_error:
|
wedge_dos_basic_error:
|
||||||
pha
|
pha
|
||||||
jsr via_ICLALL
|
jsr JCLALL
|
||||||
pla
|
pla
|
||||||
tax
|
tax
|
||||||
dex
|
dex
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
cartridge_check:
|
cartridge_check:
|
||||||
ldx #$04
|
ldx #$04
|
||||||
cartridge_check_l1:
|
cartridge_check_l1:
|
||||||
lda $8002,x
|
lda CART_SIG,x
|
||||||
cmp cartridge_signature,x
|
cmp cartridge_signature,x
|
||||||
bne no_cartridge
|
bne no_cartridge
|
||||||
dex
|
dex
|
||||||
bpl cartridge_check_l1
|
bpl cartridge_check_l1
|
||||||
jmp ($8000)
|
sec
|
||||||
cartridge_signature:
|
rts
|
||||||
.byte $C3,$C2,$CD,$38,$30
|
|
||||||
no_cartridge:
|
no_cartridge:
|
||||||
|
clc
|
||||||
rts
|
rts
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
cartridge_signature:
|
||||||
|
.byte $C3,$C2,$CD,$38,$30
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
;; CHKIN implementation
|
;; CHKIN implementation
|
||||||
|
|
||||||
chkin:
|
chkin_real:
|
||||||
|
|
||||||
;; Store Y for preservation
|
;; Store Y for preservation
|
||||||
tya
|
tya
|
||||||
@@ -88,11 +88,9 @@ chkinout_file_not_output:
|
|||||||
tay
|
tay
|
||||||
jmp kernalerror_FILE_NOT_OUTPUT
|
jmp kernalerror_FILE_NOT_OUTPUT
|
||||||
|
|
||||||
chkinout_common:
|
|
||||||
|
|
||||||
;; CKOUT implementation
|
;; CKOUT implementation
|
||||||
|
|
||||||
ckout:
|
ckout_real:
|
||||||
|
|
||||||
;; Store Y for preservation
|
;; Store Y for preservation
|
||||||
tya
|
tya
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
;; If from keyboard, then it gets a whole line of input, and returns the first char.
|
;; 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.
|
;; Repeated calls after that read out the successive bytes of the line of input.
|
||||||
|
|
||||||
chrin:
|
chrin_real:
|
||||||
|
|
||||||
;; Determine the device number
|
;; Determine the device number
|
||||||
lda DFLTN
|
lda DFLTN
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
chrout:
|
chrout_real:
|
||||||
|
|
||||||
sta last_printed_character_ascii
|
sta last_printed_character_ascii
|
||||||
|
|
||||||
+9
-5
@@ -10,8 +10,15 @@
|
|||||||
|
|
||||||
|
|
||||||
cint:
|
cint:
|
||||||
|
|
||||||
|
cint_brk: ; entry for BRK and STOP+RESTORE - XXX, where should it start?
|
||||||
|
|
||||||
jsr setup_vicii
|
jsr setup_vicii
|
||||||
|
|
||||||
|
;; According to [CM64], this routine also checks for PAL/NTSC - this must be a mistake,
|
||||||
|
;; it's too late (IOINIT already needs this information), besides - POKE something
|
||||||
|
;; to address 678 on a real C64, press STOP+RESTORE - the value won't change
|
||||||
|
|
||||||
;; Initialise cursor blink flags (Compute's Mapping the 64 p215)
|
;; Initialise cursor blink flags (Compute's Mapping the 64 p215)
|
||||||
lda #$00
|
lda #$00
|
||||||
sta cursor_blink_disable
|
sta cursor_blink_disable
|
||||||
@@ -34,8 +41,8 @@ cint:
|
|||||||
stx key_first_repeat_delay
|
stx key_first_repeat_delay
|
||||||
|
|
||||||
;; Set current colour for text (Compute's Mapping the 64 p215)
|
;; Set current colour for text (Compute's Mapping the 64 p215)
|
||||||
ldx #$0e ; light blue by default
|
ldx #$01 ; default is light blue ($0E), but we use a different one
|
||||||
stx $0286
|
stx text_colour
|
||||||
|
|
||||||
;; Set maximum keyboard buffer size (Compute's Mapping the 64 p215)
|
;; Set maximum keyboard buffer size (Compute's Mapping the 64 p215)
|
||||||
ldx #10
|
ldx #10
|
||||||
@@ -48,6 +55,3 @@ cint:
|
|||||||
|
|
||||||
;; Fallthrough/jump to screen clear routine (Compute's Mapping the 64 p215)
|
;; Fallthrough/jump to screen clear routine (Compute's Mapping the 64 p215)
|
||||||
jmp clear_screen
|
jmp clear_screen
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
clall:
|
clall_real:
|
||||||
|
|
||||||
;; Store .Y register
|
;; Store .Y register
|
||||||
tya
|
tya
|
||||||
@@ -23,7 +23,7 @@ clall:
|
|||||||
beq +
|
beq +
|
||||||
dey
|
dey
|
||||||
lda LAT, y
|
lda LAT, y
|
||||||
jsr close ; XXX jump through ICLOSE?
|
jsr JCLOSE
|
||||||
jmp -
|
jmp -
|
||||||
*
|
*
|
||||||
;; Restore .Y register
|
;; Restore .Y register
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
|
||||||
|
;; Common ppart of CLOSE and LOAD routines
|
||||||
|
|
||||||
|
close_load:
|
||||||
|
|
||||||
|
tax
|
||||||
|
|
||||||
|
;; Command drive to stop talking and to close the file
|
||||||
|
jsr untlk
|
||||||
|
|
||||||
|
txa
|
||||||
|
jsr listen
|
||||||
|
|
||||||
|
lda #$E0 ; CLOSE command
|
||||||
|
sta IEC_TMP2
|
||||||
|
jsr iec_tx_command
|
||||||
|
jsr iec_tx_command_finalize
|
||||||
|
|
||||||
|
;; Tell drive to unlisten
|
||||||
|
jsr unlsn
|
||||||
|
|
||||||
|
rts
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
clrchn:
|
clrchn_real:
|
||||||
|
|
||||||
;; Handle IEC input device
|
;; Handle IEC input device
|
||||||
lda DFLTN
|
lda DFLTN
|
||||||
@@ -15,7 +15,6 @@ clearscreen_l1:
|
|||||||
|
|
||||||
;; Y now = #$FF
|
;; Y now = #$FF
|
||||||
|
|
||||||
|
|
||||||
;; Clear screen RAM.
|
;; Clear screen RAM.
|
||||||
;; We should do this at HIBASE, which annoyingly
|
;; We should do this at HIBASE, which annoyingly
|
||||||
;; is no ZP, so we need to make a vector
|
;; is no ZP, so we need to make a vector
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
|
|
||||||
setup_vicii:
|
setup_vicii:
|
||||||
|
|
||||||
;; Set up default IO values (Compute's Mapping the 64 p215)
|
;; Set up default IO values (Compute's Mapping the 64 p215)
|
||||||
lda #$1b ; Enable text mode
|
lda #$1B ; Enable text mode
|
||||||
sta $d011
|
sta VIC_SCROLY
|
||||||
lda #$c8 ; 40 column etc
|
lda #$C8 ; 40 column etc
|
||||||
sta $d016
|
sta VIC_SCROLX
|
||||||
|
|
||||||
;; Compute's Mapping the 64, p156
|
;; Compute's Mapping the 64, p156
|
||||||
;; We use a different colour scheme of white text on all blue
|
;; We use a different colour scheme of white text on all blue
|
||||||
lda #$06
|
lda #$06
|
||||||
sta $D020
|
sta VIC_EXTCOL
|
||||||
sta $D021
|
sta VIC_BGCOL0
|
||||||
|
|
||||||
;; Turn off sprites
|
;; Turn off sprites (observed hanging around after running programs and resetting)
|
||||||
;; (observed hanging around after running programs and resetting)
|
|
||||||
lda #$00
|
lda #$00
|
||||||
sta $D015
|
sta VIC_SPENA
|
||||||
|
|
||||||
|
;;FALLTROUGH
|
||||||
File renamed without changes.
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
;; Our implementation is longer than the original one,
|
||||||
|
;; placing it here would cause a collision with CHROUT
|
||||||
|
|
||||||
|
chrin:
|
||||||
|
jmp chrin_real
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
;; Our implementation is longer than the original one,
|
||||||
|
;; placing it here would cause a collision with CHKIN
|
||||||
|
|
||||||
|
chrout:
|
||||||
|
jmp chrout_real
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
;; In our implementation CHKIN and CKOUT are closely tied,
|
||||||
|
;; placing it here would cause a collision
|
||||||
|
|
||||||
|
chkin:
|
||||||
|
jmp chkin_real
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
;; In our implementation CHKIN and CKOUT are closely tied,
|
||||||
|
;; placing it here would cause a collision
|
||||||
|
|
||||||
|
ckout:
|
||||||
|
jmp ckout_real
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -26,8 +26,13 @@ close:
|
|||||||
;; IEC device
|
;; IEC device
|
||||||
|
|
||||||
jsr iec_tx_flush ; make sure no byte is awaiting
|
jsr iec_tx_flush ; make sure no byte is awaiting
|
||||||
*
|
|
||||||
lda SAT, y ; get secondary address
|
lda SAT, y ; get secondary address
|
||||||
|
cmp #$60
|
||||||
|
bne +
|
||||||
|
;; workaround for using CLOSE on reading executable - XXX is this a proper way?
|
||||||
|
jsr close_load
|
||||||
|
jmp close_remove_from_table
|
||||||
|
*
|
||||||
ora $E0 ; CLOSE command
|
ora $E0 ; CLOSE command
|
||||||
sta IEC_TMP2
|
sta IEC_TMP2
|
||||||
jsr iec_tx_command
|
jsr iec_tx_command
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
;; Our implementation is longer than the original one,
|
||||||
|
;; placing it here would cause a collision with CLRCHN
|
||||||
|
|
||||||
|
clall:
|
||||||
|
jmp clall_real
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
;; Our implementation is longer than the original one,
|
||||||
|
;; placing it here would cause a collision with OPEN
|
||||||
|
|
||||||
|
clrchn:
|
||||||
|
jmp clrchn_real
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
File renamed without changes.
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -125,19 +125,8 @@ load_loop:
|
|||||||
|
|
||||||
;; Close file on drive
|
;; Close file on drive
|
||||||
|
|
||||||
;; Command drive to stop talking and to close the file
|
|
||||||
jsr untlk
|
|
||||||
|
|
||||||
lda current_device_number
|
lda current_device_number
|
||||||
jsr listen
|
jsr close_load
|
||||||
|
|
||||||
lda #$E0
|
|
||||||
sta IEC_TMP2
|
|
||||||
jsr iec_tx_command
|
|
||||||
jsr iec_tx_command_finalize
|
|
||||||
|
|
||||||
;; Tell drive to unlisten
|
|
||||||
jsr unlsn
|
|
||||||
|
|
||||||
;; Return last address
|
;; Return last address
|
||||||
jmp lvs_return_last_address
|
jmp lvs_return_last_address
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
File renamed without changes.
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -14,8 +14,7 @@ stop:
|
|||||||
|
|
||||||
;; BASIC checks carry flag to indicate STOP or not
|
;; BASIC checks carry flag to indicate STOP or not
|
||||||
lda STKEY
|
lda STKEY
|
||||||
and #$80
|
bpl stop_pressed
|
||||||
beq stop_pressed
|
|
||||||
|
|
||||||
;; By trial and error, we know that Z + C = BREAK
|
;; By trial and error, we know that Z + C = BREAK
|
||||||
;; and that neither should be set otherwise
|
;; and that neither should be set otherwise
|
||||||
+82
-23
@@ -15,40 +15,99 @@ ioinit:
|
|||||||
; (https://www.c64-wiki.com/wiki/Zeropage)
|
; (https://www.c64-wiki.com/wiki/Zeropage)
|
||||||
;; XXX - Work around VICE bug: Writing $00 before $01 results in rubbish in $01
|
;; XXX - Work around VICE bug: Writing $00 before $01 results in rubbish in $01
|
||||||
;; after. https://sourceforge.net/p/vice-emu/bugs/1057/
|
;; after. https://sourceforge.net/p/vice-emu/bugs/1057/
|
||||||
LDA #$27
|
lda #$27
|
||||||
LDX #$2F
|
ldx #$2F
|
||||||
STA $01
|
sta CPU_R6510
|
||||||
STX $00
|
stx CPU_D6510
|
||||||
|
|
||||||
;; Enable CIA1 IRQ and ~50Hz timer
|
;; Silence the SID chips
|
||||||
;; (https://csdb.dk/forums/?roomid=11&topicid=69037)
|
|
||||||
lda #$7f
|
ldy #$00
|
||||||
sta $DC0D ; First disable all
|
*
|
||||||
|
lda SID_SIGVOL, Y
|
||||||
|
and #$F0
|
||||||
|
sta SID_SIGVOL, Y
|
||||||
|
tya
|
||||||
|
clc
|
||||||
|
adc #$20
|
||||||
|
tay
|
||||||
|
cpy #$80 ; $20 * amount of chips to silence, $80 to silence 4 chips
|
||||||
|
bne -
|
||||||
|
|
||||||
|
;; Detect video system (PAL/NTSC), use Graham's method, as it's short and reliable
|
||||||
|
;; see here: https://codebase64.org/doku.php?id=base:detect_pal_ntsc
|
||||||
|
|
||||||
|
ioinit_w0:
|
||||||
|
lda VIC_RASTER
|
||||||
|
ioinit_w1:
|
||||||
|
cmp VIC_RASTER
|
||||||
|
beq ioinit_w1
|
||||||
|
bmi ioinit_w0
|
||||||
|
|
||||||
|
;; Result in A, if no interrupt happened during the test:
|
||||||
|
;; #$37 -> 312 rasterlines, PAL, VIC 6569
|
||||||
|
;; #$06 -> 263 rasterlines, NTSC, VIC 6567R8
|
||||||
|
;; #$05 -> 262 rasterlines, NTSC, VIC 6567R56A
|
||||||
|
|
||||||
|
cmp #$07
|
||||||
|
bcs ioinit_pal
|
||||||
|
|
||||||
|
ioinit_ntsc:
|
||||||
|
lda #$00
|
||||||
|
beq +
|
||||||
|
|
||||||
|
ioinit_pal:
|
||||||
|
lda #$01
|
||||||
|
*
|
||||||
|
sta PALNTSC
|
||||||
|
|
||||||
|
;; XXX: calibrate TOD for both CIA's, see here: https://codebase64.org/doku.php?id=base:efficient_tod_initialisation
|
||||||
|
|
||||||
|
;; Enable CIA1 IRQ and ~50Hz timer (https://csdb.dk/forums/?roomid=11&topicid=69037)
|
||||||
|
lda #$7F
|
||||||
|
sta CIA1_ICR ; disable all
|
||||||
|
|
||||||
;; Set timer interval to ~1/60th of a second
|
;; Set timer interval to ~1/60th of a second
|
||||||
;; (This value was calculated by running a custom IRQ haandler on a C64
|
|
||||||
|
;; (This value was calculated by running a custom IRQ handler on a C64
|
||||||
;; with original KERNAL, and writing the values of $DC04/5 to the screen
|
;; with original KERNAL, and writing the values of $DC04/5 to the screen
|
||||||
;; in the IRQ handler to see roughly what value the timers must be set to)
|
;; in the IRQ handler to see roughly what value the timers must be set to)
|
||||||
lda #<16380
|
;; ldy #<16380
|
||||||
sta $dc04
|
;; ldx #>16380
|
||||||
lda #>16380
|
|
||||||
sta $dc05
|
;; PAL C64 (https://codebase64.org/doku.php?id=base:cpu_clocking),
|
||||||
|
;; is clocked at 0.985248 MHz, so that 1/60s is 16421 CPU cycles
|
||||||
|
|
||||||
|
ldy #<16421
|
||||||
|
ldx #>16421
|
||||||
|
|
||||||
|
lda PALNTSC
|
||||||
|
bne +
|
||||||
|
|
||||||
|
;; NTSC C64 (https://codebase64.org/doku.php?id=base:cpu_clocking),
|
||||||
|
;; is clocked at 1.022727 MHz, so that 1/60s is 17045 CPU cycles
|
||||||
|
|
||||||
|
ldy #<17045
|
||||||
|
ldx #>17045
|
||||||
|
|
||||||
|
;; Store the IRQ timing constant to CIA chip
|
||||||
|
*
|
||||||
|
sty CIA1_TIMALO
|
||||||
|
stx CIA1_TIMAHI
|
||||||
|
|
||||||
;; Enable timer interrupt
|
;; Enable timer interrupt
|
||||||
lda #$81
|
lda #$81
|
||||||
sta $dc0d
|
sta CIA1_ICR
|
||||||
|
|
||||||
;; Enable timer A to run continuously
|
;; Enable timer A to run continuously (http://codebase64.org/doku.php?id=base:timerinterrupts)
|
||||||
;; (http://codebase64.org/doku.php?id=base:timerinterrupts)
|
|
||||||
lda #$11
|
lda #$11
|
||||||
sta $dc0e
|
sta CIA1_CRA
|
||||||
lda $dc0d
|
lda CIA1_ICR
|
||||||
|
|
||||||
;; Set DDR on CIA2 for IEC bus, VIC-II banking
|
;; Set DDR on CIA2 for IEC bus, VIC-II banking
|
||||||
lda #$3b
|
lda #$3B
|
||||||
sta $dd02
|
sta CIA2_DDRA
|
||||||
|
|
||||||
;; Set IEC bus oto its initial idle state
|
;; Set IEC bus to its initial idle state
|
||||||
jsr iec_set_idle
|
jmp iec_set_idle
|
||||||
|
|
||||||
rts
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Byte telling Kernal version; we can probably put just about anything here, but we want to be distinct from everyone else!
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
;;
|
||||||
|
;; This byte identifies Kernal revision. Sources:
|
||||||
|
;; - [CM64] Compute's Mapping the Commodore 64 (page 242/243)
|
||||||
|
;; - [MM] Marko Mäkelä article, http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/c64/revisions.txt
|
||||||
|
;; - [VICE] Checked with ROMs included in VICE emulator
|
||||||
|
;;
|
||||||
|
;; IDEA: put here a value, that is different from any version currently known, as
|
||||||
|
;; a warning that this is not a Commodore Kernal. Currently known numbers for C64 are:
|
||||||
|
;;
|
||||||
|
;; - $00 - [CM64] then current number [MM] 901227-02 [VICE] C64 Revision 2
|
||||||
|
;; - $03 - [CM64] (not mentionned) [MM] 901227-02, 901227-03 [VICE] C64 Revision 3
|
||||||
|
;; - $43 - [CM64] (not mentionned) [MM] 251104-04 [VICE] SX-64
|
||||||
|
;; - $64 - [CM64] PET64 ROM [MM] (not mentionned) [VICE] PET64
|
||||||
|
;; - $AA - [CM64] first version of ROM [MM] 901227-01 [VICE] C64 Revision 1
|
||||||
|
;;
|
||||||
|
;; Values from unofficial ROMs:
|
||||||
|
;; - $03 - SuperCPU ROM 1.40, 2.04, also unofficial 0.7 ROM from [VICE]
|
||||||
|
;;
|
||||||
|
;; Values from other Commodore machines:
|
||||||
|
;; C128:
|
||||||
|
;; - $01 - see https://www.pagetable.com/?p=1058
|
||||||
|
;; - $02 - unreleased updated ROM, see https://www.pagetable.com/?p=1058
|
||||||
|
;;
|
||||||
|
;; XXX check more unofficial C64 ROMs (JiffyDOS, DolphinDOS, etc.) and other machines
|
||||||
|
;; VIC-20, PET, CBM II, 264 series, C65 prototypes, other sources for C128 ROMs
|
||||||
|
;;
|
||||||
|
|
||||||
|
|
||||||
|
kernal_revision:
|
||||||
|
.byte $FF
|
||||||
@@ -6,7 +6,7 @@ iec_wait20us:
|
|||||||
;; PAL:
|
;; PAL:
|
||||||
;; - CPU frequency 0.985248 MHz, we need to waste at least 20 cycles
|
;; - CPU frequency 0.985248 MHz, we need to waste at least 20 cycles
|
||||||
;; NTSC:
|
;; NTSC:
|
||||||
;; - CPU frequency 1.022727 MHZ, we need to waste at least 21 cycles
|
;; - CPU frequency 1.022727 MHz, we need to waste at least 21 cycles
|
||||||
|
|
||||||
;; Waste cycles by reading some unimportant memory location
|
;; Waste cycles by reading some unimportant memory location
|
||||||
;; in order not to clutter VICE debug logs
|
;; in order not to clutter VICE debug logs
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ iec_wait60us:
|
|||||||
;; PAL:
|
;; PAL:
|
||||||
;; - CPU frequency 0.985248 MHz, we need to waste at least 60 cycles
|
;; - CPU frequency 0.985248 MHz, we need to waste at least 60 cycles
|
||||||
;; NTSC:
|
;; NTSC:
|
||||||
;; - CPU frequency 1.022727 MHZ, we need to waste at least 62 cycles
|
;; - CPU frequency 1.022727 MHz, we need to waste at least 62 cycles
|
||||||
|
|
||||||
;; Waste cycles in a loop
|
;; Waste cycles in a loop
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,7 +1,9 @@
|
|||||||
|
|
||||||
default_irq_handler:
|
default_irq_handler:
|
||||||
|
|
||||||
jsr blink_cursor
|
jsr blink_cursor
|
||||||
jsr scan_keyboard
|
jsr JSCNKEY
|
||||||
|
jsr JUDTIM ; update jiffy clock
|
||||||
|
|
||||||
;; Acknowledge CIA interrupt and return
|
;; Acknowledge CIA interrupt and return
|
||||||
jmp clear_cia1_interrupt_flag_and_return_from_interrupt
|
jmp clear_cia1_interrupt_flag_and_return_from_interrupt
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
default_nmi_handler:
|
||||||
|
|
||||||
|
;; Implemented according to Compute's Mapping the Commodore 64, page 74
|
||||||
|
;; and to https://www.c64-wiki.com/wiki/Interrupt
|
||||||
|
|
||||||
|
;; Save registers, sequence according to Compute's Mapping the Commodore 64, page 73
|
||||||
|
pha
|
||||||
|
txa
|
||||||
|
pha
|
||||||
|
tya
|
||||||
|
pha
|
||||||
|
|
||||||
|
;; XXX: RS-232 support is not implemented
|
||||||
|
|
||||||
|
;; XXX confirm NMIs from CIA, or no other NMI will arrive!
|
||||||
|
|
||||||
|
jsr cartridge_check
|
||||||
|
bcc +
|
||||||
|
jmp (ICART_WARM_START)
|
||||||
|
*
|
||||||
|
|
||||||
|
;; According to C64 Wiki, if STOP key is pressed, the routine assumes warm start request
|
||||||
|
|
||||||
|
jsr JSTOP
|
||||||
|
bcs +
|
||||||
|
jmp return_from_interrupt ; no STOP pressed
|
||||||
|
*
|
||||||
|
jmp (CBINV) ; STOP + RESTORE
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
default_brk_handler:
|
||||||
|
|
||||||
|
;; Implemented according to Compute's Mapping the Commodore 64, pages 73-74
|
||||||
|
|
||||||
|
sei ; disable IRQs, to be sure they won't interfere
|
||||||
|
|
||||||
|
jsr JRESTOR
|
||||||
|
jsr JIOINIT
|
||||||
|
jsr CINT_BRK
|
||||||
|
|
||||||
|
cli
|
||||||
|
|
||||||
|
jmp (IBASIC_WARM_START)
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses.
|
||||||
|
|
||||||
|
Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point
|
||||||
|
to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify
|
||||||
|
different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original
|
||||||
|
C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory).
|
||||||
|
|
||||||
|
For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal.
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
irq_handler:
|
irq_handler:
|
||||||
;; The IRQ is a commonly messed with thing on the C64,
|
;; The IRQ is a commonly messed with thing on the C64,
|
||||||
;; so we need to handle entry points that are commonly
|
;; so we need to handle entry points that are commonly
|
||||||
@@ -7,17 +8,32 @@ irq_handler:
|
|||||||
;; $EA81 - https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb
|
;; $EA81 - https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb
|
||||||
;; Also the $0314 vector is widely used (e.g., https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb)
|
;; Also the $0314 vector is widely used (e.g., https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb)
|
||||||
|
|
||||||
;; Save registers
|
;; Save registers, sequence according to Compute's Mapping the Commodore 64, page 73
|
||||||
;; Sequence according to Compute's Mapping the 64 p73
|
|
||||||
pha
|
pha
|
||||||
txa
|
txa
|
||||||
pha
|
pha
|
||||||
tya
|
tya
|
||||||
pha
|
pha
|
||||||
|
|
||||||
;; Call interrupt routine
|
;; Check if caused by BRK
|
||||||
;; (but only if initialised)
|
|
||||||
|
;; XXX disabled for now - resets Duotris game, unknown why
|
||||||
|
; tsx
|
||||||
|
; lda $0104, x ; get the pre-interrupt processor state
|
||||||
|
; and #$10
|
||||||
|
; bne irq_handler_brk
|
||||||
|
|
||||||
|
;; Not caused by BRK - call interrupt routine (only if initialised)
|
||||||
lda CINV
|
lda CINV
|
||||||
ora CINV+1
|
ora CINV+1
|
||||||
beq default_irq_handler
|
beq +
|
||||||
jmp (CINV)
|
jmp (CINV)
|
||||||
|
*
|
||||||
|
;; Vector not initialized - call default interrupt routine
|
||||||
|
jmp default_irq_handler
|
||||||
|
|
||||||
|
irq_handler_brk:
|
||||||
|
|
||||||
|
;; Interrupt caused by BRK
|
||||||
|
jmp (CBINV)
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
nmi_handler:
|
||||||
|
|
||||||
|
sei ;; don't allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt
|
||||||
|
|
||||||
|
;; Call interrupt routine (only if initialised)
|
||||||
|
pha
|
||||||
|
lda NMINV
|
||||||
|
ora NMINV+1
|
||||||
|
beq +
|
||||||
|
pla
|
||||||
|
jmp (NMINV)
|
||||||
|
*
|
||||||
|
;; Vector not initialized - call default interrupt routine
|
||||||
|
pla
|
||||||
|
jmp default_nmi_handler
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
; Scan keyboard
|
; Scan keyboard
|
||||||
; C64 Programmer's Reference Guide Page 273
|
; C64 Programmer's Reference Guide Page 273
|
||||||
jmp scan_keyboard
|
jmp SCNKEY
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; open a logical file
|
; open a logical file
|
||||||
; C64 Programmer's Reference Guide Page 272
|
; C64 Programmer's Reference Guide Page 272
|
||||||
jmp open
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (IOPEN)
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; close a specified logical file
|
; close a specified logical file
|
||||||
; C64 Programmer's Reference Guide Page 272
|
; C64 Programmer's Reference Guide Page 272
|
||||||
jmp close
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (ICLOSE)
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; Open channel for input
|
; Open channel for input
|
||||||
; C64 Programmer's Reference Guide Page 272
|
; C64 Programmer's Reference Guide Page 272
|
||||||
jmp chkin
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (ICHKIN)
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; Open channel for output
|
; Open channel for output
|
||||||
; C64 Programmer's Reference Guide Page 272
|
; C64 Programmer's Reference Guide Page 272
|
||||||
jmp ckout
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (ICKOUT)
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; close input and output channels
|
; close input and output channels
|
||||||
; C64 Programmer's Reference Guide Page 272
|
; C64 Programmer's Reference Guide Page 272
|
||||||
jmp clrchn
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (ICLRCH)
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; Input character from channel
|
; Input character from channel
|
||||||
; C64 Programmer's Reference Guide Page 272
|
; C64 Programmer's Reference Guide Page 272
|
||||||
jmp chrin
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (IBASIN)
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; Output character to channel
|
; Output character to channel
|
||||||
; C64 Programmer's Reference Guide Page 272
|
; C64 Programmer's Reference Guide Page 272
|
||||||
jmp chrout
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (IBSOUT)
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; Scan stop key
|
; Scan stop key
|
||||||
; C64 Programmer's Reference Guide Page 273
|
; C64 Programmer's Reference Guide Page 273
|
||||||
jmp stop
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (ISTOP)
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; Get character from keyboard queue (keyboard buffer)
|
; Get character from keyboard queue (keyboard buffer)
|
||||||
; C64 Programmer's Reference Guide Page 272
|
; C64 Programmer's Reference Guide Page 272
|
||||||
jmp getin
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (IGETIN)
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
; $FFE7 - Close all files vector
|
; $FFE7 - Close all files vector
|
||||||
; (http://codebase64.org/doku.php?id=base:kernalreference)
|
; (http://codebase64.org/doku.php?id=base:kernalreference)
|
||||||
jmp clall
|
; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect
|
||||||
|
jmp (ICLALL)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
; $FFEA - Update jiffy clock vector
|
; $FFEA - Update jiffy clock vector
|
||||||
; (http://codebase64.org/doku.php?id=base:kernalreference)
|
; (http://codebase64.org/doku.php?id=base:kernalreference)
|
||||||
|
|
||||||
jmp update_jiffy_clock
|
jmp UDTIM
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
nmi_handler:
|
|
||||||
inc $D020
|
|
||||||
rti
|
|
||||||
@@ -11,24 +11,36 @@ reset_entry:
|
|||||||
txs
|
txs
|
||||||
sei
|
sei
|
||||||
|
|
||||||
; C64 PRG p269
|
|
||||||
jsr cartridge_check
|
|
||||||
|
|
||||||
; The following routine is based on reading the public KERNAL jumptable routine
|
; The following routine is based on reading the public KERNAL jumptable routine
|
||||||
; list, and making unimaginative assumptions about what should be done on reset.
|
; list, and making unimaginative assumptions about what should be done on reset.
|
||||||
; Initialising IO is obviously required. also indicated by c64 prg p269.
|
|
||||||
jsr ioinit
|
; According to example here: https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image
|
||||||
|
; the cartridge does not call RAMTAS - despite it's obviously required. So, call RAMTAS
|
||||||
|
; before the cartridge check/takeover
|
||||||
|
|
||||||
; Setting up the screen and testing ram is obviously required
|
; Setting up the screen and testing ram is obviously required
|
||||||
; also affirmed by p269 of c64 prg
|
; also affirmed by p269 of c64 prg
|
||||||
jsr ramtas
|
jsr RAMTAS
|
||||||
|
|
||||||
|
; C64 PRG p269
|
||||||
|
jsr cartridge_check
|
||||||
|
bcc +
|
||||||
|
jmp (ICART_COLD_START)
|
||||||
|
*
|
||||||
|
; Initialising IO is obviously required. Also indicated by c64 prg p269.
|
||||||
|
; Has to be after ther RAMTAS, as it clears memory, including the PAL/NTSC flag,
|
||||||
|
; which is set by IOINIT
|
||||||
|
jsr IOINIT
|
||||||
|
|
||||||
; Resetting IO vectors is obviously required, if we want interrupts to run
|
; Resetting IO vectors is obviously required, if we want interrupts to run
|
||||||
; also affirmed by c64 prg p269
|
; also affirmed by c64 prg p269
|
||||||
jsr restor
|
jsr RESTOR
|
||||||
|
|
||||||
;; "Compute's Mapping the 64" p236
|
;; "Compute's Mapping the 64" p236
|
||||||
jsr cint
|
jsr CINT
|
||||||
|
|
||||||
; What do we do when finished? A C64 jumps into the BASIC ROM
|
; What do we do when finished? A C64 jumps into the BASIC ROM
|
||||||
cli ; Allow interrupts to happen
|
cli ; Allow interrupts to happen
|
||||||
|
|
||||||
; c64 prg p269
|
; c64 prg p269
|
||||||
jmp ($a000)
|
jmp (IBASIC_COLD_START)
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
;// Operational Variables
|
;// Operational Variables
|
||||||
.alias MaxKeyRollover 3
|
.alias MaxKeyRollover 3
|
||||||
|
|
||||||
scan_keyboard:
|
scnkey:
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
sta BufferQuantity
|
sta BufferQuantity
|
||||||
@@ -204,6 +204,10 @@ ReturnNoKeys:
|
|||||||
|
|
||||||
NoActivityDetected:
|
NoActivityDetected:
|
||||||
|
|
||||||
|
;; Cancel STKEY status
|
||||||
|
lda #$FF
|
||||||
|
sta STKEY ; XXX this variable should be set by UDTIM
|
||||||
|
|
||||||
;; So cancel all bucky keys
|
;; So cancel all bucky keys
|
||||||
lda key_bucky_state
|
lda key_bucky_state
|
||||||
sta key_last_bucky_state
|
sta key_last_bucky_state
|
||||||
@@ -334,7 +338,7 @@ next_row:
|
|||||||
;; so that RUN/STOP etc can be checked easily
|
;; so that RUN/STOP etc can be checked easily
|
||||||
;; (Compute's Mapping the 64, p27)
|
;; (Compute's Mapping the 64, p27)
|
||||||
lda ScanResult+0
|
lda ScanResult+0
|
||||||
sta STKEY
|
sta STKEY ; XXX this variable should be set by UDTIM
|
||||||
|
|
||||||
;; Store de-bounce data for bucky keys
|
;; Store de-bounce data for bucky keys
|
||||||
;; (Compute's Mapping the 64, p58-59)
|
;; (Compute's Mapping the 64, p58-59)
|
||||||
@@ -538,5 +542,3 @@ KeyCanRepeat:
|
|||||||
KeyRepeatWait:
|
KeyRepeatWait:
|
||||||
pla
|
pla
|
||||||
jmp ConsiderNextKey
|
jmp ConsiderNextKey
|
||||||
|
|
||||||
|
|
||||||
@@ -9,4 +9,5 @@
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
settmo:
|
settmo:
|
||||||
|
sta TIMOUT
|
||||||
rts
|
rts
|
||||||
@@ -8,5 +8,5 @@
|
|||||||
;; CPU registers that has to be preserved (see [RG64]): .Y
|
;; CPU registers that has to be preserved (see [RG64]): .Y
|
||||||
;;
|
;;
|
||||||
|
|
||||||
update_jiffy_clock:
|
udtim:
|
||||||
rts
|
rts
|
||||||
+7
-25
@@ -20,8 +20,10 @@ vector:
|
|||||||
|
|
||||||
.scope
|
.scope
|
||||||
|
|
||||||
;; Temporary storage location
|
;; Temporary storage location - checked on real C64 that this is the
|
||||||
.alias _caller_arr_ptr CMP0
|
;; address originally used; after calling VECTOR and checking zero page
|
||||||
|
;; area afterwards, the address could be found there
|
||||||
|
.alias _caller_arr_ptr MEMUS
|
||||||
|
|
||||||
;; According to 'Compute's Mapping the Commodore 64' page 237,
|
;; According to 'Compute's Mapping the Commodore 64' page 237,
|
||||||
;; the CBM implementation does not disable IRQs - yet, the
|
;; the CBM implementation does not disable IRQs - yet, the
|
||||||
@@ -32,9 +34,10 @@ vector:
|
|||||||
php
|
php
|
||||||
cli
|
cli
|
||||||
|
|
||||||
;; Prepare the user data pointer
|
;; Prepare the user data pointer - strange order to reduce risk
|
||||||
stx _caller_arr_ptr + 0
|
;; of potential similarity to the original routine
|
||||||
sty _caller_arr_ptr + 1
|
sty _caller_arr_ptr + 1
|
||||||
|
stx _caller_arr_ptr + 0
|
||||||
|
|
||||||
;; Select routine variant - store or restore vectors
|
;; Select routine variant - store or restore vectors
|
||||||
ldy #$1F
|
ldy #$1F
|
||||||
@@ -65,24 +68,3 @@ vector_restore:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
.scend
|
.scend
|
||||||
|
|
||||||
;; XXX below we have quite a lot of data... should we decouple them?
|
|
||||||
|
|
||||||
vector_defaults:
|
|
||||||
.word default_irq_handler ;; CINV
|
|
||||||
.word $0000 ;; CBINV XXX implement this
|
|
||||||
.word $0000 ;; NMINV XXX implement this
|
|
||||||
|
|
||||||
.word open ;; IOPEN
|
|
||||||
.word close ;; ICLOSE
|
|
||||||
.word chkin ;; ICHKIN
|
|
||||||
.word ckout ;; ICKOUT
|
|
||||||
.word clrchn ;; ICLRCH
|
|
||||||
.word chrin ;; IBASIN
|
|
||||||
.word chrout ;; IBSOUT
|
|
||||||
.word stop ;; ISTOP
|
|
||||||
.word getin ;; IGETIN
|
|
||||||
.word clall ;; ICLALL
|
|
||||||
.word $0000 ;; USRCMD XXX implement this
|
|
||||||
.word load ;; ILOAD
|
|
||||||
.word save ;; ISAVE
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
;;
|
||||||
|
;; Default values for Kernal vectors - described in:
|
||||||
|
;;
|
||||||
|
;; - [RG64] C64 Programmer's Reference Guide - page 293 (RESTOR), 304 (VECTOR)
|
||||||
|
;; - [CM64] Compute's Mapping the Commodore 64 - page 237
|
||||||
|
;;
|
||||||
|
|
||||||
|
vector_defaults:
|
||||||
|
.word default_irq_handler ;; CINV
|
||||||
|
.word default_brk_handler ;; CBINV
|
||||||
|
.word default_nmi_handler ;; NMINV
|
||||||
|
|
||||||
|
.word open ;; IOPEN
|
||||||
|
.word close ;; ICLOSE
|
||||||
|
.word chkin ;; ICHKIN
|
||||||
|
.word ckout ;; ICKOUT
|
||||||
|
.word clrchn ;; ICLRCH
|
||||||
|
.word chrin ;; IBASIN
|
||||||
|
.word chrout ;; IBSOUT
|
||||||
|
.word stop ;; ISTOP
|
||||||
|
.word getin ;; IGETIN
|
||||||
|
.word clall ;; ICLALL
|
||||||
|
.word default_brk_handler ;; USRCMD
|
||||||
|
.word load ;; ILOAD
|
||||||
|
.word save ;; ISAVE
|
||||||
+9
-4
@@ -159,15 +159,20 @@ char *error_list[]={
|
|||||||
"LOAD", // https://www.discogs.com/Gimmik-Load-Error/release/482462
|
"LOAD", // https://www.discogs.com/Gimmik-Load-Error/release/482462
|
||||||
// Non-error messages
|
// Non-error messages
|
||||||
"READY.\r", // #29 // https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconc_whatistsonative.htm https://github.com/stefanhaustein/expressionparser
|
"READY.\r", // #29 // https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconc_whatistsonative.htm https://github.com/stefanhaustein/expressionparser
|
||||||
"LOADING", // #30 // https://community.tibco.com/wiki/how-show-loading-prompt-when-reloading-external-data
|
"NTSC, ", // #30
|
||||||
"VERIFYING", // https://discussions.apple.com/thread/8087203
|
"PAL, ", // #31
|
||||||
"SAVING",
|
"", // unused for now
|
||||||
"ERROR", // #33 // Simply the word error that is attached to the other parts of messages https://fjkraan.home.xs4all.nl/comp/apple2faq/app2asoftfaq.html
|
"ERROR", // #33 // Simply the word error that is attached to the other parts of messages https://fjkraan.home.xs4all.nl/comp/apple2faq/app2asoftfaq.html
|
||||||
"BYTES FREE.\r\r", // #34 // https://github.com/stefanhaustein/expressionparser
|
"BYTES FREE\r\r", // #34 // https://github.com/stefanhaustein/expressionparser
|
||||||
"MEMORY CORRUPT", // #35
|
"MEMORY CORRUPT", // #35
|
||||||
"NOT IMPLEMENTED", // #36
|
"NOT IMPLEMENTED", // #36
|
||||||
NULL};
|
NULL};
|
||||||
|
|
||||||
|
// XXX: create separate list for Kernal
|
||||||
|
// "LOADING", // #30 // https://community.tibco.com/wiki/how-show-loading-prompt-when-reloading-external-data
|
||||||
|
// "VERIFYING", // https://discussions.apple.com/thread/8087203
|
||||||
|
// "SAVING",
|
||||||
|
|
||||||
// Token $FF is end of message, so we can have only 255 unique words
|
// Token $FF is end of message, so we can have only 255 unique words
|
||||||
#define MAX_WORDS 255
|
#define MAX_WORDS 255
|
||||||
char *words[MAX_WORDS];
|
char *words[MAX_WORDS];
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
$01 + STA $02A6 (PAL/NTSC flag)
|
||||||
|
|
||||||
|
Instruction and a part (storing data into a decumented variable). Not copyrightable.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
$02 + LDA #$01 + STA (address does not match)
|
||||||
|
|
||||||
|
Instruction + some parts. Not copyrightable.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
$02 + LDA #$7F + STA (address does not match)
|
||||||
|
|
||||||
|
Instruction + some parts. Not copyrightable.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
$03 + JMP $F409
|
||||||
|
|
||||||
|
Instruction + some part. Not copyrightable.
|
||||||
Loaded 100 of 128 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user