hexes game update
hexes game update
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!
-
- Posts: 913
- Joined: Tue Apr 28, 2020 2:45 am
hexes game update
Remember, you can always use BIT instead of AND if you want to keep the original value in the accumulator.
hexes game update
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
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
BTW the BRA example only works on the 65c02 not on the 6502 or 6510 as this is a new Opcode.