I cant seem to get this program to work properly
#1
it does not display the sprite, even though i have checked the pokes at lines 1000-3000

https://archive.org/details/commodore-64...1/mode/2up

.d64   ef.d64 (Size: 170.75 KB / Downloads: 89)

1 rem ***************************
2 rem * sprite editor program  *
3 rem ***************************
4 poke53280,1:poke53281,1:?chr$(144):?chr$(147);:
5 forf=0to4:?chr$(17):nextf:?chr$(18);"sprite editor";chr$(146)
6 ?chr$(17);chr$(17);"helps you create sprites for"
8 ?chr$(17);"the commodore 64 computer. "
9 forf=0to2:?chr$(17):nextf:?"(use standard cursor moves.)"
10 fori=1to3000:next
16 ?chr$(147);:fori=1to21:forj=1to24
18 ?".";:next j:?:next i
20 ?chr$(19);chr$(17):forf=0to24:?chr$(29);:nextf:?chr$(18);"commands: ";
21 ?chr$(146);chr$(17):forf=0to24:?chr$(29);:nextf:?"press... "
22 ?chr$(146);chr$(17):forf=0to24:?chr$(29);:nextf
23 ?chr$(18);"f1";chr$(146);" to plot"
24 ?chr$(146);chr$(17):forf=0to24:?chr$(29);:nextf
25 ?chr$(18);"f3";chr$(146);" no plot"
26 ?chr$(146);chr$(17):forf=0to24:?chr$(29);:nextf
27 ?chr$(18);"f5";chr$(146);" erase"
28 ?chr$(146);chr$(17):forf=0to24:?chr$(29);:nextf
29 ?chr$(18);"f7";chr$(146);" display"
30 fori=0to62:read a:poke 832+i,a:next:
32 poke 895,0
34 poke2040,13
40 poke53269,1
45 poke53287,0
48 x=24:y=50
50 poke 53248,x
60 poke 53249,y
70 data 255,0,0,129,0,0
71 data 129,0,0,153,0,0
72 data 153,0,0,129,0,0
73 data 129,0,0,255,0,0
74 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
75 data 0,0,0
100 rem ****************************
101 rem * move cursor routine      *
102 rem ****************************
105 goto 200
110 px=0:py=0
120 poke53248,x
125 poke53249,y
130 return
200 get x$:if x$=""then 200
210 if x$=chr$(29) then x=x+8:px=px+1 :if px>23 then px=23:x=x-8
215 if x$=chr$(157)then x=x-8:px=px-1:if px<0then px=0:x=x+8
220 if x$=chr$(17)theny=y+8:py=py+1:ifpy>20thenpy=20:y=y-8
225 if x$=chr$(145)theny=y-8:py=py-1:if py<0 then py=0:y=y+8
230 if x$=chr$(133) then plot=1
240 if x$=chr$(134) then plot=0
250 if x$=chr$(135) then plot=-1
255 if x$=chr$(136)thengoto 1000
260 if plot=1 then gosub 400: goto 300
270 if plot=-1 then gosub 500:goto 300
300 gosub 120:goto200:return
400 p$=chr$(209):gosub 600:return
500 p$=".":gosub 600:return
600 if px<0 then px=0
601 if px>23 then px=23
602 if py<0 then py=0
603 if py>20 then py=20
605 poke781,py:poke782,px:poke783,0
610 sys65520:?p$: return
1000 rem******************************
1001 rem* calculate data statements  *
1002 rem* "." is chr$(46)            *
1003 rem******************************
1005 ?chr$(19);:forf=0to15:?chr$(17);:nextf:forf=0to24:?chr$(29);:nextf
1006 ?chr$(18);
1010 ?"please wait";chr$(146)
1012 dim sd(505) :x=1
1020 fori=1024 to 1824 step 40
1030 forj=i to 1+23
1040 sd(x) = peek(j):x=x+1:
1050 next j:next i
2000 dim by(64):dim de(8)
2005 de(1)=128:de(2)=64:de(3)=32:de(4)=1 6:de(5)=8:de(6)=4:de(7)=2:de(8)=1
2100 x=1
2110 for i=1 to 63
2120 for j=1 to 8
2130 if sd(x)=81 then sd(x)=de(j):goto2160
2140 if sd (x)<>81 then sd(x)=0
2160 by(i)=by(i)+sd(x)
2170 x=x+1
2180 next j:next i
3000 fori=0 to 62:pokei+832,by(i+1):next
3002 ?chr$(147);
3005 ?chr$(19);:forf=0to11:?chr$(17);:nextf:?" your sprite looks"
3008 ?" like this------------->"
3010 poke 53248,220:poke53249,150
4000 :
4010 ?chr$(19);"do you want to see the data"
4020 ?"statements on the screen (s)"
4030 ?"or sent to ?er (p)?"
4040 ?"enter 's' or 'p'.":
4042 get a$:ifa$=""then4042
4050 ifa$="s"then?chr$(147):fori=1to62:?by(i)",";:next:?by(63):goto5000
4100 rem ***** ? data *****
4105 ?chr$(19);:forf=0to20:?chr$(17):nextf:?"to run program again, enter 'y'."
4110 open 1,4
4120 cmd1
4130 fori=1to62:?by(i)",";:next:?by(63)
4140 close1,4 4150
4150 ?chr$(19)
5000 ?chr$(19);:forf=0to20:?chr$(17);:nextf:?"to run program again,enter 'y'."
5010 get a$:if a$=""then 5010
5020 if a$ ="y" then clr:poke53269,0:goto 16
5030 ?"that's all":end
Reply
#2
Line 1030 should be:

