Show Posts
Pages: 1 2 [3] 4 5 ... 139
31  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 01:49:04 pm
Ok, it seems it boots:
Code:
void loop () {
//  exec6502(100); //if timing is enabled, this value is in 6502 clock ticks. otherwise, simply instruction count.
//  if (Serial.available()) {
//    curkey = Serial.read() & 0x7F;
//  }
//}
  int address = 0;
  for (int y=0;y<25;y++) {
    for (int x=0;x<40;x++) {
      exec6502(100);
     unsigned char petscii=VRAM[address++];
     if (petscii<32) {
      petscii=petscii+64;
     }
     Serial.write(petscii);
    }
    Serial.println();
  }
}
32  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 12:58:38 pm
I was the Atari520 user at that time, so no idea how the C64 works smiley
33  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 12:55:39 pm
Ok, thanks, so I need to think about a new i/o code..
34  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 12:49:59 pm
Can you explain, plz?
Does it mean the C64 has no i/o similar to enhBasic but I have to use the output from videoram?
35  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 12:42:49 pm
No luck yet. I've tried with 65536 ramsize, and 30000 ramsize. I have got 128kB ram so no problem.
The ehBasic boots and works fine with 49k ramsize.
I did only the changes above..
Maybe the i/o addresses differ..
36  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 12:06:53 pm
Ok, I converted the rom and changed to (I am not using the video version yet):
Code:
uint8_t read6502(uint16_t address) {
  uint8_t tempval = 0;

  if (address == 0xF004) { //EhBASIC simulated ASIC input
    tempval = getkey();
    clearkey();
    return(tempval);
  }

  if ((address >= 0xA000)&&(address < 0xC000)) return BIOS[(address - 0xA000)];
  if (address >= 0xE000) return BIOS[(address - 0xC000)];
  if ((address >= 0xD000)&&(address < 0xD800)) return(0);
  if (address < RAM_SIZE) return(RAM[address]);  

}

void write6502(uint16_t address, uint8_t value) {
  if (address < RAM_SIZE) RAM[address] = value;
  if (address == 0xF001) { //EhBASIC simulated ASIC output
    serout(value);
  }
}

37  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 11:51:26 am
Do we still need the
Code:
prog_uchar BIOStop[256] PROGMEM = {....
stuff there?
38  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 11:10:40 am
So in order to run c64 v2 I need Basic and kernal roms, and I need to convert  them into the "source format". I guess I need to change the addresses in the cpu.c as well (I am using the original code without the display stuff..). Are there any other changes needed?
39  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 05:55:19 am
The enhanced basic 2.22 has only 6digits fp - that is a..  smiley-roll
I've just tried the "**** COMMODORE 64 BASIC V2 **** " (the "dos" version) and it has got 9 digits precision, what is _much_ better stuff..
Is there a chance to load that rom from somewhere??
40  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: June 30, 2014, 10:14:49 am
Who is complaining the emulator is slow??
This is calculated (and printed out @115k2) in 8.07 seconds:
Code:
6502 EhBASIC [C]old/[W]arm ?

Memory size ?

31231 Bytes free

Enhanced BASIC 2.22

Ready
5  REM TRIGONOMETRIC FUNCTIONS TEST 1..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 = 1 TO 89
70 R = D * TR
80 S = FN ASN(FN ACS(ATN(TAN(COS(SIN(R))))))
90 T = S * TD
100 PRINT T; " "; D; " "; T-D; " "; FRE(1)
110 NEXT D
120 END

RUN
 .999995  1 -4.52995E-06  30753
 2.00008  2  8.39233E-05  30753
 2.99996  3 -4.50611E-05  30753
 3.99999  4 -1.26362E-05  30753
 4.99997  5 -2.95639E-05  30753
 5.99996  6 -4.52995E-05  30753
 6.99998  7 -2.43187E-05  30753
 7.99999  8 -9.53674E-06  30753
 8.99998  9 -1.90735E-05  30753
 9.99994  10 -5.62668E-05  30753
..
 87.0002  87  1.75476E-04  30753
 87.9999  88 -6.86646E-05  30753
 89.0001  89  5.34058E-05  30753

Cool!  smiley-wink
41  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: June 30, 2014, 05:01:33 am
Nice project! Congratulation!

I took the source from the first post and compiled for the 1284p mighty. I changed the RAM_SIZE to 10000 in cpu.c.
It compiles and I get
Code:
6502 EhBASIC [C]old/[W]arm ?

Memory size ?
in my terminal.
Sorry for my naive question - what needs to be done next? When I enter a number (or I just press enter) I see nothing.. smiley

PS: I've changed to TeraTerm terminal and it seems it works:
Code:
6502 EhBASIC [C]old/[W]arm ?

Memory size ?

9231 Bytes free

Enhanced BASIC 2.22

Ready
42  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 29, 2014, 04:43:33 am
Quote
Starting read test.  Please wait up to a minute
Read 4261.15 KB/sec
That is  only 19% overhead @42MHz SPI clock. Nice!
43  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 29, 2014, 03:17:18 am
Quote
With these subsidized Evaluation Boards from Chip vendors, it's a lot harder to get that 'feel' for end product cost
The nucleo boards must not be "subsidized".. All the boards are the same, as the chips have the same pinout. So they produce 9 variants of nucleo boards on the same pcb. The price of the 2 chips used is "not known" as it comes from STM (that could be called "subsidizing"). With 50k-100k boards from each variant they may do a profit, indeed..
PS: there was a discussion whether the Discovery boards are subsidized, an insider indicated they are not..
PS1: the chip vendors follow a "what the market will bear" strategy when pricing the chips. Internally they cost them "at costs". That is a huge difference of course. Moreover, for such demo boards they may use chips coming from batches which are a little bit off certain parameters.
PS2: my rough estimate: the development costs of a stm32F401 mcu could be $300k, fab preparation $200k, and the production costs of a single smd packaged chip about 50cents (rather conservative estimate, it could be less). They sell it to distributors and large volume clients for $3 a piece in an average (10k quantities). So they break even when they sell 200k chips.. It seems to me to put 10.000 chips into a nucleo board "at cost" may not ruin their business case.. smiley
44  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 28, 2014, 04:49:58 pm
Long time back I did experiments with SDIO on the F407 (@168MHz)under chibios and 5MB/sec was easy to get with 32kB blocks. My experiments were suboptimal, so I guess you may get 4-5MB/sec@84MHz..
45  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 28, 2014, 02:40:47 pm
What is your SPI clock?
Pages: 1 2 [3] 4 5 ... 139