Motorola 6809 and Thomson Mo5 Emulator in FreeBasic

User projects written in or related to FreeBASIC.
jepalza
Posts: 70
Joined: Feb 24, 2010 10:08
Location: Spain (Bilbao)

Motorola 6809 and Thomson Mo5 Emulator in FreeBasic

Postby jepalza » Dec 13, 2011 19:57

Hello:
First at all, sorry for my bad english. I'm Spanish Native, and writing in English is very difficult for me (don't studing it). Thanks to dictionary and "google traslate", can try to write for yours in english.

This is my very first post in Freebasic forum (because my english is not good), but... recently did make an emulator for Motorola CPU 6809. Thanks to this CPU emulator, did make another emulator to try it out, one of Thomson Mo5.

6809 emulator is full Freebasic code (compiled in FB GUI), and Thomson Mo5 is the same, all FreeBasic.

6809 emulator is to 99% completed. Only a few errors in CWAI or SYNC instruccions, but this instructions so very few needed. (in the future, will try to finish them).
In Mo5 emulator, aprox. 80% is emulated. No sound (because FB is missing the sound, without external libraries). Speed is not real yet. In any PC will goes very fast, and in another, will be very slow. In my Dual core 2.6 speed is almost 100% real. Keyboard and joysticks are emulated, and tape load/save or Cartridges (K7 or Mo5 extensions). Save function only works in one way: "SAVE "name" generate one file into PC called "SaveMo5.k7" , but is enought to try it.

To load cartridge, press "F4" and load it. To load "k7" tape, in emulated "Mo5" type 'LOAD' or 'RUN "" ' and "ENTER", then press "F4" and load tape.

Keyboard is mapped for Spanish Layout (sorry for this). Some of keys are same that english layout, but other not. Sorry. (CHR$(34) or ' " ' is in "2" key.

Joystick is cursor keys and CTRL to fire.

This is all by the moment. Source code, is not finish or clean, and then, will goes to publish it in a few days, but at this moment, EXE of emulator Mo5 can downloaded from my Web Page, at http://www.euskalnet.net/ingepal/descargas.html
(look for "Mo5_Basic.rar" file in table)

You need BIOS ROM from real Mo5, called "MO5.ROM" (llok for it in web ;-) )

When my code is fully completed, then up into my web.

My name is Joseba Epalza, did make in the past several emulators in C++ for Mr. Do saga's or Mess or MAME "Speed Ball", and i'm collector of oldies 80's computers ;-)
fxm
Posts: 10206
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Postby fxm » Dec 13, 2011 20:15

6800, 6802, 6809, (Motorola, EFCIS) my youth!
jepalza
Posts: 70
Joined: Feb 24, 2010 10:08
Location: Spain (Bilbao)

Postby jepalza » Dec 13, 2011 20:24

Already has Z80, 6502, 6510 and 6809 emulators in Basic. My future proyect is 680x0 emulator (first 68000): will can FreeBasic to move 16bits CPU emulator??? will be soon.... ;-)
Roland Chastain
Posts: 951
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Postby Roland Chastain » Dec 14, 2011 17:44

Congratulations !
I imagine this is a big work and requiring much knowledge.

I would like to be able to do something like that.
What do I need, according to you, to begin such an enterprise ?
For example, I would like to emulate a school calculator. What can you say to me about it ?
TJF
Posts: 3609
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Dec 14, 2011 19:34

Roland Chastain wrote:Congratulations !
I imagine this is a big work and requiring much knowledge.

I would like to be able to do something like that.
What do I need, according to you, to begin such an enterprise ?
For example, I would like to emulate a school calculator. What can you say to me about it ?

There's no need to emulate a school calculator unless you can run software on it. Find the FB source for a simple calculator here. (BTW: it has a multi-lingual GUI.)

It's much more effort to emulate a CPU. But the biggest effort is to emulate the chips around the CPU, so you can see something on screen and get some input from devices like keyboard or disk.
jepalza
Posts: 70
Joined: Feb 24, 2010 10:08
Location: Spain (Bilbao)

Postby jepalza » Dec 14, 2011 20:08

Roland Chastain wrote:Congratulations !
I imagine this is a big work and requiring much knowledge.

I would like to be able to do something like that.
What do I need, according to you, to begin such an enterprise ?
For example, I would like to emulate a school calculator. What can you say to me about it ?


Hey, understand you, when you mean to emulate a simple calculator. In my personal task, Thomson Mo5 already emulated in several sites, and same for m6809 (best in C++) or even a simple calculator, but the real question is: must be emulate a simple calculator? answer: YES!!!

It's for fun, only for fun!!!

Programming in Freebasic is fun and put one task in your live is the best way for learn and keep your mind in best conditions ;-) (i'm 44 years old, and my mind don't work how twenties)
Roland Chastain
Posts: 951
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Postby Roland Chastain » Dec 14, 2011 21:25

TJF wrote: Find the FB source for a simple calculator here


I saw the source and the screenshot. Very beautiful !
Is it possible to have an .exe ?
Landeel
Posts: 763
Joined: Jan 25, 2007 10:32
Location: Brazil
Contact:

