6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Oct 24, 2024 10:22 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Atari 2600 questions
PostPosted: Mon Aug 29, 2016 8:55 pm 
Offline

Joined: Mon Jul 20, 2015 6:34 pm
Posts: 62
I was busy with my c64 cartridge project IRQHack64 lately so I haven't got the chance to contribute to the forum.

I started fresh with a new cartridge project for Atari 2600. I intend to create a cartridge that plays games from a sd card. I'm using a STM32 arm chip.

This is just an introduction but I have 6502 questions related to the atari 2600 hardware.

Atari 2600 have a 6507 chip which mainly has reduced address space and doesn't have interrupts.

As seen from the schematics the console doesn't even have a reset hardware, all that there is just a parallel capacitor with a resistor.

First question : How come this thing got a reset on cpu?

My challenge is : Boot code by emulating an eprom by a stm microprocessor. If that micro boots after 6507 has been reset than there is no means to reset the cpu by the cartridge port. Cartridge port only have address lines (A0..A12) and databus (D0..D7) brought. A12 is used to tell cpu need to access rom on the cartridge. No R/W lines.

Second question : Cartridge port doesn't have a R/W signal. Some cartridges have extra memory on them which are accessed through read and write ports which I guess the original equipment used address decoding to produce the R/W signal. Now the actual question is : With a pure rom cartridge, wouldn't a write access from cpu fight the bus with the rom (eprom or whatever) trying to drive the bus with the contents of the memory? Isn't that a problem?


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Mon Aug 29, 2016 9:01 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10962
Location: England
As it happens, we just discussed multi-bank ROMs over on Stardot. It turns out that the bank-switching port, in at least one case, is a read port. It's enough to read a special address to trigger a bank switch, if you have as many special addresses as you have banks. No need to write, and so no difficulty with having two drivers on the bus. (I think it should be possible, with a suitable arrangement on the cartridge, to have some write-only addresses. What's not so easy is to have addresses which can both read and write.)

