6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 4:15 pm

All times are UTC




Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu May 31, 2007 3:38 am 
Offline

Joined: Sat Sep 04, 2004 4:17 am
Posts: 30
Location: Last Ninja 2: Basement
I'm wondering if there are any 6502 emulators that use the Linux console instead of Windows or X11, etc. GUIs. I want to turn an old Pentium 133 into a 6502 development system, but don't want to use X11 to do it. I doubt it exists, but if there is one, I'm all ears.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu May 31, 2007 5:35 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
My lib65816 package is designed to be modular enough to write your own emulators. True, it's designed for the 65816, but if you keep it in emulation mode, it ought to mimick the 6502 very closely, provided you don't use 65C02-specific opcodes.

http://www.falvotech.com/content/lib65816


Top
 Profile  
Reply with quote  
PostPosted: Thu May 31, 2007 6:49 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 990
Location: near Heidelberg, Germany
daivox wrote:
I'm wondering if there are any 6502 emulators that use the Linux console instead of Windows or X11, etc. GUIs. I want to turn an old Pentium 133 into a 6502 development system, but don't want to use X11 to do it. I doubt it exists, but if there is one, I'm all ears.


Before I joined the VICE emulator team, I started my own, console-based (ncurses that is) C64 emulator. It's in a desparate state, but works to the READY prompt and IIRC can even access files.

Look for "xcbm" on:
http://www.6502.org/users/andre/misc/index.html

André


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Dec 11, 2008 7:17 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 6:43 am
Posts: 11
Location: Fremont, CA, USA
I'd just like to add a "me too" to this thread. I've started working on my first ever 6502 SBC (keeping it simple, since this is my first full microcomputer design), and I'd love a simulator for doing software debugging.

The existing simulators I've found seem to be Commodore 64 simulators, or Windows-only, or highly non-configurable. Ideally I'd want text-only (or curses based), something that would work on OS X or Linux -- or even Windows, with the right libraries -- where I can adjust the memory map to suit my design, and log memory accesses to certain locations.

I started working on a 6502 system simulator in Java (because it's my strongest compiled language at the moment, and I didn't want to have to dust off my C knowledge), but it just feels like re-inventing the wheel. I'd much rather just enhance someone else's work, rather than create Yet Another 6502 CPU Simulator :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Dec 11, 2008 8:20 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Once again, I maintain a 65816 emulator library, called "lib65816", for the Linux platform. It's 100% independent of any emulator. It stands without documentation because nobody heretofore has demonstrated any interest. However, I'd be happy to help anyone willing to write a simple console emulator using it. I'm unfortunately too busy to write such a virtual machine myself, as I'm working on my Kestrel project.

See http://www.bitbucket.org/kc5tja/lib65816/overview/ for the Mercurial repository. From there, you can also download a .zip or .gz file as well.

Again, this is just the CPU emulation library. You'll still need to write the surrounding emulator; but if all you're interested in is a virtual machine a la qemu or some such, you can use the WDM opcode handler as a kind of "system call" opcode, allowing you to interface to the host OS fairly easily. With that, there's really not even any need for creating virtual peripherals.

Let me know if you have any problems.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 22, 2008 5:53 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 6:43 am
Posts: 11
Location: Fremont, CA, USA
kc5tja wrote:
I maintain a 65816 emulator library, called "lib65816", for the Linux platform.


Hello! Thanks for your reply. I'm sorry I misread your original post, for some odd reason I thought your 65816 library only ran in native mode, not 6502 mode. I have no idea why I believed that! I'll definitely dig into it, the library looks very thorough, and probably easy to wrap a simulator around.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 22, 2008 6:19 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Nope -- it emulates a complete 65816, so far as I am aware, right down to reset behavior and cycle-counting (although, you can safely ignore cycle counts if you want to just emulate the program without concern to real-time performance). It even groks interrupts!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 23, 2008 1:22 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
That's funny -- my post above was marked as a "new message", even though I was the one who actually posted it. Anyone else seeing anomalous behavior like this?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 23, 2008 1:26 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1681
Location: Sacramento, CA
kc5tja wrote:
That's funny -- my post above was marked as a "new message", even though I was the one who actually posted it. Anyone else seeing anomalous behavior like this?


My posts are usually marked as new posts. Purhaps its how one exits the post. I usually pick return to forum vs. see my post (not exact wording).

Daryl


Top
 Profile  
Reply with quote  
 Post subject: the other lib6502
PostPosted: Fri Jan 09, 2009 9:10 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
I highly recommend Ian Piumarta's lib6502: it's console based, has a BBC mode, is readily extensible. Beautiful code, in fact.

http://piumarta.net/software/lib6502/lib6502-1.0


Top
 Profile  
Reply with quote  
 Post subject: Re: the other lib6502
PostPosted: Mon Jan 12, 2009 8:19 pm 
Offline
User avatar

Joined: Sun Feb 13, 2005 9:58 am
Posts: 85
BigEd wrote:
I highly recommend Ian Piumarta's lib6502: it's console based, has a BBC mode, is readily extensible. Beautiful code, in fact.

http://piumarta.net/software/lib6502/lib6502-1.0


I found this library very nice, thank you.
I've got some problem compiling it with the microsoft c++ express edition: it compile quite fine (with a couple of cast added) but the bbc emulation wont run.

is there anyway here in the forum with experience with this, before starting debugging ;)


Top
 Profile  
Reply with quote  
 Post subject: Re: the other lib6502
PostPosted: Mon Jan 12, 2009 9:44 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
Does it run the trivial examples from the readme? You don't need the BBC emulation for that.

Could you show us what you see?

I have a couple of patches somewhere but they're not essential.


Top
 Profile  
Reply with quote  
 Post subject: Re: the other lib6502
PostPosted: Tue Jan 13, 2009 8:02 pm 
Offline
User avatar

Joined: Sun Feb 13, 2005 9:58 am
Posts: 85
BigEd wrote:
Does it run the trivial examples from the readme? You don't need the BBC emulation for that.

Could you show us what you see?

I have a couple of patches somewhere but they're not essential.


I'm afraid to be a bit off topic here, anyway...
i can run fine the examples and not-so-big-problem during compile time, i instert only a couple of cast
Code:
typedef unsigned int uint16_t;
typedef unsigned char uint8_t;

...that i hope are right.

but i cannot run the bbc emulator with os12.rom and the basic rom, no prompt.

i found nice the idea to have a bbc rom operating in the emulator, because it is a simple environment to use for testing 6502 software.
anyway i'm open to receive hints, at the present i'm working on 6502 figforth and i need a place for running it.
tnx!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jan 14, 2009 11:44 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Code:
typedef unsigned short uint16_t;


Do not use int, because that refers to the processor's natural word width. Use short or long for 16- and 32-bit widths explicitly.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jan 15, 2009 4:30 pm 
Offline

Joined: Tue Sep 03, 2002 12:58 pm
Posts: 293
kc5tja wrote:
Code:
typedef unsigned short uint16_t;


Do not use int, because that refers to the processor's natural word width. Use short or long for 16- and 32-bit widths explicitly.


Just don't be surprised if they ever change size.

I've used one platform where char, short, and int were all 16 bit (long was probably 32 bit, but I don't remember, and doubt I used it). And another with 64 bit longs.

But on most platforms that most people will experience today, short=16 and long=32 is reasonably safe.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: