;######################### ;#SETUPCARDS ;#Create and shuffle the Chance ;# and Community Chest card decks ;#input:hl = pointer of last byte in ;# the deck ;######################### setUpCards: ld b,16 ld (hl),b ;set up the chance deck, default values dec hl ; from top (chanceDeck+16) to bottom (chanceDeck+1) djnz $-2 ld (hl),b ;store the last value (chanceDeck) push hl ;hl=chance_cards pop ix ;ix=chance_cards dec hl ld b,16 ;we have 16 cards, so shuffle all 16 sUC_shuffle: push bc push hl ;every hl should always = chanceDeck-1 ld b,(255/17)+1 ;random number between 1-17 call randomNumber ;return random nuber in b ld b,0 ;reset upper byte of bc add hl,bc ;bc = the random number, so swap the ld b,(hl) ; current card (ix) with another random ld c,(ix) ; card (hl) ld (hl),c ld (ix),b inc ix ;go to the next card in the list pop hl pop bc ;our loop counter djnz sUC_shuffle ret drawCard: ld a,(hl) ;grab the first card from the deck ld e,l ld d,h inc hl ;ld de,hl, then inc hl ld bc,16 ldir ld (de),a add a,a ;each text label is 2 bytes ld l,a ld h,0 ld de,chance_cards add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a ret textChance: ;Chance .db _C,_h,_a,_n,_c,_e,T_EOS textCommChest: ;Community Chest .db _C,_o,_m,_m,_u,_n,_i,_t,_y,T_SPACE,_C,_h,_e,_s,_t,T_EOS chance_cards: .dw textC1 .dw textC2 .dw textC3 .dw textC3 ;there are two of these .dw textC4 .dw textC5 .dw textC6 .dw textC7 .dw textC8 .dw textC9 .dw textC10 .dw textC11 .dw textC12 .dw textC13 .dw textC14 .dw textC15 .dw textC16 textC1: ;Advance to Go - Collect $200 .db _A,_d,_v,_a,_n,_c,_e,T_SPACE,_t,_o,T_SPACE,_G,_o,T_SPACE,_HYPHEN,T_SPACE,_C,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_2,_O,_O,T_CHANCE_MOVE,0 textC2: ;Advance to Illinois Ave - if you pass Go, collect $200 .db _A,_d,_v,_a,_n,_c,_e,T_SPACE,_t,_o,T_SPACE,_I,_l,_l,_i,_n,_o,_i,_s,T_SPACE,_A,_v,_e,T_SPACE,_HYPHEN,T_SPACE,_i,_f,T_SPACE,_y,_o,_u,T_SPACE,_p,_a,_s,_s,T_SPACE,_G,_o,_COMMA,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_2,_O,_O,T_EOS textC3: ;Advance token to nearest Utility. If unowned, you may buy it from the Bank. If owned, throw dice and pay owner a total ten times the amount thrown. .db _A,_d,_v,_a,_n,_c,_e,T_SPACE,_t,_o,_k,_e,_n,T_SPACE,_t,_o,T_SPACE,_n,_e,_a,_r,_e,_s,_t,T_SPACE,_U,_t,_i,_l,_i,_t,_y,_PERIOD,T_SPACE,_I,_f,T_SPACE,_u,_n,_o,_w,_n,_e,_d,_COMMA,T_SPACE,_y,_o,_u,T_SPACE,_m,_a,_y,T_SPACE,_b,_u,_y,T_SPACE,_i,_t,T_SPACE,_f,_r,_o,_m,T_SPACE,_t,_h,_e,T_SPACE,_B,_a,_n,_k,_PERIOD,T_SPACE,_I,_f,T_SPACE,_o,_w,_n,_e,_d,_COMMA,T_SPACE,_t,_h,_r,_o,_w,T_SPACE,_d,_i,_c,_e,T_SPACE,_a,_n,_d,T_SPACE,_p,_a,_y,T_SPACE,_o,_w,_n,_e,_r,T_SPACE,_a,T_SPACE,_t,_o,_t,_a,_l,T_SPACE,_t,_e,_n,T_SPACE,_t,_i,_m,_e,_s,T_SPACE,_t,_h,_e,T_SPACE,_a,_m,_o,_u,_n,_t,T_SPACE,_t,_h,_r,_o,_w,_n,_PERIOD,T_EOS textC4: ;Advance token to the nearest Railroad and pay owner twice the rental to which they are otherwise entitled. If Railroad is unowned, you may buy it from the Bank. .db _A,_d,_v,_a,_n,_c,_e,T_SPACE,_t,_o,_k,_e,_n,T_SPACE,_t,_o,T_SPACE,_t,_h,_e,T_SPACE,_n,_e,_a,_r,_e,_s,_t,T_SPACE,_R,_a,_i,_l,_r,_o,_a,_d,T_SPACE,_a,_n,_d,T_SPACE,_p,_a,_y,T_SPACE,_o,_w,_n,_e,_r,T_SPACE,_t,_w,_i,_c,_e,T_SPACE,_t,_h,_e,T_SPACE,_r,_e,_n,_t,_a,_l,T_SPACE,_t,_o,T_SPACE,_w,_h,_i,_c,_h,T_SPACE,_t,_h,_e,_y,T_SPACE,_a,_r,_e,T_SPACE,_o,_t,_h,_e,_r,_w,_i,_s,_e,T_SPACE,_e,_n,_t,_i,_t,_l,_e,_d,_PERIOD,T_SPACE,_I,_f,T_SPACE,_R,_a,_i,_l,_r,_o,_a,_d,T_SPACE,_i,_s,T_SPACE,_u,_n,_o,_w,_n,_e,_d,_COMMA,T_SPACE,_y,_o,_u,T_SPACE,_m,_a,_y,T_SPACE,_b,_u,_y,T_SPACE,_i,_t,T_SPACE,_f,_r,_o,_m,T_SPACE,_t,_h,_e,T_SPACE,_B,_a,_n,_k,_PERIOD,T_EOS textC5: ;Advance to St. Charles Place - if you pass Go, collect $200 .db _A,_d,_v,_a,_n,_c,_e,T_SPACE,_t,_o,T_SPACE,_S,_t,_PERIOD,T_SPACE,_C,_h,_a,_r,_l,_e,_s,T_SPACE,_P,_l,_a,_c,_e,T_SPACE,_HYPHEN,T_SPACE,_i,_f,T_SPACE,_y,_o,_u,T_SPACE,_p,_a,_s,_s,T_SPACE,_G,_o,_COMMA,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_2,_O,_O,T_EOS textC6: ;Bank pays you dividend of $50 .db _B,_a,_n,_k,T_SPACE,_p,_a,_y,_s,T_SPACE,_y,_o,_u,T_SPACE,_d,_i,_v,_i,_d,_e,_n,_d,T_SPACE,_o,_f,T_SPACE,_DOLLAR,_5,_O,T_EOS textC7: ;Get out of Jail free - this card may be kept until needed, traded, or sold .db _G,_e,_t,T_SPACE,_o,_u,_t,T_SPACE,_o,_f,T_SPACE,_J,_a,_i,_l,T_SPACE,_f,_r,_e,_e,T_SPACE,_HYPHEN,T_SPACE,_t,_h,_i,_s,T_SPACE,_c,_a,_r,_d,T_SPACE,_m,_a,_y,T_SPACE,_b,_e,T_SPACE,_k,_e,_p,_t,T_SPACE,_u,_n,_t,_i,_l,T_SPACE,_n,_e,_e,_d,_e,_d,_COMMA,T_SPACE,_t,_r,_a,_d,_e,_d,_COMMA,T_SPACE,_o,_r,T_SPACE,_s,_o,_l,_d,T_EOS textC8: ;Go back 3 spaces .db _G,_o,T_SPACE,_b,_a,_c,_k,T_SPACE,_3,T_SPACE,_s,_p,_a,_c,_e,_s,T_EOS textC9: ;Go directly to Jail - do not pass Go, do not collect $2OO .db _G,_o,T_SPACE,_d,_i,_r,_e,_c,_t,_l,_y,T_SPACE,_t,_o,T_SPACE,_J,_a,_i,_l,T_SPACE,_HYPHEN,T_SPACE,_d,_o,T_SPACE,_n,_o,_t,T_SPACE,_p,_a,_s,_s,T_SPACE,_G,_o,_COMMA,T_SPACE,_d,_o,T_SPACE,_n,_o,_t,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_2,_O,_O,T_EOS textC10: ;Make general repairs on all your property - for each house pay $25 - for each hotel $1OO .db _M,_a,_k,_e,T_SPACE,_g,_e,_n,_e,_r,_a,_l,T_SPACE,_r,_e,_p,_a,_i,_r,_s,T_SPACE,_o,_n,T_SPACE,_a,_l,_l,T_SPACE,_y,_o,_u,_r,T_SPACE,_p,_r,_o,_p,_e,_r,_t,_y,T_SPACE,_HYPHEN,T_SPACE,_f,_o,_r,T_SPACE,_e,_a,_c,_h,T_SPACE,_h,_o,_u,_s,_e,T_SPACE,_p,_a,_y,T_SPACE,_DOLLAR,_2,_5,T_SPACE,_HYPHEN,T_SPACE,_f,_o,_r,T_SPACE,_e,_a,_c,_h,T_SPACE,_h,_o,_t,_e,_l,T_SPACE,_DOLLAR,_1,_O,_O,T_EOS textC11: ;Pay poor tax of $15 .db _P,_a,_y,T_SPACE,_p,_o,_o,_r,T_SPACE,_t,_a,_x,T_SPACE,_o,_f,T_SPACE,_DOLLAR,_1,_5,T_EOS textC12: ;Take a trip to Reading Railroad - if you pass Go collect $2OO .db _T,_a,_k,_e,T_SPACE,_a,T_SPACE,_t,_r,_i,_p,T_SPACE,_t,_o,T_SPACE,_R,_e,_a,_d,_i,_n,_g,T_SPACE,_R,_a,_i,_l,_r,_o,_a,_d,T_SPACE,_HYPHEN,T_SPACE,_i,_f,T_SPACE,_y,_o,_u,T_SPACE,_p,_a,_s,_s,T_SPACE,_G,_o,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_2,_O,_O,T_EOS textC13: ;Take a walk on the Boardwalk - advance token to Boardwalk .db _T,_a,_k,_e,T_SPACE,_a,T_SPACE,_w,_a,_l,_k,T_SPACE,_o,_n,T_SPACE,_t,_h,_e,T_SPACE,_B,_o,_a,_r,_d,_w,_a,_l,_k,T_SPACE,_HYPHEN,T_SPACE,_a,_d,_v,_a,_n,_c,_e,T_SPACE,_t,_o,_k,_e,_n,T_SPACE,_t,_o,T_SPACE,_B,_o,_a,_r,_d,_w,_a,_l,_k,T_EOS textC14: ;You have been elected chairman of the board - pay each player $5O .db _Y,_o,_u,T_SPACE,_h,_a,_v,_e,T_SPACE,_b,_e,_e,_n,T_SPACE,_e,_l,_e,_c,_t,_e,_d,T_SPACE,_c,_h,_a,_i,_r,_m,_a,_n,T_SPACE,_o,_f,T_SPACE,_t,_h,_e,T_SPACE,_b,_o,_a,_r,_d,T_SPACE,_HYPHEN,T_SPACE,_p,_a,_y,T_SPACE,_e,_a,_c,_h,T_SPACE,_p,_l,_a,_y,_e,_r,T_SPACE,_DOLLAR,_5,_O,T_EOS textC15: ;Your building loan matures - collect $15O .db _Y,_o,_u,_r,T_SPACE,_b,_u,_i,_l,_d,_i,_n,_g,T_SPACE,_l,_o,_a,_n,T_SPACE,_m,_a,_t,_u,_r,_e,_s,T_SPACE,_HYPHEN,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_1,_5,_O,T_EOS textC16: ;You have won a crossword competition - collect $1OO .db _Y,_o,_u,T_SPACE,_h,_a,_v,_e,T_SPACE,_w,_o,_n,T_SPACE,_a,T_SPACE,_c,_r,_o,_s,_s,_w,_o,_r,_d,T_SPACE,_c,_o,_m,_p,_e,_t,_i,_t,_i,_o,_n,T_SPACE,_HYPHEN,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_1,_O,_O,T_EOS comm_chest_cards: .dw textCC1 .dw textCC2 .dw textCC3 .dw textCC4 .dw textCC5 .dw textCC6 .dw textCC7 .dw textCC8 .dw textCC9 .dw textCC10 .dw textCC11 .dw textCC12 .dw textCC13 .dw textCC14 .dw textC1 ;advance to go .dw textC7 ;get out of jail free .dw textC9 ;go to jail textCC1: ;Bank error in your favor - collect $75 .db _B,_a,_n,_k,T_SPACE,_e,_r,_r,_o,_r,T_SPACE,_i,_n,T_SPACE,_y,_o,_u,_r,T_SPACE,_f,_a,_v,_o,_r,T_SPACE,_HYPHEN,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_7,_5,T_EOS textCC2: ;Doctor's fees - Pay $5O .db _D,_o,_c,_t,_o,_r,_APOSTROPHE,_s,T_SPACE,_f,_e,_e,_s,T_SPACE,_HYPHEN,T_SPACE,_P,_a,_y,T_SPACE,_DOLLAR,_5,_O,T_EOS textCC3: ;It is your birthday Collect $1O from each player .db _I,_t,T_SPACE,_i,_s,T_SPACE,_y,_o,_u,_r,T_SPACE,_b,_i,_r,_t,_h,_d,_a,_y,T_SPACE,_C,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_1,_O,T_SPACE,_f,_r,_o,_m,T_SPACE,_e,_a,_c,_h,T_SPACE,_p,_l,_a,_y,_e,_r,T_EOS textCC4: ;Grand Opera Night - collect $5O from every player for opening night seats .db _G,_r,_a,_n,_d,T_SPACE,_O,_p,_e,_r,_a,T_SPACE,_N,_i,_g,_h,_t,T_SPACE,_HYPHEN,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_5,_O,T_SPACE,_f,_r,_o,_m,T_SPACE,_e,_v,_e,_r,_y,T_SPACE,_p,_l,_a,_y,_e,_r,T_SPACE,_f,_o,_r,T_SPACE,_o,_p,_e,_n,_i,_n,_g,T_SPACE,_n,_i,_g,_h,_t,T_SPACE,_s,_e,_a,_t,_s,T_EOS textCC5: ;Income Tax refund - collect $2O .db _I,_n,_c,_o,_m,_e,T_SPACE,_T,_a,_x,T_SPACE,_r,_e,_f,_u,_n,_d,T_SPACE,_HYPHEN,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_2,_O,T_EOS textCC6: ;Life Insurance Matures - collect $1OO .db _L,_i,_f,_e,T_SPACE,_I,_n,_s,_u,_r,_a,_n,_c,_e,T_SPACE,_M,_a,_t,_u,_r,_e,_s,T_SPACE,_HYPHEN,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_1,_O,_O,T_EOS textCC7: ;Pay Hospital Fees of $1OO .db _P,_a,_y,T_SPACE,_H,_o,_s,_p,_i,_t,_a,_l,T_SPACE,_F,_e,_e,_s,T_SPACE,_o,_f,T_SPACE,_DOLLAR,_1,_O,_O,T_EOS textCC8: ;Pay School Fees of $5O .db _P,_a,_y,T_SPACE,_S,_c,_h,_o,_o,_l,T_SPACE,_F,_e,_e,_s,T_SPACE,_o,_f,T_SPACE,_DOLLAR,_5,_O,T_EOS textCC9: ;Receive $25 Consultancy Fee .db _R,_e,_c,_e,_i,_v,_e,T_SPACE,_DOLLAR,_2,_5,T_SPACE,_C,_o,_n,_s,_u,_l,_t,_a,_n,_c,_y,T_SPACE,_F,_e,_e,T_EOS textCC10: ;You are assessed for street repairs - $4O per house, $115 per hotel .db _Y,_o,_u,T_SPACE,_a,_r,_e,T_SPACE,_a,_s,_s,_e,_s,_s,_e,_d,T_SPACE,_f,_o,_r,T_SPACE,_s,_t,_r,_e,_e,_t,T_SPACE,_r,_e,_p,_a,_i,_r,_s,T_SPACE,_HYPHEN,T_SPACE,_DOLLAR,_4,_O,T_SPACE,_p,_e,_r,T_SPACE,_h,_o,_u,_s,_e,_COMMA,T_SPACE,_DOLLAR,_1,_1,_5,T_SPACE,_p,_e,_r,T_SPACE,_h,_o,_t,_e,_l,T_EOS textCC11: ;You have won second prize in a beauty contest - collect $1O .db _Y,_o,_u,T_SPACE,_h,_a,_v,_e,T_SPACE,_w,_o,_n,T_SPACE,_s,_e,_c,_o,_n,_d,T_SPACE,_p,_r,_i,_z,_e,T_SPACE,_i,_n,T_SPACE,_a,T_SPACE,_b,_e,_a,_u,_t,_y,T_SPACE,_c,_o,_n,_t,_e,_s,_t,T_SPACE,_HYPHEN,T_SPACE,_c,_o,_l,_l,_e,_c,_t,T_SPACE,_DOLLAR,_1,_O,T_EOS textCC12: ;You inherit $1OO .db _Y,_o,_u,T_SPACE,_i,_n,_h,_e,_r,_i,_t,T_SPACE,_DOLLAR,_1,_O,_O,T_EOS textCC13: ;From sale of stock you get $5O .db _F,_r,_o,_m,T_SPACE,_s,_a,_l,_e,T_SPACE,_o,_f,T_SPACE,_s,_t,_o,_c,_k,T_SPACE,_y,_o,_u,T_SPACE,_g,_e,_t,T_SPACE,_DOLLAR,_5,_O,T_EOS textCC14: ;Holiday Fund matures - Receive $1OO .db _H,_o,_l,_i,_d,_a,_y,T_SPACE,_F,_u,_n,_d,T_SPACE,_m,_a,_t,_u,_r,_e,_s,T_SPACE,_HYPHEN,T_SPACE,_R,_e,_c,_e,_i,_v,_e,T_SPACE,_DOLLAR,_1,_O,_O,T_EOS