Jump to content


Photo

source code for JSW

members only source code jsw

  • Please log in to reply
66 replies to this topic

#61 Norman Sword

Norman Sword

    Advanced Member

  • Member
  • PipPipPip
  • 237 posts

Posted 17 July 2019 - 09:02 PM

I have edited three posts to remove the conflict of BLOCK_MOVE32: being used with differing routines.

The routine that uses a long line of ldi's and returns without decrementing the "A" register has had its labels changed

 

That block move now uses the labels BLOCKX_MOVE32 and BLOCKX_MOVE31. the inclusion of the X mid label hopefully removing confusion between two very similar routines, which are mentioned sporadically over a few posts.  


Edited by Norman Sword, 17 July 2019 - 09:06 PM.


#62 IRF

IRF

    Advanced Member

  • Contributor
  • 4,275 posts

Posted 18 July 2019 - 07:19 AM

I suppose you could modify this routine to use a similar raster copy routine as the one posted above.


Surely the raster copy code would have to revert back to your earlier method of using the Accumulator to keep track of when it is time to copy a row of attributes. Because if you are using the shared (and not self-modified) subroutine Shift_block32, then that subroutine always RETurns with the same conditionality of the Overflow Flag.

e.g. use the same code as in this post, only replacing the two LDIR commands with CALLs to Shift_block32:
http://jswmm.co.uk/t...age-4#entry6069


Edited by IRF, 18 July 2019 - 08:42 AM.


#63 Norman Sword

Norman Sword

    Advanced Member

  • Member
  • PipPipPip
  • 237 posts

Posted 18 July 2019 - 09:42 AM

All the raster copy posts under the heading "source code for JSW" work as stated. None use the piece of code listed back in APRIL 2017 and quoted in post #62.

Because you are reverting between differing pieces of code used over many years, I have expanded each reference to raster copy listed under "source code for JSW" to be self contained. Each and every version works and none use the "A" register.    



#64 IRF

IRF

    Advanced Member

  • Contributor
  • 4,275 posts

Posted 18 July 2019 - 10:07 AM

Sorry, crossed wires - when you suggested "modify[ing] this routine to use a similar raster copy routine as the one posted above", I thought you were referring to amending the substantive raster routine, rather than self-modifying the subroutine to truncate it with a RET.  Hence my reference in my previous post to: "if you are using a shared (and not self-modified) subroutine".

 

 

 


Each and every version works and none use the "A" register.

 

...except before and afterwards, where 'A' is used to self-modify the code (toggling an early RET in and then back out again).  But I think that could be done using HL as a pointer instead (if necessary?):

 

LD HL, S_M_C_New_Mod

LD (HL), $C9                          ; ;opcode for RET

 

and

 

LD HL, S_M_C_New_Mod

LD (HL), $EA                          ;opcode for JP PE,xx


Edited by IRF, 18 July 2019 - 12:20 PM.


#65 Norman Sword

Norman Sword

    Advanced Member

  • Member
  • PipPipPip
  • 237 posts

Posted 18 July 2019 - 12:27 PM

Semantics:-

 

 

Every version of the raster copy routine listed under "source code for JSW"  does not use the "a" register. I subsequently added before and after the actual routine a part which modified the Block_Copy routine (which ever variant of the block copy routine as listed in each post). The raster copy routine still does not use the a register, but the modifying code before and after did use the "a" register. 

 

 I have done the trivial change to each modifying addition to remove the usage of the "a" register throughout the whole raster copy.  



#66 IRF

IRF

    Advanced Member

  • Contributor
  • 4,275 posts

Posted 18 July 2019 - 12:43 PM

I've just noticed that the two commands in the raster copy routine which you previously struck through:

 

  ld b,0                         ; this was set for usage in a different routine

  ld c,32                             ; this was set for usage in a different routine

 

are no longer struck out in posts 59 and 60.  Although the accompanying comment after the semicolon remains in place, suggesting that those commands are still not necessary (and from my interpretation of the code, they aren't needed).

 

Perhaps the strikethrough font 'fell off' in the process of copying and pasting?

 

****

 

The LDI subroutine in post 60 gets around the problem in the 'Lose a Life' routine (#8C01), whereby the screen attributes are updated repeatedly on a loop, whilst the A register is used to count down the INK colours (the 'fade to black' moment). :)



#67 Norman Sword

Norman Sword

    Advanced Member

  • Member
  • PipPipPip
  • 237 posts

Posted 18 July 2019 - 12:55 PM

I've just noticed that the two commands in the raster copy routine which you previously struck through:

 

  ld b,0                         ; this was set for usage in a different routine

  ld c,32                             ; this was set for usage in a different routine

 

are no longer struck out in posts 59 and 60.  Although the accompanying comment after the semicolon remains in place, suggesting that those commands are still not necessary (and from my interpretation of the code, they aren't needed).

 

Perhaps the strikethrough font 'fell off' in the process of copying and pasting?

 

 

 

The strike through fell off and is lying somewhere in cyberspace.

The op codes in the listings which are unwanted have been rem'ed out and also struck through again.  (just in case I paste and copy again) with that statement I am reminded that the original still has only the strike through. So I will edit that as well.

Code with the unwanted parts will still work. But since it is not needed best rem'out in addition to the strike through.  (or just deleted completely)


Edited by Norman Sword, 18 July 2019 - 12:59 PM.






Also tagged with one or more of these keywords: members only, source code, jsw

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users