Mike Harris Posted February 1, 2019 Share Posted February 1, 2019 (edited) My current project is in the final stages of part one. Getting the bugs out, testing on real equipment. I just added 30 new rooms and am still under 14k. Can someone with expertise share some code that explain how someone like MR. Do can walk between patterns without going through them. If he digs a hole then how does coleco know because one is a sprite and one is a background. Currently I have a sprite defined as a 4x4 cube to be updated later and this is the code Tony from Electric Adventures was kind enough to shar with me. MAP_TO_SPRITE: LD HL, VRAM_NAME LD A,(SPRTBL) CP 0 JP Z, SKIP ; if we are zero SRL A ; divide by 2 three times i.e. divide by 8 will give us our row SRL A SRL A LD B,A ; save it to a loop count LD DE,32 XOR ALOOP: ADC HL,DE DJNZ LOOPSKIP: LD A,(SPRTBL+1) CP 0 JP Z,SKIP2 SRL A ; divide by 2 three times i.e. divide by 8 will give us our column SRL A SRL A LD E,A LD D,0 XOR A ADC HL,DE SKIP2: CALL SETRD IN A,(DATA_PORT)RET It does the job well but there are a couple of areas were it just does not catch the code like at the very edge and it allows the sprite to move through at certain corners. I did not want to keep bugging him especially when he has a video series he's working on. Edited February 1, 2019 by Mike Harris Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.