fixed name saving and updated save file format

This commit is contained in:
IanSkinner1982 2021-01-24 13:43:39 -05:00
parent 7eba42ff01
commit ff1a6d1168
8 changed files with 115 additions and 86 deletions

0
Banner.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View File

@ -38,21 +38,28 @@ Saves must be named cc64.sav and placed in the same directory as cookie.prg. (to
### Save file format:
<p>
Cookies
Stop key flag
<br>Cookies
<br>Cookie gain
<br>Cursor amount
<br>Grandma amount
<br>Farm amount
<br>Mine amount
<br>Player name
<br>
<br>The stop key flag must be `0` or `1`.
<br>`0` will prevent the player from stoping the program, and `1` allows the player to stop the program.
### Example save file:
3426597
0
<br>3426597
<br>0.9823
<br>230
<br>54
<br>32
<br>1</p>
<br>1
<br>IANSKINNER1982</p>
## Credits and Notes

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

45
prg.txt Normal file → Executable file
View File

@ -1,10 +1,16 @@
0 rem !to "build/cookie.prg"
5 poke788,52:poke792,193:poke53280,14:poke53281,6:poke650,64:rem screen color, stop block and no repeat
10 cc=0:cg=0:ca=0:ga=0:fa=0:ma=0:ft$="0":mt$="0":bn$="someone"
20 ds$=chr$(17):rem cursor down
30 rs$=chr$(29):rem cursor right
40 ls$=chr$(157):rem cursor left
50 c1=15:c2=100:c3=1100:c4=12000
5 poke53280,14:poke53281,6:poke650,64:rem screen color, no keys repeat
10 open 8,8,8,"cc64.sav,s,r" : rem reads the first line
15 input#8,sb : rem of the save file and
20 close 8 : rem checks stop key flag
30 if sb=0 then poke788,52:poke792,193: rem 0=on, 1=off
40 cc=0:cg=0:ca=0:ga=0:fa=0:ma=0:ft$="0":mt$="0":bn$="someone"
50 ds$=chr$(17):rem cursor down
60 rs$=chr$(29):rem cursor right
70 ls$=chr$(157):rem cursor left
80 c1=15:c2=100:c3=1100:c4=12000
99 print"{clear}{home}"
1000 print"{clear}{home}{grey2}UCCCCCCCCCCCCCCCCCCCCCCCCC{$b2}CCCCCCCCCCCI"
@ -113,6 +119,7 @@
4180 return
4180 return
Building Commodore BASIC prg with Input file /Users/mskinner/Development/Commodore/Cookie-Clicker-C64/prg.txt
10000 rem settings start here
10010 poke53280,0:poke53281,0
10100 print"{clear}{grey1}UCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCI"
@ -126,7 +133,7 @@
10180 print"B {wht}load (l) {grey1}B"
10190 print"B{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}B"
10200 print"B B"
10210 print"B {red}manage saves (m) {grey1}B"
10210 print"B {wht}manage saves (m) {grey1}B"
10220 print"B{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}{$a3}B"
10230 print"B B"
10240 print"B {yel}testmenu (t) {grey1}B"
@ -153,34 +160,39 @@
12000 print"{clear}{down}{wht}please enter a new name (14 characters max):"
12010 input nn$
12020 nl=len(nn$)
12030 if nl<14 then 12045
12040 print"{up}{up}{up}{red}error: name too long{wht}":goto 12000
12045 print"are you sure? (y/n)"
12050 getk$:ifk$=""then12050
12030 if nl<15 then 12050
12040 print"{up}{up}{up}{red}error: name too long{wht}":getk$:ifk$=""goto12040
12045 goto 12000
12050 print"are you sure? (y/n)"
12055 getk$:ifk$=""then12055
12060 ifk$="y"then 12080
12070 goto 10100
12080 bn$=nn$:goto10100
12100 print"{clear}{wht}writing save data..."
12110 open 8,8,8,"@0:cc64.sav,s,w"
12110 print#8,sb
12120 print#8,cc
12130 print#8,cg
12140 print#8,ca
12145 print#8,ga
12150 print#8,fa
12155 print#8,ma
12160 close 8
12160 print#8,bn$
12165 close 8
12170 print"saving complete"
12180 goto 10000
12200 print"{clear}{wht}loading save data..."
12210 open 8,8,8,"cc64.sav,s,r"
12215 input#8,sb
12220 input#8,cc
12222 input#8,cg
12224 input#8,ca
12226 input#8,ga
12228 input#8,fa
12230 input#8,ma
12235 input#8,bn$
12260 close 8
12270 print"loading complete"
12275 poke53280,14:poke53281,6
@ -195,23 +207,22 @@
12300 print"{home}{down}{down}{down}{down}{down}{down}{right}{right}{right}{right}*CCCCCCCCCCCCCCCCCCCCCCCCCCCCC*"
12310 print"{right}{right}{right}{right}B (1) erase current save B"
12320 print"{right}{right}{right}{right}B (2) erase backuped up save B"
12320 print"{right}{right}{right}{right}B (2) erase cc64.sav B"
12330 rem print"{right}{right}{right}{right}B (3) create 2nd save B"
12340 rem print"{right}{right}{right}{right}B (4) erase 2nd save B"
12350 print"{right}{right}{right}{right}B (5) exit B"
12350 print"{right}{right}{right}{right}B (3) exit B"
12360 print"{right}{right}{right}{right}*CCCCCCCCCCCCCCCCCCCCCCCCCCCCC*"
12400 getk$:ifk$=""then12400
12410 ifk$="1"then 12500
12420 ifk$="2"then 12600
12430 rem ifk$="3"then
12440 rem ifk$="4"then
12450 ifk$="5"then 10000
12450 ifk$="3"then 10000
12460 goto 12400
12500 cc=0:cg=0:ca=0:ga=0:fa=0:ma=0:ft$="0":mt$="0":bn$="someone"
12510 goto 10000
12600 open 8,8,8,"@0:cc64.sav,s,w"
12610 print#8,sb
12610 print#8,0
12620 print#8,0
12630 print#8,0

View File

@ -1,26 +1,26 @@
0 rem !to "build/testmenu.prg"
5 poke788,52:poke792,193
40000 rem testing menu
40010 poke53280,0:poke53281,0:poke646,5
40020 print"{clear}logging into console...
40020 print"{clear}logging into console"
40025 print"cc64:/>"
40030 print"{up}{right}{right}{right}{right}{right}{right}{right} h"
40040 print"loading help menu..."
40040 print"booting help menu"
40045 print""
40050 print" manage saves:"
40060 print""
40110 print" delete [d]"
40120 print" backup [b]"
40130 print" restore [r]"
40140 print" edit [e]"
40150 print""
40160 print" others:"
40165 print""
40170 print" help [h]"
40160 print" exit [t]"
40170 print""
40180 print"cc64:/>"
40500 getk$:ifk$=""then40500
40520 ifk$="d"then 41000
40530 ifk$="b"then 42000
40540 ifk$="r"then 43000
40570 ifk$="e"then 44000
40580 ifk$="h"then 40030
@ -28,89 +28,100 @@
40600 goto 40500
41000 print"{up}{right}{right}{right}{right}{right}{right}{right} d"
41005 print"deleting save file..."
41005 print"writing objects: 0% (0/1)"
41010 open 8,8,8,"@0:cc64.sav,s,w"
41015 print#8,0
41020 print#8,0
41025 print#8,0
41030 print#8,0
41035 print#8,0
41040 print#8,0
41050 print#8,0
41055 print#8,"someone"
41060 close 8
41070 print"done!"
41070 print"{up}print"writing objects: 0% (1/1)"
41080 goto 40180
42000 print"{up}{right}{right}{right}{right}{right}{right}{right} b"
42005 open 15,8,15
42010 print#15,"copy0:cc64.sav=test"
42020 close 15:stop
44000 print"{up}{right}{right}{right}{right}{right}{right}{right} e"
44005 print"loading save file..."
44005 print"loading save file: 0% (0/1)"
44010 open 8,8,8,"@0:cc64.sav,s,r"
44020 input#8,sa
44022 input#8,sb
44024 input#8,sc
44026 input#8,sd
44028 input#8,se
44030 input#8,sf
44015 input#8,sb
44020 input#8,cc
44022 input#8,cg
44024 input#8,ca
44026 input#8,ga
44028 input#8,fa
44030 input#8,ma
44040 input#8,bn$
44040 close 8
44070 print"loading complete"
44070 print"{up}loading save file: 100% (1/1)"
44080 print""
44100 print" [1] cookies: "sa
44110 print" [2] cookie gain: "sb
44120 print" [3] cursor amount: "sc
44130 print" [4] grandma amount: "sd
44140 print" [5] farm amount: "se
44150 print" [6] mine amount: "sf
44500 print" [7] exit menu (saves changes)"
44090 print" [1] stop key flag: "sb
44100 print" [2] cookies: "cc
44110 print" [3] cookie gain: "cg
44120 print" [4] cursor amount: "ca
44130 print" [5] grandma amount: "ga
44140 print" [6] farm amount: "fa
44150 print" [7] mine amount: "ma
44160 print" [8] bakery name: "bn$
44500 print" [9] exit menu (saves changes)"
44510 print""
44520 print"please choose an option"
44530 print"cc64:/cc64.sav/>"
44540 getk$:ifk$=""then44540
44550 if k$="1"then 44000
44560 if k$="2"then 44100
44570 if k$="3"then 44200
44580 if k$="4"then 44300
44590 if k$="5"then 44400
44600 if k$="6"then 44500
44610 if k$="7"then 44600
44550 if k$="1"then 45000
44560 if k$="2"then 45100
44570 if k$="3"then 45200
44580 if k$="4"then 45300
44590 if k$="5"then 45400
44600 if k$="6"then 45500
44610 if k$="7"then 45600
44620 if k$="8"then 45700
44630 if k$="9"then 45800
44999 goto 43540
44000 print"please set a value"
44010 input sa
44020 goto 43080
45000 print"please set a value (0=on:1=off)
45010 input sb
45020 if sb>1 then goto 45000
45030 if sb<0 then goto 45000
45040 goto 44080
45100 print"please set a value"
45110 input cc
45120 goto 44080
45200 print"please set a value"
45210 input cg
45220 goto 44080
45300 print"please set a value"
45310 input ca
45320 goto 44080
45400 print"please set a value"
45410 input ga
45420 goto 44080
45500 print"please set a value"
45510 input fa
45520 goto 44080
45600 print"please set a value"
45610 input ma
45620 goto 44080
45700 print"please set a value"
45710 input bn$
45720 goto 44080
44100 print"please set a value"
44110 input sb
44120 goto 43080
44200 print"please set a value"
44210 input sc
44220 goto 43080
44300 print"please set a value"
44310 input sd
44320 goto 43080
44400 print"please set a value"
44410 input se
44420 goto 43080
44500 print"please set a value"
44510 input sf
44520 goto 43080
44600 print"{up}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right} .."
44610 open 8,8,8,"@0:cc64.sav,s,w"
44620 print#8,sa
44630 print#8,sb
44640 print#8,sc
44650 print#8,sd
44660 print#8,se
44670 print#8,sf
44680 close 8
44690 goto 40180
45800 print"{up}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right}{right} .."
45805 print"writing objects: 0% (0/1)"
45810 open 8,8,8,"@0:cc64.sav,s,w"
45815 print#8,sb
45820 print#8,cc
45825 print#8,cg
45830 print#8,ca
45835 print#8,ga
45840 print#8,fa
45845 print#8,ma
45850 print#8,bn$
45855 close 8
45860 print"{up}writing objects: 100% (1/1)"
45865 goto 40180
60000 print"{clear}"
60010 print chr$(147);
@ -119,4 +130,4 @@
60040 print"load"q$"cookie"q$",8"
60050 printd$;d$;d$;d$;"run"
60060 rem load keyboard buffer and flush it
60070 poke631,19:poke632,13:poke633,13:poke198,3
60070 poke631,19:poke632,13:poke633,13:poke198,3