Skip to content

Commit

Permalink
update to system ROM V1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Dietrich-L committed Dec 10, 2024
1 parent d0dd5a7 commit d09e09e
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 74 deletions.
2 changes: 1 addition & 1 deletion FORTH/FORTH PROGS/sysinfo.blk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
( Sysinfo D. Lausberg 15.5.21 ) FORTH DEFINITIONS IMMEDIATE hex : cls 0c emit 0 drop ; : DPH F8 @ ; 1 variable Drive : .Ver dup 0F / 30 + emit ." ." 000F and . ; : bdosver 00 0C BDOS drop 00ff and ; : biosver 00 0C BDOS drop 100 / ; : .promver e71a 5 0 do dup c@ emit 1+ loop drop ; : set-defdrv drive c@ 0E BDOS drop drop ; : get-defdrv 0 D BDOS drop FF and drive ! ; : .Header cls ." Junior Computer ][ System Status " CR ; --> ( Sysinfo D. Lausberg 15.5.21 ) : drvparm dph 6 + c@ 1+ dup 6 .R dph 7 + c@ 6 .R dph 8 + @ 1+ dup 8 .R 4 */ 8 .R dph 0A + c@ 8 * 8 .R CR ; : .drives CR decimal get-defdrv ." Drive SPB SPBDIV BPD Cap kB Dir #" CR 8 0 do ." " I 41 + emit 3a emit 2 spaces I 0E BDOS if ." ------ " CR else drvparm endif drop loop CR set-defdrv ; --> ( Sysinfo D. Lausberg 15.5.21 ) : .Sys cr cr .Header hex ." BDOS V" bdosver .VER cr ." BIOS V" biosver .VER CR ." PROM V" .promver cr .drives cr 0 bdos ; --> ( Sysinfo D. Lausberg 15.5.21 ) decimal latest 12 +origin ! here 30 +Origin ! ;S
( Sysinfo D. Lausberg 15.5.21 ) FORTH DEFINITIONS IMMEDIATE hex : cls 0c emit 0 drop ; : DPH F8 @ ; 1 variable Drive : .Ver dup 0F / 30 + emit ." ." 000F and . ; : bdosver 00 0C BDOS drop 00ff and ; : biosver 00 0C BDOS drop 100 / ; : .promver e7a9 5 0 do dup c@ emit 1+ loop drop ; : set-defdrv drive c@ 0E BDOS drop drop ; : get-defdrv 0 D BDOS drop FF and drive ! ; : .Header cls ." Junior Computer ][ System Status " CR ; --> ( Sysinfo D. Lausberg 15.5.21 ) : drvparm dph 6 + c@ 1+ dup 6 .R dph 7 + c@ 6 .R dph 8 + @ 1+ dup 8 .R 4 */ 8 .R dph 0A + c@ 8 * 8 .R CR ; : .drives CR decimal get-defdrv ." Drive SPB SPBDIV BPD Cap kB Dir #" CR 8 0 do ." " I 41 + emit 3a emit 2 spaces I 0E BDOS if ." ------ " CR else drvparm endif drop loop CR set-defdrv ; --> ( Sysinfo D. Lausberg 15.5.21 ) : .Sys cr cr .Header hex ." BDOS V" bdosver .VER cr ." BIOS V" biosver .VER CR ." PROM V" .promver cr .drives cr 0 bdos ; --> ( Sysinfo D. Lausberg 15.5.21 ) decimal latest 12 +origin ! here 30 +Origin ! ;S
Binary file modified Images/BASIC.IMG
Binary file not shown.
Binary file modified Images/BOOT.SYS
Binary file not shown.
Binary file added Images/CPM65.SYS
Binary file not shown.
Binary file modified Images/FORTH.IMG
Binary file not shown.
44 changes: 19 additions & 25 deletions SYSPROGS/DEBUG.ASM
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
;V1.7 18.02.23 error correction dump would not stop
;V1.8 08.08.23 QUIT restores original IRQ vetor
;V1.9 28.03.24 replaces IRQ routine, saves $F1 (destroyed by JC-II IRQ routine)
VERSION = $19
;V2.0 15.11.24 version for ROM 1.1.4
VERSION = $20

;SYSTEM CONSTANTS

DMA = $FE
DPH = $F8
FCB1 = $F6
BDOS = $F0
INBUF = $EC
Expand All @@ -23,11 +25,13 @@ ZA = 2
STOACC = $1A77
TPA = $2000
MEMTOP = $B800
TAPEIRQ_OFF = $EF00
IRQ = $1A78
IRQUSR = $1A7C
IRQVECT = $1A7E

