Show Posts
Pages: 1 [2] 3 4 ... 139
16  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 05, 2014, 03:54:29 am
I ran it on pic32mx Fubarino o'clocked 120MHz (compiled with chipkit's compiler, USB serial com), and the below trigo test took about 10secs (C64 V2 ROM). I only read the first half of the bottom line to eliminate video. So it seems there is an issue somewhere (provided mips is ~20% faster than arm and my clock is 30% more yours)  smiley For example, if you do not switch CapsLock on, it returns in 1 sec as it does not run the code (the code is empty).. smiley Unless the mips compiler is a crap I would estimate 19.9 secs for your code in the DUE..

PS: The test for reference:
Code:
5  REM PITO'S TRIGONOMETRIC FUNCTIONS TEST 0..89 DEGREE
6  REM FOR C64 V2 BASIC ROMS
7  REM BASED ON WELLKNOWN "9 DEGREE" CALC FORENSIC TEST
8  REM ASIN(ACOS(ATAN(TAN(COS(SIN(9.0)))))) = 9.0 IN DEGREE
10 PH = 3.1415926536/2.0
15 REM DEFINE ARCSIN AND ARCCOS
20 DEF FN ASN(X) = ATN(X/SQR(1.0-X*X))
30 DEF FN ACS(X) = PH-ATN(X/SQR(1.0-X*X))
35 REM TR, TD - TO RAD, TO DEG
40 TR = 3.1415926536 / 180.0
50 TD = 180.0 / 3.1415926536
55 REM INPUT IN DEGREE (0..89)
60 FOR D = 0 TO 89
70 T = SIN(TR*D)
72 T = COS(TR*T)
74 T = TAN(TR*T)
76 T = TD*ATN(T)
80 T = TD*FN ACS(T)
90 T = TD*FN ASN(T)
100 PRINT D; "="; T; " DELTA="; T-D
110 NEXT D
120 END

Code:
READY.
RUN
 0 = .0708403071  DELTA= .0708403071
 1 = 1.00188405  DELTA= 1.88405439E-03
 2 = 2.00156704  DELTA= 1.56704057E-03
 3 = 3.00102166  DELTA= 1.02166273E-03
 4 = 4.00055188  DELTA= 5.51875681E-04
 5 = 5.00046232  DELTA= 4.62317839E-04
 6 = 5.99979405  DELTA=-2.05950812E-04
 7 = 6.99975351  DELTA=-2.46489421E-04
 8 = 8.00046608  DELTA= 4.6607852E-04
 9 = 9.00044075  DELTA= 4.40750271E-04
 10 = 10.0001669  DELTA= 1.66922808E-04
..
 84 = 83.9999204  DELTA=-7.96020031E-05
 85 = 85.0002601  DELTA= 2.60084868E-04
 86 = 86.0004052  DELTA= 4.05162573E-04
 87 = 87.0003106  DELTA= 3.10570002E-04
 88 = 88.0004901  DELTA= 4.90099192E-04
 89 = 89.0023091  DELTA= 2.30902433E-03

