mirror of
https://github.com/mist64/perfect6502.git
synced 2025-01-22 16:32:51 +00:00
cleanup: moved cbmbasic and apple1basic demos into subdirectories
* also changed "clang" to "cc" * enabled optimizations for 64 bit (it's 10 years later!) * updated README to reflect CPU speed in 2020 (5x faster than 2014!) * added benchmarking instructions to README
This commit is contained in:
parent
cb5469d7c3
commit
3e60b6dd44
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -1,4 +0,0 @@
|
||||
* text=auto
|
||||
*.js text
|
||||
*.css text
|
||||
*.html text
|
8
Makefile
8
Makefile
@ -1,14 +1,14 @@
|
||||
OBJS=perfect6502.o netlist_sim.o
|
||||
OBJS+=cbmbasic.o runtime.o runtime_init.o plugin.o console.o emu.o
|
||||
OBJS+=cbmbasic/cbmbasic.o cbmbasic/runtime.o cbmbasic/runtime_init.o cbmbasic/plugin.o cbmbasic/console.o cbmbasic/emu.o
|
||||
#OBJS+=measure.o
|
||||
CFLAGS=-Werror -Wall -O3
|
||||
CC=clang
|
||||
CC=cc
|
||||
|
||||
all: cbmbasic
|
||||
|
||||
cbmbasic: $(OBJS)
|
||||
$(CC) -o cbmbasic $(OBJS)
|
||||
$(CC) -o cbmbasic/cbmbasic $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) cbmbasic
|
||||
rm -f $(OBJS) cbmbasic/cbmbasic
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
OBJS=perfect6502.o apple1basic.o
|
||||
OBJS=perfect6502.o apple1basic/apple1basic.o
|
||||
CFLAGS=-Werror -Wall -O3
|
||||
CC=clang
|
||||
CC=cc
|
||||
|
||||
all: apple1basic
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
Consequently, *perfect6502* is
|
||||
* *perfect*: It is not a reimplementation of the 6502, but a simulation of the original transistors. Its complete behavior, its internal state and its outputs are half-cycle exact.
|
||||
* *slow*: Even though *perfect6502* is highly optimized C code, achieves only 1/150 of the speed of a 1 MHz 6502 on a high-end CPU of 2014.
|
||||
* *slow*: Even though *perfect6502* is highly optimized C code, achieves only 1/30 of the speed of a 1 MHz 6502 on a high-end CPU of 2020.
|
||||
|
||||
*perfect6502* is useful for
|
||||
* understanding and reverse engineering the 6502
|
||||
@ -20,7 +20,7 @@ You can compile the project with
|
||||
|
||||
and run it with
|
||||
|
||||
$ ./cbmbasic
|
||||
$ cbmbasic/cbmbasic
|
||||
|
||||
You should get the following output:
|
||||
|
||||
@ -30,6 +30,10 @@ You should get the following output:
|
||||
|
||||
READY.
|
||||
|
||||
## Benchmarking
|
||||
|
||||
You can use the UNIX `time` tool to measure the performance of the emulator. Run `time cbmbasic/cbmbasic` and press Ctrl+C once it has reached `READY.` – the "user" time is the effective time that was required to reach character input. On a 1 MHz 6502, this takes 0.05 sec.
|
||||
|
||||
# Credits
|
||||
|
||||
*perfect6502* is is written by [Michael Steil](http://www.pagetable.com/) and derived from the JavaScript [visual6502](https://github.com/trebonian/visual6502) implementation by Greg James, Brian Silverman and Barry Silverman.
|
||||
|
@ -2,7 +2,7 @@
|
||||
#ifndef _WIN32
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "perfect6502.h"
|
||||
#include "../perfect6502.h"
|
||||
|
||||
/************************************************************
|
||||
*
|
@ -1,4 +1,4 @@
|
||||
#include "perfect6502.h"
|
||||
#include "../perfect6502.h"
|
||||
#include "runtime.h"
|
||||
#include "runtime_init.h"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "perfect6502.h"
|
||||
#include "../perfect6502.h"
|
||||
/* XXX hook up memory[] with RAM[] in runtime.c */
|
||||
|
||||
/************************************************************
|
||||
@ -20,7 +20,7 @@ void
|
||||
init_monitor()
|
||||
{
|
||||
FILE *f;
|
||||
f = fopen("cbmbasic.bin", "r");
|
||||
f = fopen("cbmbasic/cbmbasic.bin", "r");
|
||||
fread(memory + 0xA000, 1, 17591, f);
|
||||
fclose(f);
|
||||
|
@ -42,7 +42,7 @@ typedef uint16_t count_t;
|
||||
*
|
||||
************************************************************/
|
||||
|
||||
#if 0 /* faster on 64 bit CPUs */
|
||||
#if 1 /* faster on 64 bit CPUs */
|
||||
typedef unsigned long long bitmap_t;
|
||||
#define BITMAP_SHIFT 6
|
||||
#define BITMAP_MASK 63
|
||||
|
Loading…
x
Reference in New Issue
Block a user