Jump to content
Sign in to follow this  
JohnGill

hexes game update

Recommended Posts

Hi all,

Been on family holidays/vacation last month so not much coding done recently.

The terrain count now stands at 21 of the final 32 terrain types. To witness my legendary pixel graphic skills (ahem ahem) see below.

The terrain types currently are:
wild scrubs ; forest ; desert ; rocky outcroppings ; marsh
lake ; cliffs ; high mountains ; lowland fells
beach ; orchard ; cave ; meadow ; pasture
lumber yard ; wheat field ; cleared ground ; ploughed field
farmstead ; watermill; ocean

I've still got a drawing glitch on the layer 1 terrain graphic overprints, down the right hand side of the hex window - I need to print only the left half the graphic if it's at the end of an odd numbered hex_y row.

Finding an odd number in assembly is ABSURDLY easy:

    LDA hex_y
    AND #1

this leaves 1 in the accumulator if hex_y is odd, 0 if it's even.

that's all for now!

 

Bitmap in Untitled-1.png

  • Like 1

Share this post


Link to post
Share on other sites

Remember, you can always use BIT instead of AND if you want to keep the original value in the accumulator.

  • Like 1
  • Thanks 3

Share this post


Link to post
Share on other sites
On 8/5/2020 at 9:00 PM, SlithyMatt said:

Remember, you can always use BIT instead of AND if you want to keep the original value in the accumulator.

And for people used to NMOS 6502 coding, you don't have to allocate a memory location for the bit ... on the 65C02, BIT #1 works.

  • Like 2

Share this post


Link to post
Share on other sites

Another Idea would be a LSR ... and then check on carry bit. 

Quote

  LDA value
  LSR
  BCS ;odd
even
  do something
  BRA continue

odd
  do something else

continue
  do something more

 

  • Like 1

Share this post


Link to post
Share on other sites

BTW the BRA example only works on the 65c02 not on the 6502 or 6510 as this is a new Opcode.

Share this post


Link to post
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.

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.

Sign in to follow this  

×
×
  • Create New...

Important Information

Please review our Terms of Use