STM32duino 6502 Emulator

ahull
Thu Jul 16, 2015 11:40 pm
I took a quick look at the 6502 Emulator mentioned here and it appears to work with a minimum of fuss. Read that thread first before you comment on this one. :D

Git repo here…

Note… it *does not* play nice with the Arduino Serial Monitor, but works with cutecom (and probably pretty much anything else that is any way closer to a real terminal emulator than the Arduino Serial Monitor).

Currently I am using the USB serial, but it would be easy to use any other serial port.

Syntax Error
Ready
10 FOR N=1 TO 30
20 PRINT N
30 NEXT N
20 PRINT 'HELLO';
RUN

Syntax Error in line \0x00\0x00
Ready
20 PRINT N
20 PRINT N;
RUN
\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00
Ready


RogerClark
Fri Jul 17, 2015 12:26 am
Andy,

Sorry to be pedantic, but When it says 6502 emulator does this really mean BBC model B, BASIC emulator ?


ahull
Fri Jul 17, 2015 12:36 am
RogerClark wrote:Andy,

Sorry to be pedantic, but When it says 6502 emulator does this really mean BBC model B, BASIC emulator ?


RogerClark
Fri Jul 17, 2015 1:41 am
Ah

Ok.

Is there a Z80 emulator ?


zoomx
Fri Jul 17, 2015 6:44 am
I believe that this
Arduino/ATmega328 C64 Emulator http://forum.arduino.cc/index.php?topic=196666.0
can be interesting.

I thought to port TVout or VGA into STM32 and get colors.


mrburnette
Fri Jul 17, 2015 12:44 pm
I know Jan from the original post that worked with the C64 emulator on the 1280. Last I saw, he had the entire thing running on the ILI9341 TFT display.

Ray


