Jump to content
Jet Set Willy & Manic Miner Community

'Guardian Aura' Bug Fix and miscellaneous other patches


IRF

Recommended Posts

Thanks Norman - silly mistake I made using LD A,(HL) instead of LD A,L (picking up an actual value from the item table, rather than picking up the index pointing at that value).

 

I notice the little optimisation at the end of the item-filter loop as well. :)

 

Hopefully with those edits applied, the 128 room version will work too.

Edited by IRF
Link to comment
Share on other sites

  • 4 weeks later...

; this code moves the tile in hl down by one line

 

;

xor a

ld d,a

ld b,8

loop

ld e,(hl) ;the current line

or d ;the line above

ld (hl),d

ld d,e

inc h

djnz loop

 

;

; a=the accumalative value of the bits drawn

 

;

 

or a ;if a value exists then the floor is still collapsing

 

This permits a one pixel line to be moved down the screen

How about this slight rewrite of the loop:

 

xor a

ld d,a

ld b,8

loop

ld e,(hl) ;the current line

or d ;the line above

ld (hl),d

ld d,e

ld a,h

add a,c

ld h,a

djnz loop

 

Set C=01 beforehand for regular crumbling tiles, or C=FF for bashing away at wall tiles from below(?)

Edited by IRF
Link to comment
Share on other sites

Also, HL has to start off pointing at the top pixel-row of the cell in the case of a crumbly, or start off pointing at the bottom pixel-row for bashing a wall tile.

Coming from 'Move Willy', HL starts off pointing at an attribute coordinate (#5Cxx or #5Dxx). Use PUSH and POP HL to preserve that address, for updating the attribute of the cell to Air once crumbling is complete.

For a wall tile, use a similar approach as the 'old' crumbly tile code, in order to point HL at the bottom pixel-row:

LD A,H
ADD A, #1B
OR #07
LD H,A

For a crumbly tile, point HL at the top pixel-row by using:

LD A,H
ADD A, #1B
AND #78
LD H,A

The command in bold can be a common entry point to a shared part of the code (if the C register is used to increment or decrement H as per my previous post).

Edited by IRF
Link to comment
Share on other sites

How about this slight rewrite of the loop:

 

xor a

ld d,a

ld b,8

loop

ld e,(hl) ;the current line

or d ;the line above

ld (hl),d

ld d,e

EX AF, AF'

ld a,h

add a,c

ld h,a

EX AF, AF'

djnz loop

 

Set C=01 beforehand for regular crumbling tiles, or C=FF for bashing away at wall tiles from below(?)

 

Update: you would need to preserve A (e.g. by bookending the new code with two EX AF, AF' commands), so that after the loop has ended, A still holds a cumulative tally of all the infilled pixels in the cell.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.