Page 1 of 1

hexes game update

Posted: Wed Aug 05, 2020 12:05 pm
by JohnGill

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

hexes game update

Posted: Wed Aug 05, 2020 1:00 pm
by SlithyMatt

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


hexes game update

Posted: Wed Aug 12, 2020 11:40 am
by BruceMcF


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.


hexes game update

Posted: Wed Aug 12, 2020 1:27 pm
by SerErris

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



 


hexes game update

Posted: Wed Aug 12, 2020 4:07 pm
by SerErris

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