wwww
Révision | f888d29c0ceaa48568b15f3269df70e6498c9dbc (tree) |
---|---|
l'heure | 2018-06-20 00:36:56 |
Auteur | sparky4 <sparky4@cock...> |
Commiter | sparky4 |
removed some junk
@@ -67,10 +67,6 @@ main(int argc, char *argv[]) | ||
67 | 67 | gvar.player[0].enti.d=2; |
68 | 68 | gvar.player[0].enti.spt=4; |
69 | 69 | |
70 | -// wordtest(); | |
71 | - bytetest(); | |
72 | -//0000 nibbletest(); | |
73 | -//0000 booleantest(); | |
74 | 70 | //printf("dbg_testkeyin=%u dbg_testcontrolnoisy=%u dbg_nogvar.playerinpu=%u\nloop if this is not responsive then please KILL or reset machine sorry!!\n", dbg_testkeyin, dbg_testcontrolnoisy, dbg_nogvar.playerinpu); |
75 | 71 | while(!gvar.in.inst->Keyboard[sc_Escape]) |
76 | 72 | { |
@@ -324,6 +324,7 @@ _dl=_DL; | ||
324 | 324 | // printf(" cf=%04x\npf=%04x\naf=%04x\nzf=%04x\nsf=%04x\ntf=%04x\nif=%04x\ndf=%04x\nof=%04x\n", _CF, _PF, _AF, _ZF, _SF, _TF, _IF, _DF, _OF); |
325 | 325 | printf("cflag: "BYTE_TO_BINARY_PATTERN""BYTE_TO_BINARY_PATTERN"\n", BYTE_TO_BINARY(_cflag>>8), BYTE_TO_BINARY(_cflag)); |
326 | 326 | // printf("cflag: %s\n",(_cflag)); |
327 | + printf("dx: "NIBBLE_TO_BINARY_PATTERN""NIBBLE_TO_BINARY_PATTERN"\n", NIBBLE_TO_BINARY(_dx>>4), NIBBLE_TO_BINARY(_dx)); | |
327 | 328 | #endif |
328 | 329 | printf("dx: "BYTE_TO_BINARY_PATTERN""BYTE_TO_BINARY_PATTERN"\n", BYTE_TO_BINARY(_dx>>8), BYTE_TO_BINARY(_dx)); |
329 | 330 | printf(" ---------------------------------------\n"); |
@@ -217,6 +217,13 @@ void regidump(); | ||
217 | 217 | (byte & 0x02 ? '1' : '0'), \ |
218 | 218 | (byte & 0x01 ? '1' : '0') |
219 | 219 | |
220 | +#define NIBBLE_TO_BINARY_PATTERN "%c%c%c%c" | |
221 | +#define NIBBLE_TO_BINARY(byte) \ | |
222 | + (byte & 0x08 ? '1' : '0'), \ | |
223 | + (byte & 0x04 ? '1' : '0'), \ | |
224 | + (byte & 0x02 ? '1' : '0'), \ | |
225 | + (byte & 0x01 ? '1' : '0') | |
226 | + | |
220 | 227 | #define PRINT_OPAQUE_STRUCT(p) print_mem((p), sizeof(*(p))) |
221 | 228 | |
222 | 229 | #endif/*__16_HEAD_H__*/ |
@@ -792,101 +792,3 @@ void turboXT(byte bakapee) | ||
792 | 792 | } |
793 | 793 | } |
794 | 794 | #endif |
795 | - | |
796 | -//from https://stackoverflow.com/questions/18327439/printing-binary-representation-of-a-char-in-c | |
797 | -const char *word_to_binary(int x) | |
798 | -{ | |
799 | - static char b[17]; | |
800 | - int z; | |
801 | - | |
802 | - b[0] = '\0'; | |
803 | - for (z = 256; z > 0; z >>= 1) | |
804 | - { | |
805 | -/// printf(" z=%u b=%u x=%u\n", z, b, x); | |
806 | - strcat(b, ((x & z) == z) ? "1" : "0"); | |
807 | - } | |
808 | - return b; | |
809 | -} | |
810 | - | |
811 | -const char *byte_to_binary(int x) | |
812 | -{ | |
813 | - static char b[9]; | |
814 | - int z; | |
815 | - | |
816 | - b[0] = '\0'; | |
817 | - for (z = 128; z > 0; z >>= 1) | |
818 | - { | |
819 | - strcat(b, ((x & z) == z) ? "1" : "0"); | |
820 | - } | |
821 | - return b; | |
822 | -} | |
823 | - | |
824 | -const char *nibble_to_binary(int x) | |
825 | -{ | |
826 | - static char b[9]; | |
827 | - int z; | |
828 | - | |
829 | - b[0] = '\0'; | |
830 | - for (z = 8; z > 0; z >>= 1) | |
831 | - { | |
832 | - strcat(b, ((x & z) == z) ? "1" : "0"); | |
833 | - } | |
834 | - return b; | |
835 | -} | |
836 | - | |
837 | -const char *boolean_to_binary(int x) | |
838 | -{ | |
839 | - static char b[3]; | |
840 | - int z; | |
841 | - | |
842 | - b[0] = '\0'; | |
843 | - for (z = 1; z > 0; z >>= 1) | |
844 | - { | |
845 | - strcat(b, ((x & z) == z) ? "1" : "0"); | |
846 | - } | |
847 | - return b; | |
848 | -} | |
849 | - | |
850 | -void wordtest() | |
851 | -{ | |
852 | - word pee; | |
853 | - printf("wordtest\n"); | |
854 | - /* word to binary string */ | |
855 | - for(pee=0;pee<280;pee++) | |
856 | - printf(" %u %s\n", pee, word_to_binary(pee)); | |
857 | - printf(" sizeof(word)=%s\n", word_to_binary(sizeof(word))); | |
858 | - printf("end of word test\n"); | |
859 | -} | |
860 | - | |
861 | -void bytetest() | |
862 | -{ | |
863 | - byte pee; | |
864 | - printf("bytetest\n"); | |
865 | - /* byte to binary string */ | |
866 | - for(pee=0;pee<18;pee++) | |
867 | - printf(" %u %s\n", pee, byte_to_binary(pee)); | |
868 | - printf(" sizeof(byte)=%s\n", byte_to_binary(sizeof(byte))); | |
869 | - printf("end of byte test\n"); | |
870 | -} | |
871 | - | |
872 | -void nibbletest() | |
873 | -{ | |
874 | - nibble pee; | |
875 | - printf("nibbletest\n"); | |
876 | - /* nibble to binary string */ | |
877 | - for(pee=0;pee<18;pee++) | |
878 | - printf(" %u %s\n", pee, nibble_to_binary(pee)); | |
879 | - printf(" sizeof(nibble)=%s\n", nibble_to_binary(sizeof(nibble))); | |
880 | - printf("end of nibble test\n"); | |
881 | -} | |
882 | - | |
883 | -void booleantest() | |
884 | -{ | |
885 | - boolean pee; | |
886 | - printf("booleantest\n"); | |
887 | - /* boolean to binary string */ | |
888 | - for(pee=0;pee<4;pee++) | |
889 | - printf(" %u %s\n", pee, boolean_to_binary(pee)); | |
890 | - printf(" sizeof(boolean)=%s\n", boolean_to_binary(sizeof(boolean))); | |
891 | - printf("end of boolean test\n"); | |
892 | -} |
@@ -141,13 +141,5 @@ void DebugMemory_(global_game_variables_t *gvar, boolean q); | ||
141 | 141 | void ClearMemory (global_game_variables_t *gvar); |
142 | 142 | void Quit (global_game_variables_t *gvar, char *error); |
143 | 143 | void turboXT(byte bakapee); |
144 | -const char *word_to_binary(int x); | |
145 | -const char *byte_to_binary(int x); | |
146 | -const char *nibble_to_binary(int x); | |
147 | -const char *boolean_to_binary(int x); | |
148 | -void wordtest(); | |
149 | -void bytetest(); | |
150 | -void nibbletest(); | |
151 | -void booleantest(); | |
152 | 144 | |
153 | 145 | #endif /*__16_TAIL__ */ |
@@ -1 +1 @@ | ||
1 | -Subproject commit 9a52516ac236cb67e1a8f0d9b06bd3f2120a8311 | |
1 | +Subproject commit 1c553707ed78522d5252677f94ddfcc31866d88f |