From 932bccfc5b5fbfcc4cd6040cd7ef76f90cb9c1ea Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 21 Jun 2018 21:27:50 -0500 Subject: [PATCH] removed linked list stuff of the palette. it is slow. also added more derived bianary stuff --- 16/ll.7z | Bin 0 -> 3708 bytes makefile | 4 - src/lib/16_head.c | 3 +- src/lib/16_head.h | 33 ++++++- src/lib/ll.c | 290 ------------------------------------------------------ src/lib/ll.h | 38 ------- src/pallist.txt | 38 +++++++ src/palllist.c | 182 ---------------------------------- 8 files changed, 68 insertions(+), 520 deletions(-) create mode 100755 16/ll.7z delete mode 100755 src/lib/ll.c delete mode 100755 src/lib/ll.h create mode 100755 src/pallist.txt delete mode 100755 src/palllist.c diff --git a/16/ll.7z b/16/ll.7z new file mode 100755 index 0000000000000000000000000000000000000000..d6718de099bf9120b6420a1d41a441f1311a1046 GIT binary patch literal 3708 zcmV-?4ukPGdc3bE8~_A`DBmGD4gdfE0000Z000000000R#_fIJE=UcmT>uf9NybMH z6QTfj9ULOX$lai0-5ZGlfmJ}`Q-m{2i{lZ_>#%{7i3(0=f|8gA`0tl8)34dXlxQAw z4;vz5ROp?w$%K#+jDeB|J7fZ`6tocvU zN*DknRJ^#M60;OU($sKKg`8_BbeEgrhZHfDEAvOOWxQhM#qX54Xdw(v1Nj5p=WUClh5<7;0&(;t_Ifu}t@H3z|q6 zmB|3+s?X;>s0tR2U;7b1p+MYjKc?PtK{*#(Jz&SmRn4Ws) z012rhEu}y!2R6|36fTnlByFb`V`9ou z0<)fLJ~H8)9DKXRWDS+;&mw8SGA>!d1@rMhm*+{YF0F(4&dplF74zP!nXffJQ;}}0 zNTI;u3eD0P^*KZdz7ddNnKc!w_xm^*#Q{ zo&cbdhrRO9fT3_u*4e)gr&YpTWD+ir2NbOYn6Yqy{TH~m{E^+k1_>Xzq`TZcpac&wz8j#5c{nrp*d#d5Ja;`OlPArTO5}9S<28+8cCz0> zcm`eFndehLzhQw;q`WNk!slwCg})IQcrO;Zf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OUTwz*d=p ze&d~ht~9iVY2RB=rO9EcP9Xla=y(`f^iPR}z8PWXPDGvxWMFZH61Oy&$g>O#2-u|W z3aNFioQb4R9?}@JV5mrry%YA?HqlV?u;u!tsqj|`FGf#~D;xP&(OV?|`naUz@?|U;WLE1O-W#1vFbh=XHU0!hGq}AxQCB>9vvuk9$a#EE?DE@-ZtkLw-iIt03>;M1&7Y2>A0SSPG00#>J a00AQd0RaVF01yBG41m500p{leng9U$oEatn literal 0 HcmV?d00001 diff --git a/makefile b/makefile index bc228a0a..a478c66d 100755 --- a/makefile +++ b/makefile @@ -226,7 +226,6 @@ TESTEXEC3= & pcxtest2.exe UTILEXEC = & palettel.exe & - palllist.exe & palbomb.exe & palettec.exe & ps.exe @@ -303,7 +302,6 @@ vrstest.exe: vrstest.$(OBJ) $(16LIB) gfx.lib $(DOSLIB) palettec.exe: palettec.$(OBJ) $(16LIB) gfx.lib $(DOSLIB) palettel.exe: palettel.$(OBJ) $(16LIB) gfx.lib $(DOSLIB) palbomb.exe: palbomb.$(OBJ) $(16LIB) gfx.lib $(DOSLIB) -palllist.exe: palllist.$(OBJ) $(16LIB) gfx.lib $(DOSLIB) ll.$(OBJ) pcxtest2.exe: pcxtest2.$(OBJ) gfx.lib $(DOSLIB) #planrpcx.exe: planrpcx.$(OBJ) gfx.lib maptest.exe: maptest.$(OBJ) 16_map.$(OBJ) 16_head.$(OBJ) gfx.lib $(DOSLIB) $(16LIB) @@ -334,7 +332,6 @@ pcxtest2.$(OBJ):$(SRC)/pcxtest2.c $(SRCLIB)/16_vl.h palettec.$(OBJ): $(SRC)/palettec.c palettel.$(OBJ): $(SRC)/palettel.c palbomb.$(OBJ): $(SRC)/palbomb.c -palllist.$(OBJ): $(SRC)/palllist.c maptest.$(OBJ):$(SRC)/maptest.c $(SRCLIB)/16_vl.h #emmtest.$(OBJ):$(SRC)/emmtest.c #emsdump.$(OBJ):$(SRC)/emsdump.c @@ -437,7 +434,6 @@ vgmSnd.$(OBJ): $(VGMSNDLIB)/vgmSnd.c $(VGMSNDLIB)/vgmSnd.h #midi.$(OBJ): $(SRCLIB)/midi.c c_utils.$(OBJ): $(MODEXLIB)/c_utils.asm modex.$(OBJ): $(MODEXLIB)/modex.asm -ll.$(OBJ): $(SRCLIB)/ll.c $(SRCLIB)/ll.h bitmapl.$(OBJ): $(SRCLIB)/bitmapl.c $(SRCLIB)/bitmapl.h # diff --git a/src/lib/16_head.c b/src/lib/16_head.c index 4e8d3335..cda97037 100755 --- a/src/lib/16_head.c +++ b/src/lib/16_head.c @@ -324,9 +324,10 @@ _dl=_DL; // 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); printf("cflag: "BYTE_TO_BINARY_PATTERN""BYTE_TO_BINARY_PATTERN"\n", BYTE_TO_BINARY(_cflag>>8), BYTE_TO_BINARY(_cflag)); // printf("cflag: %s\n",(_cflag)); - printf("dx: "NIBBLE_TO_BINARY_PATTERN""NIBBLE_TO_BINARY_PATTERN"\n", NIBBLE_TO_BINARY(_dx>>4), NIBBLE_TO_BINARY(_dx)); #endif + printf("dx: "NIBBLE_TO_BINARY_PATTERN""NIBBLE_TO_BINARY_PATTERN"\n", NIBBLE_TO_BINARY(_dx>>4), NIBBLE_TO_BINARY(_dx)); printf("dx: "BYTE_TO_BINARY_PATTERN""BYTE_TO_BINARY_PATTERN"\n", BYTE_TO_BINARY(_dx>>8), BYTE_TO_BINARY(_dx)); + printf("dx: "WORD_TO_BINARY_PATTERN"\n", WORD_TO_BINARY(_dx)); printf(" ---------------------------------------\n"); #endif diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 888773b9..3b0322b0 100755 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -217,12 +217,35 @@ void regidump(); (byte & 0x02 ? '1' : '0'), \ (byte & 0x01 ? '1' : '0') +#define WORD_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c" +#define WORD_TO_BINARY(word) \ + (word & 0x8000 ? '1' : '0'), \ + (word & 0x4000 ? '1' : '0'), \ + (word & 0x2000 ? '1' : '0'), \ + (word & 0x1000 ? '1' : '0'), \ + (word & 0x0800 ? '1' : '0'), \ + (word & 0x0400 ? '1' : '0'), \ + (word & 0x0200 ? '1' : '0'), \ + (word & 0x0100 ? '1' : '0'), \ + (word & 0x0080 ? '1' : '0'), \ + (word & 0x0040 ? '1' : '0'), \ + (word & 0x0020 ? '1' : '0'), \ + (word & 0x0010 ? '1' : '0'), \ + (word & 0x0008 ? '1' : '0'), \ + (word & 0x0004 ? '1' : '0'), \ + (word & 0x0002 ? '1' : '0'), \ + (word & 0x0001 ? '1' : '0') + #define NIBBLE_TO_BINARY_PATTERN "%c%c%c%c" -#define NIBBLE_TO_BINARY(byte) \ - (byte & 0x08 ? '1' : '0'), \ - (byte & 0x04 ? '1' : '0'), \ - (byte & 0x02 ? '1' : '0'), \ - (byte & 0x01 ? '1' : '0') +#define NIBBLE_TO_BINARY(nibble) \ + (nibble & 0x08 ? '1' : '0'), \ + (nibble & 0x04 ? '1' : '0'), \ + (nibble & 0x02 ? '1' : '0'), \ + (nibble & 0x01 ? '1' : '0') + +#define BOOLEAN_TO_BINARY_PATTERN "%c" +#define BOOLEAN_TO_BINARY(boolean) \ + (boolean & 0x01 ? '1' : '0') #define PRINT_OPAQUE_STRUCT(p) print_mem((p), sizeof(*(p))) diff --git a/src/lib/ll.c b/src/lib/ll.c deleted file mode 100755 index 103388ae..00000000 --- a/src/lib/ll.c +++ /dev/null @@ -1,290 +0,0 @@ -#include "src/lib/ll.h" - -#ifdef OTHERMERGELISTSTIFF -int listLength(node_t * item) -{ - node_t * cur = item; - int size = 0; - - while (cur->next != NULL) - { - ++size; - cur = cur->next; - } - - return size; -} - -void print_list(node_t * head) -{ - node_t * current = head; - - while (current->next != NULL) - { - printf("[%u]= %d\n", current->id, current->val); - current = current->next; - } -} - -void pushe(node_t * head, int val) -{ - node_t * current = head; - current->id = head->id; - current->next->id = current->id+1; - - while (current->next != NULL) - { - current->next->id = current->id; - current = current->next; - current->id++; - } - - // now we can add a new variable - current->next = malloc(sizeof(node_t)); - current->next->val = val; - current->next->next = NULL; - current->next->id++; -} - -void pushs(node_t ** head, int val) -{ - node_t * new_node; - new_node = malloc(sizeof(node_t)); - - new_node->val = val; - new_node->next = *head; - *head = new_node; -} - -int pop(node_t ** head) -{ - int retval = -1; - node_t * next_node = NULL; - - if (*head == NULL) { - return -1; - } - - next_node = (*head)->next; - retval = (*head)->val; - free(*head); - *head = next_node; - - return retval; -} - -int remove_last(node_t * head) -{ - int retval = 0; - node_t * current; - - /* if there is only one item in the list, remove it */ - if (head->next == NULL) { - retval = head->val; - free(head); - return retval; - } - - /* get to the last node in the list */ - current = head; - while (current->next->next != NULL) { - current = current->next; - } - - /* now current points to the last item of the list, so let's remove current->next */ - retval = current->next->val; - free(current->next); - current->next = NULL; - return retval; - -} - -int remove_by_index(node_t ** head, int n) -{ - int i = 0; - int retval = -1; - node_t * current = *head; - node_t * temp_node = NULL; - - if (n == 0) { - return pop(head); - } - - for (i = 0; i < n-1; i++) { - if (current->next == NULL) { - return -1; - } - current = current->next; - } - - temp_node = current->next; - retval = temp_node->val; - current->next = temp_node->next; - free(temp_node); - - return retval; -} -#else -/* Takes two lists sorted in increasing order, and splices - their nodes together to make one big sorted list which - is returned. */ -struct node* SortedMerge(struct node* a, struct node* b) -{ - /* a dummy first node to hang the result on */ - struct node dummy; - - /* tail points to the last result node */ - struct node* tail = &dummy; - - /* so tail->next is the place to add new nodes - to the result. */ - dummy.next = NULL; - while (1) - { - if (a == NULL) - { - /* if either list runs out, use the - other list */ - tail->next = b; - break; - } - else if (b == NULL) - { - tail->next = a; - break; - } - if (a->data <= b->data) - Movenode(&(tail->next), &a); - else - Movenode(&(tail->next), &b); - - tail = tail->next; - } - return(dummy.next); -} - -struct node* LL_merge(struct node* a, struct node* b) -{ - /* a dummy first node to hang the result on */ - struct node dummy; - - /* tail points to the last result node */ - struct node* tail = &dummy; - - /* so tail->next is the place to add new nodes - to the result. */ - dummy.next = NULL; - Movenode(&(tail->next), &a); - a = a->next; - tail = tail->next; - while (1) - { - if (a == NULL) - { - /* if either list runs out, use the - other list */ - tail->next = b; - break; - } - else if (b == NULL) - { - tail->next = a; - break; - } - if (a->data <= b->data) - Movenode(&(tail->next), &a); - else - Movenode(&(tail->next), &b); - - tail = tail->next; - } - return(dummy.next); -} - -/* The function removes duplicates from a sorted list */ -void removeDuplicates(struct node* head) -{ - /* Pointer to traverse the linked list */ - struct node* current = head; - - /* Pointer to store the next pointer of a node to be deleted*/ - struct node* next_next; - - /* do nothing if the list is empty */ - if (current == NULL) - return; - - /* Traverse the list till last node */ - while (current->next != NULL) - { - /* Compare current node with next node */ - if (current->data == current->next->data) - { - /* The sequence of steps is important */ - next_next = current->next->next; - free(current->next); - current->next = next_next; - } - else /* This is tricky: only advance if no deletion */ - { - current = current->next; - } - } -} - -/* UTILITY FUNCTIONS */ -/* Movenode() function takes the node from the front of the - source, and move it to the front of the dest. - It is an error to call this with the source list empty. - - Before calling Movenode(): - source == {1, 2, 3} - dest == {1, 2, 3} - - Affter calling Movenode(): - source == {2, 3} - dest == {1, 1, 2, 3} */ -void Movenode(struct node** destRef, struct node** sourceRef) -{ - /* the front source node */ - struct node* newnode = *sourceRef; - assert(newnode != NULL); - - /* Advance the source pointer */ - *sourceRef = newnode->next; - - /* Link the old dest off the new node */ - newnode->next = *destRef; - - /* Move dest to point to the new node */ - *destRef = newnode; -} - -/* Function to insert a node at the beginging of the - linked list */ -void pushll(struct node** head_ref, int new_data) -{ - /* allocate node */ - struct node* new_node = - (struct node*) malloc(sizeof(struct node)); - - /* put in the data */ - new_node->data = new_data; - - /* link the old list off the new node */ - new_node->next = (*head_ref); - - /* move the head to point to the new node */ - (*head_ref) = new_node; -} - -/* Function to print nodes in a given linked list */ -void printList(struct node *node) -{ - while (node!=NULL) - { - printf("%d ", node->data); - node = node->next; - } -} -#endif diff --git a/src/lib/ll.h b/src/lib/ll.h deleted file mode 100755 index 159aa4ca..00000000 --- a/src/lib/ll.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef __LL_H__ -#define __LL_H__ -#include -#include -#include -#include "src/lib/16_tail.h" - -//#define OTHERMERGELISTSTIFF - -/* Link list node_t */ -typedef struct node -{ - struct node *prev; - rgb_t d; - int data; - struct node *next; - word id; -} node_t; - -#ifdef OTHERMERGELISTSTIFF -int listLength(node_t * item); -void print_list(node_t * head); -void pushe(node_t * head, int val); -void pushs(node_t ** head, int val); -int pop(node_t ** head); -int remove_last(node_t * head); -int remove_by_index(node_t ** head, int n); -#else -/* pull off the front node of the source and put it in dest */ -void Movenode(struct node** destRef, struct node** sourceRef); -struct node* SortedMerge(struct node* a, struct node* b); -struct node* LL_merge(struct node* a, struct node* b); -void pushll(struct node** head_ref, int new_data); -void printList(struct node *node); -void removeDuplicates(struct node* head); -#endif - -#endif diff --git a/src/pallist.txt b/src/pallist.txt new file mode 100755 index 00000000..69b30c3f --- /dev/null +++ b/src/pallist.txt @@ -0,0 +1,38 @@ +/* + * palllist experiment + */ +/* + * An experiment where I make 2 small linked list which points to 2 arrays + * one is the "hardware palette" array + * the other is "image palette" array + * and their respectable pointers point to their [i] stuff + * + * the palette updater stuff i want to make is this: + * + * VGA IMG + * 1- 2- + * 2- 4- + * 3- 0- + * 4- 9- + * 5- 0-(I will figure this out later if there is dup numbs) + * 6- + * 7- + * 8- + * + * MERGE THEM INTO + * + * VGA + * 1- + * 2->IMG[0] + * 3- + * 4->IMG[1] + * 5 + * 6 + * 7 + * 8 + * 9->IMG[3] + * 0->IMG[2]->IMG[4] + * + * i am going to work on a really big area of code it will be on the refresh system, the walking/scrolling system, things that use showpage, adding disableing 8087 functions if no 8087 detected, and a bunch of other things i cannot remember off the top of my head because i am BURNT. I need a small break~ -- -- -- -- update! i am working on this i made ZC_WALK and i am going to move to VRL/VRS soon! . + * ==== PRE SHOWPAGE TO SHOWMV CONVERSION ==== i am going to work on a really big area of code it will be on the refresh system, the walking/scrolling system, things that use showpage, adding disableing 8087 functions if no 8087 detected, and a bunch of other things i cannot remember off the top of my head because i am BURNT. I need a small break~ -- -- -- -- update! i am working on this i made ZC_WALK and i am going to move to VRL/VRS soon! + */ diff --git a/src/palllist.c b/src/palllist.c deleted file mode 100755 index e9367545..00000000 --- a/src/palllist.c +++ /dev/null @@ -1,182 +0,0 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2018 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover - * - * This file is part of Project 16. - * - * Project 16 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Project 16 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see , or - * write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -/* - * palllist experiment - */ -/* - * An experiment where I make 2 small linked list which points to 2 arrays - * one is the "hardware palette" array - * the other is "image palette" array - * and their respectable pointers point to their [i] stuff - * - * the palette updater stuff i want to make is this: - * - * VGA IMG - * 1- 2- - * 2- 4- - * 3- 0- - * 4- 9- - * 5- 0-(I will figure this out later if there is dup numbs) - * 6- - * 7- - * 8- - * - * MERGE THEM INTO - * - * VGA - * 1- - * 2->IMG[0] - * 3- - * 4->IMG[1] - * 5 - * 6 - * 7 - * 8 - * 9->IMG[3] - * 0->IMG[2]->IMG[4] - * - * i am going to work on a really big area of code it will be on the refresh system, the walking/scrolling system, things that use showpage, adding disableing 8087 functions if no 8087 detected, and a bunch of other things i cannot remember off the top of my head because i am BURNT. I need a small break~ -- -- -- -- update! i am working on this i made ZC_WALK and i am going to move to VRL/VRS soon! . - * ==== PRE SHOWPAGE TO SHOWMV CONVERSION ==== i am going to work on a really big area of code it will be on the refresh system, the walking/scrolling system, things that use showpage, adding disableing 8087 functions if no 8087 detected, and a bunch of other things i cannot remember off the top of my head because i am BURNT. I need a small break~ -- -- -- -- update! i am working on this i made ZC_WALK and i am going to move to VRL/VRS soon! - */ -#include "src/lib/ll.h" - -#if 0 -//def OTHERMERGELISTSTIFF - -void -main(int argc, char *argv[]) -{ - int i; - node_t * vga = NULL; node_t * imgpal = NULL; - vga = malloc(sizeof(node_t)); imgpal = malloc(sizeof(node_t)); - vga->val = 24; imgpal->val = 9; - vga->next=NULL; imgpal->next=NULL; - vga->id=0; imgpal->id=0; - - printf(" "); - for(i=1; i<= - //PAL_SIZE - 6 - ; i++) - { - if(!(i%3)) printf("\n "); - printf("%d,", i); - pushe(vga, i); - } - - printf("\n\n "); - - for(i=4; i>0; i--) - { - if(!(i%3)) printf("\n "); - printf("%d,", i); - pushe(imgpal, i); - } - printf("\n"); - - printf("size of vga = %d\n", listLength(vga)); -//#if 0 - printf("\n=======================\n"); - printf("vga list printings\n=======================\n"); - print_list(vga); - printf("\n=======================\n"); - printf("imgpal list printings\n=======================\n"); - print_list(imgpal); -// printf("\n=======================\n"); -//#endif - i=1;//skip overscan - while(i!=listLength(imgpal)) - { - - } - free(vga); - free(imgpal); -} -#else -#if 0 -/* C/C++ program to merge two sorted linked lists */ -// from http://www.geeksforgeeks.org/merge-two-sorted-linked-lists/ - -/* Drier program to test above functions*/ -void main() -{ - /* Start with the empty list */ - struct node* res = NULL; - struct node* a = NULL; - struct node* b = NULL; - - /* Let us create two sorted linked lists to test - the functions - Created lists, a: 5->10->15, b: 2->3->20 */ - pushll(&a, 15); - pushll(&a, 10); - pushll(&a, 4); - pushll(&a, 3); - pushll(&a, 2); - pushll(&a, 1); - pushll(&a, 0); - - pushll(&b, 20); - pushll(&b, 3); - pushll(&b, 2); - pushll(&b, 4); - - printf("\n"); - printf("The 2 Linked List are: \n"); - printList(a); printf("\n"); - printList(b); printf("\n"); - - /* Remove duplicates from linked list */ - res = SortedMerge(a, b); -// res = LL_merge(a, b); - - printf("Merged Linked List is: \n"); - printList(res); -} -#endif -/* C Program to remove duplicates from a sorted linked list */ - -/* Drier program to test above functions*/ -void main() -{ - /* Start with the empty list */ - struct node* head = NULL; - - /* Let us create a sorted linked list to test the functions - Created linked list will be 11->11->11->13->13->20 */ - pushll(&head, 20); - pushll(&head, 13); - pushll(&head, 13); - pushll(&head, 11); - pushll(&head, 11); - pushll(&head, 11); - - printf("\n Linked list before duplicate removal "); - printList(head); - - /* Remove duplicates from linked list */ - removeDuplicates(head); - - printf("\n Linked list after duplicate removal "); - printList(head); -} -#endif -- 2.11.0