martinayotte
Fri Jul 17, 2015 2:30 pm
Jesus, it remind me that I played around with an Apple ][ emulator into a FPGA.
Here is the original web site from Grant Searle :
http://searle.hostei.com/grant/Multicomp/

mrburnette
Fri Jul 17, 2015 7:49 pm
Jan’s C64 built from a 1284:

C64_1284[1].jpg
C64_1284[1].jpg (146.35 KiB) Viewed 3726 times

ahull
Fri Jul 31, 2015 1:03 pm
With a little tweak to set the ROM array as a const (so it winds up in flash), I end up with with a very usable emulator with 16K of program RAM, on the STM32F103C8 or R8 boards. Updated stm32duino 6502 emulator Git repo is here..

Hints: When uploading programs using cutecom, set the Char Delay to >60 ms and the upload type to script.
Use a real terminal emulator like cutecom, rather than the IDE serial monitor.
When starting the emulator, switch on [CAPS LOCK], press C for cold boot, then enter twice.

10 PRINT TAB(33);"WUMPUS"
20 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
22 PRINT
24 PRINT
26 PRINT
30 PRINT "INSTRUCTIONS (Y-N)";
40 INPUT I$
50 IF I$="N" THEN 60
55 GOSUB 1000
60 REM- SET UP CAVE (DODECAHEDRAL NODE LIST)
70 DIM S(20,3)
80 FOR J=1 TO 20
90 FOR K=1 TO 3
100 READ S(J,K)
110 NEXT K
120 NEXT J
130 DATA 2,5,8,1,3,10,2,4,12,3,5,14,1,4,6
140 DATA 5,7,15,6,8,17,1,7,9,8,10,18,2,9,11
150 DATA 10,12,19,3,11,13,12,14,20,4,13,15,6,14,16
160 DATA 15,17,20,7,16,18,9,17,19,11,18,20,13,16,19
170 DEF FNA(X)=INT(20*RND(1))+1
180 DEF FNB(X)=INT(3*RND(1))+1
190 DEF FNC(X)=INT(4*RND(1))+1
200 REM- LOCATE L ARRAY ITEMS
210 REM- 1-YOU,2-WUMPUS,3&4-PITS,5&6-BATS
220 DIM L(6),M(6)
230 FOR J=1 TO 6
240 L(J)=FNA(0)
260 M(J)=L(J)
270 NEXT J
280 REM- CHECK FOR CROSSOVERS (IE L(1)=L(2) ETC)
290 FOR J=1 TO 6
300 FOR K=J TO 6
310 IF J=K THEN 330
320 IF L(J)=L(K) THEN 240
330 NEXT K
340 NEXT J
350 REM- SET# ARROS
360 A=5
365 L=L(1)
370 REM- RUN THE GAME
375 PRINT "HUNT THE WUMPUS"
380 REM- HAZARD WARNINGS & LOCATIONS
390 GOSUB 2000
400 REM- MOVE OR SHOOT
410 GOSUB 2500
420 ON O GOTO 440,480
430 REM- SHOOT
440 GOSUB 3000
450 IF F=0 THEN 370
460 GOTO 500
470 REM- MOVE
480 GOSUB 4000
490 IF F=0 THEN 390
500 IF F>0 THEN 550
510 REM- LOSE
520 PRINT "HA HA HA - YOU LOSE!"
530 GOTO 560
540 REM- WIN
550 PRINT "HEE HEE HEE - THE WUMPUS'LL GETCHA NEXT TIME!!"
560 FOR J=1 TO 6
570 L(J)=M(J)
580 NEXT J
590 PRINT "SAME SET-UP (Y-N)";
600 INPUT I$
610 IF I$<>"Y" THEN 230
620 GOTO 360
1000 REM- INSTRUCTIONS
1010 PRINT "WELCOME TO 'HUNT THE WUMPUS'"
1020 PRINT " THE WUMPUS LIVES IN A CAVE OF 20 ROOMS. EACH ROOM"
1030 PRINT "HAS 3 TUNNELS LEADING TO OTHER ROOMS. (LOOK AT A"
1040 PRINT "DODECAHEDRON TO SEE HOW THIS WORKS-IF YOU DON'T KNOW"
1050 PRINT "WHAT A DODECHADRON IS, ASK SOMEONE)"
1060 PRINT
1070 PRINT " HAZARDS:"
1080 PRINT "BOTTOMLESS PITS - TWO ROOMS HAVE BOTTOMLESS PITS IN THEM"
1090 PRINT " IF YOU GO THERE, YOU FALL INTO THE PIT (& LOSE!)"
1100 PRINT "SUPER BATS - TWO OTHER ROOMS HAVE SUPER BATS. IF YOU"
1110 PRINT " GO THERE, A BAT GRABS YOU AND TAKES YOU TO SOME OTHER"
1120 PRINT " ROOM AT RANDOM. (WHICH MIGHT BE TROUBLESOME)"
1130 PRINT
1140 PRINT " WUMPUS:"
1150 PRINT "THE WUMPUS IS NOT BOTHERED BY THE HAZARDS (HE HAS SUCKER"
1160 PRINT "FEET AND IS TOO BIG FOR A BAT TO LIFT). USUALLY"
1170 PRINT "HE IS ASLEEP. TWO THINGS THAT WAKE HIM UP: YOUR ENTERING"
1180 PRINT "HIS ROOM OR YOUR SHOOTING AN ARROW."
1190 PRINT " IF THE WUMPUS WAKES, HE MOVES (P=.75) ONE ROOM"
1200 PRINT "OR STAYS STILL (P=.25). AFTER THAT, IF HE IS WHERE YOU"
1210 PRINT "ARE, HE EATS YOU UP (& YOU LOSE!)"
1220 PRINT
1230 PRINT " YOU:"
1240 PRINT "EACH TURN YOU MAY MOVE OR SHOOT A CROOKED ARROW"
1250 PRINT " MOVING: YOU CAN GO ONE ROOM (THRU ONE TUNNEL)"
1260 PRINT " ARROWS: YOU HAVE 5 ARROWS. YOU LOSE WHEN YOU RUN";
1265 PRINT " OUT."
1270 PRINT " EACH ARROW CAN GO FROM I TO 5 ROOMS. YOU AIM BY";
1275 PRINT " TELLING"
1280 PRINT " THE COMPUTER THE ROOMS YOU WANT THE ARROW TO GO TO."
1290 PRINT " IF THE ARROW CAN'T GO THAT WAY (IE NO TUNNEL) IT";
1295 PRINT " MOVES"
1300 PRINT " AT RANDOM TO THE NEXT ROOM."
1310 PRINT " IF THE ARROW HITS THE WUMPUS, YOU WIN."
1320 PRINT " IF THE ARROW HITS YOU, YOU LOSE."
1330 PRINT
1340 PRINT " WARNINGS:"
1350 PRINT " WHEN YOU ARE ONE ROOM AWAY FROM WUMPUS OR HAZARD,"
1360 PRINT " THE COMPUTER SAYS:"
1370 PRINT "WUMPUS- 'I SMELL A WUMPUS'"
1380 PRINT "BAT - 'BATS NEARBY'"
1390 PRINT "FIT - 'I FEEL A DRAFT'"
1400 PRINT
1410 RETURN
2000 REM- PRINT LOCATION & HAZARD WARNINGS
2010 PRINT
2020 FOR J=2 TO 6
2030 FOR K=1 TO 3
2040 IF S(L(1),K)<>L(J) THEN 2110
2050 ON J-1 GOTO 2060,2080,2080,2100,2100
2060 PRINT "I SMELL A WUMPUS!"
2070 GOTO 2110
2080 PRINT "I FEEL A DRAFT!"
2090 GOTO 2110
2100 PRINT "BATS NEARBY!"
2110 NEXT K
2120 NEXT J
2130 PRINT "YOU ARE IN ROOM ";L(1)
2140 PRINT "TUNNELS LEAD TO ";S(L,1);S(L,2);S(L,3)
2150 PRINT
2160 RETURN
2500 REM- CHOOSE OPTION
2510 PRINT "SHOOT OR MOVE (S-M)";
2520 INPUT I$
2530 IF I$<>"S" THEN 2560
2540 O=1
2550 RETURN
2560 IF I$<>"M" THEN 2510
2570 O=2
2580 RETURN
3000 REM- ARROW ROUTINE
3010 F=0
3020 REM- PATH OF ARROW
3030 L=L(1)
3040 PRINT "NO. OF ROOMS(1-5)";
3050 INPUT J9
3060 IF J9<1 OR J9>5 THEN 3040
3070 FOR K=1 TO J9
3080 PRINT "ROOM #";
3090 INPUT P(K)
3095 IF K<=2 THEN 3115
3100 IF P(K)<>P(K-2) THEN 3115
3105 PRINT "ARROWS AREN'T THAT CROOKED - TRY ANOTHER ROOM"
3110 GOTO 3080
3115 NEXT K
3120 REM- SHOOT ARROW
3140 FOR K=1 TO J9
3150 FOR K1=1 TO 3
3160 IF S(L,K1)=P(K) THEN 3295
3170 NEXT K1
3180 REM- NO TUNNEL FOR ARROW
3190 L=S(L,FNB(1))
3200 GOTO 3300
3210 NEXT K
3220 PRINT "MISSED"
3225 L=L(1)
3230 REM- MOVE WUMPUS
3240 GOSUB 3370
3250 REM- AMMO CHECK
3255 A=A-1
3260 IF A>0 THEN 3280
3270 F=-1
3280 RETURN
3290 REM- SEE IF ARROW IS AT L(1) OR L(2)
3295 L=P(K)
3300 IF L<>L(2) THEN 3340
3310 PRINT "AHA! YOU GOT THE WUMPUS!"
3320 F=1
3330 RETURN
3340 IF L<>L(1) THEN 3210
3350 PRINT "OUCH! ARROW GOT YOU!"
3360 GOTO 3270
3370 REM- MOVE WUMPUS ROUTINE
3380 K=FNC(0)
3390 IF K=4 THEN 3410
3400 L(2)=S(L(2),K)
3410 IF L(2)<>L THEN 3440
3420 PRINT "TSK TSK TSK - WUMPUS GOT YOU!"
3430 F=-1
3440 RETURN
4000 REM- MOVE ROUTINE
4010 F=0
4020 PRINT "WHERE TO";
4030 INPUT L
4040 IF L<1 OR L>20 THEN 4020
4050 FOR K=1 TO 3
4060 REM- CHECK IF LEGAL MOVE
4070 IF S(L(1),K)=L THEN 4130
4080 NEXT K
4090 IF L=L(1) THEN 4130
4100 PRINT "NOT POSSIBLE -";
4110 GOTO 4020
4120 REM- CHECK FOR HAZARDS
4130 L(1)=L
4140 REM- WUMPUS
4150 IF L<>L(2) THEN 4220
4160 PRINT "... OOPS! BUMPED A WUMPUS!"
4170 REM- MOVE WUMPUS
4180 GOSUB 3380
4190 IF F=0 THEN 4220
4200 RETURN
4210 REM- PIT
4220 IF L<>L(3) AND L<>L(4) THEN 4270
4230 PRINT "YYYIIIIEEEE . . . FELL IN PIT"
4240 F=-1
4250 RETURN
4260 REM- BATS
4270 IF L<>L(5) AND L<>L(6) THEN 4310
4280 PRINT "ZAP--SUPER BAT SNATCH! ELSEWHEREVILLE FOR YOU!"
4290 L=FNA(1)
4300 GOTO 4130
4310 RETURN
5000 END

Ready
RUN
WUMPUS
CREATIVE COMPUTING MORRISTOWN, NEW JERSEY

INSTRUCTIONS (Y-N)? Y
WELCOME TO 'HUNT THE WUMPUS'
THE WUMPUS LIVES IN A CAVE OF 20 ROOMS. EACH ROOM
HAS 3 TUNNELS LEADING TO OTHER ROOMS. (LOOK AT A
DODECAHEDRON TO SEE HOW THIS WORKS-IF YOU DON'T KNOW
WHAT A DODECHADRON IS, ASK SOMEONE)

HAZARDS:
BOTTOMLESS PITS - TWO ROOMS HAVE BOTTOMLESS PITS IN THEM
IF YOU GO THERE, YOU FALL INTO THE PIT (& LOSE!)
SUPER BATS - TWO OTHER ROOMS HAVE SUPER BATS. IF YOU
GO THERE, A BAT GRABS YOU AND TAKES YOU TO SOME OTHER
ROOM AT RANDOM. (WHICH MIGHT BE TROUBLESOME)

WUMPUS:
THE WUMPUS IS NOT BOTHERED BY THE HAZARDS (HE HAS SUCKER
FEET AND IS TOO BIG FOR A BAT TO LIFT). USUALLY
HE IS ASLEEP. TWO THINGS THAT WAKE HIM UP: YOUR ENTERING
HIS ROOM OR YOUR SHOOTING AN ARROW.
IF THE WUMPUS WAKES, HE MOVES (P=.75) ONE ROOM
OR STAYS STILL (P=.25). AFTER THAT, IF HE IS WHERE YOU
ARE, HE EATS YOU UP (& YOU LOSE!)

YOU:
EACH TURN YOU MAY MOVE OR SHOOT A CROOKED ARROW
MOVING: YOU CAN GO ONE ROOM (THRU ONE TUNNEL)
ARROWS: YOU HAVE 5 ARROWS. YOU LOSE WHEN YOU RUN OUT.
EACH ARROW CAN GO FROM I TO 5 ROOMS. YOU AIM BY TELLING
THE COMPUTER THE ROOMS YOU WANT THE ARROW TO GO TO.
IF THE ARROW CAN'T GO THAT WAY (IE NO TUNNEL) IT MOVES
AT RANDOM TO THE NEXT ROOM.
IF THE ARROW HITS THE WUMPUS, YOU WIN.
IF THE ARROW HITS YOU, YOU LOSE.

WARNINGS:
WHEN YOU ARE ONE ROOM AWAY FROM WUMPUS OR HAZARD,
THE COMPUTER SAYS:
WUMPUS- 'I SMELL A WUMPUS'
BAT - 'BATS NEARBY'
FIT - 'I FEEL A DRAFT'

HUNT THE WUMPUS

YOU ARE IN ROOM 1
TUNNELS LEAD TO 2 5 8

SHOOT OR MOVE (S-M)?


ahull
Fri Aug 07, 2015 8:48 am
After wasting far too much time playing ancient Basic games, I discovered an interesting RAM quirk/bug.

Assuming 20K to be 1024*20 then I should be able to use all of the RAM available the IDE allows, however it seems some of the ram is being used, but not hidden from the available memory at compile time.

You should be able to reproduce the issue by grabbing the 6502 emulator from my GIT repo and and compiling it. If you leave the following lines as is…

// Maximum available ram is 20480 bytes on the STM32F103C8T6, so lets see how much we can actually use....
#define RAM_SIZE 16*1024+256+128+64
// "Global variables use 20,264 bytes of dynamic memory" << If we declare any more, then the device locks up and/or the serial port doesn't enumerate.


RogerClark
Fri Aug 07, 2015 9:57 am
Andy,

Could this just be an error in the RAM calculation recipe used to display the total memory used ?

Actually…

Surely the number show at the end of the compile is the total of globals, it doesn’t factor in any locals or anything that needs to go onto the stack etc.


ahull
Fri Aug 07, 2015 10:53 am
RogerClark wrote:Andy,

Could this just be an error in the RAM calculation recipe used to display the total memory used ?

Actually…

Surely the number show at the end of the compile is the total of globals, it doesn’t factor in any locals or anything that needs to go onto the stack etc.


victor_pv
Fri Aug 07, 2015 3:47 pm
ahull wrote:

I tried the same thing on my STM32F103RCT6 board (also 20K RAM) with the same result. Any ideas what might be the cause of the missing RAM?

Rick Kimball
Fri Aug 07, 2015 8:46 pm
ahull wrote:Do we have any way of knowing what size the stack will grow to, or how much space is needed for locals? If not then we can’t make best use of the RAM, we will always be guestimating, which is not a good idea when you are living in such a small space.

ahull
Sat Aug 08, 2015 9:03 am
victor_pv wrote:ahull wrote:

I tried the same thing on my STM32F103RCT6 board (also 20K RAM) with the same result. Any ideas what might be the cause of the missing RAM?

ahull
Sun Sep 27, 2015 10:52 pm
Well I frittered away a few more hours with this project today, mainly because it makes a good test project for the GD32 board.

I also solved a long standing issue. Pasting listings in to the emulator was a little hit and miss. However the solution was much simpler than all the messing about I had done to slow down my input speed. I simply changed the number of instructions the emulator runs between scans for data.
exec6502(10000); //if timing is enabled, this value is in 6502 clock ticks. otherwise, simply instruction count.


ahull
Sun Sep 27, 2015 11:06 pm
:D One of the first programs I ever played with…
RUN
AMAZING PROGRAM
CREATIVE COMPUTING MORRISTOWN, NEW JERSEY

WHAT ARE YOUR WIDTH AND LENGTH? 10
?? 10

.--.--.--.--.--.--.--.--.--. .
I I I
: :--: :--:--:--:--: : :--.
I I I I I I
:--: : : : : :--:--:--: .
I I I I I I I
:--:--:--:--: :--: : : : .
I I I I I I
: :--:--:--: : :--:--: :--.
I I I I I I I
: : : : : :--:--: : : .
I I I I I I
: : : :--:--:--: :--: :--.
I I I I I
:--:--:--:--:--: :--: :--: .
I I I I I I
: : :--:--:--:--: :--: :--.
I I I I I
: : : : : :--:--:--: : .
I I I I I I
:--: :--:--:--:--:--:--:--:--.

Ready


zmemw16
Sun Sep 27, 2015 11:20 pm
had one of those attached via a 20mA driver to my Tangerine Microtan65. 35yrs ago!
i used it to print out my listings from an assembler program i wrote to decode their tokenized basic.
it was in my bedroom, upstairs and on the opposite side of the house from where i hid in the living room
although you could still hear the carriage return thunk and when it stopped :-)

