0 Members and 1 Guest are viewing this topic.
DoKeyAction: LD HL,Cursor CP kLeft JR NZ,RightKeyActionLeftKeyAction: LD A,(HL) ;load cursor column DEC A ;smaller than cp 1, and also serves to decrease a :) RET Z ;if Column=1 dont got left, it'll go off the grid LD (HL),A ;1 byte, 7 T-States. Loading into an address is 3 bytes (1 byte for the opcode and 2 bytes for the address) RET ;KeyAction is done: return to main loopRightKeyAction: CP kRight JR NZ,UpKeyAction LD A,(HL) ;load cursor column (we loaded Cursor into HL above) CP 4 RET Z ;if Column=4 dont got right, it'll go off the grid INC A LD (HL),A RET ;KeyAction is done: return to main loop
LD HL,Cursor ;xorDraw active Sprite LD B, (HL) INC HL LD C, (HL) LD HL,ActiveSprite PUSH HL ;save HL (sprite pointer) and BC (sprite coordinates) PUSH BC CALL XorDrawSprite ;aguments in BC and HL, as supposed to B_CALL _GrBufCpy ;draw the current status and active square B_CALL _getKey CP kClear JR Z,GameEnd CALL DoKeyAction POP BC POP HL ;xorDraw active Sprite (on old location, so its ereased) CALL XorDrawSprite