Search found 7 matches

by dave18
Thu Sep 08, 2011 9:23 am
Forum: Emulation and Cross Development
Topic: VIA Timers
Replies: 18
Views: 4736

Problem solved. Turns out the internal roms I was using were different to those VICE uses and the kernal set different latch values. Just changed to the VICE roms and problem solved.

Thanks for all the help, I'm sure I'll be back soon asking more questions!

Dave
by dave18
Wed Sep 07, 2011 4:35 pm
Forum: Emulation and Cross Development
Topic: VIA Timers
Replies: 18
Views: 4736

Ok. Turns out it the code does simply rely on the 1 in 9 chance. This has uncovered another issue, for some reason as mentioned in my first post my emulator initiates the latch (or the CBM kernal does) as $4289 whereas the correct value according to VICE is $4826. If I hardcode my emulator to latch ...
by dave18
Wed Sep 07, 2011 1:07 pm
Forum: Emulation and Cross Development
Topic: VIA Timers
Replies: 18
Views: 4736

I did look at the VICE source to try and work out how it handled the VIA Timers and embarrassingly I can't find any source related to them. I assumed it would be in the vic20via2.c file in the vic20 sub-directory but couldn't see anything. Also tried the interrupt.c file in the main source directory...
by dave18
Wed Sep 07, 2011 10:29 am
Forum: Emulation and Cross Development
Topic: VIA Timers
Replies: 18
Views: 4736

If I set a breakpoint at $203A in VICE and load and run Skyhawk the routine is called as soon as refulling is complete. At this point the latch is set to $4826 and this is causing a problem as with the counter only being set to $FFFF for one cycle the routine never gets to read it (obviously not for...
by dave18
Tue Sep 06, 2011 4:51 pm
Forum: Emulation and Cross Development
Topic: VIA Timers
Replies: 18
Views: 4736

Thanks for all the info. Although I struggle to interpret some of the timing diagrams it appears that in continuous mode it take 6 cycles to write the latches. So even though it only reads $FFFF for 1 cycle it will count down even further before the latches are written, ie it will hit zero and then ...
by dave18
Tue Sep 06, 2011 1:16 pm
Forum: Emulation and Cross Development
Topic: VIA Timers
Replies: 18
Views: 4736

Thanks for the answer, I suspected the timer was wrapping. I'm still struggling to find information on the timings though. The datasheet at this link http://www.applevault.com/twiki/Main/Mockingboard/6522.pdf says 'However, instead of continuing to decrement from zero after a time-out, the timer aut...
by dave18
Tue Sep 06, 2011 10:03 am
Forum: Emulation and Cross Development
Topic: VIA Timers
Replies: 18
Views: 4736

VIA Timers

Hi I'm new here, I'm writing a VIC 20 emulator for ARM platforms and this seems a great place to come for advice. I'm trying to understand exactly what happens when a free running Timer 1 reaches zero. Currently I have it loading in the latch value and continuing to count down however some programs ...