stephen


ahull
Sun Sep 27, 2015 11:33 pm
zmemw16 wrote:had one of those attached via a 20mA driver to my Tangerine Microtan65. 35yrs ago!
i used it to print out my listings from an assembler program i wrote to decode their tokenized basic.
it was in my bedroom, upstairs and on the opposite side of the house from where i hid in the living room
although you could still hear the carriage return thunk and when it stopped :-)

stephen


mrburnette
Mon Sep 28, 2015 12:12 am
Just for grins…. from the ESP8266 Arduino core:
http://www.esp8266.com/viewtopic.php?f= … t=5#p29841

Reposted here for those w/o UserId’s on the other forum.

Ray


ahull
Mon Sep 28, 2015 12:30 am
Thanks Ray, I was going to have a crack at getting a 16K Pet or C64 emulation going next (although I might try for an Acorn Atom, since I used to have one of those too). I’ll take a look at the cpu.cpp in that emulator, I suspect I can re-use it, or at least strip out the ROM.

ahull
Mon Sep 28, 2015 10:42 am
6502 Speed estimates.

I added a couple of lines of debug to see roughly how fast the emulator was.

Some suggestions have been made that you can measure this by running a FOR I=1 TO 10000:NEXT I loop in basic, but this sounded pretty hit and miss to me, so instead I spat out the micros value after each 10,000 instruction loop, and then spat a code listing in to the emulator to see how fast it chomped through the listing… so the test loop looks like this…

