Jump to content

Photo

working out the bugs


No replies to this topic

#1 Mike Harris OFFLINE  

Mike Harris

    Chopper Commander

  • 205 posts

Posted Fri Feb 1, 2019 5:11 AM

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 A
LOOP:
    ADC HL,DE
    DJNZ LOOP
SKIP:
    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 by Mike Harris, Fri Feb 1, 2019 5:15 AM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users