IER = $1E ; Interrupt enable register VIA2
IOBASE = $14

;BIOS COMMANDS

CBOOT = 0
Expand Down Expand Up @@ -659,24 +663,10 @@ REPEA5 LDA #EOL
RTS

;====== BREAK-ENTRY =============
IRQ_NEW STA STOACC ; save current accumulator
PLA ; get current processor status in A
SEI
PHA ; and push it back to stack
AND #$10 ; mask break flag
BNE USRBRK ; if break flag set, jump to user break handler
LDA STOACC
RTI

USRBRK LDA STOACC
JMP (IRQ)


BREAK STA ACCU
STY YREG
STX XREG
LDA F1BUF ;restore $F1
STA $F1
PLA
STA STATUS
PLA
Expand Down Expand Up @@ -741,9 +731,18 @@ BREAK8 LDA #0

;====== SUBROUTINES ==============

INIT LDA $F1 ;save $F1
STA F1BUF
JSR TAPEIRQ_OFF
INIT LDA #TPA/256 ;PC = TPA
STA PCH
LDA #TPA
STA PCL
LDA #0
STA IOBASE
LDY #18 ;set IOBASE from BIOS
LDA (DPH),Y
STA IOBASE+1
LDY #IER ; select interrupt enable register
LDA #$7F
STA (IOBASE),Y ; disable all VIA2 interrupts
LDA IRQ
STA IRQBUF ;save IRQ vector
LDA IRQ+1
Expand All @@ -752,10 +751,6 @@ INIT LDA $F1 ;save $F1
STA IRQ
LDA #BREAK/256
STA IRQ+1
LDA #IRQ_NEW ;SET new IRQ VEKTOR
STA IRQVECT
LDA #IRQ_NEW/256
STA IRQVECT+1
LDX #3*MAXBNR
LDA #$FF
INIT1 STA BTAB,X
Expand Down Expand Up @@ -2003,13 +1998,12 @@ FLAGNR DB 0
JMP_FLAG DB 0

HEX DW 0
PNTBUF DW 0
PNTBUF DW TPA
BEGAD DW 0
ENDAD DW 0
CURAD DW TPA

IRQBUF DW 0
F1BUF DB 0

SRCBUF DS 16

Expand Down
Binary file modified SYSPROGS/DEBUG.COM
Binary file not shown.
30 changes: 21 additions & 9 deletions System/BIOS.ASM
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
;V0.9 25.04.24 $FC & $FD buffered
;V1.0 29.04.24 $1A buffered
;V1.1 17.05.24 switch to STD ROM routines,CONST corrected
;V1.2 07.12.24 changes for BIOS ROM V1.1.4

VERSION = $11 ;VERSION NUMBER
VERSION = $12 ;VERSION NUMBER

;FORMAT SD 1024 KBYTES/DISK

Expand All @@ -27,14 +28,18 @@ DIRBFV = $FC ;DIRBF-VECTOR
BLKB = $FA ;BIOS Block Pointer
DPHV = $F8 ;DPH-VECTOR
JPBDOS = $F0
MODE = $1A ;SD Mode byte 0 byte mode; <>0 block mode
IOB = $14
MODE = $DB ;SD Mode byte 0 byte mode; <>0 block mode
IOB = $14 ;IOBASE
FGCB = $16 ;FGCBASE
CARD3B = $18 ;CARD3BASE
TEMP = $FC
YSAV = $FD

;SYSTEM CONSTANTS

BLKBUF = $600 ;default buffer
BLKBUF = $600 ;default buffer

FGCBASE = $1000 ;FGC card @ K4 = $1000

CCP = $CC00
BEGIN = $D800
Expand All @@ -55,9 +60,9 @@ SDC1_ID = $24 ; SD on I/O card

; Device Command Constants ****************************************************

CMD_INIT = 0
CMD_INIT = 0 ;init SD card

CMD_BOOT = 36
CMD_BOOT = 36 ;boot from SD
CMD_READ_BUF = 37
CMD_WRITE_BUF = 38

Expand Down Expand Up @@ -132,6 +137,7 @@ DPHA DW DIRBF ;DISK PARAMETER HEADER
DB BATSIZ
SD_TYPE DB 0 ;SD card type
IOBASEH DB 0 ;IOBASE high byte
CARD3BASEH DB 0 ;CARD3BASE high byte