...
if (serial_debug.available()) {
// curkey = serial_debug.read() & 0x7F;
curkey = serial_debug.read() ;
serial_debug.print(",");
serial_debug.println(micros());
//digitalWrite(BLINK_PIN, LOW);
//delayMicroseconds(100);
//digitalWrite(BLINK_PIN, HIGH);

}
...


RogerClark
Mon Sep 28, 2015 6:47 pm
Andy,

I think I posted the dhrystone tests for GD32 @ 72Mhz vs STM32 @ 72Mhz and the GD32 was noticeably faster (which we have attributed to the zero wait states on program memory)


ahull
Mon Sep 28, 2015 10:53 pm
For comparison (since I have left the UglyBoard in the office) I ran the same emulator on the STM32F103R8T6 board.

10,000 instructions take 43ms so that makes the 1 tick per instruction clock speed 232.5 kHz or 0.2325 6502 MIPS, so roughly half the speed of a real silicon 6502 running at 1MHz

So for this slightly random use case, the GD32 running at 120MHz is roughly 2.3 times as quick as a similar STM32 running at 72MHz – “Interesting…” as Ray might observe. :D


mrburnette
Tue Sep 29, 2015 12:03 pm
“Interesting…” as Ray might observe. :D

Very interesting…

Ray


mrburnette
Tue Sep 29, 2015 12:15 pm
ahull wrote:6502 Speed estimates.
<…>
For the GD32 running at 72MHz I can process 10,000 6502 instructions per 30ms, giving an effective 6502 clock speed of approx 333kHz assuming 1 instruction per clock cycle or 0.3 Mips (a genuine MOS Technologies 6502 from back in the day, is rated at 0.43 MIPS at 1 MHz since the average instruction execution time in the silicon version is greater than one clock cycle).

