Skip to content

Commit 99b1383

Browse files
fix bug in SAVE start addr. Lo byte was always bash0
1 parent 22ce444 commit 99b1383

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

nos/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ nos.atr: src/nos.s
1414
mads src/nos.s -l:nos.lst -o:$(OUTFILE)
1515

1616
clean:
17-
rm -rf nos* dist/nos*
17+
rm -rf nos*
1818

nos/src/nos.s

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2502,18 +2502,24 @@ JMP_OVERLAY:
25022502
;---------------------------------------
25032503
DO_OVERLAY:
25042504
;---------------------------------------
2505-
LDA OVL_SECT_TAB_L,X ; Get ATR sector where code is stored
2505+
; Use table to get sector where overlay is stored
2506+
LDA OVL_SECT_TAB_L,X
25062507
STA GET_SECTOR_DCB+DCB_IDX.DAUX1
25072508

2508-
LDA OVL_SECT_TAB_H,X
2509+
; Currently, all overlays exist in sectors < 01xx,
2510+
; so $00 can be assumed for high byte of sector number.
2511+
; LDA OVL_SECT_TAB_H,X
2512+
LDA #$00
25092513
STA GET_SECTOR_DCB+DCB_IDX.DAUX2
25102514

2511-
LDA OVL_SECT_CNT_TAB,X ; Get number of sectors to load
2512-
STA SECT_CNT ; Stash sector count
2515+
; Get the number of sectors to load
2516+
LDA OVL_SECT_CNT_TAB,X
2517+
STA SECT_CNT
25132518

2519+
; Quit if requested overlay command is already in memory
25142520
LDA CMD ; Get current command
25152521
CMP OVLPRV ; Is this already in memory?
2516-
BEQ OVERLAY_DONE
2522+
BEQ OVERLAY_DONE ; Quit if already in memory
25172523
STA OVLPRV ; Update previous overlay command
25182524

25192525
; Initialize the base address for the code to be loaded
@@ -3592,20 +3598,20 @@ OVL_SECT_TAB_L:
35923598
.BYTE <(OVL_SAVE/SECTOR_SIZE-$0D)
35933599
.BYTE <(OVL_XEP/SECTOR_SIZE-$0D)
35943600

3595-
OVL_SECT_TAB_H:
3596-
.BYTE >(OVL_AUTORUN/SECTOR_SIZE-$0D)
3597-
.BYTE >(OVL_BASIC/SECTOR_SIZE-$0D)
3598-
.BYTE >(OVL_DIR/SECTOR_SIZE-$0D)
3599-
.BYTE >(OVL_DUMP/SECTOR_SIZE-$0D)
3600-
.BYTE >(OVL_FILL/SECTOR_SIZE-$0D)
3601-
.BYTE >(OVL_HELP/SECTOR_SIZE-$0D)
3602-
.BYTE >(OVL_NCOPY/SECTOR_SIZE-$0D)
3603-
.BYTE >(OVL_NCOPY1/SECTOR_SIZE-$0D)
3604-
.BYTE >(OVL_NCOPY2/SECTOR_SIZE-$0D)
3605-
.BYTE >(OVL_NTRANS/SECTOR_SIZE-$0D)
3606-
.BYTE >(OVL_REENTER/SECTOR_SIZE-$0D)
3607-
.BYTE >(OVL_SAVE/SECTOR_SIZE-$0D)
3608-
.BYTE >(OVL_XEP/SECTOR_SIZE-$0D)
3601+
;OVL_SECT_TAB_H:
3602+
; .BYTE >(OVL_AUTORUN/SECTOR_SIZE-$0D)
3603+
; .BYTE >(OVL_BASIC/SECTOR_SIZE-$0D)
3604+
; .BYTE >(OVL_DIR/SECTOR_SIZE-$0D)
3605+
; .BYTE >(OVL_DUMP/SECTOR_SIZE-$0D)
3606+
; .BYTE >(OVL_FILL/SECTOR_SIZE-$0D)
3607+
; .BYTE >(OVL_HELP/SECTOR_SIZE-$0D)
3608+
; .BYTE >(OVL_NCOPY/SECTOR_SIZE-$0D)
3609+
; .BYTE >(OVL_NCOPY1/SECTOR_SIZE-$0D)
3610+
; .BYTE >(OVL_NCOPY2/SECTOR_SIZE-$0D)
3611+
; .BYTE >(OVL_NTRANS/SECTOR_SIZE-$0D)
3612+
; .BYTE >(OVL_REENTER/SECTOR_SIZE-$0D)
3613+
; .BYTE >(OVL_SAVE/SECTOR_SIZE-$0D)
3614+
; .BYTE >(OVL_XEP/SECTOR_SIZE-$0D)
36093615

36103616
; Derive number of ATR sectors used to store code
36113617
OVL_SECT_CNT_TAB:
@@ -3633,7 +3639,7 @@ CIOHND .WORD OPEN-1
36333639

36343640
; BANNERS
36353641

3636-
BREADY .BYTE '#FUJINET NOS v0.7.0',EOL
3642+
BREADY .BYTE '#FUJINET NOS v0.7.1',EOL
36373643
BERROR .BYTE '#FUJINET ERROR',EOL
36383644

36393645
; MESSAGES
@@ -5072,7 +5078,7 @@ SAVE_SKIP2:
50725078
@: LDA STL,X
50735079
STA SAVE_HEADER+2,X
50745080
DEX
5075-
BNE @-
5081+
BPL @-
50765082

50775083
LDA BLL
50785084
STA SAVE_HEADER+6
@@ -5225,7 +5231,7 @@ DIRSTA:
52255231
DTA $60,$C3,$02,$04,$00,C"2 Network "
52265232
DTA $60,$C3,$02,$04,$00,C"3 OS "
52275233
DTA $60,$C3,$02,$04,$00,C"4 "
5228-
DTA $60,$C3,$02,$04,$00,C"5 v0.7.0 "
5234+
DTA $60,$C3,$02,$04,$00,C"5 v0.7.1 "
52295235
DTA $60,$C3,$02,$04,$00,C"6 "
52305236
DTA $60,$C3,$02,$04,$00,C"7**********"
52315237
DTA $C0

0 commit comments

Comments
 (0)