Dbug wrote: ↑Thu Oct 29, 2020 2:46 pm
Is your game for Tape or Disk configurations?
Do you have "Data" that you READ/POKE on startup in your program?
Disk, using SEDORIC commands for sequential file access. Disk build via OSDK Tap2dsk tool (and old2mfm).
And yes, it does READ data at start of the program to variables (arrays).
Does that matter? And can it indeed cause it mostly working but sometimes not?
Read statements are at 10700-10800 for the main initialisation routine for pawn co-ordinates and dice print strings and 16460-14920 for reading data for the menu and pulldown menu system. Both are called at game start before any disc operation (and not at any further point).
My present SAVE and LOAD routines:
(Explanation of GOSUBs used: 16100 is create window, 15740 is validated input routine, 15090 restore screen from window, 16140 is now disabled by RAM and was the routine for handling errors using ERR SET / ERR GOTO)
Code: Select all
12900 'SAVE GAME
12910 :
12920 XC=8:YC=8:B=30:H=7:GOSUB16100
12940 PRINT@10,10;CHR$(130);"Save game.";CHR$(129)
12960 PRINT@10,12;CHR$(131);"Enter filename:";CHR$(129)
12970 XC=10:YC=14:ML=8:TT$=AL$:GOSUB15740:GOSUB15090:IFAN$=""THENRETURN
12980 AN$=AN$+".SAV"
12990 'ERR SET: ERRGOTO 13320
13000 SEARCH AN$
13020 IFEF=0THENGOTO13120
13030 : XC=8:YC=8:B=30:H=8:GOSUB16100
13050 : PRINT@10,10;CHR$(131);"Filename exists.";CHR$(129)
13060 : PRINT@10,11;CHR$(131);"Replace?";CHR$(129)
13070 : XC=15:YC=13:MN=5:GOSUB15130
13080 : GOSUB15090
13090 : IFM=2THENRETURN
13100 : DESTROY AN$
13120 OPEN S,AN$,1
13130 : PUT 1,BS
13140 : FORN=0TO3
13150 : PUT 1,NP(N)
13160 : NEXTN
13170 : FORN=0TO3
13180 : FORM=0TO3
13190 : PUT 1,SP(N,M)
13200 : NEXTM
13210 : NEXTN
13220 : FORN=0TO3
13230 : FORM=0TO3
13240 : PUT 1,SC(N,M,0)
13250 : PUT 1,SC(N,M,1)
13260 : NEXTM
13270 : NEXTN
13280 : FORN=0TO3
13290 : PUT 1,SP$(N)
13300 : NEXTN
13310 CLOSE 1
13311 'ERR OFF: RETURN
13312 'ERROR HANDLING
13320 'GOSUB16410: ERR OFF
13330 RETURN
13340 :
13350 'LOAD GAME
13360 :
13370 XC=8:YC=8:B=30:H=8
13371 GOSUB16100
13390 PRINT@10,10;CHR$(131);"Load game.";CHR$(129)
13391 'TBD. ROUTINE TO SHOW DIR
13530 PRINT@10,12;CHR$(131);"Filename (without .SAV):";CHR$(129)
13540 XC=10:YC=14:ML=8:TT$=AL$:GOSUB15740:GOSUB15090:IFAN$=""THENRETURN
13550 AN$=AN$+".SAV"
13551 'ERR SET: ERRGOTO 13800
13552 SEARCH AN$
13553 IFEF<>0THENGOTO13560
13554 : XC=8:YC=8:B=30:H=6:GOSUB16100
13555 : PRINT@10,10;CHR$(131);"File not found.";CHR$(129)
13556 : PRINT@10,11;CHR$(131);"Press key.";CHR$(129):GOSUB16320
13557 : GOSUB15090:RETURN
13560 OPEN S,AN$,1
13600 : TAKE 1,BS
13610 : FORN=0TO3
13620 : TAKE 1,NP(N)
13630 : NEXTN
13640 : FORN=0TO3
13650 : FORM=0TO3
13660 : TAKE 1,SP(N,M)
13670 : NEXTM
13680 : NEXTN
13690 : FORN=0TO3
13700 : FORM=0TO3
13710 : TAKE 1,SC(N,M,0)
13720 : TAKE 1,SC(N,M,1)
13730 : NEXTM
13740 : NEXTN
13750 : FORN=0TO3
13760 : TAKE 1,SP$(N)
13770 : NEXTN
13780 CLOSE 1
13790 EI=2
13794 'ERR OFF
13795 'RETURN
13799 'ERROR HANDLING
13800 'GOSUB16410: ERR OFF
13810 RETURN