For the GD32 running at 120MHz the emulator process 10,000 instructions in 18ms giving an effective 6202 clock speed of around 555kHz so slightly faster than a genuine silicon 6502.


martinayotte
Tue Sep 29, 2015 1:49 pm
Although I didn’t try it out, NardJ came with a color CRT into browser yesterday : http://www.esp8266.com/viewtopic.php?f= … t=5#p30062

ahull
Tue Sep 29, 2015 4:32 pm
For completeness, here is the C64 variant.


**** COMMODORE 64 BASIC V2 ****

64K RAM SYSTEM 13311 BASIC BYTES FREE

READY.
10 PRINT "HELLO WORLD"
RUN
HELLO WORLD

READY.


zoomx
Wed Sep 30, 2015 1:19 pm
Maybe you can add TVout?

ahull
Wed Sep 30, 2015 5:26 pm
zoomx wrote:Maybe you can add TVout?

zoomx
Fri Oct 02, 2015 8:52 am
There is also a VGAout option!

ahull
Fri Oct 02, 2015 9:57 am
I would be pretty impressed if someone gets that working, unfortunately there are way too many other pressures on my time at the moment to even try. :D

mrburnette
Sat Oct 03, 2015 5:24 pm
zoomx wrote:Maybe you can add TVout?

zoomx
Mon Oct 05, 2015 9:49 am
I know Arduinocade, there are also projects with Attiny, but I thought that using an STM32 one can get better results.
Some of these projects use an hack on SPI port to generate the right frequency.

