Emily's Z80 assembler for the Gameboy.
Revision | 124de051f2dd562c7401d26b47b803c5aefa6b86 (tree) |
---|---|
Zeit | 2021-03-02 17:09:35 |
Autor | AlaskanEmily <emily@alas...> |
Commiter | AlaskanEmily |
Add !incbin
@@ -734,6 +734,18 @@ def assemble(block, mnemonic, operands=()): | ||
734 | 734 | raise |
735 | 735 | finally: |
736 | 736 | included_names.remove(o) |
737 | + return+ | |
738 | + | |
739 | + if mnemonic == "!incbin": | |
740 | + for o in operands: | |
741 | + f = open(o, "rb") | |
742 | + for b in f: | |
743 | + if type(b) == str: | |
744 | + for c in b: | |
745 | + block.pushByte(ord(c)) | |
746 | + else: | |
747 | + block.pushByte(b) | |
748 | + f.close() | |
737 | 749 | return |
738 | 750 | |
739 | 751 | if mnemonic[0] == '!': |