(As a copy-protection tactic, the special bank-switching read ports can also act as normal ROM data and code.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Mon Aug 29, 2016 11:21 pm 
Offline
User avatar

Joined: Sat Dec 07, 2013 4:32 pm
Posts: 246
Location: The Kettle Moraine
I know very little about the VCS, but I don't think a ROM cartridge will have code to write to the cartridge. It's probably just that simple. There probably aren't cartridges with bugs except the ones that have bugs. :)

As far as reset, it was common for consumer electronics at that time to be reset by cycling the power. This can be seen famously on the Commodore 64.


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Mon Aug 29, 2016 11:29 pm 
Offline

Joined: Mon Jul 20, 2015 6:34 pm
Posts: 62
Of course original hardware should be examined but another question arises about bankswitching. Is it happening at the same cycle with the read access to the determined address?

Say a LDA $1FF8 switches banks... do A register contain the rom value at $1FF8 at the end of the operation or is it just undetermined. I guess there would be no intention to read for such a case. Still it's not clear from the docs I read so far.

About the reset... no C64 had a proper reset circuit with a 555 timer ic.

About the no write to rom address space by software : I for one wouldn't rely on software to behave if indeed bus driven by two sources could do any harm.


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Tue Aug 30, 2016 2:07 am 
Offline
User avatar

Joined: Sat Jun 08, 2013 4:02 pm
Posts: 46
Without a hardware mod of installing a push button to short pin 2 of the 555 to ground, the only other way to hard reset the C64 once it was up and running was to cycle power.

it was possible to program a key combination to soft reset the C64, but that's not the same thing.

_________________
"I am endeavoring, ma'am, to create a mnemonic memory circuit... using stone knives and bearskins." -- Spock to Edith Keeler


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Tue Aug 30, 2016 3:58 am 
Offline
User avatar

Joined: Sat Dec 07, 2013 4:32 pm
Posts: 246
Location: The Kettle Moraine
i_r_on wrote:
About the no write to rom address space by software : I for one wouldn't rely on software to behave if indeed bus driven by two sources could do any harm.

You have two options here.

You can assume that none of the software behaves incorrectly (really, it probably doesn't, but you can't guarantee anything with all the new homebrew titles).

Or, you can design your hardware so that it isn't damaged by bus contention. You cannot redesign the VCS, so if it can be damaged this way (unlikely), there's nothing you can do about it anyway. Unless every title uses the same RAM access scheme (they probably don't!), you'll have to go this route anyway, or avoid titles that use a RAM access scheme incompatible with your hardware.


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Tue Aug 30, 2016 2:08 pm 
Offline

Joined: Mon Jul 20, 2015 6:34 pm
Posts: 62
@richardc64 : Actually I was talking about the hardware part, of course there is no reset functionality provided to the end user on c64.

I examined the 2600 circuit again. It seems I misinterpreted the reset part. Pin pulled high with a resistor, also it's tied to GND with a capacitor. This setup generates the needed pulse on the Reset pin.

Here are the reset circuits of both systems. (2600 up, down is C64)


Attachments:
Reset2600vsC64.png
Reset2600vsC64.png [ 128.98 KiB | Viewed 2266 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Tue Aug 30, 2016 2:29 pm 
Offline
User avatar

Joined: Sat Dec 07, 2013 4:32 pm
Posts: 246
Location: The Kettle Moraine
Either way, the only way a reset happens is by cycling the power. There's nothing you can do about that without modifying the hardware, unfortunately. There may be a way to send the uP to the reset vector by telling it to JMP there from the cartridge port.


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Tue Aug 30, 2016 3:04 pm 
Offline

Joined: Mon Jul 20, 2015 6:34 pm
Posts: 62
The quick and dirty solution to the startup problem would be to use some kind of startup rom or similar thing that keeps the cpu in a predefined state. Even a controllable free running mode would do. (tieing the databus to EA)


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Tue Aug 30, 2016 3:45 pm 
Offline

Joined: Sun Jun 29, 2014 5:42 am
Posts: 352
There's probably more than you ever wanted to know about Atari 2600 bank switching here:
http://stella.sourceforge.net/bankswitching-methods.pdf

This document also describes how some cartridges include RAM, even though there is no R/W signal present.

You might also want to look at Retromaster's A2601 (Atari 2600 on FPGA) project:
https://retromaster.wordpress.com/a2601/

I've used a Papilio port of this called Papilio Arcade:
https://github.com/GadgetFactory/Papilio-Arcade

It implements various bank switching methods here:
https://github.com/GadgetFactory/Papili ... oFlash.vhd

Dave


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Tue Aug 30, 2016 7:58 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8525
Location: Southern California
I made an I/O expansion board for the C64 when one of our sons was using the C64 a lot. Because of the lack of a reset button, I added that function on the board. This was a plug-in board, not a modification of the C64 itself. You can see it (including a poor scan of the pencil-drawn circuit) at http://6502.org/users/garth/projects.php?project=7 . It also times the reset pulse so it only stays down for about 20ms, regardless of how long you hold the button, because of the heating problem some NMOS 6502's had when the RST\ was held low too long.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Tue Aug 30, 2016 8:40 pm 
Offline

Joined: Mon Jul 20, 2015 6:34 pm
Posts: 62
By the way, searching the web I saw overdriving the databus is used safely as a hack to increase the TIA's resolution.
http://atariage.com/forums/topic/183085 ... -graduate/

It's still safe for one side (6507) though I don't know if STM32 would like it.

@hoglet : Thanks for the links. I had read the bankswitching as described by Kevin Horton here previously : http://kevtris.org/files/sizes.txt

I'll study the bank switching stuff in Retromaster's A2601 project if I can't implement it in software. Actually I got the sources for that project 4-5 months ago. The person behind it happened to be a fellow member in a local commodore related forum who I realized that I knew from his previous projects.

@GARTHWILSON : Interesting stuff really. Do you remember how much current drawn by the cartridge? Before changing paths in my C64 cartridge design I had once considered filling an sram with several tristate buffers by an arduino and then dropped that idea just because overall power consumption exceeded the supplied 350ma on expansion port from C64.


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Tue Aug 30, 2016 9:49 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10962
Location: England
i_r_on wrote:
By the way, searching the web I saw overdriving the databus is used safely as a hack to increase the TIA's resolution.
http://atariage.com/forums/topic/183085 ... -graduate/

Fascinating, and naughty. I reckon some people here will love it and some hate it. It would be even more controversial with a CMOS part, and maybe beyond unwise it wouldn't even work. We can think of it as a fast DMA channel for NMOS 6502. (As an aside, if anyone can resurrect the images meant to illustrate the hidden DMA channel as discussed here, that would be great.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Wed Aug 31, 2016 12:20 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8525
Location: Southern California
i_r_on wrote:
@GARTHWILSON : Interesting stuff really. Do you remember how much current drawn by the cartridge? Before changing paths in my C64 cartridge design I had once considered filling an sram with several tristate buffers by an arduino and then dropped that idea just because overall power consumption exceeded the supplied 350ma on expansion port from C64.

I never measured it, but from the max specified for the ICs, it should be under 5mA with no loads. Each VIA I/O pin could conceivably add several mA under normal loads.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: Atari 2600 questions
PostPosted: Wed Aug 31, 2016 4:04 am 
Offline
User avatar

Joined: Sat Dec 07, 2013 4:32 pm
Posts: 246
Location: The Kettle Moraine
The Commodore REU required a replacement power supply with higher output be attached to the C64. The C128 power supply was larger to alleviate this.

If you bought an REU for the '64, it came with the larger power supply.

There shouldn't be any reason one couldn't add an additional external supply for anything on the expansion port, if need be.


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

All times are UTC


Who is online

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