Go Down

Topic: Arduino 6502 emulator + BASIC interpreter (Read 116196 times) previous topic - next topic

janost

Me like! :)

For a much simpler and cheaper display, buy a $3 TFT screen on eBay and use it to emulate the LED-display.

janost

#46
Jun 29, 2014, 03:06 am Last Edit: Jun 29, 2014, 05:12 pm by janost Reason: 1
Get me the memorymap, Ray ,and some ROM dumps and I'll put together a CBM PET?
I love those 6502 machines.

This is fun stuff.

mrburnette

#47
Jun 29, 2014, 11:32 pm Last Edit: Jun 29, 2014, 11:34 pm by mrburnette Reason: 1

Get me the memorymap, Ray ,and some ROM dumps and I'll put together a CBM PET?
I love those 6502 machines.

This is fun stuff.



The P.E.T. has some age on her, I hate to pull the ROMS, but will unless I can find the listings online.

I also have an Apple collection, Apple ][ Plus w/ Integer card & CPM card (2) machines, and all 6 of the first Macintosh b/w series units (yes, that is a 128 original next to the Fat Mac!).  Somewhere off to the right out of frame is an Osborne I CPM dual-floopy unit.

Back at one time, I had them all refurbished and they performed flawlessly, but these days I cannot find time for them.  Wish I could find 'em a good home.

Ray

retrolefty

What, no Kaypro. They were built like the proverbial brick shit house, weighed a ton.

http://oldcomputers.net/pics/kayproii.jpg

mrburnette


What, no Kaypro. They were built like the proverbial brick shit house, weighed a ton.

http://oldcomputers.net/pics/kayproii.jpg


Yep  I do remember and came very close to buying one, but got interested in IBM because I had access to one at work. 

update to Jan, here is the PET ROMs:

http://www.6502.org/users/andre/petindex/roms.html

See if you can get it to work with the 2.2" TFT SPI display... I have like 8 of them!  Also, I have a tube of Atmega 1284 with 16K... Sweet.

Ray

janost

I also have a box full of those 2.2" TFTs

I'll set it up on a breadboard :)

pito

#51
Jun 30, 2014, 12:01 pm Last Edit: Jun 30, 2014, 12:10 pm by pito Reason: 1
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: [Select]

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.. :)

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

Memory size ?

9231 Bytes free

Enhanced BASIC 2.22

Ready

pito

#52
Jun 30, 2014, 05:14 pm Last Edit: Jun 30, 2014, 05:50 pm by pito Reason: 1
Who is complaining the emulator is slow??
This is calculated (and printed out @115k2) in 8.07 seconds:
Code: [Select]
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!  ;)

janost

It was slow when used together with video rendering.
Most of the ATmega cycles goes to updating the video.

Its not slow when used by it self on the ATmega.

The 6502 emulator runs at about 600KHz on a 16MHz ATmega.

mrburnette


...
It compiles and I get
Code: [Select]

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.. :)

PS: I've changed to TeraTerm terminal and it seems it works:
Code: [Select]
6502 EhBASIC [C]old/[W]arm ?
Memory size ?
9231 Bytes free
Enhanced BASIC 2.22
Ready



When you press Enter in response to "Memory size?" All free (S)RAM is used... In the old days, you would type in a smaller number if you needed to load a second "piece" into RAM, maybe an assembler program.
The Cold/Warm is to permit you to have a "C" complete boot with nothing in the program space or a "W"arm boot to preserve the already loaded program. 
These things are holdovers from the original ROMs.

Ray

janost

I did a quick mock up of my VIC-20 emu on the DUE board because it has a 2.2" TFT.
This was only a test to know that the video and cpu emulation works.

Now over to the PET ROM's

Those are a real mess.
Don't even know which ones to use.

pito

#56
Jul 01, 2014, 12:55 pm Last Edit: Jul 01, 2014, 01:21 pm by pito Reason: 1
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??

janost

Those ROMs are all over the place.

The thing with CBM ROMs is that they are so overpatched that they need to be run in sets or won't work.
That is both the BASIC and KERNAL ROMs are needed.



mrburnette


I did a quick mock up of my VIC-20 emu on the DUE board because it has a 2.2" TFT.
This was only a test to know that the video and cpu emulation works.

Now over to the PET ROM's

Those are a real mess.
Don't even know which ones to use.



That is pretty cool to see the character-based VIC-20 screen running on a TFT graphic display and on ARM Cortex-M3.  Pretty Wow!

I'm thinking that you should be able to get the Cypress PSoC 4200 to perform the video almost exclusively without the CPU intervening which would put a 4K VIC-20 into a Minty Can size!!!  Way cool, Jan.

Also, as a testament to the 6502 emulator code, it seems to run fine on ARM Cortex.  Great job there,
miker00lz.


Ray

janost

#59
Jul 01, 2014, 02:59 pm Last Edit: Jul 01, 2014, 03:23 pm by janost Reason: 1
The thing with the SPI-TFT's is that they are very data hungry.
Even an 8x8 character takes a massiv amount of data over the SPI-bus.

But it's event driven with write through.
The display only updates if you write to videoram and only that character.

I tried one set of PET2001 ROMS but it did not boot.
Have to try some other of those found on the linked site.

But you're right about it being cool.
Wish I could find a keyboard that matches the size :)


Go Up