hexes game update

Chat about anything CX16 related that doesn't fit elsewhere
Post Reply
JohnGill
Posts: 66
Joined: Thu Jun 25, 2020 11:45 am

hexes game update

Post 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
SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

hexes game update

Post by SlithyMatt »


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

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

hexes game update

Post 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.

SerErris
Posts: 172
Joined: Sat Aug 08, 2020 9:18 am

hexes game update

Post 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



 

SerErris
Posts: 172
Joined: Sat Aug 08, 2020 9:18 am

hexes game update

Post by SerErris »


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

Post Reply