Unfortunately I am not able to do that. :(


RogerClark
Tue Oct 06, 2015 12:44 am
As most monitors and TV’s are now HDMI, I think the best solution is to TV output would be to use a dedicated HDMI generator chip.

I did a bit of research and found this http://electronics.stackexchange.com/qu … an-arduino

But I can’t see anyone selling a module with the Chrontel CH7035.

But perhaps there is an alternative device that does the same job, that is available on eBay or Aliexpress etc ??


mrburnette
Tue Oct 06, 2015 12:39 pm
RogerClark wrote:As most monitors and TV’s are now HDMI, I think the best solution is to TV output would be to use a dedicated HDMI generator chip.
<…>

zoomx
Tue Oct 06, 2015 12:53 pm
I have a small LCD unit that works with rearview cams on a car. I got it for 12 euros. My old RaspberryPI has a composite video output, instead the new ones don’t :(
But it works well with Arduino TVout.

ahull
Tue Oct 06, 2015 4:04 pm
zoomx wrote:I have a small LCD unit that works with rearview cams on a car. I got it for 12 euros. My old RaspberryPI has a composite video output, instead the new ones don’t :(
But it works well with Arduino TVout.

ahull
Wed Oct 07, 2015 12:35 pm
I just forked a copy of TinyBasicPlus to compare the speed of a native C written Basic Interpreter with the 6502 emulated one. I will put any enhancements in my TinyBasicPlus git repo here.

I may even start a new thread for this if there is sufficient interest. So far I am pretty impressed, it compiled and worked first time with absolutely no changes. Needless to say it is considerably faster than the 6502 emulation.

Testing so far involves connecting to the USB serial console and blinking the LED on PB1 (“TinyBasicPlus refers to this as pin 16, I found this by experiment, not by looking it up :oops: “)
5 REM Blink for TinyBasicPlus - you will need to figure out which pin maps where. On my STM32F103R8T6 board the LED is on "Pin 16"
10 FOR A=1 to 64
20 DWRITE 16, LOW
30 DELAY 250
40 DWRITE 16, HIGH
50 DELAY 250
60 NEXT A


zoomx
Wed Oct 07, 2015 1:08 pm
You can run Microchess, that is a …. micro chess in 6502 assembler.

ahull
Wed Oct 07, 2015 4:16 pm
zoomx wrote:You can run Microchess, that is a …. micro chess in 6502 assembler.

zoomx
Thu Oct 08, 2015 8:31 am
I wrote this because i read of an Arduino port.

mrburnette
Fri Oct 09, 2015 12:19 am
zoomx wrote:I wrote this because i read of an Arduino port.

daybyter
Fri Oct 09, 2015 1:44 am
You think there is a chance to emulate the other components of a C= 1541 floppy drive and run it’s rom in the emulator?

ahull
Wed Oct 14, 2015 7:31 pm
For those of you wanting to take the emulator a little further, you might like to watch Ben Heck’s video where he adds a screen and keyboard to an AVR running TinyBasic.

With the STM32F103 of course you have considerably more scope, since you have more memory, you could go for a colour LCD. The keyboard idea is pretty neat. I may have a play with that since the XBox keyboards are pennies.

Image

EDIT: Fixed. Some Youtube gremlin had caused the wrong Ben Heck video to be linked above.


ahull
Wed Oct 14, 2015 7:37 pm
daybyter wrote:You think there is a chance to emulate the other components of a C= 1541 floppy drive and run it’s rom in the emulator?

RogerClark
Wed Oct 14, 2015 9:14 pm
The Xbox keyboard looks interesting.

How do you interface to it? is it IR or BLE etc???


ahull
Wed Oct 14, 2015 9:48 pm
RogerClark wrote:The Xbox keyboard looks interesting.

How do you interface to it? is it IR or BLE etc???


daybyter
Wed Oct 14, 2015 9:59 pm
ahull wrote:You might be better to emulate the 1541 with another STM32F103, since emulating it would take up quite a lot of the microcontroller’s resources.
Emulated 1541 drives already exist of course… but they are designed for interfacing to a real C64.

ahull
Wed Oct 14, 2015 10:04 pm
daybyter wrote:ahull wrote:You might be better to emulate the 1541 with another STM32F103, since emulating it would take up quite a lot of the microcontroller’s resources.
Emulated 1541 drives already exist of course… but they are designed for interfacing to a real C64.

RogerClark
Wed Oct 14, 2015 10:55 pm
Andy,

It looks like you need to reflash the PIC MCU inside the keyboard to use it as a serial keyboard (at least according to the video)

I have a ChipKit2 programmer kicking around somewhere, but I’d need to check if it can program the device inside the keyboard.

But if you don’ have a ChipKit programmer, these keyboards are not going to be usable as far as I can tell :-(


daybyter
Wed Oct 14, 2015 11:17 pm
Over here, they sell dirt cheap infrared keyboards.

The ruwido merlin was sold for 50 ct, and the protocol is open AFAIK.

http://www.hackup.net/2013/05/usb-recei … -keyboard/

http://www.pollin.de/shop/dt/MjQ5ODgyOT … oCQ-nw_wcB

Similar keyboards sell for like 75 ct, or so.

https://www.pollin.de/shop/dt/MDk5ODgyO … _8650.html

Maybe you could check, if they are available in your area, too.


ahull
Wed Oct 14, 2015 11:51 pm
Looks like the reflash isn’t necessary, there is an arduino library that speaks native ChatPad.
http://cliffle.com/project/chatpad/arduino/

ahull
Wed Oct 14, 2015 11:52 pm
daybyter wrote:Over here, they sell dirt cheap infrared keyboards.

The ruwido merlin was sold for 50 ct, and the protocol is open AFAIK.

http://www.hackup.net/2013/05/usb-recei … -keyboard/

http://www.pollin.de/shop/dt/MjQ5ODgyOT … oCQ-nw_wcB

Similar keyboards sell for like 75 ct, or so.

https://www.pollin.de/shop/dt/MDk5ODgyO … _8650.html

Maybe you could check, if they are available in your area, too.


RogerClark
Thu Oct 15, 2015 12:15 am
ahull wrote:Looks like the reflash isn’t necessary, there is an arduino library that speaks native ChatPad.
http://cliffle.com/project/chatpad/arduino/

ryang14
Sun Oct 18, 2015 7:39 pm
I added some basic SPI LCD support. Now I just have to figure out how to add color.

ahull
Sun Oct 18, 2015 10:34 pm
ryang14 wrote:I added some basic SPI LCD support. Now I just have to figure out how to add color.

mrburnette
Mon Oct 19, 2015 12:46 am
ryang14 wrote:I added some basic SPI LCD support. Now I just have to figure out how to add color.

ryang14
Mon Oct 19, 2015 1:18 am
I remember seeing that, but I didn’t have anything to run it on at the time. The LCD interface is much more complete than mine, but I believe all the LCD code was built in instead of using a library, so I’m not sure how easy it would be to port.

mrburnette
Mon Oct 19, 2015 1:25 pm
ryang14 wrote:I remember seeing that, but I didn’t have anything to run it on at the time. The LCD interface is much more complete than mine, but I believe all the LCD code was built in instead of using a library, so I’m not sure how easy it would be to port.

jcw
Thu Dec 03, 2015 11:48 am
RogerClark wrote:Is there a Z80 emulator ?

ahull
Thu Dec 03, 2015 1:30 pm
I await the results with interest :D

zoomx
Thu Dec 03, 2015 4:39 pm
I get a “Can’t find that page, but…”
Which of this pages it is?
http://jeelabs.org/?s=8080
Maybe this one
http://jeelabs.org/2015/12/02/a-fingern … on-lander/

Rick Kimball
Thu Dec 03, 2015 8:01 pm
jcw wrote:Check this link, tomorrow:

jcw
Thu Dec 03, 2015 11:09 pm
With apologies for the tease… article should be online now.

zoomx
Fri Dec 04, 2015 8:20 am
Yesss it is!

Leave a Reply

Your email address will not be published. Required fields are marked *