READY.
17  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 04, 2014, 05:08:09 am
And your program completes in 1.5 seconds on the emulator running on the DUE smiley
Hard to believe smiley
18  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 04:32:34 pm
I don't know what you want to measure?
People might be interested to see how the cpu.c emulator performs with avr, CM0, CMO+, CM3, CM4, pic32MX, pic32MZ, etc.. compiled with X, Y, Z compilers..  So when they want start to measure the enhBasic running a benchmark is the good option..
19  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 04:19:22 pm
When you need to compare architectures/compilers running the cpu.c emulator then the best option is to use the enhBasic as it communicates via Serial only. So the error related to the communication with the emulated system (with Basic) is small.
The C64 rom communicates via video stream, where the stream takes a lot of time in comparison to the time spent in the emulator. That issue is the same for my Terminal printing, as well as for your tft video emulation.
20  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 04:03:31 pm
Unless some tricks applied I cannot do it easily with C64 as when I stop the video I cannot see the test has finished smiley
With enhBasic you may print start/stop and measure the elapsed time. No video buffer needs to be read.
21  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 03:50:45 pm
I cannot compare that under C64 even when run on both systems, as the video (not related to the emulation) messes heavily the results up..
The enhBasic is good for benchmarking (of the emulation speed) on various systems as the serial i/o there does not interfere too much.
22  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 03:41:00 pm
It does not matter because both benchmarks were done under enhBasic.  1284p mighty 84secs, second system 8.1secs.
There is serial i/o in enhBasic, so the video does not interfere into the measurement..
23  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 03:29:44 pm
I ran the enhBasic with above trigonometric test under arduino @16MHz (no video mess) and it took 84secs/
Then I ran it under the second system (also the enhBasic,no video mess) and it did it in 8.1sec. So my understanding is the second system's emulation speed  is ~10x faster than the arduino @16MHz - based on your info it means 6MHz.
I doubt DUE can do that such fast..
24  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 03:14:45 pm
I think the 100 in the 6502exec is not about "delays", but it says "do 100 6502 instructions before returning from 6502exec".
With 1 it will do a single 6502 instruction, then it returns. So the higher number there the more time it spends in 6502 emulation..
Also, I think there must be a function which offers a char at a specific ram address to be printed into video ram..
Finding that point I can get rid of the video mess and hook the stuff similarly as the enhBasic does..
25  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 02:59:13 pm
This takes 4.5sec on my system:
Code:
10 FOR I = 1 TO 10000
20 NEXT I
READY.
RUN

That makes 10000/4500*1MHz or a 2.2MHz 6502 smiley
But that is with exec6502(100); inside the "video and input loop" sending 1000bytes of video @115k2 continuously. So it must be much higher speed than the 2.2MHz. How to measure it then??.
26  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 02:26:00 pm
This takes 4.5sec on my system:
Code:
10 FOR I = 1 TO 10000
20 NEXT I
READY.
RUN
27  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 03, 2014, 01:20:15 pm
The C64 has an 6510 inside. So we need to enhance the emulator somehow smiley
Try to run this on the DUE, how long does it take..
Code:
5  REM TRIGONOMETRIC FUNCTIONS TEST 0..89 DEGREE
10 PH = 3.141592653/2.0
15 REM DEFINE ARCSIN AND ARCCOS
20 DEF FN ASN(X) = ATN(X/SQR(1.0-X*X))
30 DEF FN ACS(X) = PH-ATN(X/SQR(1.0-X*X))
35 REM TR, TD - TO RAD, TO DEG
40 TR = 3.141592653 / 180.0
50 TD = 180.0 / 3.141592653
55 REM INPUT IN DEGREE (1..89)
60 FOR D = 0 TO 89
70 T = SIN(TR*D)
72 T = COS(TR*T)
74 T = TAN(TR*T)
76 T = TD*ATN(T)
80 T = TD*FN ACS(T)
90 T = TD*FN ASN(T)
100 PRINT D; "="; T; " DELTA="; T-D
110 NEXT D
120 END
28  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 04:55:10 pm
It's not a good way to continuously rewrite the whole screen.
Causes a lot of data to be transmitted.
..
Yea, sending deltas only will do better.. But nice to see it works. And faster than the original.. smiley
29  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 04:07:58 pm
It works, but I would prefer a standard i/o.. smiley
PS: you may see a snip of the screen does not work properly as it continuously rewrites it (see the line with "4")..
30  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 03:52:10 pm
Code:
void loop () {

  int v_address = 0;
  Serial.write(27);   // Move to Home
  Serial.write("[H");
  
  for (int y=0;y<25;y++) {
    for (int x=0;x<40;x++) {
      exec6502(100);
      if (Serial.available()) {
     curkey = Serial.read() & 0x7F;
   RAM[198]=1;
   RAM[631]=curkey;
  }
     unsigned char petscii=VRAM[v_address++];
     if (petscii<32) petscii=petscii+64;
     Serial.write(petscii);
    }
    Serial.write(13);
    Serial.write(10);
  }
}

Pages: 1 [2] 3 4 ... 139