1
0
mirror of https://github.com/mist64/perfect6502.git synced 2024-06-08 12:29:28 +00:00
This commit is contained in:
ChrisCoxArt 2021-09-28 20:28:18 -07:00
parent 3ac5525216
commit ca293b3783
3 changed files with 11 additions and 14 deletions

View File

@ -4,6 +4,7 @@
#include "runtime_init.h"
#include <time.h>
/*
See https://www.c64-wiki.com/wiki/C64-Commands
@ -14,11 +15,11 @@ RUN
Intel Xeon 3.4 Ghz
original speed: 19611 to 19677 steps per second
original memory usage: 21.4 MB
original speed: 19677 steps per second
original memory usage: 18.8 MB
current speed: 20578 to 20834 steps per second
current memory usage: 3.5 MB
current speed: 20834 steps per second
current memory usage: 1.1 MB
*/
@ -44,11 +45,13 @@ main()
handle_monitor(state);
// chipStatus(state);
/*
if ( (cycle % 20000) == 0 ) {
end_time = clock();
double time = (end_time - start_time)/ (double)(CLOCKS_PER_SEC);
double speed = cycle / time;
printf("cycle %u, speed %g steps per second\n", cycle, speed);
}
*/
};
}

View File

@ -499,14 +499,8 @@ add_nodes_left_dependant(state_t *state, nodenum_t a, nodenum_t b)
block_gate_size = 3239
block_dep_size = 7260
Memory used in debugger
Previous total mem = 25 MB 19611 steps/sec
block dependents - 9.5 MB 20760 steps/sec
block nodes - 3.6 MB 20672 steps/sec
Working set = 207 KB allocations, 220 KB binary, plus system libs
= 1.1 MB in release build
*/
state_t *
setupNodesAndTransistors(netlist_transdefs *transdefs, BOOL *node_is_pullup, nodenum_t nodes, nodenum_t transistors, nodenum_t vss, nodenum_t vcc)
@ -628,7 +622,7 @@ setupNodesAndTransistors(netlist_transdefs *transdefs, BOOL *node_is_pullup, nod
state->node_block = block_gate;
/* Assign pointer from our larger block, using only counts needed
TODO: ccox - make this use offsets like the c1c2 list?????
TODO: ccox - should this use offsets like the c1c2 list?????
*/
state->nodes_gates = malloc(nodes * sizeof(*state->nodes_gates));
for (i = 0; i < state->nodes; i++) {
@ -680,7 +674,7 @@ TODO: ccox - make this use offsets like the c1c2 list?????
state->dependent_block = block_dep;
/* Assign pointers from our larger block, using only counts needed
TODO: ccox - make this use offsets like the c1c2 list?????
TODO: ccox - should this use offsets like the c1c2 list?????
*/
state->nodes_dependant = malloc(nodes * sizeof(*state->nodes_dependant));
for (i = 0; i < state->nodes; i++) {

View File

@ -145,7 +145,7 @@ handleMemory(void *state)
*
************************************************************/
unsigned int cycle;
unsigned long cycle;
void
step(void *state)
@ -218,7 +218,7 @@ chipStatus(void *state)
uint8_t d = readDataBus(state);
BOOL r_w = isNodeHigh(state, rw);
printf("halfcyc:%d phi0:%d AB:%04X D:%02X RnW:%d PC:%04X A:%02X X:%02X Y:%02X SP:%02X P:%02X IR:%02X",
printf("halfcyc:%ld phi0:%d AB:%04X D:%02X RnW:%d PC:%04X A:%02X X:%02X Y:%02X SP:%02X P:%02X IR:%02X",
cycle,
clk,
a,