帮助:ZX81 BASIC"Peek"功能 [英] Help: ZX81 BASIC "Peek" function
问题描述
我需要一种方法来确定字符('<')是否碰到了墙壁(黑色像素图形)
I need a way to find if the character ('<') has hit a wall (Black pixel Graphic)
-在ZX81游戏上.
我一直在看另一款使用代码的游戏
I'm been looking at another game... which uses code
if peek(peek 16398 +256*peek 16399) = code "**blackpixel graphic**" then ...
似乎为他们工作的人...
Which seems to work for them...
这是正确的代码吗?
我对地址,获取内存和东西一无所知.
I'm not really knowledgable with addresses and getting memory and stuff.
请帮助我...
-如果您知道更好的方法.请回答:)
-If you know a better way. Please answer :)
谢谢
推荐答案
peek
读取内存位置的字节.根据 Sinclair ZX81的系统变量,内存位置16399
组成一个16位值,其中包含当前的显示文件中PRINT位置的地址" .
peek
reads the byte at a memory location. According to The System Variables of the Sinclair ZX81, memory location 16398
and 16399
form a 16bit value containing the current "Address of PRINT position in display file".
因此,peek 16398 + 256*peek 16399
将这两个值组合为一个16位地址,并且peek
(可能)对该地址进行处理可以获取该位置的像素/字符(?).
Thus, peek 16398 + 256*peek 16399
combines the two values into a 16 bit address and peek
ing that address (possibly) gets the pixel/character(?) at that position.
这篇关于帮助:ZX81 BASIC"Peek"功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!