Michal Kowalski's 6502 simulator
-
leeeeee
- In Memoriam
- Posts: 347
- Joined: 30 Aug 2002
- Location: UK
- Contact:
Michal Kowalski's 6502 simulator
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.
http://exifpro.com/utils.html
Anyone here fancy actively developing it? I don't have the time (or C experience) ATM.
Cheers,
Lee.
Last edited by leeeeee on Sat Dec 03, 2011 9:48 am, edited 1 time in total.
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
I'll take a look at it.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
-
Nightmaretony
- In Memoriam
- Posts: 618
- Joined: 27 Jun 2003
- Location: Meadowbrook
- Contact:
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
....
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
"My biggest dream in life? Building black plywood Habitrails"
-
leeeeee
- In Memoriam
- Posts: 347
- Joined: 30 Aug 2002
- Location: UK
- Contact:
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.
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.
-
Nightmaretony
- In Memoriam
- Posts: 618
- Joined: 27 Jun 2003
- Location: Meadowbrook
- Contact:
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 
"My biggest dream in life? Building black plywood Habitrails"
-
leeeeee
- In Memoriam
- Posts: 347
- Joined: 30 Aug 2002
- Location: UK
- Contact:
-
scratchmonkey
- Posts: 12
- Joined: 28 Apr 2004
awakened
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):
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
Sale to generate a system at the moment (minus anything to do with XML):
Quote:
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();
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();
When i say 65x02, there is a base 6502 model on which you could build a 65C02, 65C102
-
daniel_bingamon
- Posts: 5
- Joined: 22 Jan 2003
- Location: Kings Mills, OH
- Contact:
if anyone would like some of polish texts translated - just ask me
owns 1xC128, 1x128D cr ,1xc64 (broken unfortunately) ,1xc64c ,2xc64g (one is broken) ,~4xc64e ,1x1541 ,1x1541-II ,1x1541C and some chips for those machines
www.vulture.c64.org
www.rafalszyja.republika.pl
www.vulture.c64.org
www.rafalszyja.republika.pl
Raf wrote:
if anyone would like some of polish texts translated - just ask me
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.
Code: Select all
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: www.baltissen.org
offtopic 
Niema problemu, moja kochana jest Polka
heheh... przeczytalem to kiedys na Twojej stronie internetowej
gdzie znalazles Polke w holandii? 
Ruud wrote:
Niema problemu, moja kochana jest Polka
owns 1xC128, 1x128D cr ,1xc64 (broken unfortunately) ,1xc64c ,2xc64g (one is broken) ,~4xc64e ,1x1541 ,1x1541-II ,1x1541C and some chips for those machines
www.vulture.c64.org
www.rafalszyja.republika.pl
www.vulture.c64.org
www.rafalszyja.republika.pl
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.
Code: Select all
LDA (L1)
STZ
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.
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:
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).
"MaN" writes:
Quote:
It would be great to be able to add your on emulated/simulated devices (maybe as plugins?).
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).
-
leeeeee
- In Memoriam
- Posts: 347
- Joined: 30 Aug 2002
- Location: UK
- Contact:
Mats wrote:
But for W65c02 users it is annoying that the "new operations" like
etc are unknown!
Code: Select all
LDA (L1)
STZ
Code: Select all
LDA (zp)
STZ addr
Lee.