1030 for j= i to i+23
Reply
#3
(03-02-2024, 12:49 AM)sysop Wrote: Line 1030 should be:

1030 for j= i to i+23

Thank you. I've managed to get this program fully working now. Although I want to be able to display the sprite as I draw it. I've tried to do this but as the character square is also a sprite it Interferes with it. Any suggestions?
Reply
#4
No, not really.  I suppose, you could always take a look at the sprite editor that came with Commodore's own Program Pack and compare how that works to this editor.

I've attached a disk image of the Program Pack below.


.d64   Commodore_64_Program_Pack.d64 (Size: 170.75 KB / Downloads: 75)

Additional:  Loadstar also published a simple but useful sprite editor.  It's also written in BASIC and published in issue #14. See attached a disk image with the program.


.d64   sprite-editor.d64 (Size: 170.75 KB / Downloads: 74)
Reply
#5
Is there a Book/PDF of the Commodore_64_Program_Pack.d64 ?
Reply
#6
(03-02-2024, 10:34 PM)BlueCursor Wrote: Is there a Book/PDF of the  Commodore_64_Program_Pack.d64 ?

Not that I'm aware of.  If I'm remembering correctly, I obtained my original with my 1541 and the only book was the 1541 user manual.  Most of the programs, though, do have instructions included on how to use them.
Reply
#7
Yeah, but, the sprite editor is pointing to page 200. Also I find this odd that a sprite editor or a joystick tester can with a 1541 manual?
Reply
#8
(03-02-2024, 11:05 PM)BlueCursor Wrote: Yeah, but, the sprite editor is pointing to page 200. Also I find this odd that a sprite editor or a joystick tester can with a 1541 manual?

It's been over 40 years, so I'm probably remembering incorrectly.  I just don't recall a manual for the program disk.  Also, I don't think the page 200 is referring to a manual.  If you use the - and + keys, the page number can be changed.  Is it a memory location or something maybe?

Update #1:

Yes, if you press S the program asks which page location you wish to save.

Update #2:

If you do a listing of the program, you will find REM statements that describe all of the functionality of the program.  Just refer to the GOTOs above to learn which key activate each function.  Not very intuitive, but at least is some sort of documentation.
Reply
#9
Yes there are 256 pages of 256 bytes each in the C64's 64K of addressable memory.
Sometimes it is important a data structure not to cross a page boundary for performance (cycle penalty).
The sprite data seems page aligned in high RAM on page 200.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)