diff --git a/build/graphics/poker.exe b/build/graphics/poker.exe index dfd7820..f8df6dc 100644 Binary files a/build/graphics/poker.exe and b/build/graphics/poker.exe differ diff --git a/casino3d.inc b/casino3d.inc index 549c02a..5c4ee4d 100644 --- a/casino3d.inc +++ b/casino3d.inc @@ -115,6 +115,7 @@ MODE_ATM equ 5 MODE_COIN equ 6 MODE_DICE equ 7 MODE_SKULLS equ 8 +MODE_SKILL equ 9 WS_OVERLAPPEDWINDOW equ 00CF0000h SW_SHOW equ 5 @@ -283,31 +284,30 @@ roulWinningNum dd 0 roulPayout dd 0 roulOutcomeMsg db 64 dup(0) -; --- Native 2.5D Coin Flip Game --- +coinRxAnimTable db 26, 22, 16, 6, 16, 22, 26, 22, 16, 6 + +; --- Native 2.5D Coin Flip --- coin3d_bet dd 50 -coin3d_side dd 1 ; 1 = Îð¸ë, 2 = Ðåøêà +coin3d_choice dd 1 ; 1 = Îð¸ë, 2 = Ðåøêà coin3d_state dd 0 ; 0 = Idle, 1 = Flipping, 2 = Result coin3d_timer dd 0 coin3d_result dd 1 ; 1 = Îð¸ë, 2 = Ðåøêà coin3d_streak dd 0 coin3d_win dd 0 -coinRxAnimTable db 26, 22, 16, 6, 16, 22, 26, 22, 16, 6 - -; --- Native 2.5D Coin Flip --- -textCoinTitle db "* * * Ç Î Ë Î Ò À ß Ì Î Í Å Ò À * * *",0 +textCoinTitle db "* * * Ç Î Ë Î Ò À ß Ì Î Í Å Ò À * * *",0 textCoinHeads db "ÎШË",0 textCoinTails db "ÐÅØÊÀ",0 -textCoinStreak db "ÑÅÐÈß: ",0 textCoinSide1 db "[1] ÎШË",0 textCoinSide2 db "[2] ÐÅØÊÀ",0 textCoinFlipping db "ÌÎÍÅÒÀ  ÏÎ˨ÒÅ...",0 -textCoinWin db "ÂÛÈÃÐÛØ: +$",0 -textCoinLose db "ÍÅ ÓÃÀÄÀË!",0 -textCoinKey1 db "1:ÎШË",0 -textCoinKey2 db "2:ÐÅØÊÀ",0 -textCoinKeySpace db "ÏÐÎÁÅË:ÁÐÎÑÎÊ",0 -textCoinStreakFmt db "ÑÅÐÈß: [X] [X] [X] [ ] [ ] x4!",0 +textCoinWin db "ÏÎÁÅÄÀ: +$",0 +textCoinLose db "ÍÅ ÓÃÀÄÀËÈ!",0 +textCoinStreakFmt db "ÑÅÐÈß ÏÎÁÅÄ: x",0 +textCoinSelected db "ÂÛÁÐÀÍÎ",0 +textCoinKey1 db "[1] ÎШË",0 +textCoinKey2 db "[2] ÐÅØÊÀ",0 +textCoinKeySpace db "[SPACE]",0 ; --- Native 2.5D Dice Game --- dice3d_bet dd 50 @@ -319,12 +319,11 @@ dice3d_val2 dd 6 dice3d_sum dd 10 dice3d_win dd 0 -textDiceTitle db "=== G R A N D C R A P S ===",0 -textDiceSubtitle db "[ PASS LINE ] [ ANY CRAPS ]",0 +textDiceTitle db "=== G R A N D C R A P S ===",0 textDiceEven db "[1] רÒ",0 textDiceOdd db "[2] ÍÅ×ÅÒ",0 -textDiceEvenNums db "2 4 6 8 10",0 -textDiceOddNums db "3 5 7 9 11",0 +textDiceEvenNums db " 2 4 6 8 10 ",0 +textDiceOddNums db " 3 5 7 9 11 ",0 textDiceSumHdr db "ÑÓÌÌÀ: ",0 textDicePlus db " + ",0 textDiceEqual db " = ",0 @@ -334,9 +333,9 @@ textDiceRolling db " textDiceWin db "ÂÛÈÃÐÛØ: +$",0 textDiceWinMult db "! (x2)",0 textDiceLose db "ÏÐÎÈÃÐÛØ!",0 -textDiceKey1 db "1:רÒ",0 -textDiceKey2 db "2:ÍÅ×ÅÒ",0 -textDiceKeySpace db "ÏÐÎÁÅË:ÁÐÎÑÎÊ",0 +textDiceKey1 db "[1] רÒ",0 +textDiceKey2 db "[2] ÍÅ×ÅÒ",0 +textDiceKeySpace db "[SPACE]",0 ; --- Native 2.5D Skulls Game --- skulls3d_bet dd 50 @@ -349,21 +348,51 @@ skulls3d_swapPair0 dd 0 skulls3d_swapPair1 dd 1 skulls3d_swapPair2 dd 2 -textSkullsTitle db "+ + + Í À Ï ¨ Ð Ñ Ò Ê È + + +",0 +textSkullsTitle db "* * * Í À Ï ¨ Ð Ñ Ò Ê È * * *",0 textSkullsPhase0 db "ÄÅËÀÉ ÑÒÀÂÊÓ È ÆÌÈ [ÏÐÎÁÅË]",0 textSkullsPhase1 db "ÑÌÎÒÐÈ, ÃÄÅ ÇÎËÎÒÎÉ ØÀÐ...",0 textSkullsPhase2 db "ÊÐÓ×Ó, ÂÅÐ×Ó, ÇÀÏÓÒÀÒÜ ÕÎ×Ó...",0 textSkullsPhase3 db "ÃÄÅ ØÀÐ? ÂÛÁÈÐÀÉ: [1], [2] ÈËÈ [3]!",0 -textSkullsWin db "ÂÅÐÍÎ! ÂÛÏËÀÒÀ x3! +$",0 +textSkullsWin db "ÂÛÈÃÐÛØ: +$",0 +textSkullsWinMult db "! (x3) ÂÛ ÓÃÀÄÀËÈ!",0 textSkullsLose db "ÌÈÌÎ! ØÀÐ ÁÛË Â ÄÐÓÃÎÌ ÌÅÑÒÅ!",0 textSkullsAgain db "[ÏÐÎÁÅË] - ÑÛÃÐÀÒÜ ÅÙ¨ ÐÀÇ",0 -textSkullsKey1 db "1:ÊÓÁÎÊ",0 -textSkullsKey2 db "2:ÊÓÁÎÊ",0 -textSkullsKey3 db "3:ÊÓÁÎÊ",0 -textSkullsKeySpace db "ÏÐÎÁÅË",0 +textSkullsKey1 db "[1]",0 +textSkullsKey2 db "[2]",0 +textSkullsKey3 db "[3]",0 +textSkullsKeySpace db "[SPACE] ÑÒÀÐÒ",0 + +; --- Native 2.5D Skill Check (Dead by Daylight Survivor Check) --- +skill3d_bet dd 50 +skill3d_state dd 0 ; 0=Ready, 1=Active, 2=Hit Result, 3=Miss Result, 4=Escaped, 5=Defeated +skill3d_timer dd 0 +skill3d_needle dd 55 ; Needle X (52..268) +skill3d_speed dd 4 +skill3d_dir dd 1 ; 1=Right, -1=Left +skill3d_zone_start dd 140 +skill3d_zone_width dd 48 +skill3d_great_start dd 176 +skill3d_great_width dd 12 +skill3d_hits dd 0 +skill3d_misses dd 0 +skill3d_last_result dd 0 +skill3d_win_amount dd 0 + +textSkillTitle db "=== S K I L L C H E C K ===",0 +textSkillHitsHdr db "ÕÈÒ: ",0 +textSkillMissHdr db "ÏÐÎÌÀÕ: ",0 +textSkillReadyMsg db "ÍÀÆÌÈÒÅ [ÏÐÎÁÅË] ÄËß ÑÒÀÐÒÀ",0 +textSkillPrompt db "ÍÀÆÌÈÒÅ [ÏÐÎÁÅË]  ÇÎÍÅ!",0 +textSkillHitMsg db "ÕÈÒ! ÒÎ×ÍÎÅ ÏÎÏÀÄÀÍÈÅ!",0 +textSkillGreatMsg db "ÎÒËÈ×ÍÎ! GREAT SKILL CHECK! +ÁÎÍÓÑ!",0 +textSkillMissMsg db "ÏÐÎÌÀÕ! ÒÐÅÂÎÃÀ!",0 +textSkillEscape db "ÏÎÁÅà ÓÑÏÅØÅÍ! ÂÛÈÃÐÛØ: +$",0 +textSkillLost db "ÂÛ ÏÎÉÌÀÍÛ! ÏÐÎÈÃÐÛØ ÑÒÀÂÊÈ!",0 +textSkillKeySpace db "[SPACE] ÐÅÀÊÖÈß",0 +textSkillKeyBet db "[ÂÂÅÐÕ/ÂÍÈÇ]",0 ; --- Shared UI Strings --- -textKeyEsc db "ESC",0 +textKeyEsc db "[ESC]",0 textBankPrompt db "ÁÀÍÊ: $",0 textBetPrompt db "ÑÒÀÂÊÀ: $",0 textBetHint db " [W/S]",0 @@ -1604,7 +1633,7 @@ RenderMinimap PROC uses ebx esi edi mov radarY, 20 mov radarSize, 44 - invoke DrawBoxBorder, radarX, radarY, radarSize, radarSize, 00101510h, 0000D7FFh, 1 + invoke DrawBoxBorder, radarX, radarY, radarSize, radarSize, 00101510h, 00FFD700h, 1 ; Draw Sprites on radar xor esi, esi @@ -1646,7 +1675,7 @@ draw_player_radar: shr eax, 5 add eax, radarY - invoke DrawCircle, ebx, eax, 2, 000000FFh + invoke DrawCircle, ebx, eax, 2, 00FF2020h ret RenderMinimap ENDP @@ -1724,11 +1753,11 @@ HandleSlotsInput ENDP RenderSlotsGame PROC uses ebx esi edi ; Cabinet Background (Dark Cherry Wood & Gold) invoke DrawBox, 0, 0, SCREEN_W, SCREEN_H, 00150A10h - invoke DrawBoxBorder, 10, 10, 300, 220, 00251015h, 0000D7FFh, 3 + invoke DrawBoxBorder, 10, 10, 300, 220, 00251015h, 00FFD700h, 3 ; Illuminated Top Marquee - invoke DrawBoxBorder, 25, 20, 270, 32, 000A0505h, 0000FFFFh, 2 - invoke DrawString8x8, 55, 32, OFFSET textSlots3D, 0000D7FFh + invoke DrawBoxBorder, 25, 20, 270, 32, 000A0505h, 00FFFF00h, 2 + invoke DrawString8x8, 55, 32, OFFSET textSlots3D, 00FFD700h ; Spinning Animation Logic cmp slotSpinState, 1 @@ -1825,21 +1854,21 @@ draw_reels: call DrawReelSymbolAt3 ; Bottom Control Panel - invoke DrawBoxBorder, 20, 165, 280, 58, 00151515h, 0000D7FFh, 1 + invoke DrawBoxBorder, 20, 165, 280, 58, 00151515h, 00FFD700h, 1 - invoke DrawString8x8, 28, 172, OFFSET textBank3D, 0000D7FFh + invoke DrawString8x8, 28, 172, OFFSET textBank3D, 00FFD700h invoke FormatNumber, bankroll, OFFSET hudNumBuffer - invoke DrawString8x8, 110, 172, OFFSET hudNumBuffer, 0000FFFFh + invoke DrawString8x8, 110, 172, OFFSET hudNumBuffer, 00FFFF00h - invoke DrawString8x8, 175, 172, OFFSET textBet3D, 0000D7FFh + invoke DrawString8x8, 175, 172, OFFSET textBet3D, 00FFD700h invoke FormatNumber, slotBet, OFFSET hudNumBuffer invoke DrawString8x8, 240, 172, OFFSET hudNumBuffer, 0050FF50h cmp slotWinAmount, 0 jle draw_slot_ctrls - invoke DrawString8x8, 28, 187, OFFSET strWin, 0000FFFFh + invoke DrawString8x8, 28, 187, OFFSET strWin, 00FFFF00h invoke FormatNumber, slotWinAmount, OFFSET hudNumBuffer - invoke DrawString8x8, 110, 187, OFFSET hudNumBuffer, 0000FFFFh + invoke DrawString8x8, 110, 187, OFFSET hudNumBuffer, 00FFFF00h draw_slot_ctrls: invoke DrawString8x8, 28, 204, OFFSET textSlotsKeys3D, 00A0A0A0h @@ -1849,7 +1878,7 @@ RenderSlotsGame ENDP DrawReelSymbolAt1 PROC cmp eax, 0 jne @F - invoke DrawString8x8, 52, 105, OFFSET sym7, 000000FFh + invoke DrawString8x8, 52, 105, OFFSET sym7, 00FF2020h ret @@: cmp eax, 1 @@ -1859,7 +1888,7 @@ DrawReelSymbolAt1 PROC @@: cmp eax, 2 jne @F - invoke DrawString8x8, 52, 105, OFFSET symBell, 0000D7FFh + invoke DrawString8x8, 52, 105, OFFSET symBell, 00FFD700h ret @@: cmp eax, 3 @@ -1877,14 +1906,14 @@ DrawReelSymbolAt1 PROC invoke DrawString8x8, 52, 105, OFFSET symGem, 00FFFF00h ret @@: - invoke DrawString8x8, 52, 105, OFFSET symCrown, 0000D7FFh + invoke DrawString8x8, 52, 105, OFFSET symCrown, 00FFD700h ret DrawReelSymbolAt1 ENDP DrawReelSymbolAt2 PROC cmp eax, 0 jne @F - invoke DrawString8x8, 135, 105, OFFSET sym7, 000000FFh + invoke DrawString8x8, 135, 105, OFFSET sym7, 00FF2020h ret @@: cmp eax, 1 @@ -1894,7 +1923,7 @@ DrawReelSymbolAt2 PROC @@: cmp eax, 2 jne @F - invoke DrawString8x8, 135, 105, OFFSET symBell, 0000D7FFh + invoke DrawString8x8, 135, 105, OFFSET symBell, 00FFD700h ret @@: cmp eax, 3 @@ -1912,14 +1941,14 @@ DrawReelSymbolAt2 PROC invoke DrawString8x8, 135, 105, OFFSET symGem, 00FFFF00h ret @@: - invoke DrawString8x8, 135, 105, OFFSET symCrown, 0000D7FFh + invoke DrawString8x8, 135, 105, OFFSET symCrown, 00FFD700h ret DrawReelSymbolAt2 ENDP DrawReelSymbolAt3 PROC cmp eax, 0 jne @F - invoke DrawString8x8, 218, 105, OFFSET sym7, 000000FFh + invoke DrawString8x8, 218, 105, OFFSET sym7, 00FF2020h ret @@: cmp eax, 1 @@ -1929,7 +1958,7 @@ DrawReelSymbolAt3 PROC @@: cmp eax, 2 jne @F - invoke DrawString8x8, 218, 105, OFFSET symBell, 0000D7FFh + invoke DrawString8x8, 218, 105, OFFSET symBell, 00FFD700h ret @@: cmp eax, 3 @@ -1947,7 +1976,7 @@ DrawReelSymbolAt3 PROC invoke DrawString8x8, 218, 105, OFFSET symGem, 00FFFF00h ret @@: - invoke DrawString8x8, 218, 105, OFFSET symCrown, 0000D7FFh + invoke DrawString8x8, 218, 105, OFFSET symCrown, 00FFD700h ret DrawReelSymbolAt3 ENDP @@ -2211,13 +2240,13 @@ CalcDealerBJScore ENDP RenderBlackjackGame PROC uses ebx esi edi ; Emerald Felt Table Background invoke DrawBox, 0, 0, SCREEN_W, SCREEN_H, 000A3015h - invoke DrawBoxBorder, 10, 10, 300, 220, 000D4018h, 0000D7FFh, 3 + invoke DrawBoxBorder, 10, 10, 300, 220, 000D4018h, 00FFD700h, 3 ; Dealer Area Top - invoke DrawString8x8, 25, 20, OFFSET textBJ3D, 0000D7FFh + invoke DrawString8x8, 25, 20, OFFSET textBJ3D, 00FFD700h invoke DrawString8x8, 25, 35, OFFSET textDealer3D, 00FFFFFFh invoke FormatNumber, bjDealerScore, OFFSET hudNumBuffer - invoke DrawString8x8, 120, 35, OFFSET hudNumBuffer, 0000FFFFh + invoke DrawString8x8, 120, 35, OFFSET hudNumBuffer, 00FFFF00h ; Dealer Cards xor esi, esi @@ -2283,10 +2312,10 @@ draw_player_cards: draw_bj_footer: ; Footer Status & Controls - invoke DrawBoxBorder, 20, 182, 280, 42, 00102010h, 0000D7FFh, 1 + invoke DrawBoxBorder, 20, 182, 280, 42, 00102010h, 00FFD700h, 1 cmp BYTE PTR [bjOutcomeMsg], 0 je draw_bj_controls - invoke DrawString8x8, 28, 188, OFFSET bjOutcomeMsg, 0000FFFFh + invoke DrawString8x8, 28, 188, OFFSET bjOutcomeMsg, 00FFFF00h invoke DrawString8x8, 28, 204, OFFSET textNext3D, 00A0A0A0h ret @@ -2354,13 +2383,13 @@ HandleRouletteInput ENDP RenderRouletteGame PROC uses ebx esi edi ; Table felt background invoke DrawBox, 0, 0, SCREEN_W, SCREEN_H, 00151525h - invoke DrawBoxBorder, 10, 10, 300, 220, 00201525h, 0000D7FFh, 3 + invoke DrawBoxBorder, 10, 10, 300, 220, 00201525h, 00FFD700h, 3 ; 2.5D Rotating Wheel on Left invoke DrawCircle, 85, 110, 65, 00102550h - invoke DrawCircle, 85, 110, 60, 0000D7FFh + invoke DrawCircle, 85, 110, 60, 00FFD700h invoke DrawCircle, 85, 110, 52, 00101010h - invoke DrawCircle, 85, 110, 22, 0000D7FFh ; Center brass turret + invoke DrawCircle, 85, 110, 22, 00FFD700h ; Center brass turret ; Spinning Wheel / Ball Logic cmp roulState, 1 @@ -2488,32 +2517,32 @@ draw_roul_ball: ; Highlight Active Bet cmp roulBetType, 1 jne @F - invoke DrawBoxBorder, 173, 23, 129, 32, 0, 0000FFFFh, 2 + invoke DrawBoxBorder, 173, 23, 129, 32, 0, 00FFFF00h, 2 @@: cmp roulBetType, 2 jne @F - invoke DrawBoxBorder, 173, 58, 129, 32, 0, 0000FFFFh, 2 + invoke DrawBoxBorder, 173, 58, 129, 32, 0, 00FFFF00h, 2 @@: cmp roulBetType, 3 jne @F - invoke DrawBoxBorder, 173, 93, 129, 32, 0, 0000FFFFh, 2 + invoke DrawBoxBorder, 173, 93, 129, 32, 0, 00FFFF00h, 2 @@: cmp roulBetType, 4 jne @F - invoke DrawBoxBorder, 173, 128, 64, 30, 0, 0000FFFFh, 2 + invoke DrawBoxBorder, 173, 128, 64, 30, 0, 00FFFF00h, 2 @@: cmp roulBetType, 5 jne draw_ro_footer - invoke DrawBoxBorder, 238, 128, 64, 30, 0, 0000FFFFh, 2 + invoke DrawBoxBorder, 238, 128, 64, 30, 0, 00FFFF00h, 2 draw_ro_footer: - invoke DrawBoxBorder, 20, 180, 280, 42, 00101015h, 0000D7FFh, 1 + invoke DrawBoxBorder, 20, 180, 280, 42, 00101015h, 00FFD700h, 1 cmp roulState, 2 jne @F - invoke DrawString8x8, 28, 186, OFFSET textResult3D, 0000D7FFh + invoke DrawString8x8, 28, 186, OFFSET textResult3D, 00FFD700h invoke FormatNumber, roulWinningNum, OFFSET hudNumBuffer - invoke DrawString8x8, 85, 186, OFFSET hudNumBuffer, 0000FFFFh + invoke DrawString8x8, 85, 186, OFFSET hudNumBuffer, 00FFFF00h invoke DrawString8x8, 130, 186, OFFSET roulOutcomeMsg, 0050FF50h @@: invoke DrawString8x8, 28, 202, OFFSET textSpin3D, 00A0A0A0h @@ -2603,25 +2632,25 @@ HandleShopInput ENDP RenderShopGame PROC invoke DrawBox, 0, 0, SCREEN_W, SCREEN_H, 00150A0Ah - invoke DrawBoxBorder, 10, 10, 300, 220, 00251515h, 0000D7FFh, 3 - invoke DrawString8x8, 25, 20, OFFSET textShop3D, 0000D7FFh + invoke DrawBoxBorder, 10, 10, 300, 220, 00251515h, 00FFD700h, 3 + invoke DrawString8x8, 25, 20, OFFSET textShop3D, 00FFD700h invoke DrawBoxBorder, 20, 40, 280, 32, 001A1010h, 00FFFFFFh, 1 - invoke DrawString8x8, 28, 46, OFFSET textItem1_3D, 0000FFFFh + invoke DrawString8x8, 28, 46, OFFSET textItem1_3D, 00FFFF00h invoke DrawString8x8, 28, 58, OFFSET textShopHint3D, 00A0A0A0h invoke DrawBoxBorder, 20, 80, 280, 32, 001A1010h, 00FFFFFFh, 1 - invoke DrawString8x8, 28, 86, OFFSET textItem2_3D, 0000FFFFh + invoke DrawString8x8, 28, 86, OFFSET textItem2_3D, 00FFFF00h invoke DrawString8x8, 28, 98, OFFSET textShopHint3D, 00A0A0A0h invoke DrawBoxBorder, 20, 120, 280, 32, 001A1010h, 00FFFFFFh, 1 - invoke DrawString8x8, 28, 126, OFFSET textItem3_3D, 0000FFFFh + invoke DrawString8x8, 28, 126, OFFSET textItem3_3D, 00FFFF00h invoke DrawString8x8, 28, 138, OFFSET textShopHint3D, 00A0A0A0h - invoke DrawBoxBorder, 20, 165, 280, 55, 00100A0Ah, 0000D7FFh, 1 - invoke DrawString8x8, 28, 172, OFFSET textBank3D, 0000D7FFh + invoke DrawBoxBorder, 20, 165, 280, 55, 00100A0Ah, 00FFD700h, 1 + invoke DrawString8x8, 28, 172, OFFSET textBank3D, 00FFD700h invoke FormatNumber, bankroll, OFFSET hudNumBuffer - invoke DrawString8x8, 110, 172, OFFSET hudNumBuffer, 0000FFFFh + invoke DrawString8x8, 110, 172, OFFSET hudNumBuffer, 00FFFF00h cmp BYTE PTR [shopMsg], 0 je @F @@ -2650,76 +2679,80 @@ RenderATMGame PROC ret RenderATMGame ENDP +; ============================================================================== ; ============================================================================== ; ============================================================================== ; SHARED RICH UI PROCEDURES ; ============================================================================== DrawKeycap3D PROC uses ebx esi edi, x:DWORD, y:DWORD, strPtr:DWORD, isActive:DWORD - LOCAL capW:DWORD - ; Compute string length + local keyW:DWORD mov esi, strPtr xor ecx, ecx -@@: +keycap_len: mov al, [esi+ecx] test al, al - jz @F + jz keycap_len_done inc ecx - jmp @B -@@: - shl ecx, 3 ; length * 8 - add ecx, 8 ; padding 8px - mov capW, ecx + jmp keycap_len +keycap_len_done: + shl ecx, 3 + add ecx, 8 + mov keyW, ecx ; Drop shadow + mov eax, y + add eax, 2 + invoke DrawBox, x, eax, keyW, 13, 0008080Ch + + ; Border and Fill + cmp isActive, 0 + je keycap_inactive + mov eax, 00FFFF00h ; Bright Yellow active border + mov edx, 001B4B22h ; Casino Green active fill + mov ebx, 00FFFF00h ; Bright Yellow active text + jmp keycap_draw_box +keycap_inactive: + mov eax, 00606870h ; Slate inactive border + mov edx, 001A1C22h ; Charcoal inactive fill + mov ebx, 00D0D8E0h ; Silver inactive text + +keycap_draw_box: + push ebx + invoke DrawBoxBorder, x, y, keyW, 13, edx, eax, 1 + pop ebx + + ; Text label mov eax, x + add eax, 4 mov edx, y - add edx, 2 - invoke DrawBox, eax, edx, capW, 13, 0008080Ch + add edx, 3 + invoke DrawString8x8, eax, edx, strPtr, ebx - ; Body & Border - mov eax, 00606870h ; default border - mov edx, 001A1C22h ; default fill - cmp isActive, 0 - je @F - mov eax, 0000FFFFh ; active gold border - mov edx, 001B4B22h ; active dark green fill -@@: - invoke DrawBoxBorder, x, y, capW, 13, edx, eax, 1 - - ; String text - mov eax, 00D0D8E0h - cmp isActive, 0 - je @F - mov eax, 0000FFFFh -@@: - mov edx, x - add edx, 4 - mov ecx, y - add ecx, 3 - invoke DrawString8x8, edx, ecx, strPtr, eax - mov eax, capW + mov eax, keyW + add eax, 4 ret DrawKeycap3D ENDP DrawChipStack PROC uses ebx esi edi, x:DWORD, y:DWORD, chipCount:DWORD + mov edi, chipCount xor esi, esi chip_loop: - cmp esi, chipCount + cmp esi, edi jge chip_done mov eax, esi - shl eax, 2 ; esi * 4 + shl eax, 2 mov edx, y - sub edx, eax ; cy = y - esi*4 + sub edx, eax ; Shadow mov eax, x add eax, 2 mov ecx, edx add ecx, 5 - invoke DrawBox, eax, ecx, 20, 2, 00041006h + invoke DrawBox, eax, ecx, 20, 2, 00061004h - ; Chip body - invoke DrawBoxBorder, x, edx, 24, 6, 001515B8h, 00FFFFFFh, 1 + ; Red Clay Chip body with white rim + invoke DrawBoxBorder, x, edx, 24, 6, 00B81515h, 00FFFFFFh, 1 ; White stripe inlays mov eax, x @@ -2727,8 +2760,11 @@ chip_loop: mov ecx, edx add ecx, 1 invoke DrawBox, eax, ecx, 3, 4, 00FFFFFFh + mov eax, x add eax, 17 + mov ecx, edx + add ecx, 1 invoke DrawBox, eax, ecx, 3, 4, 00FFFFFFh inc esi @@ -2737,624 +2773,565 @@ chip_done: ret DrawChipStack ENDP -; ============================================================================== -; IN-ENGINE 2.5D MINI-GAME: COIN FLIP (ÌÎÍÅÒÊÀ) -; ============================================================================== DrawDetailedCoin PROC uses ebx esi edi, cxVal:DWORD, cyVal:DWORD, rxVal:DWORD, ryVal:DWORD, outerColor:DWORD, innerColor:DWORD, reliefType:DWORD - LOCAL curDY:DWORD, curDX:DWORD, rxSq:DWORD, rySq:DWORD, rxRySq:DWORD, threshSq:DWORD - cmp rxVal, 0 - jle coin_draw_ret - cmp ryVal, 0 - jle coin_draw_ret + local rxSq:DWORD + local rySq:DWORD + local rxRySq:DWORD + local threshSq:DWORD + local curDy:DWORD + local curDx:DWORD + local curX:DWORD + local curY:DWORD mov eax, rxVal - imul eax, eax + cmp eax, 0 + jle coin_draw_done + mov eax, ryVal + cmp eax, 0 + jle coin_draw_done + + mov eax, rxVal + imul eax, rxVal mov rxSq, eax mov eax, ryVal - imul eax, eax + imul eax, ryVal mov rySq, eax - mov eax, rxSq - imul eax, rySq + imul eax, rxSq mov rxRySq, eax - mov eax, rxRySq + ; 3/4 threshold for rim bevel + mov ecx, 3 + imul eax, ecx shr eax, 2 - imul eax, 3 mov threshSq, eax + ; Scan rows mov eax, ryVal neg eax - mov curDY, eax - -coin_y_loop: - mov eax, curDY + mov curDy, eax +coin_row_loop: + mov eax, curDy cmp eax, ryVal - jg check_coin_relief + jg coin_relief_check + mov edx, cyVal + add edx, curDy + mov curY, edx + + ; Scan columns mov eax, rxVal neg eax - mov curDX, eax - -coin_x_loop: - mov eax, curDX + mov curDx, eax +coin_col_loop: + mov eax, curDx cmp eax, rxVal - jg next_coin_y + jg coin_col_next_row - mov eax, curDX - imul eax, eax + mov ecx, cxVal + add ecx, curDx + mov curX, ecx + + ; val = dx*dx*rySq + dy*dy*rxSq + mov eax, curDx + imul eax, curDx imul eax, rySq - mov ebx, curDY - imul ebx, ebx - imul ebx, rxSq + mov ebx, eax + + mov eax, curDy + imul eax, curDy + imul eax, rxSq add eax, ebx + cmp eax, rxRySq - jg next_coin_x + ja coin_pixel_outside - mov ecx, innerColor cmp eax, threshSq - jb @F - mov ecx, outerColor -@@: - mov eax, cxVal - add eax, curDX - mov edx, cyVal - add edx, curDY - invoke DrawPixel, eax, edx, ecx + jb coin_draw_inner + invoke DrawPixel, curX, curY, outerColor + jmp coin_pixel_outside +coin_draw_inner: + invoke DrawPixel, curX, curY, innerColor -next_coin_x: - inc curDX - jmp coin_x_loop +coin_pixel_outside: + inc curDx + jmp coin_col_loop -next_coin_y: - inc curDY - jmp coin_y_loop +coin_col_next_row: + inc curDy + jmp coin_row_loop -check_coin_relief: +coin_relief_check: cmp rxVal, 14 - jl coin_draw_ret - cmp reliefType, 1 - je draw_eagle_relief - cmp reliefType, 2 - je draw_wreath_relief - jmp coin_draw_ret + jl coin_draw_done -draw_eagle_relief: - ; Crown + cmp reliefType, 1 + je coin_draw_eagle + cmp reliefType, 2 + je coin_draw_numeral + jmp coin_draw_done + +coin_draw_eagle: + ; Imperial Eagle relief (Dark Gold 009A7A00h / Bright 00FFD700h) mov eax, cxVal sub eax, 3 mov edx, cyVal sub edx, 14 - invoke DrawBox, eax, edx, 7, 2, 00007A9Ah + invoke DrawBox, eax, edx, 7, 2, 009A7A00h + mov eax, cxVal sub eax, 4 mov edx, cyVal sub edx, 12 - invoke DrawBox, eax, edx, 9, 2, 00007A9Ah + invoke DrawBox, eax, edx, 9, 2, 009A7A00h - ; Body & Head mov eax, cxVal sub eax, 2 mov edx, cyVal sub edx, 9 - invoke DrawBox, eax, edx, 5, 12, 00007A9Ah + invoke DrawBox, eax, edx, 5, 12, 009A7A00h + mov eax, cxVal - dec eax + sub eax, 1 mov edx, cyVal sub edx, 8 - invoke DrawBox, eax, edx, 3, 10, 0000D7FFh + invoke DrawBox, eax, edx, 3, 10, 00FFD700h - ; Wings mov eax, cxVal sub eax, 10 mov edx, cyVal sub edx, 8 - invoke DrawBox, eax, edx, 7, 3, 00007A9Ah + invoke DrawBox, eax, edx, 7, 3, 009A7A00h + mov eax, cxVal sub eax, 13 mov edx, cyVal sub edx, 5 - invoke DrawBox, eax, edx, 10, 3, 00007A9Ah + invoke DrawBox, eax, edx, 10, 3, 009A7A00h + mov eax, cxVal sub eax, 11 mov edx, cyVal sub edx, 2 - invoke DrawBox, eax, edx, 7, 3, 00007A9Ah + invoke DrawBox, eax, edx, 7, 3, 009A7A00h mov eax, cxVal add eax, 4 mov edx, cyVal sub edx, 8 - invoke DrawBox, eax, edx, 7, 3, 00007A9Ah + invoke DrawBox, eax, edx, 7, 3, 009A7A00h + mov eax, cxVal add eax, 4 mov edx, cyVal sub edx, 5 - invoke DrawBox, eax, edx, 10, 3, 00007A9Ah + invoke DrawBox, eax, edx, 10, 3, 009A7A00h + mov eax, cxVal add eax, 5 mov edx, cyVal sub edx, 2 - invoke DrawBox, eax, edx, 7, 3, 00007A9Ah + invoke DrawBox, eax, edx, 7, 3, 009A7A00h - ; Tail mov eax, cxVal sub eax, 4 mov edx, cyVal add edx, 4 - invoke DrawBox, eax, edx, 9, 3, 00007A9Ah + invoke DrawBox, eax, edx, 9, 3, 009A7A00h + mov eax, cxVal sub eax, 3 mov edx, cyVal add edx, 7 - invoke DrawBox, eax, edx, 7, 3, 00007A9Ah - jmp coin_draw_ret + invoke DrawBox, eax, edx, 7, 3, 009A7A00h + jmp coin_draw_done -draw_wreath_relief: - ; Roman numeral 'I' +coin_draw_numeral: + ; Roman numeral 'I' & laurel mov eax, cxVal sub eax, 5 mov edx, cyVal sub edx, 10 - invoke DrawBox, eax, edx, 11, 3, 00007A9Ah + invoke DrawBox, eax, edx, 11, 3, 009A7A00h + mov eax, cxVal sub eax, 2 mov edx, cyVal sub edx, 7 - invoke DrawBox, eax, edx, 5, 14, 00007A9Ah + invoke DrawBox, eax, edx, 5, 14, 009A7A00h + mov eax, cxVal - dec eax + sub eax, 1 mov edx, cyVal sub edx, 6 - invoke DrawBox, eax, edx, 3, 12, 0000D7FFh + invoke DrawBox, eax, edx, 3, 12, 00FFD700h + mov eax, cxVal sub eax, 6 mov edx, cyVal add edx, 7 - invoke DrawBox, eax, edx, 13, 3, 00007A9Ah + invoke DrawBox, eax, edx, 13, 3, 009A7A00h - ; Laurel dots left & right + ; Laurel dots mov eax, cxVal sub eax, 12 mov edx, cyVal - sub edx, 10 - invoke DrawBox, eax, edx, 2, 2, 00007A9Ah + sub edx, 8 + invoke DrawBox, eax, edx, 2, 2, 009A7A00h + mov eax, cxVal add eax, 11 mov edx, cyVal - sub edx, 10 - invoke DrawBox, eax, edx, 2, 2, 00007A9Ah + sub edx, 8 + invoke DrawBox, eax, edx, 2, 2, 009A7A00h mov eax, cxVal sub eax, 12 mov edx, cyVal - sub edx, 5 - invoke DrawBox, eax, edx, 2, 2, 00007A9Ah + invoke DrawBox, eax, edx, 2, 2, 009A7A00h + mov eax, cxVal add eax, 11 mov edx, cyVal - sub edx, 5 - invoke DrawBox, eax, edx, 2, 2, 00007A9Ah + invoke DrawBox, eax, edx, 2, 2, 009A7A00h mov eax, cxVal sub eax, 12 mov edx, cyVal - invoke DrawBox, eax, edx, 2, 2, 00007A9Ah + add edx, 8 + invoke DrawBox, eax, edx, 2, 2, 009A7A00h + mov eax, cxVal add eax, 11 mov edx, cyVal - invoke DrawBox, eax, edx, 2, 2, 00007A9Ah + add edx, 8 + invoke DrawBox, eax, edx, 2, 2, 009A7A00h - mov eax, cxVal - sub eax, 12 - mov edx, cyVal - add edx, 5 - invoke DrawBox, eax, edx, 2, 2, 00007A9Ah - mov eax, cxVal - add eax, 11 - mov edx, cyVal - add edx, 5 - invoke DrawBox, eax, edx, 2, 2, 00007A9Ah - -coin_draw_ret: +coin_draw_done: ret DrawDetailedCoin ENDP +; ============================================================================== +; IN-ENGINE 2.5D MINI-GAME: COIN FLIP +; ============================================================================== InitCoinGame PROC mov coin3d_state, 0 mov coin3d_timer, 0 + mov coin3d_streak, 0 mov coin3d_win, 0 - cmp coin3d_bet, 10 - jge @F - mov coin3d_bet, 50 -@@: ret InitCoinGame ENDP HandleCoinInput PROC + cmp coin3d_state, 0 + je coin_handle_idle cmp coin3d_state, 1 - je coin_input_done - - invoke Pressed3D, 20h ; SPACE -> Flip! - test eax, eax - jz check_coin_side - mov eax, bankroll - cmp eax, coin3d_bet - jl coin_no_cash - sub eax, coin3d_bet - mov bankroll, eax - mov coin3d_state, 1 - mov coin3d_timer, 0 - mov coin3d_win, 0 - invoke PlaySoundA, OFFSET soundCoin, 0, 1 - jmp coin_input_done - -coin_no_cash: - invoke CopyString3D, OFFSET msgNeedMoney, OFFSET flashMessage - mov flashTimer, 60 - invoke PlaySoundA, OFFSET soundClick, 0, 1 - jmp coin_input_done - -check_coin_side: - invoke Pressed3D, 31h ; '1' - test eax, eax - jz @F - mov coin3d_side, 1 - invoke PlaySoundA, OFFSET soundClick, 0, 1 -@@: - invoke Pressed3D, 32h ; '2' - test eax, eax - jz check_coin_bet_adjust - mov coin3d_side, 2 - invoke PlaySoundA, OFFSET soundClick, 0, 1 - -check_coin_bet_adjust: - invoke Pressed3D, 26h ; UP - test eax, eax - jnz coin_inc_bet - invoke Pressed3D, 57h ; W - test eax, eax - jz check_coin_bet_down -coin_inc_bet: - invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp coin3d_bet, 500 - jge coin_input_done - cmp coin3d_bet, 250 - jge coin_set_500 - cmp coin3d_bet, 100 - jge coin_set_250 - cmp coin3d_bet, 50 - jge coin_set_100 - cmp coin3d_bet, 25 - jge coin_set_50 - jmp coin_set_25 -coin_set_500: - mov coin3d_bet, 500 - jmp coin_input_done -coin_set_250: - mov coin3d_bet, 250 - jmp coin_input_done -coin_set_100: - mov coin3d_bet, 100 - jmp coin_input_done -coin_set_50: - mov coin3d_bet, 50 - jmp coin_input_done -coin_set_25: - mov coin3d_bet, 25 - jmp coin_input_done - -check_coin_bet_down: - invoke Pressed3D, 28h ; DOWN - test eax, eax - jnz coin_dec_bet - invoke Pressed3D, 53h ; S - test eax, eax - jz coin_input_done -coin_dec_bet: - invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp coin3d_bet, 25 - jle coin_set_10 - cmp coin3d_bet, 50 - jle coin_set_25 - cmp coin3d_bet, 100 - jle coin_set_50 - cmp coin3d_bet, 250 - jle coin_set_100 - mov coin3d_bet, 250 - jmp coin_input_done -coin_set_10: - mov coin3d_bet, 10 - -coin_input_done: + je coin_handle_flipping + cmp coin3d_state, 2 + je coin_handle_result ret -HandleCoinInput ENDP -RenderCoinGame PROC uses ebx esi edi - LOCAL cyVal:DWORD, rxVal:DWORD, curX:DWORD +coin_handle_idle: + invoke Pressed3D, 26h ; UP + test eax, eax + jnz coin_bet_up + invoke Pressed3D, 57h ; 'W' + test eax, eax + jnz coin_bet_up + invoke Pressed3D, 28h ; DOWN + test eax, eax + jnz coin_bet_down + invoke Pressed3D, 53h ; 'S' + test eax, eax + jnz coin_bet_down + invoke Pressed3D, 31h ; '1' + test eax, eax + jnz coin_pick_1 + invoke Pressed3D, 32h ; '2' + test eax, eax + jnz coin_pick_2 + invoke Pressed3D, 20h ; SPACE + test eax, eax + jnz coin_start_flip + ret - ; Cabinet Bezel (Mahogany wood & leather) - invoke DrawBox, 0, 0, 320, 240, 00060914h - invoke DrawBoxBorder, 6, 6, 308, 228, 000F1522h, 001B2E48h, 3 - - ; Corner Brass Rivets - invoke DrawBox, 12, 12, 3, 3, 0000D7FFh - invoke DrawPixel, 13, 13, 00FFFFFFh - invoke DrawBox, 306, 12, 3, 3, 0000D7FFh - invoke DrawPixel, 307, 13, 00FFFFFFh - invoke DrawBox, 12, 226, 3, 3, 0000D7FFh - invoke DrawPixel, 13, 227, 00FFFFFFh - invoke DrawBox, 306, 226, 3, 3, 0000D7FFh - invoke DrawPixel, 307, 227, 00FFFFFFh - - ; Illuminated Marquee Header - invoke DrawBoxBorder, 24, 12, 272, 26, 000A101Ch, 0000D7FFh, 2 - invoke DrawString8x8, 48, 21, OFFSET textCoinTitle, 0000FFFFh - - ; Bulb lights on marquee border - mov curX, 28 -coin_bulbs: - cmp curX, 292 - jge coin_meters - invoke DrawPixel, curX, 13, 0000FFFFh - invoke DrawPixel, curX, 36, 0000D7FFh - add curX, 12 - jmp coin_bulbs - -coin_meters: - ; Status Meters: Bank & Bet - invoke DrawBoxBorder, 20, 44, 114, 18, 000A1A0Eh, 001A4B22h, 1 - invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 0050FF50h - invoke FormatNumber, bankroll, OFFSET hudNumBuffer - invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 0050FF50h - - invoke DrawBoxBorder, 186, 44, 114, 18, 001A100Ah, 003A2814h, 1 - invoke DrawString8x8, 190, 49, OFFSET textBetPrompt, 0000D7FFh - invoke FormatNumber, coin3d_bet, OFFSET hudNumBuffer - invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 0000D7FFh - invoke DrawString8x8, 278, 49, OFFSET textBetHint, 00808080h - - ; Center Velvet Platter - invoke DrawCircle, 160, 110, 46, 000090C0h - invoke DrawCircle, 160, 110, 44, 0000D7FFh - invoke DrawCircle, 160, 110, 41, 00180824h - - ; Selection Podiums: [1] ÎÐ¨Ë - mov eax, 00121620h - mov edx, 00404855h - mov ecx, 0090A0B0h - cmp coin3d_side, 1 - jne @F - mov eax, 001C3822h - mov edx, 0000FFFFh - mov ecx, 0000FFFFh +coin_bet_up: + mov eax, coin3d_bet + add eax, 50 + cmp eax, bankroll + jle @F + mov eax, bankroll @@: - push ecx - invoke DrawBoxBorder, 20, 72, 76, 52, eax, edx, 2 - pop ecx - invoke DrawString8x8, 28, 78, OFFSET textCoinSide1, ecx - invoke DrawDetailedCoin, 58, 106, 12, 12, 0000A0D0h, 0000D7FFh, 1 - - ; Selection Podiums: [2] ÐÅØÊÀ - mov eax, 00121620h - mov edx, 00404855h - mov ecx, 0090A0B0h - cmp coin3d_side, 2 - jne @F - mov eax, 001C3822h - mov edx, 0000FFFFh - mov ecx, 0000FFFFh + cmp eax, 5000 + jle @F + mov eax, 5000 @@: - push ecx - invoke DrawBoxBorder, 224, 72, 76, 52, eax, edx, 2 - pop ecx - invoke DrawString8x8, 232, 78, OFFSET textCoinSide2, ecx - invoke DrawDetailedCoin, 262, 106, 12, 12, 000080A0h, 0000B0D0h, 2 + mov coin3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret - ; Flipping animation logic - cmp coin3d_state, 1 - jne coin_at_rest +coin_bet_down: + mov eax, coin3d_bet + sub eax, 50 + cmp eax, 50 + jge @F + mov eax, 50 +@@: + mov coin3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret - inc coin3d_timer +coin_pick_1: + mov coin3d_choice, 1 + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret - ; Parabolic toss: cy = 110 - (t * (40 - t)) / 14 - mov eax, coin3d_timer - mov ecx, 40 - sub ecx, eax - imul eax, ecx - xor edx, edx - mov ecx, 14 - div ecx - mov edx, 110 - sub edx, eax - mov cyVal, edx +coin_pick_2: + mov coin3d_choice, 2 + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret - ; Width rx from lookup table: (t % 10) - mov eax, coin3d_timer - xor edx, edx - mov ecx, 10 - div ecx - movzx eax, BYTE PTR [coinRxAnimTable + edx] - mov rxVal, eax +coin_start_flip: + mov eax, coin3d_bet + cmp eax, bankroll + jle @F + mov eax, bankroll + mov coin3d_bet, eax + test eax, eax + jz coin_done +@@: + mov eax, coin3d_bet + sub bankroll, eax + mov coin3d_state, 1 + mov coin3d_timer, 40 + invoke PlaySoundA, OFFSET soundCoin, 0, 1 + ret - invoke DrawDetailedCoin, 160, cyVal, rxVal, 26, 0000A0D0h, 0000D7FFh, 0 - invoke DrawString8x8, 88, 160, OFFSET textCoinFlipping, 0000FFFFh - - cmp coin3d_timer, 40 - jl coin_draw_controls - - ; Flip complete! - mov coin3d_state, 2 +coin_handle_flipping: + dec coin3d_timer + cmp coin3d_timer, 0 + jg coin_done invoke RandomRange3D, 2 inc eax mov coin3d_result, eax - - mov eax, coin3d_result - cmp eax, coin3d_side + mov edx, coin3d_choice + cmp eax, edx jne coin_flip_lost ; Won! + inc coin3d_streak mov eax, coin3d_bet shl eax, 1 - mov coin3d_win, eax add bankroll, eax - inc coin3d_streak - cmp coin3d_streak, 3 - jl @F - invoke PlaySoundA, OFFSET soundVictory, 0, 1 - jmp coin_draw_controls -@@: + mov coin3d_win, eax + mov coin3d_state, 2 invoke PlaySoundA, OFFSET soundCoinDing, 0, 1 - jmp coin_draw_controls + ret coin_flip_lost: mov coin3d_streak, 0 mov coin3d_win, 0 + mov coin3d_state, 2 invoke PlaySoundA, OFFSET soundLose, 0, 1 - jmp coin_draw_controls + ret -coin_at_rest: - ; Draw coin resting in velvet dish - mov edx, coin3d_side +coin_handle_result: + invoke Pressed3D, 20h + test eax, eax + jz coin_done + mov coin3d_state, 0 + invoke PlaySoundA, OFFSET soundClick, 0, 1 +coin_done: + ret +HandleCoinInput ENDP + +RenderCoinGame PROC uses ebx esi edi + local cyVal:DWORD + local rxVal:DWORD + local kx:DWORD + + ; Background & Cabinet border + invoke DrawBox, 0, 0, 320, 240, 00140906h + invoke DrawBoxBorder, 6, 6, 308, 228, 0022150Fh, 00482E1Bh, 3 + + ; Header + invoke DrawBoxBorder, 20, 12, 280, 26, 001C100Ah, 00FFD700h, 2 + invoke DrawString8x8, 44, 21, OFFSET textCoinTitle, 00FFFF00h + + ; Corner rivets + invoke DrawBox, 12, 12, 3, 3, 00FFD700h + invoke DrawBox, 306, 12, 3, 3, 00FFD700h + invoke DrawBox, 12, 226, 3, 3, 00FFD700h + invoke DrawBox, 306, 226, 3, 3, 00FFD700h + + ; Status meters + invoke DrawBoxBorder, 20, 44, 110, 18, 000E1A0Ah, 00224B1Ah, 1 + invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 003CFF3Ch + invoke FormatNumber, bankroll, OFFSET hudNumBuffer + invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 003CFF3Ch + + invoke DrawBoxBorder, 190, 44, 110, 18, 001A100Ah, 003A2814h, 1 + invoke DrawString8x8, 194, 49, OFFSET textBetPrompt, 00FFD700h + invoke FormatNumber, coin3d_bet, OFFSET hudNumBuffer + invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 00FFD700h + + ; Left: Heads + cmp coin3d_choice, 1 + jne coin_left_inactive + invoke DrawBoxBorder, 20, 72, 76, 68, 00101828h, 00FFFF00h, 2 + invoke DrawString8x8, 30, 78, OFFSET textCoinSide1, 00FFFF00h + invoke DrawDetailedCoin, 58, 106, 14, 14, 00D0A000h, 00FFD700h, 1 + invoke DrawString8x8, 24, 126, OFFSET textCoinSelected, 003CFF3Ch + jmp coin_right_side +coin_left_inactive: + invoke DrawBoxBorder, 20, 72, 76, 68, 000A101Ch, 00404855h, 1 + invoke DrawString8x8, 30, 78, OFFSET textCoinSide1, 00D0D8E0h + invoke DrawDetailedCoin, 58, 106, 14, 14, 009A7A00h, 00D0A000h, 1 + +coin_right_side: + ; Right: Tails + cmp coin3d_choice, 2 + jne coin_right_inactive + invoke DrawBoxBorder, 224, 72, 76, 68, 00101828h, 00FFFF00h, 2 + invoke DrawString8x8, 234, 78, OFFSET textCoinSide2, 00FFFF00h + invoke DrawDetailedCoin, 262, 106, 14, 14, 00D0A000h, 00FFD700h, 2 + invoke DrawString8x8, 228, 126, OFFSET textCoinSelected, 003CFF3Ch + jmp coin_center_area +coin_right_inactive: + invoke DrawBoxBorder, 224, 72, 76, 68, 000A101Ch, 00404855h, 1 + invoke DrawString8x8, 234, 78, OFFSET textCoinSide2, 00D0D8E0h + invoke DrawDetailedCoin, 262, 106, 14, 14, 009A7A00h, 00D0A000h, 2 + +coin_center_area: + ; Center spotlight + invoke DrawCircle, 160, 110, 48, 00121620h + invoke DrawCircle, 160, 110, 44, 00FFD700h + invoke DrawCircle, 160, 110, 42, 000E141Eh + + cmp coin3d_state, 1 + je coin_render_flipping cmp coin3d_state, 2 - jne @F - mov edx, coin3d_result -@@: - invoke DrawDetailedCoin, 160, 110, 26, 26, 0000A0D0h, 0000D7FFh, edx + je coin_render_result - ; Outcome / Streak Display - cmp coin3d_state, 2 - jne coin_show_streak + ; Idle coin + invoke DrawDetailedCoin, 160, 110, 26, 26, 00D0A000h, 00FFD700h, coin3d_choice + jmp coin_render_keys - cmp coin3d_win, 0 - je coin_show_lose - invoke DrawBoxBorder, 44, 154, 232, 20, 000E141Eh, 0050FF50h, 1 - invoke DrawString8x8, 64, 160, OFFSET textCoinWin, 0050FF50h +coin_render_flipping: + mov eax, coin3d_timer + and eax, 7 + movzx eax, byte ptr [coinRxAnimTable + eax] + mov rxVal, eax + invoke DrawDetailedCoin, 160, 110, rxVal, 26, 00D0A000h, 00FFD700h, 0 + invoke DrawString8x8, 88, 160, OFFSET textCoinFlipping, 00FFFF00h + jmp coin_render_keys + +coin_render_result: + invoke DrawDetailedCoin, 160, 110, 26, 26, 00D0A000h, 00FFD700h, coin3d_result + mov eax, coin3d_result + cmp eax, coin3d_choice + jne coin_render_loss_msg + + ; Win banner + invoke DrawBoxBorder, 44, 154, 232, 22, 000E141Eh, 003CFF3Ch, 1 + invoke DrawString8x8, 64, 161, OFFSET textCoinWin, 003CFF3Ch invoke FormatNumber, coin3d_win, OFFSET hudNumBuffer - invoke DrawString8x8, 152, 160, OFFSET hudNumBuffer, 0050FF50h - jmp coin_draw_controls + invoke DrawString8x8, 152, 161, OFFSET hudNumBuffer, 003CFF3Ch + jmp coin_render_keys -coin_show_lose: - invoke DrawBoxBorder, 44, 154, 232, 20, 000E141Eh, 000000FFh, 1 - invoke DrawString8x8, 114, 160, OFFSET textCoinLose, 008080FFh - jmp coin_draw_controls +coin_render_loss_msg: + invoke DrawBoxBorder, 44, 154, 232, 22, 000E141Eh, 00C81414h, 1 + invoke DrawString8x8, 114, 161, OFFSET textCoinLose, 00FF6464h -coin_show_streak: - invoke DrawBoxBorder, 44, 154, 232, 20, 000E141Eh, 0000D7FFh, 1 - invoke DrawString8x8, 52, 160, OFFSET textCoinStreakFmt, 0000FFFFh - -coin_draw_controls: - ; Keycaps Control Bar - invoke DrawBox, 16, 194, 288, 1, 001E2E40h - - mov eax, 0 - cmp coin3d_side, 1 +coin_render_keys: + mov kx, 16 + xor eax, eax + cmp coin3d_choice, 1 sete al - invoke DrawKeycap3D, 22, 202, OFFSET textCoinKey1, eax + invoke DrawKeycap3D, kx, 192, OFFSET textCoinKey1, eax + add kx, eax - mov eax, 0 - cmp coin3d_side, 2 + xor eax, eax + cmp coin3d_choice, 2 sete al - invoke DrawKeycap3D, 88, 202, OFFSET textCoinKey2, eax + invoke DrawKeycap3D, kx, 192, OFFSET textCoinKey2, eax + add kx, eax - invoke DrawKeycap3D, 160, 202, OFFSET textCoinKeySpace, 1 - invoke DrawKeycap3D, 274, 202, OFFSET textKeyEsc, 0 + invoke DrawKeycap3D, kx, 192, OFFSET textCoinKeySpace, 1 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textKeyEsc, 0 ret RenderCoinGame ENDP ; ============================================================================== -; IN-ENGINE 2.5D MINI-GAME: DICE / CRAPS (ÊÎÑÒÈ) +; IN-ENGINE 2.5D MINI-GAME: CRAPS / DICE ; ============================================================================== DrawCrapsDie PROC uses ebx esi edi, x:DWORD, y:DWORD, sizeVal:DWORD, valNum:DWORD - ; Drop shadow on green felt + ; Drop shadow mov eax, x add eax, 3 mov edx, y add edx, sizeVal - invoke DrawBox, eax, edx, sizeVal, 3, 00031408h + invoke DrawBox, eax, edx, sizeVal, 3, 00081403h + mov eax, x add eax, sizeVal mov edx, y add edx, 3 - invoke DrawBox, eax, edx, 3, sizeVal, 00031408h + invoke DrawBox, eax, edx, 3, sizeVal, 00081403h - ; Ivory body & dark border - invoke DrawBoxBorder, x, y, sizeVal, sizeVal, 00F0F4FAh, 00353540h, 1 - - ; Bevel highlight top & left - mov eax, sizeVal - sub eax, 2 - mov edx, x + ; Ivory body & bevel + invoke DrawBoxBorder, x, y, sizeVal, sizeVal, 00FAF4F0h, 00403535h, 1 + mov eax, x + inc eax + mov edx, y inc edx - mov ecx, y - inc ecx - invoke DrawBox, edx, ecx, eax, 1, 00FFFFFFh - invoke DrawBox, edx, ecx, 1, eax, 00FFFFFFh - - ; Bevel shadow bottom & right - mov edx, x - inc edx - mov ecx, y - add ecx, sizeVal + mov ecx, sizeVal sub ecx, 2 - invoke DrawBox, edx, ecx, eax, 1, 00C0C6D0h - mov edx, x - add edx, sizeVal - sub edx, 2 - mov ecx, y - inc ecx - invoke DrawBox, edx, ecx, 1, eax, 00C0C6D0h + invoke DrawBox, eax, edx, ecx, 1, 00FFFFFFh + invoke DrawBox, eax, edx, 1, ecx, 00FFFFFFh - ; Casino Ruby Red circular pips (radius 3) - cmp valNum, 1 - je draw_die_c - cmp valNum, 3 - je draw_die_c - cmp valNum, 5 - je draw_die_c - jmp check_die_pips_corners - -draw_die_c: + ; Ruby pips (00C81515h) + mov eax, valNum + test al, 1 + jz @F + ; Center pip mov eax, x add eax, 18 mov edx, y add edx, 18 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h dec eax dec edx invoke DrawPixel, eax, edx, 00FFFFFFh - -check_die_pips_corners: +@@: cmp valNum, 2 jl die_pips_done mov eax, x add eax, 9 mov edx, y add edx, 9 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h mov eax, x - add eax, sizeVal - sub eax, 10 + add eax, 27 mov edx, y - add edx, sizeVal - sub edx, 10 - invoke DrawCircle, eax, edx, 3, 001515C8h + add edx, 27 + invoke DrawCircle, eax, edx, 3, 00C81515h cmp valNum, 4 jl die_pips_done mov eax, x - add eax, sizeVal - sub eax, 10 + add eax, 27 mov edx, y add edx, 9 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h mov eax, x add eax, 9 mov edx, y - add edx, sizeVal - sub edx, 10 - invoke DrawCircle, eax, edx, 3, 001515C8h + add edx, 27 + invoke DrawCircle, eax, edx, 3, 00C81515h cmp valNum, 6 jl die_pips_done @@ -3362,13 +3339,12 @@ check_die_pips_corners: add eax, 9 mov edx, y add edx, 18 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h mov eax, x - add eax, sizeVal - sub eax, 10 + add eax, 27 mov edx, y add edx, 18 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h die_pips_done: ret @@ -3378,328 +3354,274 @@ InitDiceGame PROC mov dice3d_state, 0 mov dice3d_timer, 0 mov dice3d_win, 0 - cmp dice3d_bet, 10 - jge @F - mov dice3d_bet, 50 -@@: ret InitDiceGame ENDP HandleDiceInput PROC + cmp dice3d_state, 0 + je dice_handle_idle cmp dice3d_state, 1 - je dice_input_done + je dice_handle_rolling + cmp dice3d_state, 2 + je dice_handle_result + ret - invoke Pressed3D, 20h ; SPACE -> Roll! +dice_handle_idle: + invoke Pressed3D, 26h ; UP test eax, eax - jz check_dice_choice + jnz dice_bet_up + invoke Pressed3D, 57h ; 'W' + test eax, eax + jnz dice_bet_up + invoke Pressed3D, 28h ; DOWN + test eax, eax + jnz dice_bet_down + invoke Pressed3D, 53h ; 'S' + test eax, eax + jnz dice_bet_down + invoke Pressed3D, 31h ; '1' + test eax, eax + jnz dice_pick_1 + invoke Pressed3D, 32h ; '2' + test eax, eax + jnz dice_pick_2 + invoke Pressed3D, 20h ; SPACE + test eax, eax + jnz dice_start_roll + ret + +dice_bet_up: + mov eax, dice3d_bet + add eax, 50 + cmp eax, bankroll + jle @F mov eax, bankroll - cmp eax, dice3d_bet - jl dice_no_cash - sub eax, dice3d_bet - mov bankroll, eax - mov dice3d_state, 1 - mov dice3d_timer, 0 - mov dice3d_win, 0 - invoke PlaySoundA, OFFSET soundCards, 0, 1 - jmp dice_input_done - -dice_no_cash: - invoke CopyString3D, OFFSET msgNeedMoney, OFFSET flashMessage - mov flashTimer, 60 +@@: + cmp eax, 5000 + jle @F + mov eax, 5000 +@@: + mov dice3d_bet, eax invoke PlaySoundA, OFFSET soundClick, 0, 1 - jmp dice_input_done + ret -check_dice_choice: - invoke Pressed3D, 31h ; '1' - test eax, eax - jz @F +dice_bet_down: + mov eax, dice3d_bet + sub eax, 50 + cmp eax, 50 + jge @F + mov eax, 50 +@@: + mov dice3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +dice_pick_1: mov dice3d_choice, 1 invoke PlaySoundA, OFFSET soundClick, 0, 1 -@@: - invoke Pressed3D, 32h ; '2' - test eax, eax - jz check_dice_bet_adjust + ret + +dice_pick_2: mov dice3d_choice, 2 invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret -check_dice_bet_adjust: - invoke Pressed3D, 26h ; UP +dice_start_roll: + mov eax, dice3d_bet + cmp eax, bankroll + jle @F + mov eax, bankroll + mov dice3d_bet, eax test eax, eax - jnz dice_inc_bet - invoke Pressed3D, 57h ; W + jz dice_done +@@: + mov eax, dice3d_bet + sub bankroll, eax + mov dice3d_state, 1 + mov dice3d_timer, 35 + invoke PlaySoundA, OFFSET soundCards, 0, 1 + ret + +dice_handle_rolling: + dec dice3d_timer + cmp dice3d_timer, 0 + jg dice_randomize_tumble + + ; Roll finished! + invoke RandomRange3D, 6 + inc eax + mov dice3d_val1, eax + invoke RandomRange3D, 6 + inc eax + mov dice3d_val2, eax + + mov edx, dice3d_val1 + add edx, eax + mov dice3d_sum, edx + + ; Parity check + mov eax, edx + and eax, 1 + jnz dice_sum_is_odd + ; Even + mov eax, 1 + jmp dice_check_win +dice_sum_is_odd: + mov eax, 2 + +dice_check_win: + cmp eax, dice3d_choice + jne dice_roll_lost + + ; Won! + mov eax, dice3d_bet + shl eax, 1 + add bankroll, eax + mov dice3d_win, eax + mov dice3d_state, 2 + invoke PlaySoundA, OFFSET soundVictory, 0, 1 + ret + +dice_roll_lost: + mov dice3d_win, 0 + mov dice3d_state, 2 + invoke PlaySoundA, OFFSET soundLose, 0, 1 + ret + +dice_randomize_tumble: + invoke RandomRange3D, 6 + inc eax + mov dice3d_val1, eax + invoke RandomRange3D, 6 + inc eax + mov dice3d_val2, eax + ret + +dice_handle_result: + invoke Pressed3D, 20h test eax, eax - jz check_dice_bet_down -dice_inc_bet: + jz dice_done + mov dice3d_state, 0 invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp dice3d_bet, 500 - jge dice_input_done - cmp dice3d_bet, 250 - jge dice_set_500 - cmp dice3d_bet, 100 - jge dice_set_250 - cmp dice3d_bet, 50 - jge dice_set_100 - cmp dice3d_bet, 25 - jge dice_set_50 - jmp dice_set_25 -dice_set_500: - mov dice3d_bet, 500 - jmp dice_input_done -dice_set_250: - mov dice3d_bet, 250 - jmp dice_input_done -dice_set_100: - mov dice3d_bet, 100 - jmp dice_input_done -dice_set_50: - mov dice3d_bet, 50 - jmp dice_input_done -dice_set_25: - mov dice3d_bet, 25 - jmp dice_input_done - -check_dice_bet_down: - invoke Pressed3D, 28h ; DOWN - test eax, eax - jnz dice_dec_bet - invoke Pressed3D, 53h ; S - test eax, eax - jz dice_input_done -dice_dec_bet: - invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp dice3d_bet, 25 - jle dice_set_10 - cmp dice3d_bet, 50 - jle dice_set_25 - cmp dice3d_bet, 100 - jle dice_set_50 - cmp dice3d_bet, 250 - jle dice_set_100 - mov dice3d_bet, 250 - jmp dice_input_done -dice_set_10: - mov dice3d_bet, 10 - -dice_input_done: +dice_done: ret HandleDiceInput ENDP RenderDiceGame PROC uses ebx esi edi - LOCAL d1X:DWORD, d1Y:DWORD, d2X:DWORD, d2Y:DWORD, bxX:DWORD + local kx:DWORD - ; Craps Emerald Felt & Oak Armrest - invoke DrawBox, 0, 0, 320, 240, 00082E12h - invoke DrawBoxBorder, 4, 4, 312, 232, 00093816h, 00122244h, 3 - invoke DrawBoxBorder, 8, 8, 304, 224, 000A3F19h, 0005140Ah, 2 + ; Mahogany frame & Deep Felt Green table + invoke DrawBox, 0, 0, 320, 240, 00140906h + invoke DrawBoxBorder, 6, 6, 308, 228, 000A3816h, 00FFD700h, 2 - ; Pyramidal diamond craps backboard texture - mov bxX, 12 -craps_bumper: - cmp bxX, 308 - jge craps_felt_markings - mov eax, bxX - add eax, 4 - invoke DrawBox, eax, 11, 4, 4, 00041006h - mov eax, bxX - add eax, 5 - invoke DrawPixel, eax, 12, 000F4820h - add bxX, 12 - jmp craps_bumper + ; Header + invoke DrawBoxBorder, 20, 12, 280, 26, 00072E13h, 00FFD700h, 2 + invoke DrawString8x8, 48, 21, OFFSET textDiceTitle, 00FFFF00h -craps_felt_markings: - ; Table Markings printed in gold directly on felt - invoke DrawString8x8, 72, 20, OFFSET textDiceTitle, 0000D7FFh - invoke DrawString8x8, 68, 32, OFFSET textDiceSubtitle, 0000B0A0h - - ; Meters: Bank & Bet - invoke DrawBoxBorder, 16, 46, 108, 16, 0006240Eh, 000E5022h, 1 - invoke DrawString8x8, 20, 50, OFFSET textBankPrompt, 0050FF50h + ; Status + invoke DrawBoxBorder, 20, 44, 110, 18, 00072E13h, 001B4B22h, 1 + invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 003CFF3Ch invoke FormatNumber, bankroll, OFFSET hudNumBuffer - invoke DrawString8x8, 68, 50, OFFSET hudNumBuffer, 0050FF50h + invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 003CFF3Ch - invoke DrawBoxBorder, 196, 46, 108, 16, 0006240Eh, 000E5022h, 1 - invoke DrawString8x8, 200, 50, OFFSET textBetPrompt, 0000D7FFh + invoke DrawBoxBorder, 190, 44, 110, 18, 00072E13h, 001B4B22h, 1 + invoke DrawString8x8, 194, 49, OFFSET textBetPrompt, 00FFD700h invoke FormatNumber, dice3d_bet, OFFSET hudNumBuffer - invoke DrawString8x8, 264, 50, OFFSET hudNumBuffer, 0000D7FFh + invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 00FFD700h - ; Betting Zone Left: [1] ×¨Ò - mov eax, 00073014h - mov edx, 001A602Ah - mov ecx, 0080B090h + ; [1] ×¨Ò cmp dice3d_choice, 1 - jne @F - mov eax, 000B441Dh - mov edx, 0000FFFFh - mov ecx, 0000FFFFh -@@: - push ecx - invoke DrawBoxBorder, 16, 68, 88, 54, eax, edx, 2 - pop ecx - invoke DrawString8x8, 24, 74, OFFSET textDiceEven, ecx - invoke DrawString8x8, 20, 86, OFFSET textDiceEvenNums, 0000D7FFh - cmp dice3d_choice, 1 - jne @F - invoke DrawChipStack, 48, 110, 4 -@@: + jne dice_even_inactive + invoke DrawBoxBorder, 16, 70, 88, 48, 00072E13h, 00FFFF00h, 2 + invoke DrawString8x8, 30, 76, OFFSET textDiceEven, 00FFFF00h + invoke DrawString8x8, 22, 90, OFFSET textDiceEvenNums, 00FFD700h + invoke DrawString8x8, 26, 104, OFFSET textCoinSelected, 003CFF3Ch + jmp dice_odd_side +dice_even_inactive: + invoke DrawBoxBorder, 16, 70, 88, 48, 00072E13h, 001B4B22h, 1 + invoke DrawString8x8, 30, 76, OFFSET textDiceEven, 00D0D8E0h + invoke DrawString8x8, 22, 90, OFFSET textDiceEvenNums, 0080B090h - ; Betting Zone Right: [2] ÍÅ×ÅÒ - mov eax, 00073014h - mov edx, 001A602Ah - mov ecx, 0080B090h +dice_odd_side: + ; [2] ÍÅ×ÅÒ cmp dice3d_choice, 2 - jne @F - mov eax, 000B441Dh - mov edx, 0000FFFFh - mov ecx, 0000FFFFh -@@: - push ecx - invoke DrawBoxBorder, 216, 68, 88, 54, eax, edx, 2 - pop ecx - invoke DrawString8x8, 224, 74, OFFSET textDiceOdd, ecx - invoke DrawString8x8, 224, 86, OFFSET textDiceOddNums, 00508060h - cmp dice3d_choice, 2 - jne @F - invoke DrawChipStack, 248, 110, 4 -@@: + jne dice_odd_inactive + invoke DrawBoxBorder, 216, 70, 88, 48, 00072E13h, 00FFFF00h, 2 + invoke DrawString8x8, 226, 76, OFFSET textDiceOdd, 00FFFF00h + invoke DrawString8x8, 224, 90, OFFSET textDiceOddNums, 00FFD700h + invoke DrawString8x8, 226, 104, OFFSET textCoinSelected, 003CFF3Ch + jmp dice_center_cubes +dice_odd_inactive: + invoke DrawBoxBorder, 216, 70, 88, 48, 00072E13h, 001B4B22h, 1 + invoke DrawString8x8, 226, 76, OFFSET textDiceOdd, 00D0D8E0h + invoke DrawString8x8, 224, 90, OFFSET textDiceOddNums, 0080B090h - ; Center Dice Field - invoke DrawBoxBorder, 112, 68, 96, 54, 00072E13h, 00145826h, 1 +dice_center_cubes: + ; 2 Dice in center + invoke DrawCrapsDie, 116, 76, 36, dice3d_val1 + invoke DrawCrapsDie, 168, 76, 36, dice3d_val2 - ; Rolling Animation Logic cmp dice3d_state, 1 - jne dice_at_rest - - inc dice3d_timer - - ; Tumbling jitter offsets - mov eax, dice3d_timer - and eax, 3 - sub eax, 1 - - mov edx, 120 - add edx, eax - mov d1X, edx - mov edx, 76 - sub edx, eax - mov d1Y, edx - - mov edx, 164 - sub edx, eax - mov d2X, edx - mov edx, 78 - add edx, eax - mov d2Y, edx - - test dice3d_timer, 1 - jz @F - invoke RandomRange3D, 6 - inc eax - mov dice3d_val1, eax - invoke RandomRange3D, 6 - inc eax - mov dice3d_val2, eax -@@: - invoke DrawCrapsDie, d1X, d1Y, 36, dice3d_val1 - invoke DrawCrapsDie, d2X, d2Y, 36, dice3d_val2 - invoke DrawString8x8, 76, 138, OFFSET textDiceRolling, 0000FFFFh - - cmp dice3d_timer, 36 - jl dice_draw_controls - - ; Settle dice! - mov dice3d_state, 2 - invoke RandomRange3D, 6 - inc eax - mov dice3d_val1, eax - invoke RandomRange3D, 6 - inc eax - mov dice3d_val2, eax - - mov eax, dice3d_val1 - add eax, dice3d_val2 - mov dice3d_sum, eax - - ; Check choice vs sum parity - mov eax, dice3d_sum - test eax, 1 - jz dice_sum_is_even - - ; Odd - cmp dice3d_choice, 2 - je dice_roll_won - jmp dice_roll_lost - -dice_sum_is_even: - cmp dice3d_choice, 1 - je dice_roll_won - -dice_roll_lost: - mov dice3d_win, 0 - invoke PlaySoundA, OFFSET soundLose, 0, 1 - jmp dice_draw_controls - -dice_roll_won: - mov eax, dice3d_bet - shl eax, 1 - mov dice3d_win, eax - add bankroll, eax - invoke PlaySoundA, OFFSET soundVictory, 0, 1 - jmp dice_draw_controls - -dice_at_rest: - invoke DrawCrapsDie, 120, 76, 36, dice3d_val1 - invoke DrawCrapsDie, 164, 76, 36, dice3d_val2 - + je dice_render_rolling cmp dice3d_state, 2 - jne dice_draw_controls + je dice_render_result + jmp dice_render_keys - ; Scoreboard Plaque - invoke DrawBoxBorder, 36, 130, 248, 30, 00051D0Ch, 0000D7FFh, 1 - invoke DrawString8x8, 44, 135, OFFSET textDiceSumHdr, 0000D7FFh +dice_render_rolling: + invoke DrawString8x8, 76, 138, OFFSET textDiceRolling, 00FFFF00h + jmp dice_render_keys + +dice_render_result: + invoke DrawBoxBorder, 36, 130, 248, 36, 00072E13h, 00FFD700h, 1 + invoke DrawString8x8, 44, 135, OFFSET textDiceSumHdr, 00FFD700h invoke FormatNumber, dice3d_val1, OFFSET hudNumBuffer - invoke DrawString8x8, 100, 135, OFFSET hudNumBuffer, 00FFFFFFh - invoke DrawString8x8, 110, 135, OFFSET textDicePlus, 0000D7FFh + invoke DrawString8x8, 92, 135, OFFSET hudNumBuffer, 00FFFF00h + invoke DrawString8x8, 110, 135, OFFSET textDicePlus, 00FFD700h invoke FormatNumber, dice3d_val2, OFFSET hudNumBuffer - invoke DrawString8x8, 134, 135, OFFSET hudNumBuffer, 00FFFFFFh - invoke DrawString8x8, 144, 135, OFFSET textDiceEqual, 0000D7FFh + invoke DrawString8x8, 126, 135, OFFSET hudNumBuffer, 00FFFF00h + invoke DrawString8x8, 144, 135, OFFSET textDiceEqual, 00FFD700h invoke FormatNumber, dice3d_sum, OFFSET hudNumBuffer - invoke DrawString8x8, 168, 135, OFFSET hudNumBuffer, 0000FFFFh + invoke DrawString8x8, 168, 135, OFFSET hudNumBuffer, 00FFFF00h mov eax, dice3d_sum - test eax, 1 - jnz @F - invoke DrawString8x8, 186, 135, OFFSET textDiceEvenResult, 0080FF80h - jmp dice_show_win_msg -@@: - invoke DrawString8x8, 186, 135, OFFSET textDiceOddResult, 00FF8080h + and eax, 1 + jnz dice_render_odd_res + invoke DrawString8x8, 186, 135, OFFSET textDiceEvenResult, 003CFF3Ch + jmp dice_render_outcome +dice_render_odd_res: + invoke DrawString8x8, 186, 135, OFFSET textDiceOddResult, 003CFF3Ch -dice_show_win_msg: - cmp dice3d_win, 0 - je dice_show_loss - invoke DrawString8x8, 68, 147, OFFSET textDiceWin, 0050FF50h +dice_render_outcome: + mov eax, dice3d_win + test eax, eax + jz dice_render_loss_outcome + invoke DrawString8x8, 68, 150, OFFSET textDiceWin, 003CFF3Ch invoke FormatNumber, dice3d_win, OFFSET hudNumBuffer - invoke DrawString8x8, 156, 147, OFFSET hudNumBuffer, 0050FF50h - invoke DrawString8x8, 188, 147, OFFSET textDiceWinMult, 0050FF50h - jmp dice_draw_controls + invoke DrawString8x8, 156, 150, OFFSET hudNumBuffer, 003CFF3Ch + invoke DrawString8x8, 188, 150, OFFSET textDiceWinMult, 003CFF3Ch + jmp dice_render_keys -dice_show_loss: - invoke DrawString8x8, 116, 147, OFFSET textDiceLose, 008080FFh +dice_render_loss_outcome: + invoke DrawString8x8, 116, 150, OFFSET textDiceLose, 00FF6464h -dice_draw_controls: - invoke DrawBox, 16, 188, 288, 1, 00104820h - - mov eax, 0 +dice_render_keys: + mov kx, 16 + xor eax, eax cmp dice3d_choice, 1 sete al - invoke DrawKeycap3D, 20, 198, OFFSET textDiceKey1, eax + invoke DrawKeycap3D, kx, 192, OFFSET textDiceKey1, eax + add kx, eax - mov eax, 0 + xor eax, eax cmp dice3d_choice, 2 sete al - invoke DrawKeycap3D, 82, 198, OFFSET textDiceKey2, eax + invoke DrawKeycap3D, kx, 192, OFFSET textDiceKey2, eax + add kx, eax - invoke DrawKeycap3D, 160, 198, OFFSET textDiceKeySpace, 1 - invoke DrawKeycap3D, 274, 198, OFFSET textKeyEsc, 0 + invoke DrawKeycap3D, kx, 192, OFFSET textDiceKeySpace, 1 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textKeyEsc, 0 ret RenderDiceGame ENDP @@ -3707,138 +3629,133 @@ RenderDiceGame ENDP ; IN-ENGINE 2.5D MINI-GAME: SKULLS & CUPS (ÍÀϨÐÑÒÊÈ) ; ============================================================================== DrawGlowingOrb PROC uses ebx esi edi, cxVal:DWORD, cyVal:DWORD - invoke DrawCircle, cxVal, cyVal, 14, 00081E2Eh - invoke DrawCircle, cxVal, cyVal, 11, 00103A58h - invoke DrawCircle, cxVal, cyVal, 8, 001A588Ah - invoke DrawCircle, cxVal, cyVal, 6, 0000B0E0h - invoke DrawCircle, cxVal, cyVal, 4, 0000E0FFh + invoke DrawCircle, cxVal, cyVal, 14, 002E1E08h + invoke DrawCircle, cxVal, cyVal, 11, 00583A10h + invoke DrawCircle, cxVal, cyVal, 8, 008A581Ah + invoke DrawCircle, cxVal, cyVal, 6, 00D0B000h + invoke DrawCircle, cxVal, cyVal, 4, 00FFE000h mov eax, cxVal dec eax mov edx, cyVal dec edx - invoke DrawCircle, eax, edx, 2, 00A0FFFFh - mov eax, cxVal - sub eax, 2 - mov edx, cyVal - sub edx, 2 + invoke DrawCircle, eax, edx, 2, 00FFFF80h + dec eax + dec edx invoke DrawPixel, eax, edx, 00FFFFFFh ret DrawGlowingOrb ENDP DrawGothicCup PROC uses ebx esi edi, x:DWORD, y:DWORD, cupId:DWORD, isLifted:DWORD, hasBall:DWORD - LOCAL liftY:DWORD + local liftY:DWORD mov eax, y cmp isLifted, 0 je @F - sub eax, 28 + sub eax, 36 @@: mov liftY, eax - ; Drop shadow on purple velvet + ; Drop shadow cmp isLifted, 0 - jne @F + jne cup_shadow_lifted mov eax, x add eax, 6 mov edx, y add edx, 42 - invoke DrawBox, eax, edx, 36, 4, 000A0410h - jmp draw_cup_body -@@: + invoke DrawBox, eax, edx, 36, 4, 0010040Ah + jmp cup_ball_check +cup_shadow_lifted: mov eax, x add eax, 10 mov edx, y add edx, 42 - invoke DrawBox, eax, edx, 28, 2, 0012061Ah + invoke DrawBox, eax, edx, 28, 2, 001A0612h - ; Draw orb if lifted and has ball +cup_ball_check: + cmp isLifted, 0 + je cup_body_draw cmp hasBall, 0 - je draw_cup_body + je cup_body_draw mov eax, x add eax, 24 mov edx, y add edx, 26 invoke DrawGlowingOrb, eax, edx -draw_cup_body: - ; Base +cup_body_draw: + ; Base pedestal mov eax, x add eax, 6 mov edx, liftY add edx, 36 - invoke DrawBoxBorder, eax, edx, 36, 6, 00221A30h, 0000B0D0h, 1 + invoke DrawBoxBorder, eax, edx, 36, 6, 00301A22h, 00D0B000h, 1 ; Stem mov eax, x add eax, 18 mov edx, liftY add edx, 28 - invoke DrawBox, eax, edx, 12, 8, 00332545h + invoke DrawBox, eax, edx, 12, 8, 00452533h mov eax, x add eax, 22 - mov edx, liftY - add edx, 28 - invoke DrawBox, eax, edx, 4, 8, 0055406Eh + invoke DrawBox, eax, edx, 4, 8, 006E4055h - ; Bowl + ; Goblet Bowl mov eax, x add eax, 8 mov edx, liftY add edx, 8 - invoke DrawBoxBorder, eax, edx, 32, 20, 002D1E40h, 0000D7FFh, 1 + invoke DrawBoxBorder, eax, edx, 32, 20, 00401E2Dh, 00FFD700h, 1 + mov eax, x add eax, 14 mov edx, liftY add edx, 10 - invoke DrawBox, eax, edx, 6, 16, 00503570h + invoke DrawBox, eax, edx, 6, 16, 00703550h mov eax, x add eax, 17 - mov edx, liftY - add edx, 10 - invoke DrawBox, eax, edx, 3, 16, 007850A0h + invoke DrawBox, eax, edx, 3, 16, 00A05078h - ; Flared Rim + ; Golden Rim mov eax, x add eax, 4 mov edx, liftY add edx, 2 - invoke DrawBoxBorder, eax, edx, 40, 7, 00150A20h, 0000FFFFh, 1 + invoke DrawBoxBorder, eax, edx, 40, 7, 00200A15h, 00FFFF00h, 1 mov eax, x add eax, 12 mov edx, liftY add edx, 4 - invoke DrawBox, eax, edx, 16, 2, 0000FFFFh + invoke DrawBox, eax, edx, 16, 2, 00FFFF00h - ; Skull Insignia on Bowl + ; Skull face emblem mov eax, x add eax, 21 mov edx, liftY add edx, 12 - invoke DrawBox, eax, edx, 6, 5, 0000D7FFh + invoke DrawBox, eax, edx, 6, 5, 00FFD700h mov eax, x add eax, 22 mov edx, liftY add edx, 17 - invoke DrawBox, eax, edx, 4, 3, 0000D7FFh + invoke DrawBox, eax, edx, 4, 3, 00FFD700h mov eax, x add eax, 22 mov edx, liftY add edx, 14 - invoke DrawPixel, eax, edx, 00150A20h + invoke DrawPixel, eax, edx, 00200A15h mov eax, x add eax, 24 - mov edx, liftY - add edx, 14 - invoke DrawPixel, eax, edx, 00150A20h + invoke DrawPixel, eax, edx, 00200A15h - ; Cup ID Badge + ; Cup number label mov eax, x add eax, 21 mov edx, liftY add edx, 24 mov ecx, cupId - add ecx, '0' - invoke DrawChar8x8, eax, edx, ecx, 0000FFFFh + add ecx, '1' + invoke DrawChar8x8, eax, edx, ecx, 00FFFF00h ret DrawGothicCup ENDP @@ -3846,445 +3763,657 @@ InitSkullsGame PROC mov skulls3d_state, 0 mov skulls3d_timer, 0 mov skulls3d_win, 0 - cmp skulls3d_bet, 10 - jge @F - mov skulls3d_bet, 50 -@@: invoke RandomRange3D, 3 mov skulls3d_ballPos, eax + mov skulls3d_choice, 1 ret InitSkullsGame ENDP FinalizeSkullsGuess PROC uses ebx - mov skulls3d_state, 4 mov eax, skulls3d_choice cmp eax, skulls3d_ballPos - jne skulls_guess_lost + jne skulls_guess_wrong - ; Won 3x! + ; Won! 3x payout mov eax, skulls3d_bet imul eax, 3 - mov skulls3d_win, eax add bankroll, eax - invoke PlaySoundA, OFFSET soundVictory, 0, 1 + mov skulls3d_win, eax + mov skulls3d_state, 4 + invoke PlaySoundA, OFFSET soundJackpot, 0, 1 ret -skulls_guess_lost: +skulls_guess_wrong: mov skulls3d_win, 0 + mov skulls3d_state, 4 invoke PlaySoundA, OFFSET soundLose, 0, 1 ret FinalizeSkullsGuess ENDP HandleSkullsInput PROC + cmp skulls3d_state, 0 + je skulls_handle_idle cmp skulls3d_state, 1 - je skulls_input_done + je skulls_handle_show cmp skulls3d_state, 2 - je skulls_input_done - + je skulls_handle_shuffle cmp skulls3d_state, 3 - je check_skulls_pick + je skulls_handle_pick + cmp skulls3d_state, 4 + je skulls_handle_reveal + ret - ; State 0 or 4: Can start new round or adjust bet - invoke Pressed3D, 20h ; SPACE +skulls_handle_idle: + invoke Pressed3D, 26h ; UP test eax, eax - jz check_skulls_bet_adjust + jnz skulls_bet_up + invoke Pressed3D, 57h ; 'W' + test eax, eax + jnz skulls_bet_up + invoke Pressed3D, 28h ; DOWN + test eax, eax + jnz skulls_bet_down + invoke Pressed3D, 53h ; 'S' + test eax, eax + jnz skulls_bet_down + invoke Pressed3D, 20h ; SPACE + test eax, eax + jnz skulls_start_game + ret +skulls_bet_up: + mov eax, skulls3d_bet + add eax, 50 + cmp eax, bankroll + jle @F mov eax, bankroll - cmp eax, skulls3d_bet - jl skulls_no_cash - sub eax, skulls3d_bet - mov bankroll, eax +@@: + cmp eax, 5000 + jle @F + mov eax, 5000 +@@: + mov skulls3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret +skulls_bet_down: + mov eax, skulls3d_bet + sub eax, 50 + cmp eax, 50 + jge @F + mov eax, 50 +@@: + mov skulls3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +skulls_start_game: + mov eax, skulls3d_bet + cmp eax, bankroll + jle @F + mov eax, bankroll + mov skulls3d_bet, eax + test eax, eax + jz skulls_done +@@: + mov eax, skulls3d_bet + sub bankroll, eax invoke RandomRange3D, 3 mov skulls3d_ballPos, eax - - invoke RandomRange3D, 3 - mov skulls3d_swapPair0, eax - invoke RandomRange3D, 3 - mov skulls3d_swapPair1, eax - invoke RandomRange3D, 3 - mov skulls3d_swapPair2, eax - mov skulls3d_state, 1 - mov skulls3d_timer, 0 - mov skulls3d_win, 0 + mov skulls3d_timer, 45 invoke PlaySoundA, OFFSET soundShuffle, 0, 1 - jmp skulls_input_done + ret -skulls_no_cash: - invoke CopyString3D, OFFSET msgNeedMoney, OFFSET flashMessage - mov flashTimer, 60 - invoke PlaySoundA, OFFSET soundClick, 0, 1 - jmp skulls_input_done +skulls_handle_show: + dec skulls3d_timer + cmp skulls3d_timer, 0 + jg skulls_done + mov skulls3d_state, 2 + mov skulls3d_timer, 60 + invoke PlaySoundA, OFFSET soundShuffle, 0, 1 + ret -check_skulls_pick: - invoke Pressed3D, 31h ; '1' +skulls_handle_shuffle: + dec skulls3d_timer + cmp skulls3d_timer, 0 + jg skulls_done + invoke RandomRange3D, 3 + mov skulls3d_ballPos, eax + mov skulls3d_state, 3 + ret + +skulls_handle_pick: + invoke Pressed3D, 31h ; '1' test eax, eax - jz @F + jnz skulls_pick_1 + invoke Pressed3D, 32h ; '2' + test eax, eax + jnz skulls_pick_2 + invoke Pressed3D, 33h ; '3' + test eax, eax + jnz skulls_pick_3 + ret + +skulls_pick_1: mov skulls3d_choice, 0 call FinalizeSkullsGuess - jmp skulls_input_done -@@: - invoke Pressed3D, 32h ; '2' - test eax, eax - jz @F + ret + +skulls_pick_2: mov skulls3d_choice, 1 call FinalizeSkullsGuess - jmp skulls_input_done -@@: - invoke Pressed3D, 33h ; '3' - test eax, eax - jz skulls_input_done + ret + +skulls_pick_3: mov skulls3d_choice, 2 call FinalizeSkullsGuess - jmp skulls_input_done + ret -check_skulls_bet_adjust: - invoke Pressed3D, 26h ; UP +skulls_handle_reveal: + invoke Pressed3D, 20h test eax, eax - jnz skulls_inc_bet - invoke Pressed3D, 57h ; W - test eax, eax - jz check_skulls_bet_down -skulls_inc_bet: + jz skulls_done + mov skulls3d_state, 0 invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp skulls3d_bet, 500 - jge skulls_input_done - cmp skulls3d_bet, 250 - jge skulls_set_500 - cmp skulls3d_bet, 100 - jge skulls_set_250 - cmp skulls3d_bet, 50 - jge skulls_set_100 - cmp skulls3d_bet, 25 - jge skulls_set_50 - jmp skulls_set_25 -skulls_set_500: - mov skulls3d_bet, 500 - jmp skulls_input_done -skulls_set_250: - mov skulls3d_bet, 250 - jmp skulls_input_done -skulls_set_100: - mov skulls3d_bet, 100 - jmp skulls_input_done -skulls_set_50: - mov skulls3d_bet, 50 - jmp skulls_input_done -skulls_set_25: - mov skulls3d_bet, 25 - jmp skulls_input_done - -check_skulls_bet_down: - invoke Pressed3D, 28h ; DOWN - test eax, eax - jnz skulls_dec_bet - invoke Pressed3D, 53h ; S - test eax, eax - jz skulls_input_done -skulls_dec_bet: - invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp skulls3d_bet, 25 - jle skulls_set_10 - cmp skulls3d_bet, 50 - jle skulls_set_25 - cmp skulls3d_bet, 100 - jle skulls_set_50 - cmp skulls3d_bet, 250 - jle skulls_set_100 - mov skulls3d_bet, 250 - jmp skulls_input_done -skulls_set_10: - mov skulls3d_bet, 10 - -skulls_input_done: +skulls_done: ret HandleSkullsInput ENDP RenderSkullsGame PROC uses ebx esi edi - LOCAL passTick:DWORD, curPair:DWORD, swapSlotA:DWORD, swapSlotB:DWORD - LOCAL xA:DWORD, xB:DWORD, curXA:DWORD, curXB:DWORD, curYA:DWORD, curYB:DWORD - LOCAL distX:DWORD, dxVal:DWORD, archY:DWORD + local kx:DWORD - ; Dark Gothic Tavern Table with Royal Velvet - invoke DrawBox, 0, 0, 320, 240, 000D0612h - invoke DrawBoxBorder, 4, 4, 312, 232, 00160B20h, 00321845h, 3 - invoke DrawBoxBorder, 8, 8, 304, 224, 00220F30h, 0000D7FFh, 1 + ; Mahogany & Gothic Purple table + invoke DrawBox, 0, 0, 320, 240, 00140906h + invoke DrawBoxBorder, 6, 6, 308, 228, 00300F22h, 00FFD700h, 2 ; Header - invoke DrawBoxBorder, 24, 12, 272, 24, 0012081Ah, 0000D7FFh, 2 - invoke DrawString8x8, 64, 20, OFFSET textSkullsTitle, 0000FFFFh + invoke DrawBoxBorder, 20, 12, 280, 26, 001A0812h, 00FFD700h, 2 + invoke DrawString8x8, 40, 21, OFFSET textSkullsTitle, 00FFFF00h - ; Meters: Bank & Bet - invoke DrawBoxBorder, 20, 42, 114, 16, 000D0616h, 00401858h, 1 - invoke DrawString8x8, 24, 46, OFFSET textBankPrompt, 0050FF50h + ; Status + invoke DrawBoxBorder, 20, 44, 110, 18, 001A0812h, 00452033h, 1 + invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 003CFF3Ch invoke FormatNumber, bankroll, OFFSET hudNumBuffer - invoke DrawString8x8, 72, 46, OFFSET hudNumBuffer, 0050FF50h + invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 003CFF3Ch - invoke DrawBoxBorder, 186, 42, 114, 16, 000D0616h, 00401858h, 1 - invoke DrawString8x8, 190, 46, OFFSET textBetPrompt, 0000D7FFh + invoke DrawBoxBorder, 190, 44, 110, 18, 001A0812h, 00452033h, 1 + invoke DrawString8x8, 194, 49, OFFSET textBetPrompt, 00FFD700h invoke FormatNumber, skulls3d_bet, OFFSET hudNumBuffer - invoke DrawString8x8, 254, 46, OFFSET hudNumBuffer, 0000D7FFh + invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 00FFD700h - ; Velvet Table Runner - invoke DrawBoxBorder, 16, 64, 288, 120, 001A0B25h, 00452060h, 1 - - ; Dispatch based on phase + ; Subtitle phase prompts + cmp skulls3d_state, 0 + jne @F + invoke DrawString8x8, 56, 62, OFFSET textSkullsPhase0, 00FFD700h + jmp skulls_render_cups +@@: cmp skulls3d_state, 1 - je skulls_render_phase1 + jne @F + invoke DrawString8x8, 56, 62, OFFSET textSkullsPhase1, 00FFFF00h + jmp skulls_render_cups +@@: cmp skulls3d_state, 2 - je skulls_render_phase2 + jne @F + invoke DrawString8x8, 56, 62, OFFSET textSkullsPhase2, 00FFFF00h + jmp skulls_render_cups +@@: cmp skulls3d_state, 3 - je skulls_render_phase3 - cmp skulls3d_state, 4 - je skulls_render_phase4 - - ; Phase 0: Idle / Betting - invoke DrawString8x8, 56, 70, OFFSET textSkullsPhase0, 0000D7FFh - invoke DrawGothicCup, 48, 108, 1, 0, 0 - invoke DrawGothicCup, 136, 108, 2, 0, 0 - invoke DrawGothicCup, 224, 108, 3, 0, 0 - jmp skulls_draw_controls - -skulls_render_phase1: - inc skulls3d_timer - invoke DrawString8x8, 56, 70, OFFSET textSkullsPhase1, 0000FFFFh - - ; Draw cups with ballPos cup lifted - mov eax, 0 - cmp skulls3d_ballPos, 0 - sete al - invoke DrawGothicCup, 48, 108, 1, eax, eax - - mov eax, 0 - cmp skulls3d_ballPos, 1 - sete al - invoke DrawGothicCup, 136, 108, 2, eax, eax - - mov eax, 0 - cmp skulls3d_ballPos, 2 - sete al - invoke DrawGothicCup, 224, 108, 3, eax, eax - - cmp skulls3d_timer, 40 - jl skulls_draw_controls - - ; Start Phase 2 (Shuffle) - mov skulls3d_state, 2 - mov skulls3d_timer, 0 - invoke PlaySoundA, OFFSET soundShuffle, 0, 1 - jmp skulls_draw_controls - -skulls_render_phase2: - inc skulls3d_timer - - mov eax, skulls3d_timer - cmp eax, 20 - jbe pass_0 - cmp eax, 40 - jbe pass_1 - sub eax, 41 - mov passTick, eax - mov eax, skulls3d_swapPair2 - mov curPair, eax - jmp setup_pass_pair - -pass_0: - dec eax - mov passTick, eax - mov eax, skulls3d_swapPair0 - mov curPair, eax - jmp setup_pass_pair - -pass_1: - sub eax, 21 - mov passTick, eax - mov eax, skulls3d_swapPair1 - mov curPair, eax - -setup_pass_pair: - cmp curPair, 1 - je pair_1 - cmp curPair, 2 - je pair_2 - mov swapSlotA, 0 - mov swapSlotB, 1 - mov xA, 48 - mov xB, 136 - jmp calc_swap_coords -pair_1: - mov swapSlotA, 1 - mov swapSlotB, 2 - mov xA, 136 - mov xB, 224 - jmp calc_swap_coords -pair_2: - mov swapSlotA, 0 - mov swapSlotB, 2 - mov xA, 48 - mov xB, 224 - -calc_swap_coords: - mov eax, xB - sub eax, xA - mov distX, eax - - mov eax, distX - imul eax, passTick - xor edx, edx - mov ecx, 20 - div ecx - mov dxVal, eax - - mov eax, xA - add eax, dxVal - mov curXA, eax - - mov eax, xB - sub eax, dxVal - mov curXB, eax - - ; Arch height: archY = (t * (20 - t)) / 25 - mov eax, passTick - mov ecx, 20 - sub ecx, eax - imul eax, ecx - xor edx, edx - mov ecx, 25 - div ecx - mov archY, eax - - mov edx, 108 - sub edx, archY - mov curYA, edx ; upper arc - - mov edx, 108 - add edx, archY - mov curYB, edx ; lower arc - - invoke DrawString8x8, 56, 70, OFFSET textSkullsPhase2, 0000FFFFh - - ; Depth sorted rendering: Background cup (upper arc) draws FIRST, Foreground cup (lower arc) draws OVER it! - invoke DrawGothicCup, curXA, curYA, 1, 0, 0 - invoke DrawGothicCup, curXB, curYB, 2, 0, 0 - - ; Draw remaining static cup - cmp curPair, 1 - je draw_stat_0 - cmp curPair, 2 - je draw_stat_1 - invoke DrawGothicCup, 224, 108, 3, 0, 0 - jmp check_pass_finish -draw_stat_0: - invoke DrawGothicCup, 48, 108, 1, 0, 0 - jmp check_pass_finish -draw_stat_1: - invoke DrawGothicCup, 136, 108, 2, 0, 0 - -check_pass_finish: - cmp skulls3d_timer, 20 - je do_pass_swap - cmp skulls3d_timer, 40 - je do_pass_swap - cmp skulls3d_timer, 60 - je do_pass_swap - jmp skulls_draw_controls - -do_pass_swap: - ; Update ballPos if involved in swap - mov eax, skulls3d_ballPos - cmp eax, swapSlotA - jne check_swap_b - mov eax, swapSlotB - mov skulls3d_ballPos, eax - jmp ball_swap_done -check_swap_b: - cmp eax, swapSlotB - jne ball_swap_done - mov eax, swapSlotA - mov skulls3d_ballPos, eax - -ball_swap_done: - invoke PlaySoundA, OFFSET soundShuffle, 0, 1 - - cmp skulls3d_timer, 60 - jl skulls_draw_controls - - ; Shuffle complete -> Move to Pick phase - mov skulls3d_state, 3 - mov skulls3d_timer, 0 - jmp skulls_draw_controls - -skulls_render_phase3: - invoke DrawString8x8, 40, 70, OFFSET textSkullsPhase3, 0000FFFFh - invoke DrawGothicCup, 48, 108, 1, 0, 0 - invoke DrawGothicCup, 136, 108, 2, 0, 0 - invoke DrawGothicCup, 224, 108, 3, 0, 0 - jmp skulls_draw_controls - -skulls_render_phase4: - ; Reveal phase - cmp skulls3d_win, 0 - je skulls_show_loss - invoke DrawString8x8, 48, 70, OFFSET textSkullsWin, 0050FF50h + jne @F + invoke DrawString8x8, 40, 62, OFFSET textSkullsPhase3, 00FFFF00h + jmp skulls_render_cups +@@: + ; Reveal outcome + mov eax, skulls3d_win + test eax, eax + jz skulls_show_loss_text + invoke DrawString8x8, 40, 62, OFFSET textSkullsWin, 003CFF3Ch invoke FormatNumber, skulls3d_win, OFFSET hudNumBuffer - invoke DrawString8x8, 216, 70, OFFSET hudNumBuffer, 0050FF50h - jmp skulls_p4_cups + invoke DrawString8x8, 136, 62, OFFSET hudNumBuffer, 003CFF3Ch + invoke DrawString8x8, 168, 62, OFFSET textSkullsWinMult, 003CFF3Ch + jmp skulls_render_cups -skulls_show_loss: - invoke DrawString8x8, 40, 70, OFFSET textSkullsLose, 008080FFh +skulls_show_loss_text: + invoke DrawString8x8, 40, 62, OFFSET textSkullsLose, 00FF6464h -skulls_p4_cups: - ; Draw chosen cup lifted - mov eax, 0 - cmp skulls3d_choice, 0 - sete al +skulls_render_cups: + ; Draw Cup 1 (X=36, Y=114) + mov ebx, 0 mov edx, 0 + cmp skulls3d_state, 1 + jne @F + cmp skulls3d_ballPos, 0 + jne @F + mov ebx, 1 + mov edx, 1 +@@: + cmp skulls3d_state, 4 + jne @F + cmp skulls3d_choice, 0 + sete bl cmp skulls3d_ballPos, 0 sete dl - invoke DrawGothicCup, 48, 108, 1, eax, edx +@@: + invoke DrawGothicCup, 36, 114, 0, ebx, edx - mov eax, 0 - cmp skulls3d_choice, 1 - sete al + ; Draw Cup 2 (X=136, Y=114) + mov ebx, 0 mov edx, 0 + cmp skulls3d_state, 1 + jne @F + cmp skulls3d_ballPos, 1 + jne @F + mov ebx, 1 + mov edx, 1 +@@: + cmp skulls3d_state, 4 + jne @F + cmp skulls3d_choice, 1 + sete bl cmp skulls3d_ballPos, 1 sete dl - invoke DrawGothicCup, 136, 108, 2, eax, edx +@@: + invoke DrawGothicCup, 136, 114, 1, ebx, edx - mov eax, 0 - cmp skulls3d_choice, 2 - sete al + ; Draw Cup 3 (X=236, Y=114) + mov ebx, 0 mov edx, 0 + cmp skulls3d_state, 1 + jne @F + cmp skulls3d_ballPos, 2 + jne @F + mov ebx, 1 + mov edx, 1 +@@: + cmp skulls3d_state, 4 + jne @F + cmp skulls3d_choice, 2 + sete bl cmp skulls3d_ballPos, 2 sete dl - invoke DrawGothicCup, 224, 108, 3, eax, edx +@@: + invoke DrawGothicCup, 236, 114, 2, ebx, edx - invoke DrawString8x8, 64, 168, OFFSET textSkullsAgain, 0000D7FFh + ; Cup selection indicators + invoke DrawString8x8, 54, 168, OFFSET textSkullsKey1, 00D0D8E0h + invoke DrawString8x8, 150, 168, OFFSET textSkullsKey2, 00D0D8E0h + invoke DrawString8x8, 250, 168, OFFSET textSkullsKey3, 00D0D8E0h -skulls_draw_controls: - invoke DrawBox, 16, 190, 288, 1, 003A1850h - - mov eax, 0 + ; Keycaps + mov kx, 16 + xor eax, eax cmp skulls3d_choice, 0 sete al - invoke DrawKeycap3D, 18, 200, OFFSET textSkullsKey1, eax + invoke DrawKeycap3D, kx, 192, OFFSET textSkullsKey1, eax + add kx, eax - mov eax, 0 + xor eax, eax cmp skulls3d_choice, 1 sete al - invoke DrawKeycap3D, 82, 200, OFFSET textSkullsKey2, eax + invoke DrawKeycap3D, kx, 192, OFFSET textSkullsKey2, eax + add kx, eax - mov eax, 0 + xor eax, eax cmp skulls3d_choice, 2 sete al - invoke DrawKeycap3D, 146, 200, OFFSET textSkullsKey3, eax + invoke DrawKeycap3D, kx, 192, OFFSET textSkullsKey3, eax + add kx, eax - invoke DrawKeycap3D, 212, 200, OFFSET textSkullsKeySpace, 1 - invoke DrawKeycap3D, 274, 200, OFFSET textKeyEsc, 0 + invoke DrawKeycap3D, kx, 192, OFFSET textSkullsKeySpace, 1 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textKeyEsc, 0 ret RenderSkullsGame ENDP +; ============================================================================== +; IN-ENGINE 2.5D MINI-GAME: SKILL CHECK (DEAD BY DAYLIGHT SURVIVOR CHECK) +; ============================================================================== +InitSkillGame PROC + mov skill3d_state, 0 + mov skill3d_timer, 0 + mov skill3d_hits, 0 + mov skill3d_misses, 0 + mov skill3d_needle, 55 + mov skill3d_speed, 4 + mov skill3d_dir, 1 + mov skill3d_last_result, 0 + mov skill3d_win_amount, 0 + + ; Randomize initial zone: 80 + RandomRange(90) -> 80..170 + invoke RandomRange3D, 90 + add eax, 80 + mov skill3d_zone_start, eax + + ; Great zone: start + 20 + RandomRange(12) + invoke RandomRange3D, 12 + add eax, skill3d_zone_start + add eax, 20 + mov skill3d_great_start, eax + ret +InitSkillGame ENDP + +HandleSkillInput PROC uses ebx esi + mov eax, skill3d_state + cmp eax, 0 + je skill_handle_ready + cmp eax, 1 + je skill_handle_active + cmp eax, 2 + je skill_handle_round_wait + cmp eax, 3 + je skill_handle_round_wait + cmp eax, 4 + je skill_handle_end_wait + cmp eax, 5 + je skill_handle_end_wait + ret + +skill_handle_ready: + invoke Pressed3D, 26h ; UP + test eax, eax + jnz skill_bet_up + invoke Pressed3D, 57h ; 'W' + test eax, eax + jnz skill_bet_up + invoke Pressed3D, 28h ; DOWN + test eax, eax + jnz skill_bet_down + invoke Pressed3D, 53h ; 'S' + test eax, eax + jnz skill_bet_down + jmp skill_check_start + +skill_bet_up: + mov eax, skill3d_bet + add eax, 50 + cmp eax, bankroll + jle @F + mov eax, bankroll +@@: + cmp eax, 5000 + jle @F + mov eax, 5000 +@@: + mov skill3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +skill_bet_down: + mov eax, skill3d_bet + sub eax, 50 + cmp eax, 50 + jge @F + mov eax, 50 +@@: + mov skill3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +skill_check_start: + invoke Pressed3D, 20h ; SPACE + test eax, eax + jz skill_input_done + + ; Deduct bet on game start if beginning of run + mov eax, skill3d_hits + or eax, skill3d_misses + jnz @F + mov eax, skill3d_bet + cmp eax, bankroll + jle skill_has_funds + mov eax, bankroll + mov skill3d_bet, eax + test eax, eax + jz skill_input_done +skill_has_funds: + mov eax, skill3d_bet + sub bankroll, eax +@@: + mov skill3d_state, 1 + mov skill3d_needle, 55 + mov skill3d_dir, 1 + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +skill_handle_active: + ; Move needle smoothly + mov eax, skill3d_needle + mov edx, skill3d_speed + cmp skill3d_dir, 1 + je skill_move_right + sub eax, edx + cmp eax, 52 + jge skill_update_needle + mov eax, 52 + mov skill3d_dir, 1 + jmp skill_update_needle +skill_move_right: + add eax, edx + cmp eax, 268 + jle skill_update_needle + mov eax, 268 + mov skill3d_dir, -1 +skill_update_needle: + mov skill3d_needle, eax + + ; Check SPACE pressed (Reaction Hit Attempt!) + invoke Pressed3D, 20h + test eax, eax + jz skill_input_done + + ; Is needle in Great Sweet Spot? + mov eax, skill3d_needle + mov edx, skill3d_great_start + cmp eax, edx + jl check_success_zone + add edx, skill3d_great_width + cmp eax, edx + jg check_success_zone + + ; GREAT HIT! + mov skill3d_last_result, 2 + add skill3d_hits, 2 + mov skill3d_state, 2 + mov skill3d_timer, 40 + invoke PlaySoundA, OFFSET soundCoinDing, 0, 1 + jmp skill_check_finish_round + +check_success_zone: + mov eax, skill3d_needle + mov edx, skill3d_zone_start + cmp eax, edx + jl skill_was_miss + add edx, skill3d_zone_width + cmp eax, edx + jg skill_was_miss + + ; NORMAL HIT! + mov skill3d_last_result, 1 + inc skill3d_hits + mov skill3d_state, 2 + mov skill3d_timer, 40 + invoke PlaySoundA, OFFSET soundVictory, 0, 1 + jmp skill_check_finish_round + +skill_was_miss: + ; MISS! + mov skill3d_last_result, 0 + inc skill3d_misses + mov skill3d_state, 3 + mov skill3d_timer, 45 + invoke PlaySoundA, OFFSET soundLose, 0, 1 + +skill_check_finish_round: + cmp skill3d_hits, 5 + jge skill_game_escaped + cmp skill3d_misses, 3 + jge skill_game_lost + ret + +skill_game_escaped: + mov skill3d_state, 4 + mov skill3d_timer, 0 + ; Payout: 3x total return (+$2x bet profit) + mov eax, skill3d_bet + imul eax, 3 + add bankroll, eax + mov eax, skill3d_bet + shl eax, 1 + mov skill3d_win_amount, eax + invoke PlaySoundA, OFFSET soundJackpot, 0, 1 + ret + +skill_game_lost: + mov skill3d_state, 5 + mov skill3d_timer, 0 + invoke PlaySoundA, OFFSET soundLose, 0, 1 + ret + +skill_handle_round_wait: + dec skill3d_timer + cmp skill3d_timer, 0 + jg skill_input_done + + ; Next round setup + invoke RandomRange3D, 90 + add eax, 80 + mov skill3d_zone_start, eax + + invoke RandomRange3D, 12 + add eax, skill3d_zone_start + add eax, 20 + mov skill3d_great_start, eax + + mov eax, skill3d_hits + shr eax, 1 + add eax, 4 + mov skill3d_speed, eax + mov skill3d_state, 1 + ret + +skill_handle_end_wait: + invoke Pressed3D, 20h + test eax, eax + jz skill_input_done + call InitSkillGame + ret + +skill_input_done: + ret +HandleSkillInput ENDP + +RenderSkillGame PROC uses ebx esi edi + local kx:DWORD + local tx:DWORD + + ; Industrial Steel bezel + invoke DrawBox, 0, 0, 320, 240, 00121416h + invoke DrawBoxBorder, 6, 6, 308, 228, 001A1D20h, 00FFD700h, 2 + + ; Header + invoke DrawBoxBorder, 20, 12, 280, 26, 00121418h, 00FFD700h, 2 + invoke DrawString8x8, 40, 21, OFFSET textSkillTitle, 00FFFF00h + + ; Status + invoke DrawBoxBorder, 20, 44, 110, 18, 00121418h, 002A3540h, 1 + invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 003CFF3Ch + invoke FormatNumber, bankroll, OFFSET hudNumBuffer + invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 003CFF3Ch + + invoke DrawBoxBorder, 190, 44, 110, 18, 00121418h, 002A3540h, 1 + invoke DrawString8x8, 194, 49, OFFSET textBetPrompt, 00FFD700h + invoke FormatNumber, skill3d_bet, OFFSET hudNumBuffer + invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 00FFD700h + + ; Survivor Progress + invoke DrawString8x8, 24, 70, OFFSET textSkillHitsHdr, 003CFF3Ch + invoke FormatNumber, skill3d_hits, OFFSET hudNumBuffer + invoke DrawString8x8, 64, 70, OFFSET hudNumBuffer, 003CFF3Ch + + invoke DrawString8x8, 180, 70, OFFSET textSkillMissHdr, 00FF6464h + invoke FormatNumber, skill3d_misses, OFFSET hudNumBuffer + invoke DrawString8x8, 240, 70, OFFSET hudNumBuffer, 00FF6464h + + ; Dial Frame (Track: X=50..270, Y=102..134) + invoke DrawBoxBorder, 50, 102, 220, 32, 000F1114h, 00404855h, 2 + + ; Calibrated ticks + mov tx, 60 +skill_ticks_loop: + cmp tx, 260 + jge skill_draw_zones + invoke DrawBox, tx, 104, 1, 6, 00303845h + invoke DrawBox, tx, 126, 1, 6, 00303845h + add tx, 12 + jmp skill_ticks_loop + +skill_draw_zones: + ; Normal Success Zone (Green) + invoke DrawBoxBorder, skill3d_zone_start, 106, skill3d_zone_width, 24, 00155020h, 003CFF3Ch, 1 + + ; Great Zone (Gold) + invoke DrawBoxBorder, skill3d_great_start, 106, skill3d_great_width, 24, 00FFD700h, 00FFFF00h, 1 + + ; Pointer / Needle at skill3d_needle + mov eax, skill3d_needle + dec eax + invoke DrawBox, eax, 98, 3, 40, 00FFFFFFh + mov eax, skill3d_needle + sub eax, 2 + invoke DrawBox, eax, 96, 5, 2, 00FF3030h + invoke DrawBox, eax, 138, 5, 2, 00FF3030h + + ; Center prompts / outcome + cmp skill3d_state, 0 + jne @F + invoke DrawString8x8, 52, 150, OFFSET textSkillReadyMsg, 00FFD700h + invoke DrawString8x8, 76, 166, OFFSET textSkillPrompt, 00D0D8E0h + jmp skill_render_keys +@@: + cmp skill3d_state, 1 + jne @F + invoke DrawString8x8, 76, 150, OFFSET textSkillPrompt, 00FFFF00h + jmp skill_render_keys +@@: + cmp skill3d_state, 2 + jne @F + cmp skill3d_last_result, 2 + jne skill_normal_hit_text + invoke DrawString8x8, 36, 150, OFFSET textSkillGreatMsg, 00FFFF00h + jmp skill_render_keys +skill_normal_hit_text: + invoke DrawString8x8, 64, 150, OFFSET textSkillHitMsg, 003CFF3Ch + jmp skill_render_keys +@@: + cmp skill3d_state, 3 + jne @F + invoke DrawString8x8, 88, 150, OFFSET textSkillMissMsg, 00FF6464h + jmp skill_render_keys +@@: + cmp skill3d_state, 4 + jne @F + invoke DrawString8x8, 48, 150, OFFSET textSkillEscape, 003CFF3Ch + invoke FormatNumber, skill3d_win_amount, OFFSET hudNumBuffer + invoke DrawString8x8, 240, 150, OFFSET hudNumBuffer, 003CFF3Ch + invoke DrawString8x8, 64, 166, OFFSET textSkullsAgain, 00FFD700h + jmp skill_render_keys +@@: + invoke DrawString8x8, 44, 150, OFFSET textSkillLost, 00FF6464h + invoke DrawString8x8, 64, 166, OFFSET textSkullsAgain, 00FFD700h + +skill_render_keys: + mov kx, 16 + invoke DrawKeycap3D, kx, 192, OFFSET textSkillKeySpace, 1 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textSkillKeyBet, 0 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textKeyEsc, 0 + ret +RenderSkillGame ENDP + HandlePlayerInput PROC uses ebx esi edi local speed:DWORD local nextX:DWORD @@ -4721,7 +4850,8 @@ check_target_coin: check_target_skill: cmp eax, INTERACT_SKILL_CHECK jne check_target_buckshot - invoke LaunchClassicGame, OFFSET GameSkillCheck, 11, OFFSET szTitleSkillCheck + call InitSkillGame + mov engineMode, MODE_SKILL ret check_target_buckshot: @@ -5119,6 +5249,11 @@ leave_table: je engine_tick cmp skulls3d_state, 2 je engine_tick + cmp engineMode, MODE_SKILL + jne @F + cmp skill3d_state, 1 + je engine_tick +@@: mov engineMode, MODE_WALK engine_tick: cmp paused3D, 0 @@ -5181,10 +5316,16 @@ check_dice_mode: jmp present_frame check_skulls_mode: cmp engineMode, MODE_SKULLS - jne present_frame + jne check_skill_mode call HandleSkullsInput call RenderSkullsGame jmp present_frame +check_skill_mode: + cmp engineMode, MODE_SKILL + jne present_frame + call HandleSkillInput + call RenderSkillGame + jmp present_frame draw_pause: invoke DrawBoxBorder, 65, 75, 190, 85, 00151C21h, 00D8BC6Ah, 2 invoke DrawString8x8, 86, 88, OFFSET textPause3D, 00FFFFFFh diff --git a/docs/previews_minigames/coin_preview.png b/docs/previews_minigames/coin_preview.png index 64d7668..c7c1fcd 100644 Binary files a/docs/previews_minigames/coin_preview.png and b/docs/previews_minigames/coin_preview.png differ diff --git a/docs/previews_minigames/dice_preview.png b/docs/previews_minigames/dice_preview.png index a9758b6..a2c279a 100644 Binary files a/docs/previews_minigames/dice_preview.png and b/docs/previews_minigames/dice_preview.png differ diff --git a/docs/previews_minigames/skill_preview.png b/docs/previews_minigames/skill_preview.png new file mode 100644 index 0000000..9be703a Binary files /dev/null and b/docs/previews_minigames/skill_preview.png differ diff --git a/docs/previews_minigames/skulls_preview.png b/docs/previews_minigames/skulls_preview.png index 400d5bd..9f7f77c 100644 Binary files a/docs/previews_minigames/skulls_preview.png and b/docs/previews_minigames/skulls_preview.png differ diff --git a/font8x8.inc b/font8x8.inc index fc5cdf4..1cd91e0 100644 --- a/font8x8.inc +++ b/font8x8.inc @@ -1,260 +1,260 @@ -; --- 8x8 BITMAP FONT FOR CP1251 (Generated) --- +; --- 8x8 BITMAP FONT FOR CP1251 (Authentic IBM VGA CP866/1251) --- .data ALIGN 4 font8x8 label byte db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x00 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x01 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x02 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x03 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x04 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x05 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x06 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x07 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x08 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x09 -db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x0A -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x0B -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x0C -db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x0D -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x0E -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x0F -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x10 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x11 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x12 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x13 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x14 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x15 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x16 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x17 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x18 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x19 -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x1A -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x1B -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x1C -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x1D -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x1E -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x1F +db 038h, 044h, 06Ch, 044h, 054h, 044h, 038h, 000h ; char 0x01 +db 038h, 07Ch, 054h, 07Ch, 044h, 07Ch, 038h, 000h ; char 0x02 +db 000h, 028h, 07Ch, 07Ch, 07Ch, 038h, 010h, 000h ; char 0x03 +db 000h, 010h, 038h, 07Ch, 07Ch, 038h, 010h, 000h ; char 0x04 +db 010h, 038h, 038h, 010h, 07Ch, 07Ch, 010h, 000h ; char 0x05 +db 000h, 010h, 038h, 07Ch, 07Ch, 010h, 038h, 000h ; char 0x06 +db 000h, 000h, 000h, 030h, 030h, 000h, 000h, 000h ; char 0x07 +db 0FCh, 0FCh, 0FCh, 0CCh, 0CCh, 0FCh, 0FCh, 0FCh ; char 0x08 +db 000h, 000h, 078h, 048h, 048h, 078h, 000h, 000h ; char 0x09 +db 0FCh, 0FCh, 084h, 0B4h, 0B4h, 084h, 0FCh, 0FCh ; char 0x0A +db 000h, 01Ch, 00Ch, 034h, 048h, 048h, 030h, 000h ; char 0x0B +db 038h, 044h, 044h, 038h, 010h, 038h, 010h, 000h ; char 0x0C +db 010h, 018h, 014h, 010h, 030h, 070h, 060h, 000h ; char 0x0D +db 00Ch, 034h, 02Ch, 034h, 02Ch, 06Ch, 060h, 000h ; char 0x0E +db 000h, 054h, 038h, 06Ch, 038h, 054h, 000h, 000h ; char 0x0F +db 020h, 030h, 038h, 03Ch, 038h, 030h, 020h, 000h ; char 0x10 +db 008h, 018h, 038h, 078h, 038h, 018h, 008h, 000h ; char 0x11 +db 010h, 038h, 07Ch, 010h, 07Ch, 038h, 010h, 000h ; char 0x12 +db 028h, 028h, 028h, 028h, 028h, 000h, 028h, 000h ; char 0x13 +db 03Ch, 054h, 054h, 034h, 014h, 014h, 014h, 000h ; char 0x14 +db 038h, 044h, 030h, 028h, 018h, 044h, 038h, 000h ; char 0x15 +db 000h, 000h, 000h, 000h, 000h, 078h, 078h, 000h ; char 0x16 +db 010h, 038h, 07Ch, 010h, 07Ch, 038h, 010h, 038h ; char 0x17 +db 010h, 038h, 07Ch, 010h, 010h, 010h, 010h, 000h ; char 0x18 +db 010h, 010h, 010h, 010h, 07Ch, 038h, 010h, 000h ; char 0x19 +db 000h, 010h, 018h, 07Ch, 018h, 010h, 000h, 000h ; char 0x1A +db 000h, 010h, 030h, 07Ch, 030h, 010h, 000h, 000h ; char 0x1B +db 000h, 000h, 000h, 040h, 040h, 040h, 07Ch, 000h ; char 0x1C +db 000h, 028h, 028h, 07Ch, 028h, 028h, 000h, 000h ; char 0x1D +db 010h, 010h, 038h, 038h, 07Ch, 07Ch, 000h, 000h ; char 0x1E +db 07Ch, 07Ch, 038h, 038h, 010h, 010h, 000h, 000h ; char 0x1F db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x20 -db 020h, 020h, 020h, 020h, 000h, 020h, 000h, 000h ; char 0x21 -db 050h, 050h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x22 -db 030h, 0F8h, 030h, 0F8h, 060h, 060h, 000h, 000h ; char 0x23 -db 038h, 050h, 070h, 018h, 028h, 078h, 020h, 000h ; char 0x24 -db 0E8h, 0B0h, 0E0h, 038h, 068h, 0B8h, 000h, 000h ; char 0x25 -db 0E0h, 0A0h, 0C0h, 0D0h, 0A0h, 0F0h, 000h, 000h ; char 0x26 -db 020h, 020h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x27 -db 020h, 040h, 040h, 040h, 040h, 040h, 020h, 010h ; char 0x28 -db 020h, 010h, 010h, 010h, 010h, 010h, 020h, 040h ; char 0x29 -db 020h, 070h, 070h, 020h, 000h, 000h, 000h, 000h ; char 0x2A -db 000h, 020h, 020h, 0F8h, 020h, 020h, 000h, 000h ; char 0x2B -db 000h, 000h, 000h, 000h, 000h, 020h, 020h, 040h ; char 0x2C -db 000h, 000h, 000h, 070h, 000h, 000h, 000h, 000h ; char 0x2D -db 000h, 000h, 000h, 000h, 000h, 020h, 000h, 000h ; char 0x2E -db 008h, 010h, 010h, 020h, 020h, 020h, 040h, 000h ; char 0x2F -db 060h, 090h, 0B0h, 0D0h, 090h, 060h, 000h, 000h ; char 0x30 -db 020h, 060h, 020h, 020h, 020h, 070h, 000h, 000h ; char 0x31 -db 038h, 048h, 008h, 010h, 020h, 078h, 000h, 000h ; char 0x32 -db 078h, 008h, 030h, 008h, 008h, 070h, 000h, 000h ; char 0x33 -db 030h, 030h, 050h, 090h, 0F8h, 010h, 000h, 000h ; char 0x34 -db 078h, 040h, 070h, 008h, 008h, 070h, 000h, 000h ; char 0x35 -db 038h, 060h, 078h, 048h, 048h, 030h, 000h, 000h ; char 0x36 -db 078h, 008h, 010h, 010h, 020h, 020h, 000h, 000h ; char 0x37 -db 078h, 048h, 030h, 048h, 048h, 070h, 000h, 000h ; char 0x38 -db 060h, 090h, 090h, 0F0h, 010h, 0E0h, 000h, 000h ; char 0x39 -db 000h, 000h, 020h, 000h, 000h, 020h, 000h, 000h ; char 0x3A -db 000h, 000h, 020h, 000h, 000h, 020h, 020h, 040h ; char 0x3B -db 000h, 010h, 020h, 040h, 020h, 010h, 000h, 000h ; char 0x3C -db 000h, 000h, 078h, 000h, 078h, 000h, 000h, 000h ; char 0x3D -db 000h, 040h, 020h, 010h, 020h, 040h, 000h, 000h ; char 0x3E -db 060h, 010h, 010h, 070h, 000h, 040h, 000h, 000h ; char 0x3F -db 030h, 048h, 0B8h, 0B8h, 0B8h, 0A8h, 080h, 070h ; char 0x40 -db 020h, 050h, 050h, 050h, 070h, 050h, 000h, 000h ; char 0x41 -db 078h, 048h, 070h, 048h, 048h, 070h, 000h, 000h ; char 0x42 -db 070h, 080h, 080h, 080h, 080h, 070h, 000h, 000h ; char 0x43 -db 0E0h, 090h, 090h, 090h, 090h, 0E0h, 000h, 000h ; char 0x44 -db 070h, 040h, 070h, 040h, 040h, 070h, 000h, 000h ; char 0x45 -db 070h, 040h, 070h, 040h, 040h, 040h, 000h, 000h ; char 0x46 -db 070h, 080h, 0B0h, 090h, 090h, 070h, 000h, 000h ; char 0x47 -db 090h, 090h, 0F0h, 090h, 090h, 090h, 000h, 000h ; char 0x48 -db 070h, 020h, 020h, 020h, 020h, 070h, 000h, 000h ; char 0x49 -db 070h, 010h, 010h, 010h, 010h, 070h, 000h, 000h ; char 0x4A -db 048h, 050h, 060h, 060h, 050h, 048h, 000h, 000h ; char 0x4B -db 040h, 040h, 040h, 040h, 040h, 070h, 000h, 000h ; char 0x4C -db 010h, 0B0h, 0B0h, 050h, 010h, 010h, 000h, 000h ; char 0x4D -db 050h, 050h, 070h, 070h, 050h, 050h, 000h, 000h ; char 0x4E -db 070h, 088h, 088h, 088h, 088h, 070h, 000h, 000h ; char 0x4F -db 070h, 048h, 048h, 070h, 040h, 040h, 000h, 000h ; char 0x50 -db 070h, 088h, 088h, 088h, 088h, 070h, 020h, 018h ; char 0x51 -db 070h, 048h, 048h, 070h, 048h, 048h, 000h, 000h ; char 0x52 -db 038h, 040h, 060h, 018h, 008h, 070h, 000h, 000h ; char 0x53 -db 0F8h, 020h, 020h, 020h, 020h, 020h, 000h, 000h ; char 0x54 -db 090h, 090h, 090h, 090h, 090h, 060h, 000h, 000h ; char 0x55 -db 050h, 050h, 050h, 050h, 050h, 020h, 000h, 000h ; char 0x56 -db 050h, 050h, 070h, 050h, 050h, 050h, 000h, 000h ; char 0x57 -db 088h, 050h, 020h, 020h, 050h, 088h, 000h, 000h ; char 0x58 -db 088h, 050h, 050h, 020h, 020h, 020h, 000h, 000h ; char 0x59 -db 0F0h, 020h, 020h, 040h, 040h, 0F0h, 000h, 000h ; char 0x5A -db 060h, 040h, 040h, 040h, 040h, 040h, 040h, 060h ; char 0x5B -db 040h, 020h, 020h, 020h, 010h, 010h, 008h, 000h ; char 0x5C -db 030h, 010h, 010h, 010h, 010h, 010h, 010h, 030h ; char 0x5D -db 020h, 050h, 050h, 000h, 000h, 000h, 000h, 000h ; char 0x5E -db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0F8h ; char 0x5F -db 020h, 000h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x60 -db 000h, 000h, 078h, 008h, 078h, 078h, 000h, 000h ; char 0x61 -db 040h, 040h, 078h, 048h, 048h, 070h, 000h, 000h ; char 0x62 -db 000h, 000h, 030h, 040h, 040h, 070h, 000h, 000h ; char 0x63 -db 010h, 010h, 070h, 090h, 090h, 0F0h, 000h, 000h ; char 0x64 -db 000h, 000h, 038h, 078h, 040h, 038h, 000h, 000h ; char 0x65 -db 038h, 020h, 0F0h, 020h, 020h, 020h, 000h, 000h ; char 0x66 -db 000h, 000h, 0F0h, 090h, 0F0h, 080h, 0F0h, 0F0h ; char 0x67 -db 040h, 040h, 078h, 048h, 048h, 048h, 000h, 000h ; char 0x68 -db 010h, 000h, 070h, 010h, 010h, 078h, 000h, 000h ; char 0x69 -db 010h, 000h, 070h, 010h, 010h, 010h, 010h, 070h ; char 0x6A -db 040h, 040h, 050h, 060h, 050h, 048h, 000h, 000h ; char 0x6B -db 070h, 010h, 010h, 010h, 010h, 078h, 000h, 000h ; char 0x6C -db 000h, 000h, 0F8h, 0A8h, 0A8h, 0A8h, 000h, 000h ; char 0x6D -db 000h, 000h, 078h, 048h, 048h, 048h, 000h, 000h ; char 0x6E -db 000h, 000h, 060h, 090h, 090h, 060h, 000h, 000h ; char 0x6F -db 000h, 000h, 078h, 048h, 048h, 070h, 040h, 040h ; char 0x70 -db 000h, 000h, 070h, 090h, 090h, 0F0h, 010h, 010h ; char 0x71 -db 000h, 000h, 078h, 048h, 040h, 040h, 000h, 000h ; char 0x72 -db 000h, 000h, 078h, 060h, 018h, 078h, 000h, 000h ; char 0x73 -db 000h, 040h, 0F0h, 040h, 040h, 070h, 000h, 000h ; char 0x74 -db 000h, 000h, 048h, 048h, 048h, 078h, 000h, 000h ; char 0x75 -db 000h, 000h, 050h, 050h, 050h, 020h, 000h, 000h ; char 0x76 -db 000h, 000h, 088h, 0B0h, 070h, 050h, 000h, 000h ; char 0x77 -db 000h, 000h, 088h, 070h, 050h, 088h, 000h, 000h ; char 0x78 -db 000h, 000h, 050h, 050h, 050h, 020h, 020h, 0C0h ; char 0x79 -db 000h, 000h, 070h, 020h, 020h, 070h, 000h, 000h ; char 0x7A -db 030h, 020h, 020h, 040h, 020h, 020h, 020h, 030h ; char 0x7B -db 020h, 020h, 020h, 020h, 020h, 020h, 020h, 020h ; char 0x7C -db 060h, 020h, 020h, 010h, 020h, 020h, 020h, 060h ; char 0x7D -db 000h, 000h, 000h, 0D0h, 070h, 000h, 000h, 000h ; char 0x7E -db 0F8h, 088h, 0A8h, 0A8h, 088h, 0F8h, 000h, 000h ; char 0x7F -db 0E0h, 040h, 070h, 048h, 048h, 050h, 000h, 000h ; char 0x80 -db 070h, 040h, 040h, 040h, 040h, 040h, 000h, 000h ; char 0x81 -db 000h, 000h, 000h, 000h, 000h, 020h, 020h, 040h ; char 0x82 -db 020h, 000h, 070h, 040h, 040h, 040h, 000h, 000h ; char 0x83 -db 000h, 000h, 000h, 000h, 000h, 050h, 0F0h, 000h ; char 0x84 -db 000h, 000h, 000h, 000h, 000h, 0A8h, 000h, 000h ; char 0x85 -db 020h, 070h, 020h, 020h, 020h, 000h, 000h, 000h ; char 0x86 -db 020h, 070h, 020h, 020h, 070h, 020h, 000h, 000h ; char 0x87 -db 030h, 040h, 0E0h, 040h, 0E0h, 070h, 000h, 000h ; char 0x88 -db 0E0h, 0E0h, 038h, 0C0h, 0FCh, 0FCh, 000h, 000h ; char 0x89 -db 0E0h, 0A0h, 0B8h, 0A8h, 0A8h, 0B8h, 000h, 000h ; char 0x8A -db 000h, 000h, 020h, 040h, 040h, 020h, 000h, 000h ; char 0x8B -db 0A0h, 0A0h, 0F8h, 0A8h, 0A8h, 0B8h, 000h, 000h ; char 0x8C -db 048h, 050h, 060h, 060h, 050h, 048h, 000h, 000h ; char 0x8D -db 0E0h, 040h, 078h, 048h, 048h, 048h, 000h, 000h ; char 0x8E -db 088h, 088h, 088h, 088h, 088h, 0F8h, 020h, 000h ; char 0x8F -db 040h, 0E0h, 040h, 078h, 048h, 048h, 008h, 010h ; char 0x90 -db 010h, 020h, 020h, 000h, 000h, 000h, 000h, 000h ; char 0x91 -db 020h, 020h, 040h, 000h, 000h, 000h, 000h, 000h ; char 0x92 -db 050h, 0A0h, 0A0h, 000h, 000h, 000h, 000h, 000h ; char 0x93 -db 050h, 050h, 0A0h, 000h, 000h, 000h, 000h, 000h ; char 0x94 -db 000h, 000h, 070h, 070h, 070h, 000h, 000h, 000h ; char 0x95 -db 000h, 000h, 000h, 078h, 000h, 000h, 000h, 000h ; char 0x96 -db 000h, 000h, 000h, 0F8h, 000h, 000h, 000h, 000h ; char 0x97 -db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x98 -db 0E8h, 0B8h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x99 -db 000h, 000h, 060h, 078h, 068h, 0B8h, 000h, 000h ; char 0x9A -db 000h, 000h, 020h, 010h, 010h, 020h, 000h, 000h ; char 0x9B -db 000h, 000h, 0A0h, 0F8h, 0A8h, 0B8h, 000h, 000h ; char 0x9C -db 020h, 000h, 058h, 070h, 050h, 048h, 000h, 000h ; char 0x9D -db 0F0h, 040h, 078h, 048h, 048h, 048h, 000h, 000h ; char 0x9E -db 000h, 000h, 050h, 050h, 050h, 070h, 020h, 000h ; char 0x9F +db 010h, 038h, 038h, 010h, 010h, 000h, 010h, 000h ; char 0x21 +db 06Ch, 06Ch, 048h, 000h, 000h, 000h, 000h, 000h ; char 0x22 +db 000h, 028h, 07Ch, 028h, 028h, 07Ch, 028h, 000h ; char 0x23 +db 020h, 038h, 040h, 030h, 008h, 070h, 010h, 000h ; char 0x24 +db 064h, 064h, 008h, 010h, 020h, 04Ch, 04Ch, 000h ; char 0x25 +db 020h, 050h, 050h, 020h, 054h, 048h, 034h, 000h ; char 0x26 +db 030h, 030h, 020h, 000h, 000h, 000h, 000h, 000h ; char 0x27 +db 010h, 020h, 020h, 020h, 020h, 020h, 010h, 000h ; char 0x28 +db 020h, 010h, 010h, 010h, 010h, 010h, 020h, 000h ; char 0x29 +db 000h, 028h, 038h, 07Ch, 038h, 028h, 000h, 000h ; char 0x2A +db 000h, 010h, 010h, 07Ch, 010h, 010h, 000h, 000h ; char 0x2B +db 000h, 000h, 000h, 000h, 000h, 030h, 030h, 020h ; char 0x2C +db 000h, 000h, 000h, 07Ch, 000h, 000h, 000h, 000h ; char 0x2D +db 000h, 000h, 000h, 000h, 000h, 030h, 030h, 000h ; char 0x2E +db 000h, 004h, 008h, 010h, 020h, 040h, 000h, 000h ; char 0x2F +db 038h, 044h, 04Ch, 054h, 064h, 044h, 038h, 000h ; char 0x30 +db 010h, 030h, 010h, 010h, 010h, 010h, 038h, 000h ; char 0x31 +db 038h, 044h, 004h, 018h, 020h, 040h, 07Ch, 000h ; char 0x32 +db 038h, 044h, 004h, 038h, 004h, 044h, 038h, 000h ; char 0x33 +db 008h, 018h, 028h, 048h, 07Ch, 008h, 008h, 000h ; char 0x34 +db 07Ch, 040h, 040h, 078h, 004h, 044h, 038h, 000h ; char 0x35 +db 018h, 020h, 040h, 078h, 044h, 044h, 038h, 000h ; char 0x36 +db 07Ch, 004h, 008h, 010h, 020h, 020h, 020h, 000h ; char 0x37 +db 038h, 044h, 044h, 038h, 044h, 044h, 038h, 000h ; char 0x38 +db 038h, 044h, 044h, 03Ch, 004h, 008h, 030h, 000h ; char 0x39 +db 000h, 000h, 030h, 030h, 000h, 030h, 030h, 000h ; char 0x3A +db 000h, 000h, 030h, 030h, 000h, 030h, 030h, 020h ; char 0x3B +db 008h, 010h, 020h, 040h, 020h, 010h, 008h, 000h ; char 0x3C +db 000h, 000h, 07Ch, 000h, 000h, 07Ch, 000h, 000h ; char 0x3D +db 020h, 010h, 008h, 004h, 008h, 010h, 020h, 000h ; char 0x3E +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x3F +db 038h, 044h, 05Ch, 054h, 05Ch, 040h, 038h, 000h ; char 0x40 +db 038h, 044h, 044h, 044h, 07Ch, 044h, 044h, 000h ; char 0x41 +db 078h, 044h, 044h, 078h, 044h, 044h, 078h, 000h ; char 0x42 +db 038h, 044h, 040h, 040h, 040h, 044h, 038h, 000h ; char 0x43 +db 078h, 044h, 044h, 044h, 044h, 044h, 078h, 000h ; char 0x44 +db 07Ch, 040h, 040h, 078h, 040h, 040h, 07Ch, 000h ; char 0x45 +db 07Ch, 040h, 040h, 078h, 040h, 040h, 040h, 000h ; char 0x46 +db 038h, 044h, 040h, 05Ch, 044h, 044h, 03Ch, 000h ; char 0x47 +db 044h, 044h, 044h, 07Ch, 044h, 044h, 044h, 000h ; char 0x48 +db 038h, 010h, 010h, 010h, 010h, 010h, 038h, 000h ; char 0x49 +db 004h, 004h, 004h, 004h, 044h, 044h, 038h, 000h ; char 0x4A +db 044h, 048h, 050h, 060h, 050h, 048h, 044h, 000h ; char 0x4B +db 040h, 040h, 040h, 040h, 040h, 040h, 07Ch, 000h ; char 0x4C +db 044h, 06Ch, 054h, 044h, 044h, 044h, 044h, 000h ; char 0x4D +db 044h, 064h, 054h, 04Ch, 044h, 044h, 044h, 000h ; char 0x4E +db 038h, 044h, 044h, 044h, 044h, 044h, 038h, 000h ; char 0x4F +db 078h, 044h, 044h, 078h, 040h, 040h, 040h, 000h ; char 0x50 +db 038h, 044h, 044h, 044h, 054h, 048h, 034h, 000h ; char 0x51 +db 078h, 044h, 044h, 078h, 048h, 044h, 044h, 000h ; char 0x52 +db 038h, 044h, 040h, 038h, 004h, 044h, 038h, 000h ; char 0x53 +db 07Ch, 010h, 010h, 010h, 010h, 010h, 010h, 000h ; char 0x54 +db 044h, 044h, 044h, 044h, 044h, 044h, 038h, 000h ; char 0x55 +db 044h, 044h, 044h, 044h, 044h, 028h, 010h, 000h ; char 0x56 +db 044h, 044h, 054h, 054h, 054h, 054h, 028h, 000h ; char 0x57 +db 044h, 044h, 028h, 010h, 028h, 044h, 044h, 000h ; char 0x58 +db 044h, 044h, 044h, 028h, 010h, 010h, 010h, 000h ; char 0x59 +db 078h, 008h, 010h, 020h, 040h, 040h, 078h, 000h ; char 0x5A +db 038h, 020h, 020h, 020h, 020h, 020h, 038h, 000h ; char 0x5B +db 000h, 040h, 020h, 010h, 008h, 004h, 000h, 000h ; char 0x5C +db 038h, 008h, 008h, 008h, 008h, 008h, 038h, 000h ; char 0x5D +db 010h, 028h, 044h, 000h, 000h, 000h, 000h, 000h ; char 0x5E +db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0FCh ; char 0x5F +db 030h, 030h, 010h, 000h, 000h, 000h, 000h, 000h ; char 0x60 +db 000h, 000h, 038h, 004h, 03Ch, 044h, 03Ch, 000h ; char 0x61 +db 040h, 040h, 078h, 044h, 044h, 044h, 078h, 000h ; char 0x62 +db 000h, 000h, 038h, 044h, 040h, 044h, 038h, 000h ; char 0x63 +db 004h, 004h, 03Ch, 044h, 044h, 044h, 03Ch, 000h ; char 0x64 +db 000h, 000h, 038h, 044h, 078h, 040h, 038h, 000h ; char 0x65 +db 018h, 020h, 020h, 078h, 020h, 020h, 020h, 000h ; char 0x66 +db 000h, 000h, 03Ch, 044h, 044h, 03Ch, 004h, 038h ; char 0x67 +db 040h, 040h, 070h, 048h, 048h, 048h, 048h, 000h ; char 0x68 +db 010h, 000h, 010h, 010h, 010h, 010h, 018h, 000h ; char 0x69 +db 008h, 000h, 018h, 008h, 008h, 008h, 048h, 030h ; char 0x6A +db 040h, 040h, 048h, 050h, 060h, 050h, 048h, 000h ; char 0x6B +db 010h, 010h, 010h, 010h, 010h, 010h, 018h, 000h ; char 0x6C +db 000h, 000h, 068h, 054h, 054h, 044h, 044h, 000h ; char 0x6D +db 000h, 000h, 070h, 048h, 048h, 048h, 048h, 000h ; char 0x6E +db 000h, 000h, 038h, 044h, 044h, 044h, 038h, 000h ; char 0x6F +db 000h, 000h, 078h, 044h, 044h, 044h, 078h, 040h ; char 0x70 +db 000h, 000h, 03Ch, 044h, 044h, 044h, 03Ch, 004h ; char 0x71 +db 000h, 000h, 058h, 024h, 020h, 020h, 070h, 000h ; char 0x72 +db 000h, 000h, 038h, 040h, 038h, 004h, 038h, 000h ; char 0x73 +db 000h, 020h, 078h, 020h, 020h, 028h, 010h, 000h ; char 0x74 +db 000h, 000h, 048h, 048h, 048h, 058h, 028h, 000h ; char 0x75 +db 000h, 000h, 044h, 044h, 044h, 028h, 010h, 000h ; char 0x76 +db 000h, 000h, 044h, 044h, 054h, 07Ch, 028h, 000h ; char 0x77 +db 000h, 000h, 048h, 048h, 030h, 048h, 048h, 000h ; char 0x78 +db 000h, 000h, 048h, 048h, 048h, 038h, 010h, 060h ; char 0x79 +db 000h, 000h, 078h, 008h, 030h, 040h, 078h, 000h ; char 0x7A +db 018h, 020h, 020h, 060h, 020h, 020h, 018h, 000h ; char 0x7B +db 010h, 010h, 010h, 000h, 010h, 010h, 010h, 000h ; char 0x7C +db 030h, 008h, 008h, 00Ch, 008h, 008h, 030h, 000h ; char 0x7D +db 028h, 050h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0x7E +db 010h, 038h, 06Ch, 044h, 044h, 07Ch, 000h, 000h ; char 0x7F +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x80 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x81 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x82 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x83 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x84 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x85 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x86 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x87 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x88 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x89 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x8A +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x8B +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x8C +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x8D +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x8E +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x8F +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x90 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x91 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x92 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x93 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x94 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x95 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x96 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x97 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x98 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x99 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x9A +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x9B +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x9C +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x9D +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x9E +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0x9F db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h ; char 0xA0 -db 050h, 050h, 050h, 020h, 020h, 040h, 000h, 000h ; char 0xA1 -db 070h, 000h, 050h, 050h, 050h, 020h, 020h, 0C0h ; char 0xA2 -db 070h, 010h, 010h, 010h, 010h, 070h, 000h, 000h ; char 0xA3 -db 088h, 070h, 050h, 050h, 070h, 088h, 000h, 000h ; char 0xA4 -db 070h, 040h, 040h, 040h, 040h, 040h, 000h, 000h ; char 0xA5 -db 020h, 020h, 020h, 000h, 020h, 020h, 020h, 020h ; char 0xA6 -db 070h, 040h, 070h, 048h, 038h, 008h, 078h, 000h ; char 0xA7 -db 070h, 040h, 070h, 040h, 040h, 070h, 000h, 000h ; char 0xA8 -db 070h, 088h, 0A8h, 0A8h, 088h, 070h, 000h, 000h ; char 0xA9 -db 070h, 080h, 0F0h, 080h, 080h, 070h, 000h, 000h ; char 0xAA -db 000h, 048h, 090h, 090h, 048h, 000h, 000h, 000h ; char 0xAB -db 000h, 000h, 000h, 078h, 008h, 000h, 000h, 000h ; char 0xAC -db 000h, 000h, 000h, 070h, 000h, 000h, 000h, 000h ; char 0xAD -db 070h, 088h, 0A8h, 070h, 000h, 000h, 000h, 000h ; char 0xAE -db 070h, 020h, 020h, 020h, 020h, 070h, 000h, 000h ; char 0xAF -db 078h, 048h, 078h, 000h, 000h, 000h, 000h, 000h ; char 0xB0 -db 000h, 020h, 0F8h, 020h, 000h, 0F8h, 000h, 000h ; char 0xB1 -db 070h, 020h, 020h, 020h, 020h, 070h, 000h, 000h ; char 0xB2 -db 010h, 000h, 070h, 010h, 010h, 078h, 000h, 000h ; char 0xB3 -db 000h, 010h, 070h, 040h, 040h, 040h, 000h, 000h ; char 0xB4 -db 000h, 000h, 048h, 048h, 048h, 07Ch, 040h, 040h ; char 0xB5 -db 070h, 0D0h, 0D0h, 050h, 010h, 010h, 070h, 000h ; char 0xB6 +db 054h, 054h, 044h, 03Ch, 004h, 044h, 038h, 000h ; char 0xA1 +db 048h, 030h, 048h, 048h, 048h, 038h, 010h, 060h ; char 0xA2 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xA3 +db 000h, 0CCh, 078h, 0CCh, 078h, 0CCh, 000h, 000h ; char 0xA4 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xA5 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xA6 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xA7 +db 028h, 07Ch, 040h, 078h, 040h, 040h, 07Ch, 000h ; char 0xA8 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xA9 +db 038h, 044h, 040h, 070h, 040h, 044h, 038h, 000h ; char 0xAA +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xAB +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xAC +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xAD +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xAE +db 044h, 010h, 010h, 010h, 010h, 010h, 038h, 000h ; char 0xAF +db 030h, 048h, 048h, 030h, 000h, 000h, 000h, 000h ; char 0xB0 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xB1 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xB2 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xB3 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xB4 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xB5 +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xB6 db 000h, 000h, 000h, 020h, 000h, 000h, 000h, 000h ; char 0xB7 -db 050h, 000h, 038h, 078h, 040h, 038h, 000h, 000h ; char 0xB8 -db 0D8h, 0D8h, 0C0h, 0D8h, 0C0h, 0C0h, 000h, 000h ; char 0xB9 -db 000h, 000h, 038h, 078h, 040h, 038h, 000h, 000h ; char 0xBA -db 090h, 048h, 048h, 090h, 000h, 000h, 000h, 000h ; char 0xBB -db 010h, 000h, 070h, 010h, 010h, 010h, 010h, 070h ; char 0xBC -db 038h, 040h, 060h, 018h, 008h, 070h, 000h, 000h ; char 0xBD -db 000h, 000h, 078h, 060h, 018h, 078h, 000h, 000h ; char 0xBE -db 050h, 000h, 070h, 010h, 010h, 078h, 000h, 000h ; char 0xBF -db 020h, 050h, 050h, 050h, 070h, 050h, 000h, 000h ; char 0xC0 -db 078h, 040h, 070h, 048h, 048h, 070h, 000h, 000h ; char 0xC1 -db 078h, 048h, 070h, 048h, 048h, 070h, 000h, 000h ; char 0xC2 -db 070h, 040h, 040h, 040h, 040h, 040h, 000h, 000h ; char 0xC3 -db 070h, 050h, 050h, 050h, 050h, 0F8h, 088h, 000h ; char 0xC4 -db 070h, 040h, 070h, 040h, 040h, 070h, 000h, 000h ; char 0xC5 -db 0A8h, 070h, 070h, 070h, 0A8h, 0A8h, 000h, 000h ; char 0xC6 -db 0F0h, 010h, 0E0h, 010h, 010h, 0E0h, 000h, 000h ; char 0xC7 -db 048h, 058h, 058h, 068h, 068h, 048h, 000h, 000h ; char 0xC8 -db 048h, 058h, 058h, 068h, 068h, 048h, 000h, 000h ; char 0xC9 -db 048h, 050h, 060h, 060h, 050h, 048h, 000h, 000h ; char 0xCA -db 0E0h, 0A0h, 0A0h, 0A0h, 0A0h, 020h, 000h, 000h ; char 0xCB -db 010h, 0B0h, 0B0h, 050h, 010h, 010h, 000h, 000h ; char 0xCC -db 090h, 090h, 0F0h, 090h, 090h, 090h, 000h, 000h ; char 0xCD -db 070h, 088h, 088h, 088h, 088h, 070h, 000h, 000h ; char 0xCE -db 078h, 048h, 048h, 048h, 048h, 048h, 000h, 000h ; char 0xCF -db 070h, 048h, 048h, 070h, 040h, 040h, 000h, 000h ; char 0xD0 -db 070h, 080h, 080h, 080h, 080h, 070h, 000h, 000h ; char 0xD1 -db 0F8h, 020h, 020h, 020h, 020h, 020h, 000h, 000h ; char 0xD2 -db 050h, 050h, 050h, 020h, 020h, 040h, 000h, 000h ; char 0xD3 -db 020h, 070h, 0A8h, 0A8h, 070h, 020h, 000h, 000h ; char 0xD4 -db 088h, 050h, 020h, 020h, 050h, 088h, 000h, 000h ; char 0xD5 -db 050h, 050h, 050h, 050h, 050h, 078h, 008h, 000h ; char 0xD6 -db 090h, 090h, 090h, 070h, 010h, 010h, 000h, 000h ; char 0xD7 -db 0A8h, 0A8h, 0A8h, 0A8h, 0A8h, 0F8h, 000h, 000h ; char 0xD8 -db 0A8h, 0A8h, 0A8h, 0A8h, 0A8h, 0F8h, 008h, 000h ; char 0xD9 -db 0C0h, 040h, 070h, 048h, 048h, 070h, 000h, 000h ; char 0xDA -db 090h, 090h, 0F0h, 0B0h, 0B0h, 0D0h, 000h, 000h ; char 0xDB -db 040h, 040h, 070h, 048h, 048h, 070h, 000h, 000h ; char 0xDC -db 070h, 008h, 078h, 008h, 008h, 070h, 000h, 000h ; char 0xDD -db 0B8h, 0A8h, 0E8h, 0A8h, 0A8h, 0B8h, 000h, 000h ; char 0xDE -db 070h, 090h, 090h, 070h, 050h, 090h, 000h, 000h ; char 0xDF -db 000h, 000h, 078h, 008h, 078h, 078h, 000h, 000h ; char 0xE0 -db 060h, 078h, 048h, 048h, 030h, 000h, 000h, 000h ; char 0xE1 -db 000h, 000h, 078h, 070h, 048h, 078h, 000h, 000h ; char 0xE2 -db 000h, 000h, 070h, 040h, 040h, 040h, 000h, 000h ; char 0xE3 -db 000h, 000h, 070h, 050h, 050h, 0F8h, 088h, 000h ; char 0xE4 -db 000h, 000h, 038h, 078h, 040h, 038h, 000h, 000h ; char 0xE5 -db 000h, 000h, 0A8h, 070h, 070h, 0A8h, 000h, 000h ; char 0xE6 -db 000h, 000h, 078h, 030h, 008h, 078h, 000h, 000h ; char 0xE7 -db 000h, 000h, 048h, 058h, 068h, 048h, 000h, 000h ; char 0xE8 -db 070h, 000h, 048h, 058h, 068h, 048h, 000h, 000h ; char 0xE9 -db 000h, 000h, 058h, 070h, 050h, 048h, 000h, 000h ; char 0xEA -db 000h, 000h, 070h, 050h, 050h, 090h, 000h, 000h ; char 0xEB -db 000h, 000h, 050h, 070h, 0B0h, 088h, 000h, 000h ; char 0xEC -db 000h, 000h, 048h, 078h, 048h, 048h, 000h, 000h ; char 0xED -db 000h, 000h, 060h, 090h, 090h, 060h, 000h, 000h ; char 0xEE -db 000h, 000h, 078h, 048h, 048h, 048h, 000h, 000h ; char 0xEF -db 000h, 000h, 078h, 048h, 048h, 070h, 040h, 040h ; char 0xF0 -db 000h, 000h, 030h, 040h, 040h, 070h, 000h, 000h ; char 0xF1 -db 000h, 000h, 0F8h, 020h, 020h, 020h, 000h, 000h ; char 0xF2 -db 000h, 000h, 050h, 050h, 050h, 020h, 020h, 0C0h ; char 0xF3 -db 020h, 020h, 078h, 0A8h, 0A8h, 070h, 020h, 020h ; char 0xF4 -db 000h, 000h, 088h, 070h, 050h, 088h, 000h, 000h ; char 0xF5 -db 000h, 000h, 050h, 050h, 050h, 078h, 008h, 000h ; char 0xF6 -db 000h, 000h, 048h, 078h, 008h, 008h, 000h, 000h ; char 0xF7 -db 000h, 000h, 0A8h, 0A8h, 0A8h, 0F8h, 000h, 000h ; char 0xF8 -db 000h, 000h, 0A8h, 0A8h, 0A8h, 0F8h, 008h, 000h ; char 0xF9 -db 000h, 000h, 0C0h, 078h, 048h, 078h, 000h, 000h ; char 0xFA -db 000h, 000h, 090h, 0F0h, 0B0h, 0F0h, 000h, 000h ; char 0xFB -db 000h, 000h, 040h, 078h, 048h, 078h, 000h, 000h ; char 0xFC -db 000h, 000h, 070h, 078h, 008h, 070h, 000h, 000h ; char 0xFD -db 000h, 000h, 0B0h, 0F0h, 0B0h, 0B0h, 000h, 000h ; char 0xFE -db 000h, 000h, 0F0h, 090h, 070h, 090h, 000h, 000h ; char 0xFF +db 028h, 000h, 038h, 044h, 078h, 040h, 038h, 000h ; char 0xB8 +db 09Ch, 0DCh, 0D0h, 0B0h, 0BCh, 090h, 090h, 000h ; char 0xB9 +db 000h, 000h, 038h, 044h, 070h, 044h, 038h, 000h ; char 0xBA +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xBB +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xBC +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xBD +db 038h, 044h, 004h, 018h, 010h, 000h, 010h, 000h ; char 0xBE +db 028h, 000h, 010h, 010h, 010h, 010h, 018h, 000h ; char 0xBF +db 038h, 044h, 044h, 044h, 07Ch, 044h, 044h, 000h ; char 0xC0 +db 07Ch, 040h, 040h, 078h, 044h, 044h, 078h, 000h ; char 0xC1 +db 078h, 044h, 044h, 078h, 044h, 044h, 078h, 000h ; char 0xC2 +db 07Ch, 040h, 040h, 040h, 040h, 040h, 040h, 000h ; char 0xC3 +db 038h, 048h, 048h, 048h, 048h, 048h, 0FCh, 084h ; char 0xC4 +db 07Ch, 040h, 040h, 078h, 040h, 040h, 07Ch, 000h ; char 0xC5 +db 054h, 054h, 054h, 038h, 054h, 054h, 054h, 000h ; char 0xC6 +db 070h, 088h, 008h, 070h, 008h, 088h, 070h, 000h ; char 0xC7 +db 044h, 044h, 044h, 04Ch, 054h, 064h, 044h, 000h ; char 0xC8 +db 038h, 044h, 044h, 04Ch, 054h, 064h, 044h, 000h ; char 0xC9 +db 044h, 048h, 050h, 060h, 050h, 048h, 044h, 000h ; char 0xCA +db 01Ch, 024h, 024h, 024h, 024h, 024h, 064h, 000h ; char 0xCB +db 044h, 06Ch, 054h, 044h, 044h, 044h, 044h, 000h ; char 0xCC +db 044h, 044h, 044h, 07Ch, 044h, 044h, 044h, 000h ; char 0xCD +db 038h, 044h, 044h, 044h, 044h, 044h, 038h, 000h ; char 0xCE +db 07Ch, 044h, 044h, 044h, 044h, 044h, 044h, 000h ; char 0xCF +db 078h, 044h, 044h, 078h, 040h, 040h, 040h, 000h ; char 0xD0 +db 038h, 044h, 040h, 040h, 040h, 044h, 038h, 000h ; char 0xD1 +db 07Ch, 010h, 010h, 010h, 010h, 010h, 010h, 000h ; char 0xD2 +db 044h, 044h, 044h, 03Ch, 004h, 044h, 038h, 000h ; char 0xD3 +db 038h, 054h, 054h, 054h, 038h, 010h, 010h, 000h ; char 0xD4 +db 044h, 044h, 028h, 010h, 028h, 044h, 044h, 000h ; char 0xD5 +db 048h, 048h, 048h, 048h, 048h, 048h, 07Ch, 004h ; char 0xD6 +db 044h, 044h, 044h, 03Ch, 004h, 004h, 004h, 000h ; char 0xD7 +db 054h, 054h, 054h, 054h, 054h, 054h, 07Ch, 000h ; char 0xD8 +db 054h, 054h, 054h, 054h, 054h, 054h, 07Ch, 004h ; char 0xD9 +db 0E0h, 0A0h, 020h, 038h, 024h, 024h, 038h, 000h ; char 0xDA +db 044h, 044h, 044h, 074h, 04Ch, 04Ch, 074h, 000h ; char 0xDB +db 040h, 040h, 040h, 078h, 044h, 044h, 078h, 000h ; char 0xDC +db 038h, 044h, 004h, 01Ch, 004h, 044h, 038h, 000h ; char 0xDD +db 048h, 054h, 054h, 074h, 054h, 054h, 048h, 000h ; char 0xDE +db 03Ch, 044h, 044h, 03Ch, 024h, 044h, 044h, 000h ; char 0xDF +db 000h, 000h, 038h, 004h, 03Ch, 044h, 03Ch, 000h ; char 0xE0 +db 004h, 038h, 040h, 078h, 044h, 044h, 038h, 000h ; char 0xE1 +db 000h, 000h, 078h, 044h, 078h, 044h, 078h, 000h ; char 0xE2 +db 000h, 000h, 078h, 048h, 040h, 040h, 040h, 000h ; char 0xE3 +db 000h, 000h, 038h, 048h, 048h, 048h, 0FCh, 084h ; char 0xE4 +db 000h, 000h, 038h, 044h, 078h, 040h, 038h, 000h ; char 0xE5 +db 000h, 000h, 054h, 054h, 038h, 054h, 054h, 000h ; char 0xE6 +db 000h, 000h, 038h, 044h, 018h, 044h, 038h, 000h ; char 0xE7 +db 000h, 000h, 044h, 04Ch, 054h, 064h, 044h, 000h ; char 0xE8 +db 000h, 018h, 044h, 04Ch, 054h, 064h, 044h, 000h ; char 0xE9 +db 000h, 000h, 048h, 050h, 060h, 050h, 048h, 000h ; char 0xEA +db 000h, 000h, 038h, 048h, 048h, 048h, 088h, 000h ; char 0xEB +db 000h, 000h, 044h, 06Ch, 054h, 044h, 044h, 000h ; char 0xEC +db 000h, 000h, 044h, 044h, 07Ch, 044h, 044h, 000h ; char 0xED +db 000h, 000h, 038h, 044h, 044h, 044h, 038h, 000h ; char 0xEE +db 000h, 000h, 07Ch, 044h, 044h, 044h, 044h, 000h ; char 0xEF +db 000h, 000h, 078h, 044h, 044h, 044h, 078h, 040h ; char 0xF0 +db 000h, 000h, 038h, 044h, 040h, 044h, 038h, 000h ; char 0xF1 +db 000h, 000h, 07Ch, 010h, 010h, 010h, 010h, 000h ; char 0xF2 +db 000h, 000h, 048h, 048h, 048h, 038h, 010h, 060h ; char 0xF3 +db 000h, 000h, 038h, 054h, 054h, 038h, 010h, 000h ; char 0xF4 +db 000h, 000h, 048h, 048h, 030h, 048h, 048h, 000h ; char 0xF5 +db 000h, 000h, 048h, 048h, 048h, 048h, 07Ch, 004h ; char 0xF6 +db 000h, 000h, 044h, 044h, 03Ch, 004h, 004h, 000h ; char 0xF7 +db 000h, 000h, 054h, 054h, 054h, 054h, 07Ch, 000h ; char 0xF8 +db 000h, 000h, 054h, 054h, 054h, 054h, 07Ch, 004h ; char 0xF9 +db 000h, 000h, 0E0h, 0A0h, 038h, 024h, 038h, 000h ; char 0xFA +db 000h, 000h, 044h, 044h, 074h, 04Ch, 074h, 000h ; char 0xFB +db 000h, 000h, 040h, 040h, 078h, 044h, 078h, 000h ; char 0xFC +db 000h, 000h, 038h, 044h, 01Ch, 044h, 038h, 000h ; char 0xFD +db 000h, 000h, 048h, 054h, 074h, 054h, 048h, 000h ; char 0xFE +db 000h, 000h, 03Ch, 044h, 03Ch, 024h, 044h, 000h ; char 0xFF diff --git a/poker.exe b/poker.exe index dfd7820..f8df6dc 100644 Binary files a/poker.exe and b/poker.exe differ diff --git a/tools/generators/generate_clean_font.py b/tools/generators/generate_clean_font.py new file mode 100644 index 0000000..9bc7e8d --- /dev/null +++ b/tools/generators/generate_clean_font.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +""" +Generate 100% authentic, pixel-perfect 8x8 IBM VGA bitmap font for CP1251 in font8x8.inc. +Extracts official IBM VGA 8x8 font resources directly from C:\\Windows\\Fonts\\app866.fon, +mapping CP1251 characters to the corresponding CP866 Cyrillic glyphs. +""" +import struct +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parents[2] +FONT_INC = REPO_ROOT / 'font8x8.inc' + +# Load authentic 8x8 font from app866.fon (Resource at offset 8784: 8x8, 256 glyphs) +with open('C:/Windows/Fonts/app866.fon', 'rb') as f: + fon_data = f.read() + +font_res = fon_data[8784:8784+3211] +raw_glyphs = {} +for ch in range(256): + entry_off = 0x76 + ch * 4 + w, off = struct.unpack(' Flip! - test eax, eax - jz check_coin_side - mov eax, bankroll - cmp eax, coin3d_bet - jl coin_no_cash - sub eax, coin3d_bet - mov bankroll, eax - mov coin3d_state, 1 - mov coin3d_timer, 0 - mov coin3d_win, 0 - invoke PlaySoundA, OFFSET soundCoin, 0, 1 - jmp coin_input_done - -coin_no_cash: - invoke CopyString3D, OFFSET msgNeedMoney, OFFSET flashMessage - mov flashTimer, 60 - invoke PlaySoundA, OFFSET soundClick, 0, 1 - jmp coin_input_done - -check_coin_side: - invoke Pressed3D, 31h ; '1' - test eax, eax - jz @F - mov coin3d_side, 1 - invoke PlaySoundA, OFFSET soundClick, 0, 1 -@@: - invoke Pressed3D, 32h ; '2' - test eax, eax - jz check_coin_bet_adjust - mov coin3d_side, 2 - invoke PlaySoundA, OFFSET soundClick, 0, 1 - -check_coin_bet_adjust: - invoke Pressed3D, 26h ; UP - test eax, eax - jnz coin_inc_bet - invoke Pressed3D, 57h ; W - test eax, eax - jz check_coin_bet_down -coin_inc_bet: - invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp coin3d_bet, 500 - jge coin_input_done - cmp coin3d_bet, 250 - jge coin_set_500 - cmp coin3d_bet, 100 - jge coin_set_250 - cmp coin3d_bet, 50 - jge coin_set_100 - cmp coin3d_bet, 25 - jge coin_set_50 - jmp coin_set_25 -coin_set_500: - mov coin3d_bet, 500 - jmp coin_input_done -coin_set_250: - mov coin3d_bet, 250 - jmp coin_input_done -coin_set_100: - mov coin3d_bet, 100 - jmp coin_input_done -coin_set_50: - mov coin3d_bet, 50 - jmp coin_input_done -coin_set_25: - mov coin3d_bet, 25 - jmp coin_input_done - -check_coin_bet_down: - invoke Pressed3D, 28h ; DOWN - test eax, eax - jnz coin_dec_bet - invoke Pressed3D, 53h ; S - test eax, eax - jz coin_input_done -coin_dec_bet: - invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp coin3d_bet, 25 - jle coin_set_10 - cmp coin3d_bet, 50 - jle coin_set_25 - cmp coin3d_bet, 100 - jle coin_set_50 - cmp coin3d_bet, 250 - jle coin_set_100 - mov coin3d_bet, 250 - jmp coin_input_done -coin_set_10: - mov coin3d_bet, 10 - -coin_input_done: + je coin_handle_flipping + cmp coin3d_state, 2 + je coin_handle_result ret -HandleCoinInput ENDP -RenderCoinGame PROC uses ebx esi edi - LOCAL cyVal:DWORD, rxVal:DWORD, curX:DWORD +coin_handle_idle: + invoke Pressed3D, 26h ; UP + test eax, eax + jnz coin_bet_up + invoke Pressed3D, 57h ; 'W' + test eax, eax + jnz coin_bet_up + invoke Pressed3D, 28h ; DOWN + test eax, eax + jnz coin_bet_down + invoke Pressed3D, 53h ; 'S' + test eax, eax + jnz coin_bet_down + invoke Pressed3D, 31h ; '1' + test eax, eax + jnz coin_pick_1 + invoke Pressed3D, 32h ; '2' + test eax, eax + jnz coin_pick_2 + invoke Pressed3D, 20h ; SPACE + test eax, eax + jnz coin_start_flip + ret - ; Cabinet Bezel (Mahogany wood & leather) - invoke DrawBox, 0, 0, 320, 240, 00060914h - invoke DrawBoxBorder, 6, 6, 308, 228, 000F1522h, 001B2E48h, 3 - - ; Corner Brass Rivets - invoke DrawBox, 12, 12, 3, 3, 0000D7FFh - invoke DrawPixel, 13, 13, 00FFFFFFh - invoke DrawBox, 306, 12, 3, 3, 0000D7FFh - invoke DrawPixel, 307, 13, 00FFFFFFh - invoke DrawBox, 12, 226, 3, 3, 0000D7FFh - invoke DrawPixel, 13, 227, 00FFFFFFh - invoke DrawBox, 306, 226, 3, 3, 0000D7FFh - invoke DrawPixel, 307, 227, 00FFFFFFh - - ; Illuminated Marquee Header - invoke DrawBoxBorder, 24, 12, 272, 26, 000A101Ch, 0000D7FFh, 2 - invoke DrawString8x8, 48, 21, OFFSET textCoinTitle, 0000FFFFh - - ; Bulb lights on marquee border - mov curX, 28 -coin_bulbs: - cmp curX, 292 - jge coin_meters - invoke DrawPixel, curX, 13, 0000FFFFh - invoke DrawPixel, curX, 36, 0000D7FFh - add curX, 12 - jmp coin_bulbs - -coin_meters: - ; Status Meters: Bank & Bet - invoke DrawBoxBorder, 20, 44, 114, 18, 000A1A0Eh, 001A4B22h, 1 - invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 0050FF50h - invoke FormatNumber, bankroll, OFFSET hudNumBuffer - invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 0050FF50h - - invoke DrawBoxBorder, 186, 44, 114, 18, 001A100Ah, 003A2814h, 1 - invoke DrawString8x8, 190, 49, OFFSET textBetPrompt, 0000D7FFh - invoke FormatNumber, coin3d_bet, OFFSET hudNumBuffer - invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 0000D7FFh - invoke DrawString8x8, 278, 49, OFFSET textBetHint, 00808080h - - ; Center Velvet Platter - invoke DrawCircle, 160, 110, 46, 000090C0h - invoke DrawCircle, 160, 110, 44, 0000D7FFh - invoke DrawCircle, 160, 110, 41, 00180824h - - ; Selection Podiums: [1] ОРÐ�Л - mov eax, 00121620h - mov edx, 00404855h - mov ecx, 0090A0B0h - cmp coin3d_side, 1 - jne @F - mov eax, 001C3822h - mov edx, 0000FFFFh - mov ecx, 0000FFFFh +coin_bet_up: + mov eax, coin3d_bet + add eax, 50 + cmp eax, bankroll + jle @F + mov eax, bankroll @@: - push ecx - invoke DrawBoxBorder, 20, 72, 76, 52, eax, edx, 2 - pop ecx - invoke DrawString8x8, 28, 78, OFFSET textCoinSide1, ecx - invoke DrawDetailedCoin, 58, 106, 12, 12, 0000A0D0h, 0000D7FFh, 1 - - ; Selection Podiums: [2] РЕШКÐ� - mov eax, 00121620h - mov edx, 00404855h - mov ecx, 0090A0B0h - cmp coin3d_side, 2 - jne @F - mov eax, 001C3822h - mov edx, 0000FFFFh - mov ecx, 0000FFFFh + cmp eax, 5000 + jle @F + mov eax, 5000 @@: - push ecx - invoke DrawBoxBorder, 224, 72, 76, 52, eax, edx, 2 - pop ecx - invoke DrawString8x8, 232, 78, OFFSET textCoinSide2, ecx - invoke DrawDetailedCoin, 262, 106, 12, 12, 000080A0h, 0000B0D0h, 2 + mov coin3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret - ; Flipping animation logic - cmp coin3d_state, 1 - jne coin_at_rest +coin_bet_down: + mov eax, coin3d_bet + sub eax, 50 + cmp eax, 50 + jge @F + mov eax, 50 +@@: + mov coin3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret - inc coin3d_timer +coin_pick_1: + mov coin3d_choice, 1 + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret - ; Parabolic toss: cy = 110 - (t * (40 - t)) / 14 - mov eax, coin3d_timer - mov ecx, 40 - sub ecx, eax - imul eax, ecx - xor edx, edx - mov ecx, 14 - div ecx - mov edx, 110 - sub edx, eax - mov cyVal, edx +coin_pick_2: + mov coin3d_choice, 2 + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret - ; Width rx from lookup table: (t % 10) - mov eax, coin3d_timer - xor edx, edx - mov ecx, 10 - div ecx - movzx eax, BYTE PTR [coinRxAnimTable + edx] - mov rxVal, eax +coin_start_flip: + mov eax, coin3d_bet + cmp eax, bankroll + jle @F + mov eax, bankroll + mov coin3d_bet, eax + test eax, eax + jz coin_done +@@: + mov eax, coin3d_bet + sub bankroll, eax + mov coin3d_state, 1 + mov coin3d_timer, 40 + invoke PlaySoundA, OFFSET soundCoin, 0, 1 + ret - invoke DrawDetailedCoin, 160, cyVal, rxVal, 26, 0000A0D0h, 0000D7FFh, 0 - invoke DrawString8x8, 88, 160, OFFSET textCoinFlipping, 0000FFFFh - - cmp coin3d_timer, 40 - jl coin_draw_controls - - ; Flip complete! - mov coin3d_state, 2 +coin_handle_flipping: + dec coin3d_timer + cmp coin3d_timer, 0 + jg coin_done invoke RandomRange3D, 2 inc eax mov coin3d_result, eax - - mov eax, coin3d_result - cmp eax, coin3d_side + mov edx, coin3d_choice + cmp eax, edx jne coin_flip_lost ; Won! + inc coin3d_streak mov eax, coin3d_bet shl eax, 1 - mov coin3d_win, eax add bankroll, eax - inc coin3d_streak - cmp coin3d_streak, 3 - jl @F - invoke PlaySoundA, OFFSET soundVictory, 0, 1 - jmp coin_draw_controls -@@: + mov coin3d_win, eax + mov coin3d_state, 2 invoke PlaySoundA, OFFSET soundCoinDing, 0, 1 - jmp coin_draw_controls + ret coin_flip_lost: mov coin3d_streak, 0 mov coin3d_win, 0 + mov coin3d_state, 2 invoke PlaySoundA, OFFSET soundLose, 0, 1 - jmp coin_draw_controls + ret -coin_at_rest: - ; Draw coin resting in velvet dish - mov edx, coin3d_side +coin_handle_result: + invoke Pressed3D, 20h + test eax, eax + jz coin_done + mov coin3d_state, 0 + invoke PlaySoundA, OFFSET soundClick, 0, 1 +coin_done: + ret +HandleCoinInput ENDP + +RenderCoinGame PROC uses ebx esi edi + local cyVal:DWORD + local rxVal:DWORD + local kx:DWORD + + ; Background & Cabinet border + invoke DrawBox, 0, 0, 320, 240, 00140906h + invoke DrawBoxBorder, 6, 6, 308, 228, 0022150Fh, 00482E1Bh, 3 + + ; Header + invoke DrawBoxBorder, 20, 12, 280, 26, 001C100Ah, 00FFD700h, 2 + invoke DrawString8x8, 44, 21, OFFSET textCoinTitle, 00FFFF00h + + ; Corner rivets + invoke DrawBox, 12, 12, 3, 3, 00FFD700h + invoke DrawBox, 306, 12, 3, 3, 00FFD700h + invoke DrawBox, 12, 226, 3, 3, 00FFD700h + invoke DrawBox, 306, 226, 3, 3, 00FFD700h + + ; Status meters + invoke DrawBoxBorder, 20, 44, 110, 18, 000E1A0Ah, 00224B1Ah, 1 + invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 003CFF3Ch + invoke FormatNumber, bankroll, OFFSET hudNumBuffer + invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 003CFF3Ch + + invoke DrawBoxBorder, 190, 44, 110, 18, 001A100Ah, 003A2814h, 1 + invoke DrawString8x8, 194, 49, OFFSET textBetPrompt, 00FFD700h + invoke FormatNumber, coin3d_bet, OFFSET hudNumBuffer + invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 00FFD700h + + ; Left: Heads + cmp coin3d_choice, 1 + jne coin_left_inactive + invoke DrawBoxBorder, 20, 72, 76, 68, 00101828h, 00FFFF00h, 2 + invoke DrawString8x8, 30, 78, OFFSET textCoinSide1, 00FFFF00h + invoke DrawDetailedCoin, 58, 106, 14, 14, 00D0A000h, 00FFD700h, 1 + invoke DrawString8x8, 24, 126, OFFSET textCoinSelected, 003CFF3Ch + jmp coin_right_side +coin_left_inactive: + invoke DrawBoxBorder, 20, 72, 76, 68, 000A101Ch, 00404855h, 1 + invoke DrawString8x8, 30, 78, OFFSET textCoinSide1, 00D0D8E0h + invoke DrawDetailedCoin, 58, 106, 14, 14, 009A7A00h, 00D0A000h, 1 + +coin_right_side: + ; Right: Tails + cmp coin3d_choice, 2 + jne coin_right_inactive + invoke DrawBoxBorder, 224, 72, 76, 68, 00101828h, 00FFFF00h, 2 + invoke DrawString8x8, 234, 78, OFFSET textCoinSide2, 00FFFF00h + invoke DrawDetailedCoin, 262, 106, 14, 14, 00D0A000h, 00FFD700h, 2 + invoke DrawString8x8, 228, 126, OFFSET textCoinSelected, 003CFF3Ch + jmp coin_center_area +coin_right_inactive: + invoke DrawBoxBorder, 224, 72, 76, 68, 000A101Ch, 00404855h, 1 + invoke DrawString8x8, 234, 78, OFFSET textCoinSide2, 00D0D8E0h + invoke DrawDetailedCoin, 262, 106, 14, 14, 009A7A00h, 00D0A000h, 2 + +coin_center_area: + ; Center spotlight + invoke DrawCircle, 160, 110, 48, 00121620h + invoke DrawCircle, 160, 110, 44, 00FFD700h + invoke DrawCircle, 160, 110, 42, 000E141Eh + + cmp coin3d_state, 1 + je coin_render_flipping cmp coin3d_state, 2 - jne @F - mov edx, coin3d_result -@@: - invoke DrawDetailedCoin, 160, 110, 26, 26, 0000A0D0h, 0000D7FFh, edx + je coin_render_result - ; Outcome / Streak Display - cmp coin3d_state, 2 - jne coin_show_streak + ; Idle coin + invoke DrawDetailedCoin, 160, 110, 26, 26, 00D0A000h, 00FFD700h, coin3d_choice + jmp coin_render_keys - cmp coin3d_win, 0 - je coin_show_lose - invoke DrawBoxBorder, 44, 154, 232, 20, 000E141Eh, 0050FF50h, 1 - invoke DrawString8x8, 64, 160, OFFSET textCoinWin, 0050FF50h +coin_render_flipping: + mov eax, coin3d_timer + and eax, 7 + movzx eax, byte ptr [coinRxAnimTable + eax] + mov rxVal, eax + invoke DrawDetailedCoin, 160, 110, rxVal, 26, 00D0A000h, 00FFD700h, 0 + invoke DrawString8x8, 88, 160, OFFSET textCoinFlipping, 00FFFF00h + jmp coin_render_keys + +coin_render_result: + invoke DrawDetailedCoin, 160, 110, 26, 26, 00D0A000h, 00FFD700h, coin3d_result + mov eax, coin3d_result + cmp eax, coin3d_choice + jne coin_render_loss_msg + + ; Win banner + invoke DrawBoxBorder, 44, 154, 232, 22, 000E141Eh, 003CFF3Ch, 1 + invoke DrawString8x8, 64, 161, OFFSET textCoinWin, 003CFF3Ch invoke FormatNumber, coin3d_win, OFFSET hudNumBuffer - invoke DrawString8x8, 152, 160, OFFSET hudNumBuffer, 0050FF50h - jmp coin_draw_controls + invoke DrawString8x8, 152, 161, OFFSET hudNumBuffer, 003CFF3Ch + jmp coin_render_keys -coin_show_lose: - invoke DrawBoxBorder, 44, 154, 232, 20, 000E141Eh, 000000FFh, 1 - invoke DrawString8x8, 114, 160, OFFSET textCoinLose, 008080FFh - jmp coin_draw_controls +coin_render_loss_msg: + invoke DrawBoxBorder, 44, 154, 232, 22, 000E141Eh, 00C81414h, 1 + invoke DrawString8x8, 114, 161, OFFSET textCoinLose, 00FF6464h -coin_show_streak: - invoke DrawBoxBorder, 44, 154, 232, 20, 000E141Eh, 0000D7FFh, 1 - invoke DrawString8x8, 52, 160, OFFSET textCoinStreakFmt, 0000FFFFh - -coin_draw_controls: - ; Keycaps Control Bar - invoke DrawBox, 16, 194, 288, 1, 001E2E40h - - mov eax, 0 - cmp coin3d_side, 1 +coin_render_keys: + mov kx, 16 + xor eax, eax + cmp coin3d_choice, 1 sete al - invoke DrawKeycap3D, 22, 202, OFFSET textCoinKey1, eax + invoke DrawKeycap3D, kx, 192, OFFSET textCoinKey1, eax + add kx, eax - mov eax, 0 - cmp coin3d_side, 2 + xor eax, eax + cmp coin3d_choice, 2 sete al - invoke DrawKeycap3D, 88, 202, OFFSET textCoinKey2, eax + invoke DrawKeycap3D, kx, 192, OFFSET textCoinKey2, eax + add kx, eax - invoke DrawKeycap3D, 160, 202, OFFSET textCoinKeySpace, 1 - invoke DrawKeycap3D, 274, 202, OFFSET textKeyEsc, 0 + invoke DrawKeycap3D, kx, 192, OFFSET textCoinKeySpace, 1 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textKeyEsc, 0 ret RenderCoinGame ENDP ; ============================================================================== -; IN-ENGINE 2.5D MINI-GAME: DICE / CRAPS (КОСТИ) +; IN-ENGINE 2.5D MINI-GAME: CRAPS / DICE ; ============================================================================== DrawCrapsDie PROC uses ebx esi edi, x:DWORD, y:DWORD, sizeVal:DWORD, valNum:DWORD - ; Drop shadow on green felt + ; Drop shadow mov eax, x add eax, 3 mov edx, y add edx, sizeVal - invoke DrawBox, eax, edx, sizeVal, 3, 00031408h + invoke DrawBox, eax, edx, sizeVal, 3, 00081403h + mov eax, x add eax, sizeVal mov edx, y add edx, 3 - invoke DrawBox, eax, edx, 3, sizeVal, 00031408h + invoke DrawBox, eax, edx, 3, sizeVal, 00081403h - ; Ivory body & dark border - invoke DrawBoxBorder, x, y, sizeVal, sizeVal, 00F0F4FAh, 00353540h, 1 - - ; Bevel highlight top & left - mov eax, sizeVal - sub eax, 2 - mov edx, x + ; Ivory body & bevel + invoke DrawBoxBorder, x, y, sizeVal, sizeVal, 00FAF4F0h, 00403535h, 1 + mov eax, x + inc eax + mov edx, y inc edx - mov ecx, y - inc ecx - invoke DrawBox, edx, ecx, eax, 1, 00FFFFFFh - invoke DrawBox, edx, ecx, 1, eax, 00FFFFFFh - - ; Bevel shadow bottom & right - mov edx, x - inc edx - mov ecx, y - add ecx, sizeVal + mov ecx, sizeVal sub ecx, 2 - invoke DrawBox, edx, ecx, eax, 1, 00C0C6D0h - mov edx, x - add edx, sizeVal - sub edx, 2 - mov ecx, y - inc ecx - invoke DrawBox, edx, ecx, 1, eax, 00C0C6D0h + invoke DrawBox, eax, edx, ecx, 1, 00FFFFFFh + invoke DrawBox, eax, edx, 1, ecx, 00FFFFFFh - ; Casino Ruby Red circular pips (radius 3) - cmp valNum, 1 - je draw_die_c - cmp valNum, 3 - je draw_die_c - cmp valNum, 5 - je draw_die_c - jmp check_die_pips_corners - -draw_die_c: + ; Ruby pips (00C81515h) + mov eax, valNum + test al, 1 + jz @F + ; Center pip mov eax, x add eax, 18 mov edx, y add edx, 18 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h dec eax dec edx invoke DrawPixel, eax, edx, 00FFFFFFh - -check_die_pips_corners: +@@: cmp valNum, 2 jl die_pips_done mov eax, x add eax, 9 mov edx, y add edx, 9 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h mov eax, x - add eax, sizeVal - sub eax, 10 + add eax, 27 mov edx, y - add edx, sizeVal - sub edx, 10 - invoke DrawCircle, eax, edx, 3, 001515C8h + add edx, 27 + invoke DrawCircle, eax, edx, 3, 00C81515h cmp valNum, 4 jl die_pips_done mov eax, x - add eax, sizeVal - sub eax, 10 + add eax, 27 mov edx, y add edx, 9 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h mov eax, x add eax, 9 mov edx, y - add edx, sizeVal - sub edx, 10 - invoke DrawCircle, eax, edx, 3, 001515C8h + add edx, 27 + invoke DrawCircle, eax, edx, 3, 00C81515h cmp valNum, 6 jl die_pips_done @@ -855,13 +836,12 @@ check_die_pips_corners: add eax, 9 mov edx, y add edx, 18 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h mov eax, x - add eax, sizeVal - sub eax, 10 + add eax, 27 mov edx, y add edx, 18 - invoke DrawCircle, eax, edx, 3, 001515C8h + invoke DrawCircle, eax, edx, 3, 00C81515h die_pips_done: ret @@ -871,328 +851,274 @@ InitDiceGame PROC mov dice3d_state, 0 mov dice3d_timer, 0 mov dice3d_win, 0 - cmp dice3d_bet, 10 - jge @F - mov dice3d_bet, 50 -@@: ret InitDiceGame ENDP HandleDiceInput PROC + cmp dice3d_state, 0 + je dice_handle_idle cmp dice3d_state, 1 - je dice_input_done + je dice_handle_rolling + cmp dice3d_state, 2 + je dice_handle_result + ret - invoke Pressed3D, 20h ; SPACE -> Roll! +dice_handle_idle: + invoke Pressed3D, 26h ; UP test eax, eax - jz check_dice_choice + jnz dice_bet_up + invoke Pressed3D, 57h ; 'W' + test eax, eax + jnz dice_bet_up + invoke Pressed3D, 28h ; DOWN + test eax, eax + jnz dice_bet_down + invoke Pressed3D, 53h ; 'S' + test eax, eax + jnz dice_bet_down + invoke Pressed3D, 31h ; '1' + test eax, eax + jnz dice_pick_1 + invoke Pressed3D, 32h ; '2' + test eax, eax + jnz dice_pick_2 + invoke Pressed3D, 20h ; SPACE + test eax, eax + jnz dice_start_roll + ret + +dice_bet_up: + mov eax, dice3d_bet + add eax, 50 + cmp eax, bankroll + jle @F mov eax, bankroll - cmp eax, dice3d_bet - jl dice_no_cash - sub eax, dice3d_bet - mov bankroll, eax - mov dice3d_state, 1 - mov dice3d_timer, 0 - mov dice3d_win, 0 - invoke PlaySoundA, OFFSET soundCards, 0, 1 - jmp dice_input_done - -dice_no_cash: - invoke CopyString3D, OFFSET msgNeedMoney, OFFSET flashMessage - mov flashTimer, 60 +@@: + cmp eax, 5000 + jle @F + mov eax, 5000 +@@: + mov dice3d_bet, eax invoke PlaySoundA, OFFSET soundClick, 0, 1 - jmp dice_input_done + ret -check_dice_choice: - invoke Pressed3D, 31h ; '1' - test eax, eax - jz @F +dice_bet_down: + mov eax, dice3d_bet + sub eax, 50 + cmp eax, 50 + jge @F + mov eax, 50 +@@: + mov dice3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +dice_pick_1: mov dice3d_choice, 1 invoke PlaySoundA, OFFSET soundClick, 0, 1 -@@: - invoke Pressed3D, 32h ; '2' - test eax, eax - jz check_dice_bet_adjust + ret + +dice_pick_2: mov dice3d_choice, 2 invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret -check_dice_bet_adjust: - invoke Pressed3D, 26h ; UP +dice_start_roll: + mov eax, dice3d_bet + cmp eax, bankroll + jle @F + mov eax, bankroll + mov dice3d_bet, eax test eax, eax - jnz dice_inc_bet - invoke Pressed3D, 57h ; W + jz dice_done +@@: + mov eax, dice3d_bet + sub bankroll, eax + mov dice3d_state, 1 + mov dice3d_timer, 35 + invoke PlaySoundA, OFFSET soundCards, 0, 1 + ret + +dice_handle_rolling: + dec dice3d_timer + cmp dice3d_timer, 0 + jg dice_randomize_tumble + + ; Roll finished! + invoke RandomRange3D, 6 + inc eax + mov dice3d_val1, eax + invoke RandomRange3D, 6 + inc eax + mov dice3d_val2, eax + + mov edx, dice3d_val1 + add edx, eax + mov dice3d_sum, edx + + ; Parity check + mov eax, edx + and eax, 1 + jnz dice_sum_is_odd + ; Even + mov eax, 1 + jmp dice_check_win +dice_sum_is_odd: + mov eax, 2 + +dice_check_win: + cmp eax, dice3d_choice + jne dice_roll_lost + + ; Won! + mov eax, dice3d_bet + shl eax, 1 + add bankroll, eax + mov dice3d_win, eax + mov dice3d_state, 2 + invoke PlaySoundA, OFFSET soundVictory, 0, 1 + ret + +dice_roll_lost: + mov dice3d_win, 0 + mov dice3d_state, 2 + invoke PlaySoundA, OFFSET soundLose, 0, 1 + ret + +dice_randomize_tumble: + invoke RandomRange3D, 6 + inc eax + mov dice3d_val1, eax + invoke RandomRange3D, 6 + inc eax + mov dice3d_val2, eax + ret + +dice_handle_result: + invoke Pressed3D, 20h test eax, eax - jz check_dice_bet_down -dice_inc_bet: + jz dice_done + mov dice3d_state, 0 invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp dice3d_bet, 500 - jge dice_input_done - cmp dice3d_bet, 250 - jge dice_set_500 - cmp dice3d_bet, 100 - jge dice_set_250 - cmp dice3d_bet, 50 - jge dice_set_100 - cmp dice3d_bet, 25 - jge dice_set_50 - jmp dice_set_25 -dice_set_500: - mov dice3d_bet, 500 - jmp dice_input_done -dice_set_250: - mov dice3d_bet, 250 - jmp dice_input_done -dice_set_100: - mov dice3d_bet, 100 - jmp dice_input_done -dice_set_50: - mov dice3d_bet, 50 - jmp dice_input_done -dice_set_25: - mov dice3d_bet, 25 - jmp dice_input_done - -check_dice_bet_down: - invoke Pressed3D, 28h ; DOWN - test eax, eax - jnz dice_dec_bet - invoke Pressed3D, 53h ; S - test eax, eax - jz dice_input_done -dice_dec_bet: - invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp dice3d_bet, 25 - jle dice_set_10 - cmp dice3d_bet, 50 - jle dice_set_25 - cmp dice3d_bet, 100 - jle dice_set_50 - cmp dice3d_bet, 250 - jle dice_set_100 - mov dice3d_bet, 250 - jmp dice_input_done -dice_set_10: - mov dice3d_bet, 10 - -dice_input_done: +dice_done: ret HandleDiceInput ENDP RenderDiceGame PROC uses ebx esi edi - LOCAL d1X:DWORD, d1Y:DWORD, d2X:DWORD, d2Y:DWORD, bxX:DWORD + local kx:DWORD - ; Craps Emerald Felt & Oak Armrest - invoke DrawBox, 0, 0, 320, 240, 00082E12h - invoke DrawBoxBorder, 4, 4, 312, 232, 00093816h, 00122244h, 3 - invoke DrawBoxBorder, 8, 8, 304, 224, 000A3F19h, 0005140Ah, 2 + ; Mahogany frame & Deep Felt Green table + invoke DrawBox, 0, 0, 320, 240, 00140906h + invoke DrawBoxBorder, 6, 6, 308, 228, 000A3816h, 00FFD700h, 2 - ; Pyramidal diamond craps backboard texture - mov bxX, 12 -craps_bumper: - cmp bxX, 308 - jge craps_felt_markings - mov eax, bxX - add eax, 4 - invoke DrawBox, eax, 11, 4, 4, 00041006h - mov eax, bxX - add eax, 5 - invoke DrawPixel, eax, 12, 000F4820h - add bxX, 12 - jmp craps_bumper + ; Header + invoke DrawBoxBorder, 20, 12, 280, 26, 00072E13h, 00FFD700h, 2 + invoke DrawString8x8, 48, 21, OFFSET textDiceTitle, 00FFFF00h -craps_felt_markings: - ; Table Markings printed in gold directly on felt - invoke DrawString8x8, 72, 20, OFFSET textDiceTitle, 0000D7FFh - invoke DrawString8x8, 68, 32, OFFSET textDiceSubtitle, 0000B0A0h - - ; Meters: Bank & Bet - invoke DrawBoxBorder, 16, 46, 108, 16, 0006240Eh, 000E5022h, 1 - invoke DrawString8x8, 20, 50, OFFSET textBankPrompt, 0050FF50h + ; Status + invoke DrawBoxBorder, 20, 44, 110, 18, 00072E13h, 001B4B22h, 1 + invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 003CFF3Ch invoke FormatNumber, bankroll, OFFSET hudNumBuffer - invoke DrawString8x8, 68, 50, OFFSET hudNumBuffer, 0050FF50h + invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 003CFF3Ch - invoke DrawBoxBorder, 196, 46, 108, 16, 0006240Eh, 000E5022h, 1 - invoke DrawString8x8, 200, 50, OFFSET textBetPrompt, 0000D7FFh + invoke DrawBoxBorder, 190, 44, 110, 18, 00072E13h, 001B4B22h, 1 + invoke DrawString8x8, 194, 49, OFFSET textBetPrompt, 00FFD700h invoke FormatNumber, dice3d_bet, OFFSET hudNumBuffer - invoke DrawString8x8, 264, 50, OFFSET hudNumBuffer, 0000D7FFh + invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 00FFD700h - ; Betting Zone Left: [1] ЧÐ�Т - mov eax, 00073014h - mov edx, 001A602Ah - mov ecx, 0080B090h + ; [1] ЧÐ�Т cmp dice3d_choice, 1 - jne @F - mov eax, 000B441Dh - mov edx, 0000FFFFh - mov ecx, 0000FFFFh -@@: - push ecx - invoke DrawBoxBorder, 16, 68, 88, 54, eax, edx, 2 - pop ecx - invoke DrawString8x8, 24, 74, OFFSET textDiceEven, ecx - invoke DrawString8x8, 20, 86, OFFSET textDiceEvenNums, 0000D7FFh - cmp dice3d_choice, 1 - jne @F - invoke DrawChipStack, 48, 110, 4 -@@: + jne dice_even_inactive + invoke DrawBoxBorder, 16, 70, 88, 48, 00072E13h, 00FFFF00h, 2 + invoke DrawString8x8, 30, 76, OFFSET textDiceEven, 00FFFF00h + invoke DrawString8x8, 22, 90, OFFSET textDiceEvenNums, 00FFD700h + invoke DrawString8x8, 26, 104, OFFSET textCoinSelected, 003CFF3Ch + jmp dice_odd_side +dice_even_inactive: + invoke DrawBoxBorder, 16, 70, 88, 48, 00072E13h, 001B4B22h, 1 + invoke DrawString8x8, 30, 76, OFFSET textDiceEven, 00D0D8E0h + invoke DrawString8x8, 22, 90, OFFSET textDiceEvenNums, 0080B090h - ; Betting Zone Right: [2] Ð�ЕЧЕТ - mov eax, 00073014h - mov edx, 001A602Ah - mov ecx, 0080B090h +dice_odd_side: + ; [2] Ð�ЕЧЕТ cmp dice3d_choice, 2 - jne @F - mov eax, 000B441Dh - mov edx, 0000FFFFh - mov ecx, 0000FFFFh -@@: - push ecx - invoke DrawBoxBorder, 216, 68, 88, 54, eax, edx, 2 - pop ecx - invoke DrawString8x8, 224, 74, OFFSET textDiceOdd, ecx - invoke DrawString8x8, 224, 86, OFFSET textDiceOddNums, 00508060h - cmp dice3d_choice, 2 - jne @F - invoke DrawChipStack, 248, 110, 4 -@@: + jne dice_odd_inactive + invoke DrawBoxBorder, 216, 70, 88, 48, 00072E13h, 00FFFF00h, 2 + invoke DrawString8x8, 226, 76, OFFSET textDiceOdd, 00FFFF00h + invoke DrawString8x8, 224, 90, OFFSET textDiceOddNums, 00FFD700h + invoke DrawString8x8, 226, 104, OFFSET textCoinSelected, 003CFF3Ch + jmp dice_center_cubes +dice_odd_inactive: + invoke DrawBoxBorder, 216, 70, 88, 48, 00072E13h, 001B4B22h, 1 + invoke DrawString8x8, 226, 76, OFFSET textDiceOdd, 00D0D8E0h + invoke DrawString8x8, 224, 90, OFFSET textDiceOddNums, 0080B090h - ; Center Dice Field - invoke DrawBoxBorder, 112, 68, 96, 54, 00072E13h, 00145826h, 1 +dice_center_cubes: + ; 2 Dice in center + invoke DrawCrapsDie, 116, 76, 36, dice3d_val1 + invoke DrawCrapsDie, 168, 76, 36, dice3d_val2 - ; Rolling Animation Logic cmp dice3d_state, 1 - jne dice_at_rest - - inc dice3d_timer - - ; Tumbling jitter offsets - mov eax, dice3d_timer - and eax, 3 - sub eax, 1 - - mov edx, 120 - add edx, eax - mov d1X, edx - mov edx, 76 - sub edx, eax - mov d1Y, edx - - mov edx, 164 - sub edx, eax - mov d2X, edx - mov edx, 78 - add edx, eax - mov d2Y, edx - - test dice3d_timer, 1 - jz @F - invoke RandomRange3D, 6 - inc eax - mov dice3d_val1, eax - invoke RandomRange3D, 6 - inc eax - mov dice3d_val2, eax -@@: - invoke DrawCrapsDie, d1X, d1Y, 36, dice3d_val1 - invoke DrawCrapsDie, d2X, d2Y, 36, dice3d_val2 - invoke DrawString8x8, 76, 138, OFFSET textDiceRolling, 0000FFFFh - - cmp dice3d_timer, 36 - jl dice_draw_controls - - ; Settle dice! - mov dice3d_state, 2 - invoke RandomRange3D, 6 - inc eax - mov dice3d_val1, eax - invoke RandomRange3D, 6 - inc eax - mov dice3d_val2, eax - - mov eax, dice3d_val1 - add eax, dice3d_val2 - mov dice3d_sum, eax - - ; Check choice vs sum parity - mov eax, dice3d_sum - test eax, 1 - jz dice_sum_is_even - - ; Odd - cmp dice3d_choice, 2 - je dice_roll_won - jmp dice_roll_lost - -dice_sum_is_even: - cmp dice3d_choice, 1 - je dice_roll_won - -dice_roll_lost: - mov dice3d_win, 0 - invoke PlaySoundA, OFFSET soundLose, 0, 1 - jmp dice_draw_controls - -dice_roll_won: - mov eax, dice3d_bet - shl eax, 1 - mov dice3d_win, eax - add bankroll, eax - invoke PlaySoundA, OFFSET soundVictory, 0, 1 - jmp dice_draw_controls - -dice_at_rest: - invoke DrawCrapsDie, 120, 76, 36, dice3d_val1 - invoke DrawCrapsDie, 164, 76, 36, dice3d_val2 - + je dice_render_rolling cmp dice3d_state, 2 - jne dice_draw_controls + je dice_render_result + jmp dice_render_keys - ; Scoreboard Plaque - invoke DrawBoxBorder, 36, 130, 248, 30, 00051D0Ch, 0000D7FFh, 1 - invoke DrawString8x8, 44, 135, OFFSET textDiceSumHdr, 0000D7FFh +dice_render_rolling: + invoke DrawString8x8, 76, 138, OFFSET textDiceRolling, 00FFFF00h + jmp dice_render_keys + +dice_render_result: + invoke DrawBoxBorder, 36, 130, 248, 36, 00072E13h, 00FFD700h, 1 + invoke DrawString8x8, 44, 135, OFFSET textDiceSumHdr, 00FFD700h invoke FormatNumber, dice3d_val1, OFFSET hudNumBuffer - invoke DrawString8x8, 100, 135, OFFSET hudNumBuffer, 00FFFFFFh - invoke DrawString8x8, 110, 135, OFFSET textDicePlus, 0000D7FFh + invoke DrawString8x8, 92, 135, OFFSET hudNumBuffer, 00FFFF00h + invoke DrawString8x8, 110, 135, OFFSET textDicePlus, 00FFD700h invoke FormatNumber, dice3d_val2, OFFSET hudNumBuffer - invoke DrawString8x8, 134, 135, OFFSET hudNumBuffer, 00FFFFFFh - invoke DrawString8x8, 144, 135, OFFSET textDiceEqual, 0000D7FFh + invoke DrawString8x8, 126, 135, OFFSET hudNumBuffer, 00FFFF00h + invoke DrawString8x8, 144, 135, OFFSET textDiceEqual, 00FFD700h invoke FormatNumber, dice3d_sum, OFFSET hudNumBuffer - invoke DrawString8x8, 168, 135, OFFSET hudNumBuffer, 0000FFFFh + invoke DrawString8x8, 168, 135, OFFSET hudNumBuffer, 00FFFF00h mov eax, dice3d_sum - test eax, 1 - jnz @F - invoke DrawString8x8, 186, 135, OFFSET textDiceEvenResult, 0080FF80h - jmp dice_show_win_msg -@@: - invoke DrawString8x8, 186, 135, OFFSET textDiceOddResult, 00FF8080h + and eax, 1 + jnz dice_render_odd_res + invoke DrawString8x8, 186, 135, OFFSET textDiceEvenResult, 003CFF3Ch + jmp dice_render_outcome +dice_render_odd_res: + invoke DrawString8x8, 186, 135, OFFSET textDiceOddResult, 003CFF3Ch -dice_show_win_msg: - cmp dice3d_win, 0 - je dice_show_loss - invoke DrawString8x8, 68, 147, OFFSET textDiceWin, 0050FF50h +dice_render_outcome: + mov eax, dice3d_win + test eax, eax + jz dice_render_loss_outcome + invoke DrawString8x8, 68, 150, OFFSET textDiceWin, 003CFF3Ch invoke FormatNumber, dice3d_win, OFFSET hudNumBuffer - invoke DrawString8x8, 156, 147, OFFSET hudNumBuffer, 0050FF50h - invoke DrawString8x8, 188, 147, OFFSET textDiceWinMult, 0050FF50h - jmp dice_draw_controls + invoke DrawString8x8, 156, 150, OFFSET hudNumBuffer, 003CFF3Ch + invoke DrawString8x8, 188, 150, OFFSET textDiceWinMult, 003CFF3Ch + jmp dice_render_keys -dice_show_loss: - invoke DrawString8x8, 116, 147, OFFSET textDiceLose, 008080FFh +dice_render_loss_outcome: + invoke DrawString8x8, 116, 150, OFFSET textDiceLose, 00FF6464h -dice_draw_controls: - invoke DrawBox, 16, 188, 288, 1, 00104820h - - mov eax, 0 +dice_render_keys: + mov kx, 16 + xor eax, eax cmp dice3d_choice, 1 sete al - invoke DrawKeycap3D, 20, 198, OFFSET textDiceKey1, eax + invoke DrawKeycap3D, kx, 192, OFFSET textDiceKey1, eax + add kx, eax - mov eax, 0 + xor eax, eax cmp dice3d_choice, 2 sete al - invoke DrawKeycap3D, 82, 198, OFFSET textDiceKey2, eax + invoke DrawKeycap3D, kx, 192, OFFSET textDiceKey2, eax + add kx, eax - invoke DrawKeycap3D, 160, 198, OFFSET textDiceKeySpace, 1 - invoke DrawKeycap3D, 274, 198, OFFSET textKeyEsc, 0 + invoke DrawKeycap3D, kx, 192, OFFSET textDiceKeySpace, 1 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textKeyEsc, 0 ret RenderDiceGame ENDP @@ -1200,138 +1126,133 @@ RenderDiceGame ENDP ; IN-ENGINE 2.5D MINI-GAME: SKULLS & CUPS (Ð�Ð�ПÐ�РСТКИ) ; ============================================================================== DrawGlowingOrb PROC uses ebx esi edi, cxVal:DWORD, cyVal:DWORD - invoke DrawCircle, cxVal, cyVal, 14, 00081E2Eh - invoke DrawCircle, cxVal, cyVal, 11, 00103A58h - invoke DrawCircle, cxVal, cyVal, 8, 001A588Ah - invoke DrawCircle, cxVal, cyVal, 6, 0000B0E0h - invoke DrawCircle, cxVal, cyVal, 4, 0000E0FFh + invoke DrawCircle, cxVal, cyVal, 14, 002E1E08h + invoke DrawCircle, cxVal, cyVal, 11, 00583A10h + invoke DrawCircle, cxVal, cyVal, 8, 008A581Ah + invoke DrawCircle, cxVal, cyVal, 6, 00D0B000h + invoke DrawCircle, cxVal, cyVal, 4, 00FFE000h mov eax, cxVal dec eax mov edx, cyVal dec edx - invoke DrawCircle, eax, edx, 2, 00A0FFFFh - mov eax, cxVal - sub eax, 2 - mov edx, cyVal - sub edx, 2 + invoke DrawCircle, eax, edx, 2, 00FFFF80h + dec eax + dec edx invoke DrawPixel, eax, edx, 00FFFFFFh ret DrawGlowingOrb ENDP DrawGothicCup PROC uses ebx esi edi, x:DWORD, y:DWORD, cupId:DWORD, isLifted:DWORD, hasBall:DWORD - LOCAL liftY:DWORD + local liftY:DWORD mov eax, y cmp isLifted, 0 je @F - sub eax, 28 + sub eax, 36 @@: mov liftY, eax - ; Drop shadow on purple velvet + ; Drop shadow cmp isLifted, 0 - jne @F + jne cup_shadow_lifted mov eax, x add eax, 6 mov edx, y add edx, 42 - invoke DrawBox, eax, edx, 36, 4, 000A0410h - jmp draw_cup_body -@@: + invoke DrawBox, eax, edx, 36, 4, 0010040Ah + jmp cup_ball_check +cup_shadow_lifted: mov eax, x add eax, 10 mov edx, y add edx, 42 - invoke DrawBox, eax, edx, 28, 2, 0012061Ah + invoke DrawBox, eax, edx, 28, 2, 001A0612h - ; Draw orb if lifted and has ball +cup_ball_check: + cmp isLifted, 0 + je cup_body_draw cmp hasBall, 0 - je draw_cup_body + je cup_body_draw mov eax, x add eax, 24 mov edx, y add edx, 26 invoke DrawGlowingOrb, eax, edx -draw_cup_body: - ; Base +cup_body_draw: + ; Base pedestal mov eax, x add eax, 6 mov edx, liftY add edx, 36 - invoke DrawBoxBorder, eax, edx, 36, 6, 00221A30h, 0000B0D0h, 1 + invoke DrawBoxBorder, eax, edx, 36, 6, 00301A22h, 00D0B000h, 1 ; Stem mov eax, x add eax, 18 mov edx, liftY add edx, 28 - invoke DrawBox, eax, edx, 12, 8, 00332545h + invoke DrawBox, eax, edx, 12, 8, 00452533h mov eax, x add eax, 22 - mov edx, liftY - add edx, 28 - invoke DrawBox, eax, edx, 4, 8, 0055406Eh + invoke DrawBox, eax, edx, 4, 8, 006E4055h - ; Bowl + ; Goblet Bowl mov eax, x add eax, 8 mov edx, liftY add edx, 8 - invoke DrawBoxBorder, eax, edx, 32, 20, 002D1E40h, 0000D7FFh, 1 + invoke DrawBoxBorder, eax, edx, 32, 20, 00401E2Dh, 00FFD700h, 1 + mov eax, x add eax, 14 mov edx, liftY add edx, 10 - invoke DrawBox, eax, edx, 6, 16, 00503570h + invoke DrawBox, eax, edx, 6, 16, 00703550h mov eax, x add eax, 17 - mov edx, liftY - add edx, 10 - invoke DrawBox, eax, edx, 3, 16, 007850A0h + invoke DrawBox, eax, edx, 3, 16, 00A05078h - ; Flared Rim + ; Golden Rim mov eax, x add eax, 4 mov edx, liftY add edx, 2 - invoke DrawBoxBorder, eax, edx, 40, 7, 00150A20h, 0000FFFFh, 1 + invoke DrawBoxBorder, eax, edx, 40, 7, 00200A15h, 00FFFF00h, 1 mov eax, x add eax, 12 mov edx, liftY add edx, 4 - invoke DrawBox, eax, edx, 16, 2, 0000FFFFh + invoke DrawBox, eax, edx, 16, 2, 00FFFF00h - ; Skull Insignia on Bowl + ; Skull face emblem mov eax, x add eax, 21 mov edx, liftY add edx, 12 - invoke DrawBox, eax, edx, 6, 5, 0000D7FFh + invoke DrawBox, eax, edx, 6, 5, 00FFD700h mov eax, x add eax, 22 mov edx, liftY add edx, 17 - invoke DrawBox, eax, edx, 4, 3, 0000D7FFh + invoke DrawBox, eax, edx, 4, 3, 00FFD700h mov eax, x add eax, 22 mov edx, liftY add edx, 14 - invoke DrawPixel, eax, edx, 00150A20h + invoke DrawPixel, eax, edx, 00200A15h mov eax, x add eax, 24 - mov edx, liftY - add edx, 14 - invoke DrawPixel, eax, edx, 00150A20h + invoke DrawPixel, eax, edx, 00200A15h - ; Cup ID Badge + ; Cup number label mov eax, x add eax, 21 mov edx, liftY add edx, 24 mov ecx, cupId - add ecx, '0' - invoke DrawChar8x8, eax, edx, ecx, 0000FFFFh + add ecx, '1' + invoke DrawChar8x8, eax, edx, ecx, 00FFFF00h ret DrawGothicCup ENDP @@ -1339,452 +1260,757 @@ InitSkullsGame PROC mov skulls3d_state, 0 mov skulls3d_timer, 0 mov skulls3d_win, 0 - cmp skulls3d_bet, 10 - jge @F - mov skulls3d_bet, 50 -@@: invoke RandomRange3D, 3 mov skulls3d_ballPos, eax + mov skulls3d_choice, 1 ret InitSkullsGame ENDP FinalizeSkullsGuess PROC uses ebx - mov skulls3d_state, 4 mov eax, skulls3d_choice cmp eax, skulls3d_ballPos - jne skulls_guess_lost + jne skulls_guess_wrong - ; Won 3x! + ; Won! 3x payout mov eax, skulls3d_bet imul eax, 3 - mov skulls3d_win, eax add bankroll, eax - invoke PlaySoundA, OFFSET soundVictory, 0, 1 + mov skulls3d_win, eax + mov skulls3d_state, 4 + invoke PlaySoundA, OFFSET soundJackpot, 0, 1 ret -skulls_guess_lost: +skulls_guess_wrong: mov skulls3d_win, 0 + mov skulls3d_state, 4 invoke PlaySoundA, OFFSET soundLose, 0, 1 ret FinalizeSkullsGuess ENDP HandleSkullsInput PROC + cmp skulls3d_state, 0 + je skulls_handle_idle cmp skulls3d_state, 1 - je skulls_input_done + je skulls_handle_show cmp skulls3d_state, 2 - je skulls_input_done - + je skulls_handle_shuffle cmp skulls3d_state, 3 - je check_skulls_pick + je skulls_handle_pick + cmp skulls3d_state, 4 + je skulls_handle_reveal + ret - ; State 0 or 4: Can start new round or adjust bet - invoke Pressed3D, 20h ; SPACE +skulls_handle_idle: + invoke Pressed3D, 26h ; UP test eax, eax - jz check_skulls_bet_adjust + jnz skulls_bet_up + invoke Pressed3D, 57h ; 'W' + test eax, eax + jnz skulls_bet_up + invoke Pressed3D, 28h ; DOWN + test eax, eax + jnz skulls_bet_down + invoke Pressed3D, 53h ; 'S' + test eax, eax + jnz skulls_bet_down + invoke Pressed3D, 20h ; SPACE + test eax, eax + jnz skulls_start_game + ret +skulls_bet_up: + mov eax, skulls3d_bet + add eax, 50 + cmp eax, bankroll + jle @F mov eax, bankroll - cmp eax, skulls3d_bet - jl skulls_no_cash - sub eax, skulls3d_bet - mov bankroll, eax +@@: + cmp eax, 5000 + jle @F + mov eax, 5000 +@@: + mov skulls3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret +skulls_bet_down: + mov eax, skulls3d_bet + sub eax, 50 + cmp eax, 50 + jge @F + mov eax, 50 +@@: + mov skulls3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +skulls_start_game: + mov eax, skulls3d_bet + cmp eax, bankroll + jle @F + mov eax, bankroll + mov skulls3d_bet, eax + test eax, eax + jz skulls_done +@@: + mov eax, skulls3d_bet + sub bankroll, eax invoke RandomRange3D, 3 mov skulls3d_ballPos, eax - - invoke RandomRange3D, 3 - mov skulls3d_swapPair0, eax - invoke RandomRange3D, 3 - mov skulls3d_swapPair1, eax - invoke RandomRange3D, 3 - mov skulls3d_swapPair2, eax - mov skulls3d_state, 1 - mov skulls3d_timer, 0 - mov skulls3d_win, 0 + mov skulls3d_timer, 45 invoke PlaySoundA, OFFSET soundShuffle, 0, 1 - jmp skulls_input_done + ret -skulls_no_cash: - invoke CopyString3D, OFFSET msgNeedMoney, OFFSET flashMessage - mov flashTimer, 60 - invoke PlaySoundA, OFFSET soundClick, 0, 1 - jmp skulls_input_done +skulls_handle_show: + dec skulls3d_timer + cmp skulls3d_timer, 0 + jg skulls_done + mov skulls3d_state, 2 + mov skulls3d_timer, 60 + invoke PlaySoundA, OFFSET soundShuffle, 0, 1 + ret -check_skulls_pick: - invoke Pressed3D, 31h ; '1' +skulls_handle_shuffle: + dec skulls3d_timer + cmp skulls3d_timer, 0 + jg skulls_done + invoke RandomRange3D, 3 + mov skulls3d_ballPos, eax + mov skulls3d_state, 3 + ret + +skulls_handle_pick: + invoke Pressed3D, 31h ; '1' test eax, eax - jz @F + jnz skulls_pick_1 + invoke Pressed3D, 32h ; '2' + test eax, eax + jnz skulls_pick_2 + invoke Pressed3D, 33h ; '3' + test eax, eax + jnz skulls_pick_3 + ret + +skulls_pick_1: mov skulls3d_choice, 0 call FinalizeSkullsGuess - jmp skulls_input_done -@@: - invoke Pressed3D, 32h ; '2' - test eax, eax - jz @F + ret + +skulls_pick_2: mov skulls3d_choice, 1 call FinalizeSkullsGuess - jmp skulls_input_done -@@: - invoke Pressed3D, 33h ; '3' - test eax, eax - jz skulls_input_done + ret + +skulls_pick_3: mov skulls3d_choice, 2 call FinalizeSkullsGuess - jmp skulls_input_done + ret -check_skulls_bet_adjust: - invoke Pressed3D, 26h ; UP +skulls_handle_reveal: + invoke Pressed3D, 20h test eax, eax - jnz skulls_inc_bet - invoke Pressed3D, 57h ; W - test eax, eax - jz check_skulls_bet_down -skulls_inc_bet: + jz skulls_done + mov skulls3d_state, 0 invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp skulls3d_bet, 500 - jge skulls_input_done - cmp skulls3d_bet, 250 - jge skulls_set_500 - cmp skulls3d_bet, 100 - jge skulls_set_250 - cmp skulls3d_bet, 50 - jge skulls_set_100 - cmp skulls3d_bet, 25 - jge skulls_set_50 - jmp skulls_set_25 -skulls_set_500: - mov skulls3d_bet, 500 - jmp skulls_input_done -skulls_set_250: - mov skulls3d_bet, 250 - jmp skulls_input_done -skulls_set_100: - mov skulls3d_bet, 100 - jmp skulls_input_done -skulls_set_50: - mov skulls3d_bet, 50 - jmp skulls_input_done -skulls_set_25: - mov skulls3d_bet, 25 - jmp skulls_input_done - -check_skulls_bet_down: - invoke Pressed3D, 28h ; DOWN - test eax, eax - jnz skulls_dec_bet - invoke Pressed3D, 53h ; S - test eax, eax - jz skulls_input_done -skulls_dec_bet: - invoke PlaySoundA, OFFSET soundClick, 0, 1 - cmp skulls3d_bet, 25 - jle skulls_set_10 - cmp skulls3d_bet, 50 - jle skulls_set_25 - cmp skulls3d_bet, 100 - jle skulls_set_50 - cmp skulls3d_bet, 250 - jle skulls_set_100 - mov skulls3d_bet, 250 - jmp skulls_input_done -skulls_set_10: - mov skulls3d_bet, 10 - -skulls_input_done: +skulls_done: ret HandleSkullsInput ENDP RenderSkullsGame PROC uses ebx esi edi - LOCAL passTick:DWORD, curPair:DWORD, swapSlotA:DWORD, swapSlotB:DWORD - LOCAL xA:DWORD, xB:DWORD, curXA:DWORD, curXB:DWORD, curYA:DWORD, curYB:DWORD - LOCAL distX:DWORD, dxVal:DWORD, archY:DWORD + local kx:DWORD - ; Dark Gothic Tavern Table with Royal Velvet - invoke DrawBox, 0, 0, 320, 240, 000D0612h - invoke DrawBoxBorder, 4, 4, 312, 232, 00160B20h, 00321845h, 3 - invoke DrawBoxBorder, 8, 8, 304, 224, 00220F30h, 0000D7FFh, 1 + ; Mahogany & Gothic Purple table + invoke DrawBox, 0, 0, 320, 240, 00140906h + invoke DrawBoxBorder, 6, 6, 308, 228, 00300F22h, 00FFD700h, 2 ; Header - invoke DrawBoxBorder, 24, 12, 272, 24, 0012081Ah, 0000D7FFh, 2 - invoke DrawString8x8, 64, 20, OFFSET textSkullsTitle, 0000FFFFh + invoke DrawBoxBorder, 20, 12, 280, 26, 001A0812h, 00FFD700h, 2 + invoke DrawString8x8, 40, 21, OFFSET textSkullsTitle, 00FFFF00h - ; Meters: Bank & Bet - invoke DrawBoxBorder, 20, 42, 114, 16, 000D0616h, 00401858h, 1 - invoke DrawString8x8, 24, 46, OFFSET textBankPrompt, 0050FF50h + ; Status + invoke DrawBoxBorder, 20, 44, 110, 18, 001A0812h, 00452033h, 1 + invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 003CFF3Ch invoke FormatNumber, bankroll, OFFSET hudNumBuffer - invoke DrawString8x8, 72, 46, OFFSET hudNumBuffer, 0050FF50h + invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 003CFF3Ch - invoke DrawBoxBorder, 186, 42, 114, 16, 000D0616h, 00401858h, 1 - invoke DrawString8x8, 190, 46, OFFSET textBetPrompt, 0000D7FFh + invoke DrawBoxBorder, 190, 44, 110, 18, 001A0812h, 00452033h, 1 + invoke DrawString8x8, 194, 49, OFFSET textBetPrompt, 00FFD700h invoke FormatNumber, skulls3d_bet, OFFSET hudNumBuffer - invoke DrawString8x8, 254, 46, OFFSET hudNumBuffer, 0000D7FFh + invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 00FFD700h - ; Velvet Table Runner - invoke DrawBoxBorder, 16, 64, 288, 120, 001A0B25h, 00452060h, 1 - - ; Dispatch based on phase + ; Subtitle phase prompts + cmp skulls3d_state, 0 + jne @F + invoke DrawString8x8, 56, 62, OFFSET textSkullsPhase0, 00FFD700h + jmp skulls_render_cups +@@: cmp skulls3d_state, 1 - je skulls_render_phase1 + jne @F + invoke DrawString8x8, 56, 62, OFFSET textSkullsPhase1, 00FFFF00h + jmp skulls_render_cups +@@: cmp skulls3d_state, 2 - je skulls_render_phase2 + jne @F + invoke DrawString8x8, 56, 62, OFFSET textSkullsPhase2, 00FFFF00h + jmp skulls_render_cups +@@: cmp skulls3d_state, 3 - je skulls_render_phase3 - cmp skulls3d_state, 4 - je skulls_render_phase4 - - ; Phase 0: Idle / Betting - invoke DrawString8x8, 56, 70, OFFSET textSkullsPhase0, 0000D7FFh - invoke DrawGothicCup, 48, 108, 1, 0, 0 - invoke DrawGothicCup, 136, 108, 2, 0, 0 - invoke DrawGothicCup, 224, 108, 3, 0, 0 - jmp skulls_draw_controls - -skulls_render_phase1: - inc skulls3d_timer - invoke DrawString8x8, 56, 70, OFFSET textSkullsPhase1, 0000FFFFh - - ; Draw cups with ballPos cup lifted - mov eax, 0 - cmp skulls3d_ballPos, 0 - sete al - invoke DrawGothicCup, 48, 108, 1, eax, eax - - mov eax, 0 - cmp skulls3d_ballPos, 1 - sete al - invoke DrawGothicCup, 136, 108, 2, eax, eax - - mov eax, 0 - cmp skulls3d_ballPos, 2 - sete al - invoke DrawGothicCup, 224, 108, 3, eax, eax - - cmp skulls3d_timer, 40 - jl skulls_draw_controls - - ; Start Phase 2 (Shuffle) - mov skulls3d_state, 2 - mov skulls3d_timer, 0 - invoke PlaySoundA, OFFSET soundShuffle, 0, 1 - jmp skulls_draw_controls - -skulls_render_phase2: - inc skulls3d_timer - - mov eax, skulls3d_timer - cmp eax, 20 - jbe pass_0 - cmp eax, 40 - jbe pass_1 - sub eax, 41 - mov passTick, eax - mov eax, skulls3d_swapPair2 - mov curPair, eax - jmp setup_pass_pair - -pass_0: - dec eax - mov passTick, eax - mov eax, skulls3d_swapPair0 - mov curPair, eax - jmp setup_pass_pair - -pass_1: - sub eax, 21 - mov passTick, eax - mov eax, skulls3d_swapPair1 - mov curPair, eax - -setup_pass_pair: - cmp curPair, 1 - je pair_1 - cmp curPair, 2 - je pair_2 - mov swapSlotA, 0 - mov swapSlotB, 1 - mov xA, 48 - mov xB, 136 - jmp calc_swap_coords -pair_1: - mov swapSlotA, 1 - mov swapSlotB, 2 - mov xA, 136 - mov xB, 224 - jmp calc_swap_coords -pair_2: - mov swapSlotA, 0 - mov swapSlotB, 2 - mov xA, 48 - mov xB, 224 - -calc_swap_coords: - mov eax, xB - sub eax, xA - mov distX, eax - - mov eax, distX - imul eax, passTick - xor edx, edx - mov ecx, 20 - div ecx - mov dxVal, eax - - mov eax, xA - add eax, dxVal - mov curXA, eax - - mov eax, xB - sub eax, dxVal - mov curXB, eax - - ; Arch height: archY = (t * (20 - t)) / 25 - mov eax, passTick - mov ecx, 20 - sub ecx, eax - imul eax, ecx - xor edx, edx - mov ecx, 25 - div ecx - mov archY, eax - - mov edx, 108 - sub edx, archY - mov curYA, edx ; upper arc - - mov edx, 108 - add edx, archY - mov curYB, edx ; lower arc - - invoke DrawString8x8, 56, 70, OFFSET textSkullsPhase2, 0000FFFFh - - ; Depth sorted rendering: Background cup (upper arc) draws FIRST, Foreground cup (lower arc) draws OVER it! - invoke DrawGothicCup, curXA, curYA, 1, 0, 0 - invoke DrawGothicCup, curXB, curYB, 2, 0, 0 - - ; Draw remaining static cup - cmp curPair, 1 - je draw_stat_0 - cmp curPair, 2 - je draw_stat_1 - invoke DrawGothicCup, 224, 108, 3, 0, 0 - jmp check_pass_finish -draw_stat_0: - invoke DrawGothicCup, 48, 108, 1, 0, 0 - jmp check_pass_finish -draw_stat_1: - invoke DrawGothicCup, 136, 108, 2, 0, 0 - -check_pass_finish: - cmp skulls3d_timer, 20 - je do_pass_swap - cmp skulls3d_timer, 40 - je do_pass_swap - cmp skulls3d_timer, 60 - je do_pass_swap - jmp skulls_draw_controls - -do_pass_swap: - ; Update ballPos if involved in swap - mov eax, skulls3d_ballPos - cmp eax, swapSlotA - jne check_swap_b - mov eax, swapSlotB - mov skulls3d_ballPos, eax - jmp ball_swap_done -check_swap_b: - cmp eax, swapSlotB - jne ball_swap_done - mov eax, swapSlotA - mov skulls3d_ballPos, eax - -ball_swap_done: - invoke PlaySoundA, OFFSET soundShuffle, 0, 1 - - cmp skulls3d_timer, 60 - jl skulls_draw_controls - - ; Shuffle complete -> Move to Pick phase - mov skulls3d_state, 3 - mov skulls3d_timer, 0 - jmp skulls_draw_controls - -skulls_render_phase3: - invoke DrawString8x8, 40, 70, OFFSET textSkullsPhase3, 0000FFFFh - invoke DrawGothicCup, 48, 108, 1, 0, 0 - invoke DrawGothicCup, 136, 108, 2, 0, 0 - invoke DrawGothicCup, 224, 108, 3, 0, 0 - jmp skulls_draw_controls - -skulls_render_phase4: - ; Reveal phase - cmp skulls3d_win, 0 - je skulls_show_loss - invoke DrawString8x8, 48, 70, OFFSET textSkullsWin, 0050FF50h + jne @F + invoke DrawString8x8, 40, 62, OFFSET textSkullsPhase3, 00FFFF00h + jmp skulls_render_cups +@@: + ; Reveal outcome + mov eax, skulls3d_win + test eax, eax + jz skulls_show_loss_text + invoke DrawString8x8, 40, 62, OFFSET textSkullsWin, 003CFF3Ch invoke FormatNumber, skulls3d_win, OFFSET hudNumBuffer - invoke DrawString8x8, 216, 70, OFFSET hudNumBuffer, 0050FF50h - jmp skulls_p4_cups + invoke DrawString8x8, 136, 62, OFFSET hudNumBuffer, 003CFF3Ch + invoke DrawString8x8, 168, 62, OFFSET textSkullsWinMult, 003CFF3Ch + jmp skulls_render_cups -skulls_show_loss: - invoke DrawString8x8, 40, 70, OFFSET textSkullsLose, 008080FFh +skulls_show_loss_text: + invoke DrawString8x8, 40, 62, OFFSET textSkullsLose, 00FF6464h -skulls_p4_cups: - ; Draw chosen cup lifted - mov eax, 0 - cmp skulls3d_choice, 0 - sete al +skulls_render_cups: + ; Draw Cup 1 (X=36, Y=114) + mov ebx, 0 mov edx, 0 + cmp skulls3d_state, 1 + jne @F + cmp skulls3d_ballPos, 0 + jne @F + mov ebx, 1 + mov edx, 1 +@@: + cmp skulls3d_state, 4 + jne @F + cmp skulls3d_choice, 0 + sete bl cmp skulls3d_ballPos, 0 sete dl - invoke DrawGothicCup, 48, 108, 1, eax, edx +@@: + invoke DrawGothicCup, 36, 114, 0, ebx, edx - mov eax, 0 - cmp skulls3d_choice, 1 - sete al + ; Draw Cup 2 (X=136, Y=114) + mov ebx, 0 mov edx, 0 + cmp skulls3d_state, 1 + jne @F + cmp skulls3d_ballPos, 1 + jne @F + mov ebx, 1 + mov edx, 1 +@@: + cmp skulls3d_state, 4 + jne @F + cmp skulls3d_choice, 1 + sete bl cmp skulls3d_ballPos, 1 sete dl - invoke DrawGothicCup, 136, 108, 2, eax, edx +@@: + invoke DrawGothicCup, 136, 114, 1, ebx, edx - mov eax, 0 - cmp skulls3d_choice, 2 - sete al + ; Draw Cup 3 (X=236, Y=114) + mov ebx, 0 mov edx, 0 + cmp skulls3d_state, 1 + jne @F + cmp skulls3d_ballPos, 2 + jne @F + mov ebx, 1 + mov edx, 1 +@@: + cmp skulls3d_state, 4 + jne @F + cmp skulls3d_choice, 2 + sete bl cmp skulls3d_ballPos, 2 sete dl - invoke DrawGothicCup, 224, 108, 3, eax, edx +@@: + invoke DrawGothicCup, 236, 114, 2, ebx, edx - invoke DrawString8x8, 64, 168, OFFSET textSkullsAgain, 0000D7FFh + ; Cup selection indicators + invoke DrawString8x8, 54, 168, OFFSET textSkullsKey1, 00D0D8E0h + invoke DrawString8x8, 150, 168, OFFSET textSkullsKey2, 00D0D8E0h + invoke DrawString8x8, 250, 168, OFFSET textSkullsKey3, 00D0D8E0h -skulls_draw_controls: - invoke DrawBox, 16, 190, 288, 1, 003A1850h - - mov eax, 0 + ; Keycaps + mov kx, 16 + xor eax, eax cmp skulls3d_choice, 0 sete al - invoke DrawKeycap3D, 18, 200, OFFSET textSkullsKey1, eax + invoke DrawKeycap3D, kx, 192, OFFSET textSkullsKey1, eax + add kx, eax - mov eax, 0 + xor eax, eax cmp skulls3d_choice, 1 sete al - invoke DrawKeycap3D, 82, 200, OFFSET textSkullsKey2, eax + invoke DrawKeycap3D, kx, 192, OFFSET textSkullsKey2, eax + add kx, eax - mov eax, 0 + xor eax, eax cmp skulls3d_choice, 2 sete al - invoke DrawKeycap3D, 146, 200, OFFSET textSkullsKey3, eax + invoke DrawKeycap3D, kx, 192, OFFSET textSkullsKey3, eax + add kx, eax - invoke DrawKeycap3D, 212, 200, OFFSET textSkullsKeySpace, 1 - invoke DrawKeycap3D, 274, 200, OFFSET textKeyEsc, 0 + invoke DrawKeycap3D, kx, 192, OFFSET textSkullsKeySpace, 1 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textKeyEsc, 0 ret RenderSkullsGame ENDP +; ============================================================================== +; IN-ENGINE 2.5D MINI-GAME: SKILL CHECK (DEAD BY DAYLIGHT SURVIVOR CHECK) +; ============================================================================== +InitSkillGame PROC + mov skill3d_state, 0 + mov skill3d_timer, 0 + mov skill3d_hits, 0 + mov skill3d_misses, 0 + mov skill3d_needle, 55 + mov skill3d_speed, 4 + mov skill3d_dir, 1 + mov skill3d_last_result, 0 + mov skill3d_win_amount, 0 + + ; Randomize initial zone: 80 + RandomRange(90) -> 80..170 + invoke RandomRange3D, 90 + add eax, 80 + mov skill3d_zone_start, eax + + ; Great zone: start + 20 + RandomRange(12) + invoke RandomRange3D, 12 + add eax, skill3d_zone_start + add eax, 20 + mov skill3d_great_start, eax + ret +InitSkillGame ENDP + +HandleSkillInput PROC uses ebx esi + mov eax, skill3d_state + cmp eax, 0 + je skill_handle_ready + cmp eax, 1 + je skill_handle_active + cmp eax, 2 + je skill_handle_round_wait + cmp eax, 3 + je skill_handle_round_wait + cmp eax, 4 + je skill_handle_end_wait + cmp eax, 5 + je skill_handle_end_wait + ret + +skill_handle_ready: + invoke Pressed3D, 26h ; UP + test eax, eax + jnz skill_bet_up + invoke Pressed3D, 57h ; 'W' + test eax, eax + jnz skill_bet_up + invoke Pressed3D, 28h ; DOWN + test eax, eax + jnz skill_bet_down + invoke Pressed3D, 53h ; 'S' + test eax, eax + jnz skill_bet_down + jmp skill_check_start + +skill_bet_up: + mov eax, skill3d_bet + add eax, 50 + cmp eax, bankroll + jle @F + mov eax, bankroll +@@: + cmp eax, 5000 + jle @F + mov eax, 5000 +@@: + mov skill3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +skill_bet_down: + mov eax, skill3d_bet + sub eax, 50 + cmp eax, 50 + jge @F + mov eax, 50 +@@: + mov skill3d_bet, eax + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +skill_check_start: + invoke Pressed3D, 20h ; SPACE + test eax, eax + jz skill_input_done + + ; Deduct bet on game start if beginning of run + mov eax, skill3d_hits + or eax, skill3d_misses + jnz @F + mov eax, skill3d_bet + cmp eax, bankroll + jle skill_has_funds + mov eax, bankroll + mov skill3d_bet, eax + test eax, eax + jz skill_input_done +skill_has_funds: + mov eax, skill3d_bet + sub bankroll, eax +@@: + mov skill3d_state, 1 + mov skill3d_needle, 55 + mov skill3d_dir, 1 + invoke PlaySoundA, OFFSET soundClick, 0, 1 + ret + +skill_handle_active: + ; Move needle smoothly + mov eax, skill3d_needle + mov edx, skill3d_speed + cmp skill3d_dir, 1 + je skill_move_right + sub eax, edx + cmp eax, 52 + jge skill_update_needle + mov eax, 52 + mov skill3d_dir, 1 + jmp skill_update_needle +skill_move_right: + add eax, edx + cmp eax, 268 + jle skill_update_needle + mov eax, 268 + mov skill3d_dir, -1 +skill_update_needle: + mov skill3d_needle, eax + + ; Check SPACE pressed (Reaction Hit Attempt!) + invoke Pressed3D, 20h + test eax, eax + jz skill_input_done + + ; Is needle in Great Sweet Spot? + mov eax, skill3d_needle + mov edx, skill3d_great_start + cmp eax, edx + jl check_success_zone + add edx, skill3d_great_width + cmp eax, edx + jg check_success_zone + + ; GREAT HIT! + mov skill3d_last_result, 2 + add skill3d_hits, 2 + mov skill3d_state, 2 + mov skill3d_timer, 40 + invoke PlaySoundA, OFFSET soundCoinDing, 0, 1 + jmp skill_check_finish_round + +check_success_zone: + mov eax, skill3d_needle + mov edx, skill3d_zone_start + cmp eax, edx + jl skill_was_miss + add edx, skill3d_zone_width + cmp eax, edx + jg skill_was_miss + + ; NORMAL HIT! + mov skill3d_last_result, 1 + inc skill3d_hits + mov skill3d_state, 2 + mov skill3d_timer, 40 + invoke PlaySoundA, OFFSET soundVictory, 0, 1 + jmp skill_check_finish_round + +skill_was_miss: + ; MISS! + mov skill3d_last_result, 0 + inc skill3d_misses + mov skill3d_state, 3 + mov skill3d_timer, 45 + invoke PlaySoundA, OFFSET soundLose, 0, 1 + +skill_check_finish_round: + cmp skill3d_hits, 5 + jge skill_game_escaped + cmp skill3d_misses, 3 + jge skill_game_lost + ret + +skill_game_escaped: + mov skill3d_state, 4 + mov skill3d_timer, 0 + ; Payout: 3x total return (+$2x bet profit) + mov eax, skill3d_bet + imul eax, 3 + add bankroll, eax + mov eax, skill3d_bet + shl eax, 1 + mov skill3d_win_amount, eax + invoke PlaySoundA, OFFSET soundJackpot, 0, 1 + ret + +skill_game_lost: + mov skill3d_state, 5 + mov skill3d_timer, 0 + invoke PlaySoundA, OFFSET soundLose, 0, 1 + ret + +skill_handle_round_wait: + dec skill3d_timer + cmp skill3d_timer, 0 + jg skill_input_done + + ; Next round setup + invoke RandomRange3D, 90 + add eax, 80 + mov skill3d_zone_start, eax + + invoke RandomRange3D, 12 + add eax, skill3d_zone_start + add eax, 20 + mov skill3d_great_start, eax + + mov eax, skill3d_hits + shr eax, 1 + add eax, 4 + mov skill3d_speed, eax + mov skill3d_state, 1 + ret + +skill_handle_end_wait: + invoke Pressed3D, 20h + test eax, eax + jz skill_input_done + call InitSkillGame + ret + +skill_input_done: + ret +HandleSkillInput ENDP + +RenderSkillGame PROC uses ebx esi edi + local kx:DWORD + local tx:DWORD + + ; Industrial Steel bezel + invoke DrawBox, 0, 0, 320, 240, 00121416h + invoke DrawBoxBorder, 6, 6, 308, 228, 001A1D20h, 00FFD700h, 2 + + ; Header + invoke DrawBoxBorder, 20, 12, 280, 26, 00121418h, 00FFD700h, 2 + invoke DrawString8x8, 40, 21, OFFSET textSkillTitle, 00FFFF00h + + ; Status + invoke DrawBoxBorder, 20, 44, 110, 18, 00121418h, 002A3540h, 1 + invoke DrawString8x8, 24, 49, OFFSET textBankPrompt, 003CFF3Ch + invoke FormatNumber, bankroll, OFFSET hudNumBuffer + invoke DrawString8x8, 72, 49, OFFSET hudNumBuffer, 003CFF3Ch + + invoke DrawBoxBorder, 190, 44, 110, 18, 00121418h, 002A3540h, 1 + invoke DrawString8x8, 194, 49, OFFSET textBetPrompt, 00FFD700h + invoke FormatNumber, skill3d_bet, OFFSET hudNumBuffer + invoke DrawString8x8, 254, 49, OFFSET hudNumBuffer, 00FFD700h + + ; Survivor Progress + invoke DrawString8x8, 24, 70, OFFSET textSkillHitsHdr, 003CFF3Ch + invoke FormatNumber, skill3d_hits, OFFSET hudNumBuffer + invoke DrawString8x8, 64, 70, OFFSET hudNumBuffer, 003CFF3Ch + + invoke DrawString8x8, 180, 70, OFFSET textSkillMissHdr, 00FF6464h + invoke FormatNumber, skill3d_misses, OFFSET hudNumBuffer + invoke DrawString8x8, 240, 70, OFFSET hudNumBuffer, 00FF6464h + + ; Dial Frame (Track: X=50..270, Y=102..134) + invoke DrawBoxBorder, 50, 102, 220, 32, 000F1114h, 00404855h, 2 + + ; Calibrated ticks + mov tx, 60 +skill_ticks_loop: + cmp tx, 260 + jge skill_draw_zones + invoke DrawBox, tx, 104, 1, 6, 00303845h + invoke DrawBox, tx, 126, 1, 6, 00303845h + add tx, 12 + jmp skill_ticks_loop + +skill_draw_zones: + ; Normal Success Zone (Green) + invoke DrawBoxBorder, skill3d_zone_start, 106, skill3d_zone_width, 24, 00155020h, 003CFF3Ch, 1 + + ; Great Zone (Gold) + invoke DrawBoxBorder, skill3d_great_start, 106, skill3d_great_width, 24, 00FFD700h, 00FFFF00h, 1 + + ; Pointer / Needle at skill3d_needle + mov eax, skill3d_needle + dec eax + invoke DrawBox, eax, 98, 3, 40, 00FFFFFFh + mov eax, skill3d_needle + sub eax, 2 + invoke DrawBox, eax, 96, 5, 2, 00FF3030h + invoke DrawBox, eax, 138, 5, 2, 00FF3030h + + ; Center prompts / outcome + cmp skill3d_state, 0 + jne @F + invoke DrawString8x8, 52, 150, OFFSET textSkillReadyMsg, 00FFD700h + invoke DrawString8x8, 76, 166, OFFSET textSkillPrompt, 00D0D8E0h + jmp skill_render_keys +@@: + cmp skill3d_state, 1 + jne @F + invoke DrawString8x8, 76, 150, OFFSET textSkillPrompt, 00FFFF00h + jmp skill_render_keys +@@: + cmp skill3d_state, 2 + jne @F + cmp skill3d_last_result, 2 + jne skill_normal_hit_text + invoke DrawString8x8, 36, 150, OFFSET textSkillGreatMsg, 00FFFF00h + jmp skill_render_keys +skill_normal_hit_text: + invoke DrawString8x8, 64, 150, OFFSET textSkillHitMsg, 003CFF3Ch + jmp skill_render_keys +@@: + cmp skill3d_state, 3 + jne @F + invoke DrawString8x8, 88, 150, OFFSET textSkillMissMsg, 00FF6464h + jmp skill_render_keys +@@: + cmp skill3d_state, 4 + jne @F + invoke DrawString8x8, 48, 150, OFFSET textSkillEscape, 003CFF3Ch + invoke FormatNumber, skill3d_win_amount, OFFSET hudNumBuffer + invoke DrawString8x8, 240, 150, OFFSET hudNumBuffer, 003CFF3Ch + invoke DrawString8x8, 64, 166, OFFSET textSkullsAgain, 00FFD700h + jmp skill_render_keys +@@: + invoke DrawString8x8, 44, 150, OFFSET textSkillLost, 00FF6464h + invoke DrawString8x8, 64, 166, OFFSET textSkullsAgain, 00FFD700h + +skill_render_keys: + mov kx, 16 + invoke DrawKeycap3D, kx, 192, OFFSET textSkillKeySpace, 1 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textSkillKeyBet, 0 + add kx, eax + + invoke DrawKeycap3D, kx, 192, OFFSET textKeyEsc, 0 + ret +RenderSkillGame ENDP + """ raw_content = raw_content[:pos_games_start] + new_games_code.encode('cp1251') + raw_content[pos_player_input:] -print("[OK] Replaced games implementation block with rich 2.5D procedures") +print("[OK] Replaced procedural drawing and games code") -# Write out patched casino3d.inc +# 6. Update Trigger3DInteraction for INTERACT_SKILL_CHECK +old_skill_trigger = b"""check_target_skill: + cmp eax, INTERACT_SKILL_CHECK + jne check_target_buckshot + invoke LaunchClassicGame, OFFSET GameSkillCheck, 11, OFFSET szTitleSkillCheck + ret""" + +new_skill_trigger = b"""check_target_skill: + cmp eax, INTERACT_SKILL_CHECK + jne check_target_buckshot + call InitSkillGame + mov engineMode, MODE_SKILL + ret""" + +if old_skill_trigger in raw_content: + raw_content = raw_content.replace(old_skill_trigger, new_skill_trigger) + print("[OK] Updated Trigger3DInteraction for INTERACT_SKILL_CHECK") +else: + print("[WARN] old_skill_trigger pattern not found verbatim") + +# 7. Update leave_table: for MODE_SKILL +old_leave = b""" cmp skulls3d_state, 1 + je engine_tick + cmp skulls3d_state, 2 + je engine_tick + mov engineMode, MODE_WALK""" + +new_leave = b""" cmp skulls3d_state, 1 + je engine_tick + cmp skulls3d_state, 2 + je engine_tick + cmp engineMode, MODE_SKILL + jne @F + cmp skill3d_state, 1 + je engine_tick +@@: + mov engineMode, MODE_WALK""" + +if old_leave in raw_content: + raw_content = raw_content.replace(old_leave, new_leave) + print("[OK] Updated leave_table: for MODE_SKILL") +else: + print("[WARN] old_leave pattern not found verbatim") + +# 8. Update engine_loop dispatch for MODE_SKILL +old_dispatch = b"""check_skulls_mode: + cmp engineMode, MODE_SKULLS + jne present_frame + call HandleSkullsInput + call RenderSkullsGame + jmp present_frame""" + +new_dispatch = b"""check_skulls_mode: + cmp engineMode, MODE_SKULLS + jne check_skill_mode + call HandleSkullsInput + call RenderSkullsGame + jmp present_frame +check_skill_mode: + cmp engineMode, MODE_SKILL + jne present_frame + call HandleSkillInput + call RenderSkillGame + jmp present_frame""" + +if old_dispatch in raw_content: + raw_content = raw_content.replace(old_dispatch, new_dispatch) + print("[OK] Updated engine_loop dispatch for MODE_SKILL") +else: + print("[WARN] old_dispatch pattern not found verbatim") + +# 9. Global replacement of reversed cyan color constants to proper 00RRGGBBh +color_replacements = [ + (b'0000FFFFh', b'00FFFF00h'), # Cyan -> Pure Yellow + (b'0000D7FFh', b'00FFD700h'), # Sky Blue -> Pure Gold + (b'0000A0D0h', b'00D0A000h'), # Amber Gold + (b'0000E0FFh', b'00FFE000h'), # Bright Amber + (b'00007A9Ah', b'009A7A00h'), # Bronze / Dark Gold + (b'000080A0h', b'00A08000h'), + (b'0000B0D0h', b'00D0B000h'), + (b'0000B0E0h', b'00E0B000h'), + (b'000000FFh', b'00FF2020h'), # Pure Blue -> Bright Ruby Red + (b'008080FFh', b'00FF6464h'), # Light Periwinkle -> Soft Coral Red + (b'001515B8h', b'00B81515h'), # Blue chip -> Red Clay Casino Chip + (b'001515C8h', b'00C81515h'), # Blue pips -> Ruby Red Dice Pips +] + +for old_c, new_c in color_replacements: + count = raw_content.count(old_c) + if count > 0: + raw_content = raw_content.replace(old_c, new_c) + print(f"[OK] Replaced {old_c.decode('ascii')} -> {new_c.decode('ascii')} ({count} occurrences)") + +# Write back to casino3d.inc with open(CASINO_INC, 'wb') as f: f.write(raw_content) -print(f"[SUCCESS] casino3d.inc patched successfully! New byte length: {len(raw_content)}") +print(f"[SUCCESS] casino3d.inc successfully patched! ({len(raw_content)} bytes)") diff --git a/tools/tests/test_minigames_render.py b/tools/tests/test_minigames_render.py index e4fbd5e..170a5b3 100644 --- a/tools/tests/test_minigames_render.py +++ b/tools/tests/test_minigames_render.py @@ -1,4 +1,13 @@ # -*- coding: utf-8 -*- +""" +Visual simulation & rasterization test for 2.5D Casino Minigames. +Renders pixel-perfect 640x480 (320x240 upscaled 2x) PNG previews of: +- Coin Flip (Монетка) +- Craps / Dice (КоÑ�ти) +- Skulls & Cups (Ð�апёрÑ�тки) +- Dead by Daylight Skill Check (Проверка реакции) +Uses authentic IBM VGA 8x8 font and correct 0x00RRGGBB Little-Endian DIB color space. +""" import math from pathlib import Path from PIL import Image @@ -26,10 +35,14 @@ class RasterBuffer: self.pixels = [(0, 0, 0)] * (SCREEN_W * SCREEN_H) def to_rgb(self, c): - # 0x00BBGGRR format - r = c & 0xFF + # 0x00RRGGBB format: + # In x86 Little-Endian StretchDIBits (BI_RGB 32-bit): + # byte 0 = Blue (c & 0xFF) + # byte 1 = Green ((c >> 8) & 0xFF) + # byte 2 = Red ((c >> 16) & 0xFF) + r = (c >> 16) & 0xFF g = (c >> 8) & 0xFF - b = (c >> 16) & 0xFF + b = c & 0xFF return (r, g, b) def draw_box(self, x, y, w, h, color): @@ -65,7 +78,7 @@ class RasterBuffer: if isinstance(ch, str): try: code = ch.encode('cp1251')[0] - except: + except Exception: code = ord(ch) & 0xFF else: code = ch & 0xFF @@ -87,25 +100,23 @@ class RasterBuffer: w = len(text) * 8 + 8 h = 13 if is_active: - border_c = 0x0000FFFF - fill_c = 0x001B4B22 - txt_c = 0x0000FFFF + border_c = 0x00FFFF00 # Bright Yellow border + fill_c = 0x001B4B22 # Casino Green fill + txt_c = 0x00FFFF00 # Bright Yellow text else: - border_c = 0x00606870 - fill_c = 0x001A1C22 - txt_c = 0x00D0D8E0 + border_c = 0x00606870 # Slate border + fill_c = 0x001A1C22 # Charcoal fill + txt_c = 0x00D0D8E0 # Silver text self.draw_box(x, y + 2, w, h, 0x0008080C) # shadow self.draw_box_border(x, y, w, h, fill_c, border_c, 1) self.draw_string(x + 4, y + 3, text, txt_c) return w + 4 def draw_chip_stack(self, x, y, count=3): - # Draw stack of 3D casino clay chips for i in range(count): cy = y - i * 4 - self.draw_box(x + 2, cy + 5, 20, 2, 0x00041006) # shadow - self.draw_box_border(x, cy, 24, 6, 0x001515B8, 0x00FFFFFF, 1) - # white stripe inlays + self.draw_box(x + 2, cy + 5, 20, 2, 0x00061004) # shadow + self.draw_box_border(x, cy, 24, 6, 0x00B81515, 0x00FFFFFF, 1) # Red chip self.draw_box(x + 4, cy + 1, 3, 4, 0x00FFFFFF) self.draw_box(x + 17, cy + 1, 3, 4, 0x00FFFFFF) @@ -128,12 +139,13 @@ class RasterBuffer: self.draw_pixel(cur_x, cur_y, inner_color) if rx >= 14 and relief == 1: - gold_dark = 0x00007A9A - # Imperial Eagle + gold_dark = 0x009A7A00 # Dark Gold relief + gold_bright = 0x00FFD700 + # Double-headed imperial eagle relief self.draw_box(cx - 3, cy - 14, 7, 2, gold_dark) self.draw_box(cx - 4, cy - 12, 9, 2, gold_dark) self.draw_box(cx - 2, cy - 9, 5, 12, gold_dark) - self.draw_box(cx - 1, cy - 8, 3, 10, 0x0000D7FF) + self.draw_box(cx - 1, cy - 8, 3, 10, gold_bright) self.draw_box(cx - 10, cy - 8, 7, 3, gold_dark) self.draw_box(cx - 13, cy - 5, 10, 3, gold_dark) self.draw_box(cx - 11, cy - 2, 7, 3, gold_dark) @@ -143,29 +155,30 @@ class RasterBuffer: self.draw_box(cx - 4, cy + 4, 9, 3, gold_dark) self.draw_box(cx - 3, cy + 7, 7, 3, gold_dark) elif rx >= 14 and relief == 2: - gold_dark = 0x00007A9A - # Roman numeral 'I' + gold_dark = 0x009A7A00 + gold_bright = 0x00FFD700 + # Roman numeral 'I' & laurel crown self.draw_box(cx - 5, cy - 10, 11, 3, gold_dark) self.draw_box(cx - 2, cy - 7, 5, 14, gold_dark) - self.draw_box(cx - 1, cy - 6, 3, 12, 0x0000D7FF) + self.draw_box(cx - 1, cy - 6, 3, 12, gold_bright) self.draw_box(cx - 6, cy + 7, 13, 3, gold_dark) for w_dy in [-10, -5, 0, 5, 9]: self.draw_box(cx - 12, cy + w_dy, 2, 2, gold_dark) self.draw_box(cx + 11, cy + w_dy, 2, 2, gold_dark) def draw_craps_die(self, x, y, size, val): - self.draw_box(x + 3, y + size, size, 3, 0x00031408) - self.draw_box(x + size, y + 3, 3, size, 0x00031408) - body_color = 0x00F0F4FA - bevel_color = 0x00C0C6D0 - border_color = 0x00353540 + self.draw_box(x + 3, y + size, size, 3, 0x00081403) + self.draw_box(x + size, y + 3, 3, size, 0x00081403) + body_color = 0x00FAF4F0 + bevel_color = 0x00D0C6C0 + border_color = 0x00403535 self.draw_box_border(x, y, size, size, body_color, border_color, 1) self.draw_box(x + 1, y + 1, size - 2, 1, 0x00FFFFFF) self.draw_box(x + 1, y + 1, 1, size - 2, 0x00FFFFFF) self.draw_box(x + 1, y + size - 2, size - 2, 1, bevel_color) self.draw_box(x + size - 2, y + 1, 1, size - 2, bevel_color) - pip_c = 0x001515C8 + pip_c = 0x00C81515 # Red ruby pips pip_r = 3 if val in [1, 3, 5]: self.draw_circle(x + size // 2, y + size // 2, pip_r, pip_c) @@ -183,35 +196,36 @@ class RasterBuffer: def draw_gothic_cup(self, x, y, cup_id, is_lifted=False, has_ball=False): lift_y = y - 36 if is_lifted else y if not is_lifted: - self.draw_box(x + 6, y + 42, 36, 4, 0x000A0410) + self.draw_box(x + 6, y + 42, 36, 4, 0x0010040A) else: - self.draw_box(x + 10, y + 42, 28, 2, 0x0012061A) + self.draw_box(x + 10, y + 42, 28, 2, 0x001A0612) if is_lifted and has_ball: self.draw_glowing_orb(x + 24, y + 26) - self.draw_box_border(x + 6, lift_y + 36, 36, 6, 0x00221A30, 0x0000B0D0, 1) - self.draw_box(x + 18, lift_y + 28, 12, 8, 0x00332545) - self.draw_box(x + 22, lift_y + 28, 4, 8, 0x0055406E) - self.draw_box_border(x + 8, lift_y + 8, 32, 20, 0x002D1E40, 0x0000D7FF, 1) - self.draw_box(x + 14, lift_y + 10, 6, 16, 0x00503570) - self.draw_box(x + 17, lift_y + 10, 3, 16, 0x007850A0) - self.draw_box_border(x + 4, lift_y + 2, 40, 7, 0x00150A20, 0x0000FFFF, 1) - self.draw_box(x + 12, lift_y + 4, 16, 2, 0x0000FFFF) + self.draw_box_border(x + 6, lift_y + 36, 36, 6, 0x00301A22, 0x00D0B000, 1) + self.draw_box(x + 18, lift_y + 28, 12, 8, 0x00452533) + self.draw_box(x + 22, lift_y + 28, 4, 8, 0x006E4055) + self.draw_box_border(x + 8, lift_y + 8, 32, 20, 0x00401E2D, 0x00FFD700, 1) + self.draw_box(x + 14, lift_y + 10, 6, 16, 0x00703550) + self.draw_box(x + 17, lift_y + 10, 3, 16, 0x00A05078) + self.draw_box_border(x + 4, lift_y + 2, 40, 7, 0x00200A15, 0x00FFFF00, 1) + self.draw_box(x + 12, lift_y + 4, 16, 2, 0x00FFFF00) - self.draw_box(x + 21, lift_y + 12, 6, 5, 0x0000D7FF) - self.draw_box(x + 22, lift_y + 17, 4, 3, 0x0000D7FF) - self.draw_pixel(x + 22, lift_y + 14, 0x00150A20) - self.draw_pixel(x + 24, lift_y + 14, 0x00150A20) - self.draw_string(x + 21, lift_y + 24, str(cup_id), 0x0000FFFF) + # Skull face relief on goblet + self.draw_box(x + 21, lift_y + 12, 6, 5, 0x00FFD700) + self.draw_box(x + 22, lift_y + 17, 4, 3, 0x00FFD700) + self.draw_pixel(x + 22, lift_y + 14, 0x00200A15) + self.draw_pixel(x + 24, lift_y + 14, 0x00200A15) + self.draw_string(x + 21, lift_y + 24, str(cup_id), 0x00FFFF00) def draw_glowing_orb(self, cx, cy): - self.draw_circle(cx, cy, 14, 0x00081E2E) - self.draw_circle(cx, cy, 11, 0x00103A58) - self.draw_circle(cx, cy, 8, 0x001A588A) - self.draw_circle(cx, cy, 6, 0x0000B0E0) - self.draw_circle(cx, cy, 4, 0x0000E0FF) - self.draw_circle(cx - 1, cy - 1, 2, 0x00A0FFFF) + self.draw_circle(cx, cy, 14, 0x002E1E08) + self.draw_circle(cx, cy, 11, 0x00583A10) + self.draw_circle(cx, cy, 8, 0x008A581A) + self.draw_circle(cx, cy, 6, 0x00D0B000) + self.draw_circle(cx, cy, 4, 0x00FFE000) + self.draw_circle(cx - 1, cy - 1, 2, 0x00FFFF80) self.draw_pixel(cx - 2, cy - 2, 0x00FFFFFF) def save(self, filename): @@ -222,158 +236,216 @@ class RasterBuffer: print(f"Saved {out_path}") # ============================================================================== -# 1. RENDER COIN GAME +# 1. RENDER COIN GAME (Монетка) # ============================================================================== def render_coin(filename='coin_preview.png'): b = RasterBuffer() - b.draw_box(0, 0, 320, 240, 0x00060914) # Mahogany cabinet - b.draw_box_border(6, 6, 308, 228, 0x000F1522, 0x001B2E48, 3) + b.draw_box(0, 0, 320, 240, 0x00140906) # Mahogany cabinet + b.draw_box_border(6, 6, 308, 228, 0x0022150F, 0x00482E1B, 3) for cx in [12, 306]: for cy in [12, 226]: - b.draw_box(cx, cy, 3, 3, 0x0000D7FF) + b.draw_box(cx, cy, 3, 3, 0x00FFD700) b.draw_pixel(cx + 1, cy + 1, 0x00FFFFFF) - b.draw_box_border(20, 12, 280, 26, 0x000A101C, 0x0000D7FF, 2) - b.draw_string(44, 21, '*** З О Л О Т Ð� Я М О Ð� Е Т Ð� ***', 0x0000FFFF) + b.draw_box_border(20, 12, 280, 26, 0x001C100A, 0x00FFD700, 2) + b.draw_string(44, 21, '* * * З О Л О Т Ð� Я М О Ð� Е Т Ð� * * *', 0x00FFFF00) for bx in range(24, 296, 12): - b.draw_pixel(bx, 13, 0x0000FFFF) - b.draw_pixel(bx, 36, 0x0000D7FF) + b.draw_pixel(bx, 13, 0x00FFFF00) + b.draw_pixel(bx, 36, 0x00FFD700) # Status meters - b.draw_box_border(20, 44, 110, 18, 0x000A1A0E, 0x001A4B22, 1) - b.draw_string(24, 49, 'БÐ�Ð�К: $12500', 0x0050FF50) + b.draw_box_border(20, 44, 110, 18, 0x000E1A0A, 0x00224B1A, 1) + b.draw_string(24, 49, 'БÐ�Ð�К: $12500', 0x003CFF3C) b.draw_box_border(190, 44, 110, 18, 0x001A100A, 0x003A2814, 1) - b.draw_string(194, 49, 'СТÐ�ВКÐ�: $50 [W/S]', 0x0000D7FF) + b.draw_string(194, 49, 'СТÐ�ВКÐ�: $250', 0x00FFD700) - # Center Dish - b.draw_circle(160, 110, 46, 0x000090C0) - b.draw_circle(160, 110, 44, 0x0000D7FF) - b.draw_circle(160, 110, 41, 0x00180824) + # Side indicators + # Left: Heads (Selected) + b.draw_box(20, 72, 76, 68, 0x000A101C) + b.draw_box_border(20, 72, 76, 68, 0x00101828, 0x00FFFF00, 2) + b.draw_string(30, 78, '[1] ОРÐ�Л', 0x00FFFF00) + b.draw_coin_ellipse(58, 106, 14, 14, 0x00D0A000, 0x00FFD700, 1) + b.draw_string(24, 126, 'ВЫБРÐ�Ð�О', 0x003CFF3C) - # Coin at rest (Heads) - b.draw_coin_ellipse(160, 110, 26, 26, 0x0000A0D0, 0x0000D7FF, relief=1) + # Right: Tails + b.draw_box(224, 72, 76, 68, 0x000A101C) + b.draw_box_border(224, 72, 76, 68, 0x00101828, 0x00404855, 1) + b.draw_string(234, 78, '[2] РЕШКÐ�', 0x00D0D8E0) + b.draw_coin_ellipse(262, 106, 14, 14, 0x00A08000, 0x00D0B000, 2) - # Left: [1] ОРЕЛ (Active) - b.draw_box_border(20, 72, 76, 52, 0x001C3822, 0x0000FFFF, 2) - b.draw_string(28, 78, '[1] ОРÐ�Л', 0x0000FFFF) - b.draw_coin_ellipse(58, 106, 12, 12, 0x0000A0D0, 0x0000D7FF, relief=1) + # Center coin spotlight + b.draw_circle(160, 110, 48, 0x00121620) + b.draw_circle(160, 110, 44, 0x00FFD700) + b.draw_circle(160, 110, 42, 0x000E141E) + b.draw_coin_ellipse(160, 110, 26, 26, 0x00D0A000, 0x00FFD700, 1) - # Right: [2] РЕШКÐ� - b.draw_box_border(224, 72, 76, 52, 0x00121620, 0x00404855, 1) - b.draw_string(232, 78, '[2] РЕШКÐ�', 0x0090A0B0) - b.draw_coin_ellipse(262, 106, 12, 12, 0x000080A0, 0x0000B0D0, relief=2) + # Result Banner + b.draw_box_border(44, 154, 232, 22, 0x000E141E, 0x003CFF3C, 1) + b.draw_string(60, 161, 'ПОБЕДÐ�: +$500! СЕРИЯ x3', 0x003CFF3C) - # Streak - b.draw_box_border(44, 154, 232, 20, 0x000E141E, 0x0000D7FF, 1) - b.draw_string(52, 160, 'СЕРИЯ: [X] [X] [X] [ ] [ ] x4!', 0x0000FFFF) + # Bottom Keycaps + kx = 16 + kx += b.draw_keycap(kx, 192, '[1] ОРÐ�Л', is_active=True) + kx += b.draw_keycap(kx, 192, '[2] РЕШКÐ�', is_active=False) + kx += b.draw_keycap(kx, 192, '[SPACE]', is_active=True) + b.draw_keycap(kx, 192, '[ESC]', is_active=False) - # Keycaps - b.draw_box(16, 194, 288, 1, 0x001E2E40) - b.draw_keycap(22, 202, '1:ОРÐ�Л', is_active=True) - b.draw_keycap(88, 202, '2:РЕШКÐ�') - b.draw_keycap(160, 202, 'ПРОБЕЛ:БРОСОК', is_active=True) - b.draw_keycap(274, 202, 'ESC') b.save(filename) # ============================================================================== -# 2. RENDER DICE GAME +# 2. RENDER DICE GAME (КоÑ�ти) # ============================================================================== def render_dice(filename='dice_preview.png'): b = RasterBuffer() - # Emerald felt - b.draw_box(0, 0, 320, 240, 0x00082E12) - # Oak wood border & leather bumper - b.draw_box_border(4, 4, 312, 232, 0x00093816, 0x00122244, 3) - b.draw_box_border(8, 8, 304, 224, 0x000A3F19, 0x0005140A, 2) - - # Pyramidal backboard rubber diamond texture along top - for bx in range(12, 308, 12): - b.draw_box(bx + 4, 11, 4, 4, 0x00041006) - b.draw_pixel(bx + 5, 12, 0x000F4820) + b.draw_box(0, 0, 320, 240, 0x00140906) # Mahogany frame + b.draw_box_border(6, 6, 308, 228, 0x000A3816, 0x00FFD700, 2) # Deep Green Felt # Header - b.draw_string(48, 20, '==== G R A N D C R A P S T A B L E ====', 0x0000D7FF) - b.draw_string(72, 32, '[ PASS LINE ] [ ANY CRAPS ]', 0x0000B0A0) + b.draw_box_border(20, 12, 280, 26, 0x00072E13, 0x00FFD700, 2) + b.draw_string(48, 21, '=== G R A N D C R A P S ===', 0x00FFFF00) # Status - b.draw_box_border(16, 46, 100, 16, 0x0006240E, 0x000E5022, 1) - b.draw_string(20, 50, 'БÐ�Ð�К: $12500', 0x0050FF50) - b.draw_box_border(204, 46, 100, 16, 0x0006240E, 0x000E5022, 1) - b.draw_string(208, 50, 'СТÐ�ВКÐ�: $50 [W/S]', 0x0000D7FF) + b.draw_box_border(20, 44, 110, 18, 0x00072E13, 0x001B4B22, 1) + b.draw_string(24, 49, 'БÐ�Ð�К: $12500', 0x003CFF3C) + b.draw_box_border(190, 44, 110, 18, 0x00072E13, 0x001B4B22, 1) + b.draw_string(194, 49, 'СТÐ�ВКÐ�: $100', 0x00FFD700) - # Betting Zones - # Left: [1] ЧЕТ (Active with chip stack!) - b.draw_box_border(16, 68, 88, 54, 0x000B441D, 0x0000FFFF, 2) - b.draw_string(24, 74, '[1] ЧÐ�Т', 0x0000FFFF) - b.draw_string(20, 86, '2 4 6 8 10 12', 0x0000D7FF) - b.draw_chip_stack(48, 110, count=4) + # Betting Pass Lines + # [1] ЧÐ�Т + b.draw_box_border(16, 70, 88, 48, 0x00072E13, 0x00FFFF00, 2) + b.draw_string(30, 76, '[1] ЧÐ�Т', 0x00FFFF00) + b.draw_string(22, 90, ' 2 4 6 8 10 ', 0x00FFD700) + b.draw_string(26, 104, 'ВЫБРÐ�Ð�О', 0x003CFF3C) - # Right: [2] Ð�ЕЧЕТ - b.draw_box_border(216, 68, 88, 54, 0x00073014, 0x001A602A, 1) - b.draw_string(224, 74, '[2] Ð�ЕЧЕТ', 0x0080B090) - b.draw_string(222, 86, '3 5 7 9 11', 0x00508060) + # [2] Ð�ЕЧЕТ + b.draw_box_border(216, 70, 88, 48, 0x00072E13, 0x001B4B22, 1) + b.draw_string(226, 76, '[2] Ð�ЕЧЕТ', 0x00D0D8E0) + b.draw_string(224, 90, ' 3 5 7 9 11 ', 0x0080B090) - # Center Dice Field - b.draw_box_border(112, 68, 96, 54, 0x00072E13, 0x00145826, 1) - # Draw Two Precision Dice - b.draw_craps_die(120, 76, 36, 4) - b.draw_craps_die(164, 76, 36, 6) + # Center Craps Table: 2 Dice + b.draw_craps_die(116, 80, 36, 4) + b.draw_craps_die(168, 76, 36, 6) - # Score Plaque - b.draw_box_border(36, 130, 248, 30, 0x00051D0C, 0x0000D7FF, 1) - b.draw_string(44, 135, 'СУММÐ�: 4 + 6 = 10 (ЧÐ�Т)', 0x0000FFFF) - b.draw_string(68, 147, 'ВЫИГРЫШ: +$100! (x2)', 0x0050FF50) + # Sum & Result + b.draw_box_border(36, 132, 248, 36, 0x00072E13, 0x00FFD700, 1) + b.draw_string(48, 138, 'СУММÐ�: 4 + 6 = 10 (ЧÐ�Т)', 0x00FFFF00) + b.draw_string(68, 152, 'ВЫИГРЫШ: +$200! (x2)', 0x003CFF3C) # Keycaps - b.draw_box(16, 188, 288, 1, 0x00104820) - b.draw_keycap(20, 198, '1:ЧÐ�Т', is_active=True) - b.draw_keycap(82, 198, '2:Ð�ЕЧЕТ') - b.draw_keycap(160, 198, 'ПРОБЕЛ:БРОСОК', is_active=True) - b.draw_keycap(274, 198, 'ESC') + kx = 16 + kx += b.draw_keycap(kx, 192, '[1] ЧÐ�Т', is_active=True) + kx += b.draw_keycap(kx, 192, '[2] Ð�ЕЧЕТ', is_active=False) + kx += b.draw_keycap(kx, 192, '[SPACE]', is_active=True) + b.draw_keycap(kx, 192, '[ESC]', is_active=False) + b.save(filename) # ============================================================================== -# 3. RENDER SKULLS GAME +# 3. RENDER SKULLS GAME (Ð�апёрÑ�тки) # ============================================================================== def render_skulls(filename='skulls_preview.png'): b = RasterBuffer() - # Dark gothic table with purple velvet - b.draw_box(0, 0, 320, 240, 0x000D0612) - b.draw_box_border(4, 4, 312, 232, 0x00160B20, 0x00321845, 3) - b.draw_box_border(8, 8, 304, 224, 0x00220F30, 0x0000D7FF, 1) + b.draw_box(0, 0, 320, 240, 0x00140906) + b.draw_box_border(6, 6, 308, 228, 0x00300F22, 0x00FFD700, 2) # Gothic Purple # Header - b.draw_box_border(24, 12, 272, 24, 0x0012081A, 0x0000D7FF, 2) - b.draw_string(48, 20, '+ + + Ð� Ð� П Ð� Р С Т К И С К Ð’ Е Р Ð� Ы + + +', 0x0000FFFF) + b.draw_box_border(20, 12, 280, 26, 0x001A0812, 0x00FFD700, 2) + b.draw_string(44, 21, '* * * Ð� Ð� П Ð� Р С Т К И * * *', 0x00FFFF00) # Status - b.draw_box_border(20, 42, 110, 16, 0x000D0616, 0x00401858, 1) - b.draw_string(24, 46, 'БÐ�Ð�К: $12500', 0x0050FF50) - b.draw_box_border(190, 42, 110, 16, 0x000D0616, 0x00401858, 1) - b.draw_string(194, 46, 'СТÐ�ВКÐ�: $50 [W/S]', 0x0000D7FF) + b.draw_box_border(20, 44, 110, 18, 0x001A0812, 0x00452033, 1) + b.draw_string(24, 49, 'БÐ�Ð�К: $12500', 0x003CFF3C) + b.draw_box_border(190, 44, 110, 18, 0x001A0812, 0x00452033, 1) + b.draw_string(194, 49, 'СТÐ�ВКÐ�: $300', 0x00FFD700) - # Table Runner - b.draw_box_border(16, 66, 288, 114, 0x001A0B25, 0x00452060, 1) + # Subtitle + b.draw_string(40, 62, 'ВЫИГРЫШ: +$900! (x3) ВЫ УГÐ�ДÐ�ЛИ!', 0x003CFF3C) - # Narrative banner - b.draw_string(40, 74, 'СЛЕДИ ЗÐ� ЗОЛОТЫМ ОКОМ СУДЬБЫ...', 0x0000FFFF) + # 3 Cups: Cup 2 lifted revealing gold ball + b.draw_gothic_cup(36, 114, 1, is_lifted=False, has_ball=False) + b.draw_gothic_cup(136, 114, 2, is_lifted=True, has_ball=True) + b.draw_gothic_cup(236, 114, 3, is_lifted=False, has_ball=False) - # Draw 3 Gothic Cups (Cup 2 is lifted revealing glowing orb!) - b.draw_gothic_cup(48, 100, 1, is_lifted=False) - b.draw_gothic_cup(136, 100, 2, is_lifted=True, has_ball=True) - b.draw_gothic_cup(224, 100, 3, is_lifted=False) + # Selection indicators + b.draw_string(54, 168, '[ 1 ]', 0x00D0D8E0) + b.draw_string(150, 168, '[ 2 ]', 0x00FFFF00) + b.draw_string(250, 168, '[ 3 ]', 0x00D0D8E0) # Keycaps - b.draw_box(16, 190, 288, 1, 0x003A1850) - b.draw_keycap(18, 200, '1:КУБОК') - b.draw_keycap(82, 200, '2:КУБОК', is_active=True) - b.draw_keycap(146, 200, '3:КУБОК') - b.draw_keycap(212, 200, 'ПРОБЕЛ', is_active=True) - b.draw_keycap(274, 200, 'ESC') + kx = 16 + kx += b.draw_keycap(kx, 192, '[1]', is_active=False) + kx += b.draw_keycap(kx, 192, '[2]', is_active=True) + kx += b.draw_keycap(kx, 192, '[3]', is_active=False) + kx += b.draw_keycap(kx, 192, '[SPACE] СТÐ�РТ', is_active=True) + b.draw_keycap(kx, 192, '[ESC]', is_active=False) + + b.save(filename) + +# ============================================================================== +# 4. RENDER SKILL CHECK GAME (Dead by Daylight Survivor Check) +# ============================================================================== +def render_skill(filename='skill_preview.png'): + b = RasterBuffer() + # Industrial survivor steel bezel + b.draw_box(0, 0, 320, 240, 0x00121416) + b.draw_box_border(6, 6, 308, 228, 0x001A1D20, 0x00FFD700, 2) + + # Header + b.draw_box_border(20, 12, 280, 26, 0x00121418, 0x00FFD700, 2) + b.draw_string(44, 21, '* * * Ð� Ð� П Ð� Р С Т К И * * *', 0x00FFFF00) + + # Status + b.draw_box_border(20, 44, 110, 18, 0x00121418, 0x002A3540, 1) + b.draw_string(24, 49, 'БÐ�Ð�К: $12500', 0x003CFF3C) + b.draw_box_border(190, 44, 110, 18, 0x00121418, 0x002A3540, 1) + b.draw_string(194, 49, 'СТÐ�ВКÐ�: $200', 0x00FFD700) + + # Survivor progress + b.draw_string(24, 70, 'ХИТ: 3 / 5', 0x003CFF3C) + b.draw_string(180, 70, 'ПРОМÐ�Ð¥: 1 / 3', 0x00FF6464) + + # Tension Dial / Track: X=50 to 270, Y=100 to 134 + track_x = 50 + track_y = 102 + track_w = 220 + track_h = 32 + + # Outer frame + b.draw_box_border(track_x, track_y, track_w, track_h, 0x000F1114, 0x00404855, 2) + + # Calibrated ticks + for tx in range(track_x + 10, track_x + track_w - 10, 12): + b.draw_box(tx, track_y + 2, 1, 6, 0x00303845) + b.draw_box(tx, track_y + track_h - 8, 1, 6, 0x00303845) + + # Normal Success Zone (Green): X=150 to 198 (48px) + b.draw_box_border(150, track_y + 4, 48, track_h - 8, 0x00155020, 0x003CFF3C, 1) + + # Great / Perfect Sweet Spot (Gold): X=186 to 198 (12px) + b.draw_box_border(186, track_y + 4, 12, track_h - 8, 0x00FFD700, 0x00FFFF00, 1) + b.draw_string(156, track_y + 10, 'HIT!', 0x003CFF3C) + + # Needle at X=190 (Inside Great Zone!) + needle_x = 190 + b.draw_box(needle_x - 1, track_y - 4, 3, track_h + 8, 0x00FFFFFF) + b.draw_box(needle_x - 2, track_y - 6, 5, 2, 0x00FF3030) + b.draw_box(needle_x - 2, track_y + track_h + 4, 5, 2, 0x00FF3030) + + # Prompt text + b.draw_string(52, 150, 'ОТЛИЧÐ�О! GREAT SKILL CHECK!', 0x00FFFF00) + b.draw_string(76, 166, 'Ð�Ð�ЖМИТЕ [ПРОБЕЛ] Ð’ ЗОÐ�Е', 0x00D0D8E0) + + # Bottom Keycaps + kx = 16 + kx += b.draw_keycap(kx, 192, '[SPACE] РЕÐ�КЦИЯ', is_active=True) + kx += b.draw_keycap(kx, 192, '[ВВЕРХ/Ð’Ð�ИЗ]', is_active=False) + b.draw_keycap(kx, 192, '[ESC]', is_active=False) + b.save(filename) if __name__ == '__main__': render_coin() render_dice() render_skulls() - print("All 3 minigames previews rendered successfully!") + render_skill() + print("[ALL DONE] All 4 previews successfully generated!")