2009-01-03:

Lightsack - code from CPC, conclusion

cpc464:basic:easy
The night has ended, and so has the data transfer from CPC to PC (if interested, one can download the RAM dump here). I also rewritten the code from CPC to PC - the listing is at the end of this post.

And now the for the conclusion:
- I think I should have given additional 16 bits for RAM address in each data frame - the dump seemed to be lacking 66 bytes of data. After comparing the dump with The Amstrad CPC Firmware Guide (by Bob Taylor and Thomas Defoe, 1992) it occurred that the missing bytes are in fact zeros in some large zero field. So it was easy to fix.
- Almost 90% of RAM is filled with zeros.
- Hmm, the RAM address in the frame would really prove useful.. it seems I am missing some zeros at the end too - I think it's because of the old monitor - sometimes it starts to flicker (not to often)
- It's cool to read the Firmware Guide having a memory dump - You can check if the thing they are describing really exists, and how does it look like ;>

And now, for the end, the ultra ugly code that displays data frames on the CPC.

5 rem Show the data! by Gynvael Coldwind
6 rem The code is ugly,stupid,etc. Use at ur own risk
10 mode 0
15 symbol 255,255,255,255,255,255,255,255,255
20 cls
25 c=1
30 for i=0 to 65535
40 v=peek(i)
50 m=v
55 cls
56 locate 1,20
58 print "now: &" hex$(i,4) "=" hex$(v,2) " [" c "]"
60 n=1:m=c:gosub 200:print " ";
100 for j=1 to 8
102 m=v
105 read t:n=t:gosub 200
110 next j
115 restore
120 print " ";
121 n=1:m=c:gosub 200
122 print chr$(10) chr$(13) chr$(10) chr$(13) "C 76543210 C"
131 after 25 gosub 300
132 o=c
133 IF o=c then goto 133
140 next i
200 t=m AND n
205 if t=n then print chr$(255);:return
210 print " ";
220 return
300 if c=1 then c=0:return
310 c=1:return
800 data 128,64,32,16,8,4,2,1

Add a comment:

Nick:
URL (optional):
Math captcha: 2 ∗ 6 + 4 =