6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Jun 02, 2024 4:28 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon Apr 12, 2021 5:27 pm 
Offline

Joined: Mon Apr 12, 2021 4:43 pm
Posts: 3
Hi, I'm new. I hope newbie questions about C64 emulation are okay here.

I want to try to write a C64 emulator as a learning exercise. I started with implementing the 6510, which passes all these tests, and bank switching code.

Now when I run the C64 ROMs, the machine keeps running the RAM test (FD6C - FD86) loop forever, when it should be done after ~560k instructions according to VICE.

I currently have no other emulated hardware except for very incomplete CIAs, which I suppose could be the reason for this issue, but I can't tell it's missing hardware, or a bug in the CPU, or in the memory access routines. Can anyone here tell whether an emu should be able to get past this loop with nothing but CPU and memory emulation? I've read the disassembly and from what I understand I think I should be able to pass this RAM test.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 12, 2021 6:44 pm 
Offline

Joined: Thu Oct 05, 2017 2:04 am
Posts: 62
Hi,

Not sure about the C64 memory test, but maybe it would help to try swapping-in my MCL65+ 6502 emulator to see if you get the same results? This emulator works in the VIC-20 and Apple II+ actual hardware, so should be able to tell you if the problem is your CPU emulator or your emulated hardware.

https://github.com/MicroCoreLabs/Projec ... L65%2B.ino

-Ted


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 12, 2021 8:32 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10815
Location: England
Welcome grumpy!

If you've narrowed it down to some 30-odd bytes, that should be a help. Please share the code you're running - everyone here knows 6502 but only a fraction know C64. Help us to help you!


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 12, 2021 8:43 pm 
Offline

Joined: Mon Apr 12, 2021 4:43 pm
Posts: 3
Thanks guys, I found the issue. My indirect addressing modes were faulty and the bug wasn't caught by the functional tests. The emulated C64 now completes its entire boot sequence, yay :)


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 12, 2021 8:50 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10815
Location: England
Good to hear!

It would be great if you could feed the details to Klaus, so he could improve the tests. (It would be enough to describe them here.)


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 12, 2021 9:56 pm 
Offline

Joined: Mon Apr 12, 2021 4:43 pm
Posts: 3
Yeah, I'll try and make a test case for the missed bug. Maybe there should be tests for every addressing mode that fill and compare a couple of RAM pages, just like the C64 RAM test. With my bugged implementation, the same page was tested over and over instead of progressing to the next page. How an error like that could be detected is beyond me though.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 13, 2021 4:17 am 
Offline

Joined: Thu Oct 05, 2017 2:04 am
Posts: 62
withdrawn


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 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: