Skip to content

Commit

Permalink
removed papertape code out of CMOS monitor
Browse files Browse the repository at this point in the history
- timcat uses TIM papertape to upload, so having it in sysmon is redundant
- left in NMOS 6502 toolkit, as TIM is not available there

Signed-off-by: Sven Oliver Moll <svolli@svolli.de>
  • Loading branch information
Sven Oliver Moll committed Nov 29, 2024
1 parent c73bee8 commit 65d5e46
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
6 changes: 3 additions & 3 deletions doc/monitors.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ These commands supported commands are:
| : | edit memory |
| D | disassemble |
| A | assemble |
| ; | handle papertape input |
| ; | handle papertape input (not available on CMOS version) |
| BR | read sector from internal drive |
| BW | write sector to internal drive |
| L | load file from CP/M filesystem (not available on NMOS version) |
| S | save file to CP/M filesystem (not available on NMOS version) |
| L | load file from CP/M filesystem (not available on NMOS version) |
| S | save file to CP/M filesystem (not available on NMOS version) |
| $ | show directory of CP/M filesystem (not available on NMOS version) |

Command examples:
Expand Down
1 change: 0 additions & 1 deletion src/65c02/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ add_executable(native_kernel
mon/disassembler.s
mon/hexdump.s
mon/interndrive.s
mon/papertape.s
mon/registers.s
mon/storage.s
mon/table65sc02.s
Expand Down
14 changes: 12 additions & 2 deletions src/65c02/mon/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
; [X] BRK handler
; [X] native ROM integration
; [X] NMOS 6502 toolkit integration
; [ ] consistent current address pointer for 'm', 'd', set upon init to PC
; [X] consistent current address pointer for 'm', 'd', set upon init to PC
; [ ] merge code?
; --- release build
; [ ] memory read/write respects bank register
Expand All @@ -31,8 +31,10 @@
.define PROMPT '>'
.ifp02
.define LOADSAVE 0
.define PAPERTAPE 1
.else
.define LOADSAVE 1
.define PAPERTAPE 0
.endif
; TODO: replace in code
.define HEXPREFIX ':'
Expand Down Expand Up @@ -132,8 +134,10 @@ INBUF_SIZE := $4e ; 78 characters to fit 80 char screen width
; from interndrive.s
.import blockrw

.if PAPERTAPE
; from papertape.s
.import papertape
.endif

; from registers.s
.import go
Expand Down Expand Up @@ -274,14 +278,20 @@ handleenter:
rts

@cmds:
.byte 0,":;~ABDGMR"
.byte 0,":"
.if PAPERTAPE
.byte ";"
.endif
.byte "~ABDGMR"
.if LOADSAVE
.byte "$LS"
.endif
@funcs:
.word empty-1 ; $00
.word hexenter-1 ; :
.if PAPERTAPE
.word papertape-1 ; ;
.endif
.word regedit-1 ; ~
.word assemble-1 ; A
.word blockrw-1 ; B
Expand Down
10 changes: 6 additions & 4 deletions src/65c02/mon/registers.s
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ mon_hello:
sei ; sanitize
cld ; sanitize
.ifp02
; on NMOS no need to store interrupt number
.else
phy ; save index for later check on BRK
lda (TMP16)
phy
pha
.endif
jsr PRINT
Expand All @@ -153,10 +154,11 @@ mon_hello:
bne :-
:
.ifp02
; on NMOS doesn't use interrupt numbers
.else
; on CMOS get interrupt number
pla
ply
ply ; load index just for zero flag = BRK
bne :+
jsr prhex8
:
Expand All @@ -181,10 +183,10 @@ regdump:
jsr PRINT
.if REGSTART
.byte 10," PC AC XR YR SP NV-BDIZC"
; FFF2 14 43 45 FF 00100110
; ~FFF2 53 56 4F FF 00100110
.else
.byte 10," PC BK AC XR YR SP NV-BDIZC"
; FFF2 00 14 43 45 FF 00100110
; ~FFF2 00 53 56 4F FF 00100110
.endif
.byte 10," ~",0
lda R_PC+1
Expand Down
6 changes: 3 additions & 3 deletions src/65c02/native_rom/kernel.s
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ reset:

@no65c02loop:
jsr PRINT
.byte 13, "NMOS 6502 not supported, key to boot sector 2 ", 0
.byte 13, "NMOS 6502 not supported, 2) for NMOS toolkit ", 0
:
iny
bne :-
Expand Down Expand Up @@ -209,7 +209,7 @@ boota:
.byte "Go",10,0
beq execram ; will be run using NMOS 6502

xgensine:
b2gensine:
ldx #$02 ; tools bank starts with jmp ($e003,x)
.byte $2c
filebrowser:
Expand Down Expand Up @@ -290,7 +290,7 @@ brkjump:
@jumptable:
.word @user, chrinuc, chrcfg, prhex8, prhex16 ; $00-$04
.word cpmname, cpmload, cpmsave, cpmerase, cpmdir ; $05-$09
.word vt100, copybios, xinputline, xgensine, mon_brk ; $0a-$0e
.word vt100, copybios, xinputline, b2gensine, mon_brk ; $0a-$0e
@jumptableend:

signature:
Expand Down

0 comments on commit 65d5e46

Please sign in to comment.