BAT DB %11110000 ;Block Allocation Table Drive A-D
DS BATSIZ ;max. 1 page
Expand Down Expand Up @@ -459,10 +465,16 @@ PUSH_E1 LDX ZP_IOB,Y ;load page zero adr
STA ZP_BUF,Y ;and save it
DEY
BPL PUSH_E1
INY ;restore IOB
INY ;restore IOB & FGCB & CARD3B
STY IOB
STY FGCB
STY CARD3B
LDA IOBASEH
STA IOB+1
LDA #FGCBASE/256 ;fix @ $1000
STA FGCB+1
LDA CARD3BASEH
STA CARD3B+1
LDY Y_BUF
PLA
RTS
Expand All @@ -485,8 +497,8 @@ PULL_E1 LDX ZP_IOB,Y ;load page zero adr
RTS


ZP_IOB DB $14,$15,$FD
ZP_CELL DB $E3,$E2,$E1,$E0,$FC,$1A
ZP_IOB DB $14,$15,$16,$17,$18,$19,$F1,$FD
ZP_CELL DB $E3,$E2,$E1,$E0,$FC,$DB
ZP_BUF DS ZP_BUF-ZP_IOB,0

Y_BUF DB 0
Expand Down
Binary file modified System/BIOS.COM
Binary file not shown.
21 changes: 18 additions & 3 deletions System/BOOTSYS.ASM
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
;V1.6 08.05.24 IRQs shut down
;V1.7 17.05.24 switch to STD ROM routines
;V1.8 08.06.24 buffering SD_TYPE & IOBASE+1 corrected
Version = $18
;V1.9 13.06.24 calling SELDSK with undefined A could lead to crash
;V2.0 18.06.24 SD read error recovery
;V2.1 07.12.24 changes for ROM BIOS 1.1.4
Version = $21


;Parameter
Expand All @@ -38,8 +41,9 @@ NUM32 = $F8 ;LBA vector to 1. Cluster of disc image

BLKBUF = $DC ;BLKBUF adr for SD

SD_TYPE = $1A
SD_TYPE = $DB
IOBASE = $14
CARD3BASE = $18
PSTR = $EA

BLKB = $600
Expand Down Expand Up @@ -78,6 +82,7 @@ HEXDIG = $E09A ;print HEX in A
PRTCHR = $E052 ;COUT
CMDDEV = $E0BA

CMD_INIT = 0 ;init SD card
CMD_READ = 34 ;load sector in LBA to (BLKBUF)

ROM_MONITOR = $E000 ;Monitor cold start
Expand All @@ -93,6 +98,8 @@ BOOT LDA #BOOTM ;print boot message
STA SD_TYPB
LDA IOBASE+1 ;save IOBASE high
STA IOBUF
LDA CARD3BASE+1 ;save CARD3BASE high
STA CARD3BUF
LDY #3 ;set LBA to current file
BOOT3 LDA NUM32,Y
STA LBA,Y
Expand Down Expand Up @@ -122,13 +129,17 @@ BOOT1 JSR INCLBA ;load CCP from sector 1 = next sector
LDA #IMAGE ;A: in $00..$04, A=0
JSR MOUNT*3+BIOS ;mount A:
BCS B_ERR
LDA #0
JSR SELDSK*3+BIOS ;BIOS SELDSK command
LDY #17
LDA SD_TYPB
STA (DPH),Y ;save SD_TYPE to BIOS
INY
LDA IOBUF
STA (DPH),Y ;save IOBASE high to BIOS
INY
LDA CARD3BUF
STA (DPH),Y ;save IOBASE high to BIOS
JMP BIOS ;COLD BOOT

B_ERR1 LDA #ERR1M
Expand All @@ -149,6 +160,7 @@ MINUS_2 DB $FE,$FF,$FF,$FF ;-2

SD_TYPB DB 0
IOBUF DB 0
CARD3BUF DB 0

;--- MESSAGES -----------------------------

Expand Down Expand Up @@ -182,7 +194,10 @@ R_LBA LDX #LBA ;read sector in LBA to (BLKBUF)
CLC
RTS

R_LBA1 SEC ;Error
R_LBA1 LDA #CMD_INIT ;on error retry
JSR CMDDEV
BCS R_LBA
SEC ;Error
RTS


Expand Down
Binary file modified System/bootsys.com
Binary file not shown.
Binary file modified Testbed/BDOS.COM
Binary file not shown.
Loading

0 comments on commit d09e09e

Please sign in to comment.