Postby Landeel » Dec 14, 2011 22:44

This is awesome!
An emulator written in FreeBASIC. How cool is that?

I remember a long time ago someone was writing a NES emulator in FreeBASIC (or was it QB, not sure). Never heard of it again.
D.J.Peters
Posts: 8208
Joined: May 28, 2005 3:28
Contact:

Postby D.J.Peters » Dec 15, 2011 5:45

@jepalza,
good job i like it.

@Landeel,
there are more "EMU's" in FB the C64 is one nice piece of FB source code too.

Joshy
TJF
Posts: 3609
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Dec 15, 2011 9:49

Roland Chastain wrote:I saw the source and the screenshot. Very beautiful !
Is it possible to have an .exe ?

Yes, I can compile an exe for you. To run it you'll need an up-to-date GTK run-time installation (version >= 2.16). So I recommend to download and install a GTK-bundle (run-time and dev) and then you can compile it yourself. (And you can extend the code for your personal needs - a GUI for your chess program can be made very similar to the FB_Calc GUI.)
jepalza
Posts: 70
Joined: Feb 24, 2010 10:08
Location: Spain (Bilbao)

Postby jepalza » Dec 15, 2011 10:51

D.J.Peters wrote:@jepalza,
good job i like it.

@Landeel,
there are more "EMU's" in FB the C64 is one nice piece of FB source code too.

Joshy


Yes, know it. At least, five emulators in Basic that remember me: C64, Spectrum, NES , Gameboy and Chip8, for CPU 6510, Z80, 6502 and Chip8. With mine, Motorola 6809 for Thomson Mo5, already six emulators in Basic.

Maybe today goes to publish my source code for free.

Emulators for 8bits in FreeBasic is very Fun. Don't has the problems asociated to C++ and Object oriented. Basic is very easy.


Besides, in the past, did make Spectrum emulator From VBSPEC (another emulator of Spectrum, but in Visual Basic code), porting code from it to FB. Did make it only for fun, for get another CPU emulator on FB.
jepalza
Posts: 70
Joined: Feb 24, 2010 10:08
Location: Spain (Bilbao)

Postby jepalza » Dec 15, 2011 17:38

Well: source code already uploaded into my web, here --> http://www.euskalnet.net/ingepal/descargas.html

You can use it for free (it's logic...is for FreeBasic ;-) ) .

The only thing that don't wotk good, is speed control. Did make any trying to repair it, but byt the moment, m, prefer not touch it.

Only one thing: all coments are in spahish, sorry, but it's very difficult to traslate it. But, now in days, with "San Gugle", is not a problem.
Landeel
Posts: 763
Joined: Jan 25, 2007 10:32
Location: Brazil
Contact:

Postby Landeel » Dec 15, 2011 17:52

@D.J.Peters:
Oh, I'm sorry, I totally forgot about the c64 emu.
Mike Chambers
Posts: 85
Joined: Jun 18, 2006 19:48

Postby Mike Chambers » Dec 19, 2011 7:12

VERY cool to see more CPU emulators written in FreeBASIC. i haven't worked on it for some time now, but i've written a complete 8086/80186 CPU emulator in 100% FreeBASIC. i've done a 6502 emulator in it as well. i've since moved on to re-writing it in C, but my old FB version is quite solid as well.

I built a full FreeBASIC x86 PC emulator around the 8086 core. it can run many older PC games very well, including Wolfenstein 3D among others. it even runs Windows 3.0.

i was thinking that it would be very nice if the FB dev team included a few sample CPU emulators in FB as part of future releases. your emulators and my own could be included.

i wonder who we should talk to about getting our code possibly included. not sure if you're interested in getting yours included or not, but i know i would certainly love to see it. it demonstrates that some pretty serious and powerful applications that would normally be done in C or C++ can be created just as well in FreeBASIC, even if a little bit slower.

i've done a FreeBASIC NES emulator around my 6502 code as well. my 8086 emulator source code is available here - http://code.google.com/p/core86/

good job on your emu projects, jepalza.
jepalza
Posts: 70
Joined: Feb 24, 2010 10:08
Location: Spain (Bilbao)

Postby jepalza » Dec 19, 2011 9:55

Yes, know you. Did see your works before today.

I love basic Emulators, and to show how it's to possible make same that C++ (or almost).

Has many emulator written in C or C++ in the past (for example, Mr. Do! Sagas o Lady Bug), but "C" is boring, it's better Basic, more clean and easy to work quickly.

And with power and speed of FreeBasic, it's possible make emulators in Full Speed. My goes at this moment, is to make 68000 emulator, for try to make Amiga A500 Emulator. It's very difficult, but, is fun make it.

Your idea for to join all emulators is good. Did see you x86 emul (source code of CGA version, not VGA). It's good. Same that you, own several emulators for other CPU, for example, Z80, 6510 or 6502, but not is mine, only conversions from others to try it in FreeBasic, but will be good put ir for free, and to make a good data base for CPU emulators in FreeBasic. ;-)

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 12 guests