Page 1 of 2
Michal Kowalski's 6502 simulator
Posted: Wed May 12, 2004 6:53 pm
by leeeeee
Michal has at last released the source code to his excelent 6502 simulator. You can find it at ..
http://exifpro.com/utils.html
Anyone here fancy actively developing it? I don't have the time (or C experience) ATM.
Cheers,
Lee.
Posted: Thu May 13, 2004 8:26 am
by BitWise
I'll take a look at it.
Posted: Fri May 14, 2004 3:26 pm
by Nightmaretony
EXCELLENT. Now, if only hte help file would come into English, then I woiuld be a happy puppy.
serisouly, got it going along nicely out here. Only other thign that would be neat would be to build up a hardware emulation part so that you can specifiy rom, ram and 6522 location and have it view those registers and accesses (mainly the 6522

....
Posted: Sat May 15, 2004 10:44 am
by leeeeee
The file Macroassembly.txt is the important part of the help file in English, the rest of the help file is a Polish translation of a 6502 instruction guide.
You can make a ROM area by setting the detect write attempt flag and specifying a range.
Things that would make my life easier are -
If the code isn't already running then RESET starts the code as if power had just been applied in a real 6502 system.
That the fill byte for unused memory could be user defined. At the moment unused bytes are filled with $00 which is a PITA for making EPROM images. It also means some code works that would fail with the random mess you get in real RAM at power up.
Make the memory window a hex edit window. It would be soooo good to be able to type over bytes or move bytes. The current way to modify the memory is a bit cumbersome.
Need more 6502 core types. The 6502, 65C02, R6502, M38067, CCU3000 etc are all very similar and I use all of them but can't easily test code for anything but the 65(C)02.
</wish_list>
Cheers,
Lee.
Posted: Sun May 16, 2004 6:15 am
by MaN
It would be great to be able to add your on emulated/simulated devices (maybe as plugins?).
-MaN-
Posted: Mon May 17, 2004 3:40 pm
by Nightmaretony
So far, the RAM/ROM simulators seem to work out well on it so far. I have a checksum calculator for the ROM side of it and it works correctly in the simulator. The trick is more the 6522, thats all. One part of my POST tests out the interrupt which the simulator doesnt emulate, I dont think. But so far, its been shotgunning all the way out here

Posted: Mon May 17, 2004 11:15 pm
by leeeeee
You can generate timed interrupts by selecting Simulator - Generate Interrupt - Generator... (or Ctrl+Shift+G) and then set the generator to do the work. Not ideal but much better than nothing.
This works well enough to be able to run a clock written in BASIC.
Cheers
Lee.
awakened
Posted: Mon Oct 04, 2004 10:46 pm
by scratchmonkey
Just thought i'd stick my nose in and say i'm building a 65X02 emulator in C#/.net at the moment. You can (as requested) build up devices programmatically although i am working on doing this via XML and generating the system at runtime.
Sale to generate a system at the moment (minus anything to do with XML):
Bus b = new Bus();
Cpu6502 c = new Cpu6502(b);
MemoryRAM ram = new MemoryRAM(b, 0x0000, 0x4000);
// params: b =bus, base address, size
MemoryROM rom = new MemoryROM(b, 0xE800, 0x1800, "monitor.obj");
// params: b =bus, base address, size, binary image
c.Reset();
while(true)
c.ExecInstruction();
This is in the early stages of development but assuming i get a few minutes here and there, i'll try and get a release out before the end of the year.
When i say 65x02, there is a base 6502 model on which you could build a 65C02, 65C102
Posted: Thu Jul 07, 2005 2:52 pm
by daniel_bingamon
I have written a Machine Language Monitor with assemble and dissasemble functions in plain C. It was part of an unfinished 6502 simulator project. If anyone is interested, send me a private message.
Posted: Tue Aug 02, 2005 9:48 pm
by Raf
if anyone would like some of polish texts translated - just ask me
Posted: Fri Aug 05, 2005 10:42 am
by Ruud
if anyone would like some of polish texts translated - just ask me
Niema problemu, moja kochana jest Polka :)
But regarding emulators, for those who don't know: at
http://www.viceteam.org/ you'll find an emulator that can emulate various Commodores computers and drives. Written in C, freeware.
The emulation covers the 6545, a 6845 clone, 6520 (6821 clone), 6522, 6551 and various other IC's. IMHO a matter of rearranging the hardware, implementing your own Kernal and have it a go.
The above is just an idea, I myself am more a Pascal guy and my C knowledge isn't that good.
Posted: Fri Aug 05, 2005 1:04 pm
by Raf
offtopic
Niema problemu, moja kochana jest Polka
heheh... przeczytalem to kiedys na Twojej stronie internetowej

gdzie znalazles Polke w holandii?

Posted: Sat Dec 30, 2006 8:36 pm
by Mats
After having read Leee..s entusiastic contribution I decided to try this Kowalski system. Certainly nicely integrated. But for W65c02 users it is annoying that the "new operations" like
etc are unknown!
And according to my understanding a string is a label if and only if it starts at column 1. This syntax is used by the assembler I wrote myself. But the Kowalski assembler takes for example "STA" as the operation, not as a label, even if it starts at column 1. But this is the old story that the assembler syntax is not absolutely standardised.
Posted: Sun Dec 31, 2006 12:26 pm
by Mats
The Kowalski simulator is fine to test out pure 6502 code not using the new W65C02 operations that one anyway can live very well without.
"MaN" writes:
It would be great to be able to add your on emulated/simulated devices (maybe as plugins?).
No, I think this would be too big a task and even if in theory possible it would in practise probably be a "never ending project". And in any case not be worth the effort!
Then it would be better to make a full "in-circuite emulator" with a PC reading/writing all the pins of the 6502. The interface between the 6502 socket and the PC port could for example go over shift registers read/written by the PC (like for a typical EPROM programmer)
The classical approach is to debug using a Monitor like for example the MOS Monitor and to put BRK commands in the code. I have developped a very user friendly version of this! I have written a "demon" program on the 6502 system that is controlled by commands from a PC. These commands go from the PC parallel port to one of the 2 ports of a 6522 chip. This "demon" do all the usual Monitor tasks and sends data to the PC over the interface for display on the PC screen. In principle you see the same data on the PC screen as you see when using the Kowalski simulator. It is just that the program was executed on the 6502 system, not the PC, with the whole actual system (peripherical chips) interfacing with 6502 chip.
If there is interest for this and if Michael puts space on the WEB site to my disposal I would be willing to write up a description of this system (including the software for down-load).
Posted: Sun Dec 31, 2006 3:18 pm
by leeeeee
But for W65c02 users it is annoying that the "new operations" like
etc are unknown!
65C02 opcodes such as ..
.. work only in 65C02 mode. to set this mode go to
Simulator -
Options... -
General and select the
65C02, 6501 button.
Lee.