6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 01, 2024 7:26 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Fri Aug 11, 2006 6:53 pm 
Offline

Joined: Wed Mar 24, 2004 10:54 am
Posts: 38
Right where to begin.....

VIA Port B assignments

Bit Used as
7 DAV in from IEEE
6 NRFD in from IEEE
5 Retrace in from video (used for sensing when to write video RAM)
4 Tape#2 Motor control (on/off)
3 Tape data out (write line used by BOTH Tape#1 and Tape#2)
2 ATN out to IEEE
1 NRFD out to IEEE
0 NDAC out to IEEE

CB1 Tape#2 data in
CB2 Nominally assigned to User Port, BUT used on FAT-40s and 8032 as the shift register output to generate the Bell "tinkle" sound.

VIA Port A Assignments

Bits 7-0 nominally assigned to User Port

CA1 User Port
CA2 Graphics mode control out (switches between upper case & graphics/lower case & upper case fonts in CG ROM).

Timers

Timer1 Used during IEEE bus activity (disk access, printer operation etc). Also used during tape I/O
Timer2 Used heavily during tape I/O. Also used for tone generation on FAT-40s and 8032 for the Bell "tinkle"

Both timers also used as part of RND(0) function to generate "random" numbers

Interrupts

Timer1 and Timer2 interrupts are used during IEEE activity and tape I/O. CB1 interrupts are also used during tape I/O. CB2, shift register, CA1 and CA2 interrupts are NOT used by the system ROM but that doesn't mean it leaves their ACR and IER bits alone!

In addition any time there is tape I/O or IEEE bus activity the IRQ vector will get changed using values held in ROM tables, and when finished the values written back to the IRQ vector will also be from ROM tables. "Daisy chaining" of IRQ vectors is short lived unless you NEVER do any tape or IEEE access. Also during the regular 60Hz system interrupt, the cassette switch sense lines (on the PIAs) are checked and the cassette motor control lines (one on a PIA, the other on CB1 of the VIA) are set accordingly.

So to try and summarise all this as far as making productive use of the VIA on an 8032 goes, if you NEVER cause the Bell "tinkle" to sound, NEVER do any tape I/O (including pressing buttons on the cassette decks), and NEVER use any IEEE peripherals you should be fine.

However, tape and IEEE activity will clobber the IRQ vector, the ACR, PCR, IFR and IER registers.
Causing the Bell "tinkle" to sound will clobber Timer2, the shift Register and PCR register.
Pressing a button on Tape #2 deck will likely clobber the PCR.
Using CTRL "N" and CTRL "n" to switch CG character sets will clobber the PCR.

I say "clobber" as until I can disassemble some hefty chunks of the 8032 system ROMs there is no way of knowing how well it masks off bits it isn't using in the VIA registers (as opposed to the ones it uses itself but doesn't want to touch) or whether it just doesn't care and overwrites them anyway because it's not using them (common with Commodore system software).

Some quick experiments seeing what happens to your code before and after triggering the above events could be very revealing.

Enjoy!

George
:wink:


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

All times are UTC


Who is online

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