Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pseudo-random algorithm #70

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Use pseudo-random algorithm #70

wants to merge 4 commits into from

Conversation

donno2048
Copy link
Owner

No description provided.

@donno2048
Copy link
Owner Author

Another possible pseudo randomizer I thought of is to do:

+    push si
.food:
-    in ax, 0x40
-    and bx, ax
+    pop ax
+    push ax
+    sub bx, ax
...
-    js .food

which will also reduce one byte

@donno2048
Copy link
Owner Author

Another possible pseudo randomizer I thought of is to do:

+    push si
.food:
-    in ax, 0x40
-    and bx, ax
+    pop ax
+    push ax
+    sub bx, ax
...
-    js .food

which will also reduce one byte

Damn just realized combining both of these methods by using mov bx, [byte si+bx+0x50] instead of mov bx, [si] (after replacing bx<->si) would allow js/jc .food-2 by removing pop ax, push ax and reduce two bytes, too bad it fails after too many apples being eaten... :(

@donno2048
Copy link
Owner Author

Made a commit to combine the two methods

@donno2048 donno2048 added enhancement New feature or request help wanted Extra attention is needed labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant