mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Rename
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "utils.h"
|
#include "disassembler_utils.h"
|
||||||
#include "disassembler.h"
|
#include "disassembler.h"
|
||||||
|
|
||||||
#define SPC(n) printf("%.*s", n, "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |");
|
#define SPC(n) printf("%.*s", n, "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |");
|
||||||
@@ -471,7 +471,7 @@ static void dis_read_interpreter_sections(dis_program_t **prg, uint32_t *pc, uin
|
|||||||
printf("%d ", index);
|
printf("%d ", index);
|
||||||
LIT_ADD(DIS_LITERAL_NULL, literal_type, literal_count);
|
LIT_ADD(DIS_LITERAL_NULL, literal_type, literal_count);
|
||||||
if (!(i % 15) && i != 0) {
|
if (!(i % 15) && i != 0) {
|
||||||
printf(" \\\n");
|
printf("\\\n");
|
||||||
if (!alt_fmt) {
|
if (!alt_fmt) {
|
||||||
SPC(spaces);
|
SPC(spaces);
|
||||||
printf("| | ");
|
printf("| | ");
|
||||||
@@ -509,7 +509,7 @@ static void dis_read_interpreter_sections(dis_program_t **prg, uint32_t *pc, uin
|
|||||||
printf("%d,%d ", key, val);
|
printf("%d,%d ", key, val);
|
||||||
|
|
||||||
if (!(i % 5) && i != 0) {
|
if (!(i % 5) && i != 0) {
|
||||||
printf(" \\\n");
|
printf("\\\n");
|
||||||
if (!alt_fmt) {
|
if (!alt_fmt) {
|
||||||
SPC(spaces);
|
SPC(spaces);
|
||||||
printf("| | ");
|
printf("| | ");
|
||||||
@@ -584,7 +584,7 @@ static void dis_read_interpreter_sections(dis_program_t **prg, uint32_t *pc, uin
|
|||||||
printf("| | ");
|
printf("| | ");
|
||||||
printf("\n ( subtype: [%d, %d] )", kt, vt);
|
printf("\n ( subtype: [%d, %d] )", kt, vt);
|
||||||
} else
|
} else
|
||||||
printf(" SUBTYPE %d, %d", kt, vt);
|
printf(" SUBTYPE %d,%d", kt, vt);
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
} else
|
} else
|
||||||
@@ -681,7 +681,7 @@ static void dis_read_interpreter_sections(dis_program_t **prg, uint32_t *pc, uin
|
|||||||
strcpy(fun->fun, tree_local);
|
strcpy(fun->fun, tree_local);
|
||||||
fun->start = fpc_start;
|
fun->start = fpc_start;
|
||||||
fun->len = fpc_end;
|
fun->len = fpc_end;
|
||||||
enqueue((void*) fun);
|
disassembler_enqueue((void*) fun);
|
||||||
}
|
}
|
||||||
|
|
||||||
fcnt++;
|
fcnt++;
|
||||||
@@ -737,13 +737,13 @@ void disassemble(const char *filename, bool alt_fmt) {
|
|||||||
|
|
||||||
if (alt_fmt) {
|
if (alt_fmt) {
|
||||||
while (queue_front != NULL) {
|
while (queue_front != NULL) {
|
||||||
fun_code_t *fun = (fun_code_t*) front();
|
fun_code_t *fun = (fun_code_t*) disassembler_front();
|
||||||
printf("\nFUN_%s:", fun->fun);
|
printf("\nFUN_%s:", fun->fun);
|
||||||
free(fun->fun);
|
free(fun->fun);
|
||||||
|
|
||||||
dis_disassemble_section(&prg, fun->start, fun->len, 0, true, alt_fmt);
|
dis_disassemble_section(&prg, fun->start, fun->len, 0, true, alt_fmt);
|
||||||
|
|
||||||
dequeue();
|
disassembler_dequeue();
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,14 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
|
|
||||||
#include "utils.h"
|
#include "disassembler_utils.h"
|
||||||
|
|
||||||
struct Node *queue_front, *queue_rear;
|
struct disassembler_node_s *queue_front, *queue_rear;
|
||||||
|
|
||||||
void enqueue(void *x) {
|
void disassembler_enqueue(void *x) {
|
||||||
struct Node *temp;
|
struct disassembler_node_s *temp;
|
||||||
|
|
||||||
temp = (struct Node*) malloc(sizeof(struct Node));
|
temp = (struct disassembler_node_s*) malloc(sizeof(struct disassembler_node_s));
|
||||||
temp->data = x;
|
temp->data = x;
|
||||||
temp->next = NULL;
|
temp->next = NULL;
|
||||||
|
|
||||||
@@ -30,8 +30,8 @@ void enqueue(void *x) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dequeue(void) {
|
void disassembler_dequeue(void) {
|
||||||
struct Node *temp = queue_front;
|
struct disassembler_node_s *temp = queue_front;
|
||||||
|
|
||||||
if (queue_front == NULL) {
|
if (queue_front == NULL) {
|
||||||
printf("Error : QUEUE is empty!!");
|
printf("Error : QUEUE is empty!!");
|
||||||
@@ -47,6 +47,6 @@ void dequeue(void) {
|
|||||||
free(temp);
|
free(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* front(void) {
|
void* disassembler_front(void) {
|
||||||
return queue_front->data;
|
return queue_front->data;
|
||||||
}
|
}
|
||||||
@@ -10,15 +10,15 @@
|
|||||||
#ifndef UTILS_H_
|
#ifndef UTILS_H_
|
||||||
#define UTILS_H_
|
#define UTILS_H_
|
||||||
|
|
||||||
struct Node {
|
struct disassembler_node_s {
|
||||||
void *data;
|
void *data;
|
||||||
struct Node *next;
|
struct disassembler_node_s *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct Node *queue_front, *queue_rear;
|
extern struct disassembler_node_s *queue_front, *queue_rear;
|
||||||
|
|
||||||
void enqueue(void *x);
|
void disassembler_enqueue(void *x);
|
||||||
void dequeue(void);
|
void disassembler_dequeue(void);
|
||||||
void* front(void);
|
void* disassembler_front(void);
|
||||||
|
|
||||||
#endif /* UTILS_H_ */
|
#endif /* UTILS_H_ */
|
||||||
Reference in New Issue
Block a user