{{ Propeller Poker - Copyright 2009 Michael Kohn }} {{ http://www.mikekohn.net/ mike@mikekohn.net/ }} CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 OBJ VGA : "VGA_512x384_Bitmap" Deck: "PokerDeck" Keyboard: "Keyboard" VAR word colors[192] long bitmap[6144] long sync Pub Main | dpin, cpin, key, state VGA.start(16, @colors, @bitmap, @sync) clearScreen state := 0 Deck.Initialize Deck.drawDecoration(@colors, @bitmap) Keyboard.start(26, 27) 'Deck.shuffleCards 'Deck.drawCards(@colors, @bitmap) 'Deck.suggest 'Deck.drawHolds(@colors, @bitmap) Deck.drawScore(@colors, @bitmap) Deck.drawBet(@colors, @bitmap) repeat key := Keyboard.key if key > 48 and key < 54 if state == 1 Deck.toggleHold(key-49) Deck.drawHolds(@colors, @bitmap) elseif key == 32 if state == 2 Deck.removeCards(@colors, @bitmap) state := 0 if state == 0 Deck.changeScore(@colors, @bitmap, 0) Deck.shuffleCards Deck.drawCards(@colors, @bitmap) Deck.suggest Deck.drawHolds(@colors, @bitmap) state++ elseif state == 1 Deck.removeCards(@colors, @bitmap) Deck.newDeal Deck.drawCards(@colors, @bitmap) Deck.drawHolds(@colors, @bitmap) ' deletes the current holds Deck.checkHand(@colors, @bitmap) ' Deck.changeScore(@colors, @bitmap, payout) state++ elseif key == 98 if state == 0 or state == 2 Deck.changeBet Deck.drawBet(@colors, @bitmap) elseif key == 65 Deck.changeScore(@colors, @bitmap, 10) Pri clearScreen WordFill(@colors, %00000000, 192) LongFill(@bitmap, 0, 6144)