Compare commits

..

No commits in common. "df2cd4079f7c96b9b13567d31cc805230b1f4a52" and "e2cbdcaf9267621978a93045c87d9a0efd11003e" have entirely different histories.

4 changed files with 10 additions and 86 deletions

View file

@ -7,7 +7,7 @@ RAREST_WORD = murky
all: dosdl.com all: dosdl.com
dosdl.com: dosdl.asm dictionary.inc targets.inc license.inc dosdl.com: dosdl.asm dictionary.inc targets.inc
$(NASM) -fbin -o $@ $< $(NASM) -fbin -o $@ $<
dictionary.inc: dictionary.json targets.json compress-dict.py dictionary.inc: dictionary.json targets.json compress-dict.py
@ -16,9 +16,6 @@ dictionary.inc: dictionary.json targets.json compress-dict.py
targets.inc: targets.json compress-targets.py targets.inc: targets.json compress-targets.py
$(PYTHON) compress-targets.py $< $(RAREST_WORD) $@ $(PYTHON) compress-targets.py $< $(RAREST_WORD) $@
license.inc: LICENSE embed-textfile.py
$(PYTHON) embed-textfile.py $< license_str $@
clean: clean:
rm -f *.inc *.com rm -f *.inc *.com

View file

@ -13,6 +13,11 @@ Gameplay
Gameplay is as in hello wordl's default daily mode. `x` under a letter marks it Gameplay is as in hello wordl's default daily mode. `x` under a letter marks it
as incorrect and `^` marks it as being in the wrong place. as incorrect and `^` marks it as being in the wrong place.
Missing features
----------------
- Ability to set the seed manually
Word lists Word lists
---------- ----------
The words lists are taken from The words lists are taken from

View file

@ -25,15 +25,13 @@ parse_arguments:
.leading_spaces_skipped: .leading_spaces_skipped:
; See whether we have /h, /u, /l, or /? ; See whether we have /h or /u
cmp cx, 2 cmp cx, 2
jb .not_mode_option jb .not_mode_option
cmp byte [si], '/' cmp byte [si], '/'
jne .not_mode_option jne .not_mode_option
cmp byte [si + 1], 'h' cmp byte [si + 1], 'h'
je .hard_mode
cmp byte [si + 1], 'H'
jne .not_hard_mode jne .not_hard_mode
.hard_mode: .hard_mode:
@ -44,8 +42,6 @@ parse_arguments:
.not_hard_mode: .not_hard_mode:
cmp byte [si + 1], 'u' cmp byte [si + 1], 'u'
je .ultra_hard_mode
cmp byte [si + 1], 'U'
jne .not_ultra_hard_mode jne .not_ultra_hard_mode
.ultra_hard_mode: .ultra_hard_mode:
@ -66,57 +62,11 @@ parse_arguments:
.option_done: .option_done:
.not_ultra_hard_mode: .not_ultra_hard_mode:
cmp byte [si + 1], 'l'
je print_license
cmp byte [si + 1], 'L'
je print_license
cmp byte [si + 2], '?'
je print_help
.not_mode_option: .not_mode_option:
test cx, cx test cx, cx
jz seed_rng_date jz seed_rng_date
seed_rng_argument:
xor ax, ax
xor dx, dx
mov bp, mull32
call store32
.loop:
xor dx, dx
mov ax, 10
mov bp, mulr32
call store32
call mul32
mov bp, addl32
call store32
lodsb
cmp al, '0'
jb print_help
cmp al, '9'
ja print_help
sub al, '0'
xor ah, ah
xor dx, dx
mov bp, addr32
call store32
call add32
mov bp, mull32
call store32
loop .loop
mov bp, rng_seed
call store32
jmp select_target
print_help: print_help:
mov ah, 9 mov ah, 9
mov dx, help_str mov dx, help_str
@ -124,13 +74,6 @@ print_help:
ret ret
print_license:
mov ah, 9
mov dx, license_str
int 0x21
ret
seed_rng_date: seed_rng_date:
; Get date ; Get date
mov ah, 0x2a mov ah, 0x2a
@ -1096,11 +1039,9 @@ guesses_str db ' guesses.$'
guess_str db ' guess.$' guess_str db ' guess.$'
help_str: help_str:
db 'Usage: dosdl [/h | /u | /l | /?] [seed]', 13, 10 db 'Usage: dosdl [/h | /u]', 13, 10
db '/h Enable hard mode.', 13, 10 db '/h Enable hard mode.', 13, 10
db '/u Enable ultra hard mode.', 13, 10 db '/u Enable ultra hard mode.', 13, 10
db '/l Display license info.', 13, 10
db '/? Display this help.', 13, 10
db 13, 10 db 13, 10
db 'Hello DOSdl is a word guessing game. You have six tries to guess the correct', 13, 10 db 'Hello DOSdl is a word guessing game. You have six tries to guess the correct', 13, 10
db 'English word. After a guess the game displays feedback under each letter:', 13, 10 db 'English word. After a guess the game displays feedback under each letter:', 13, 10
@ -1115,9 +1056,8 @@ help_str:
db 13, 10 db 13, 10
db 'In hard mode all letters marked as being in the correct place must stay fixed', 13, 10 db 'In hard mode all letters marked as being in the correct place must stay fixed', 13, 10
db 'and those marked as being in the wrong place must be reused. In ultra hard mode', 13, 10 db 'and those marked as being in the wrong place must be reused. In ultra hard mode', 13, 10
db 'letters marked as being in the wrong place must also be moved and letters that', 13, 10 db 'letters marked as being in the wrong place must also be moved and letters not', 13, 10
db 'have been ruled out must not be played again.$' db 'in the word must not be played again.$'
%include "dictionary.inc" %include "dictionary.inc"
%include "targets.inc" %include "targets.inc"
%include "license.inc"

View file

@ -1,18 +0,0 @@
#!/usr/bin/env python
import sys
srcpath = sys.argv[1]
name = sys.argv[2]
targetpath = sys.argv[3]
with open(srcpath, 'r') as f:
lines = [line.rstrip() for line in f]
with open(targetpath, 'w') as f:
f.write(f'{name}:\n')
for line in lines:
encoded = line.encode('cp437')
if len(encoded) > 0:
f.write(f'\tdb {", ".join(str(char) for char in encoded)}, 13, 10\n')
else:
f.write('\tdb 13, 10\n')
f.write("\tdb '$'\n")