6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Oct 06, 2024 2:30 am

All times are UTC




Post new topic Reply to topic  [ 56 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject:
PostPosted: Wed Mar 14, 2007 12:05 pm 
Offline

Joined: Sun Feb 05, 2006 1:20 am
Posts: 21
Location: The Netherlands
Mats wrote:

But as the ATARI has a 65** CPU (6507) it must also start the execution at the memory position it reads from address $FFFC,$FFFD. What kind of memory/circuitry is mapped to this address if it is not ROM?

ROM is not built in, but in de game cartridges only.

_________________
I trust my somewhat flawed English is comprehensible to all.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 14, 2007 12:29 pm 
Offline

Joined: Sun Aug 24, 2003 7:17 pm
Posts: 111
Looking into "Wikipedia" I have learned that 6507 only had 13 address pins for 8K of memory and was lacking the interrupt functions but otherwise was identical to 6502. A part of this 8K address space was mapped into the "game cartridge" where the "game application program" was resident.

To my understanding this must mean that the top of the address space,

???? - $1FFF

was ROM with reset vector either in $1FFC,$1FFD (as for 6502) or in $1FFE,$1FFF (no IRQ or NMI). Programming a game then means (re)programming the cartridge (what hardware is needed for this) while the operating system in ???? - $1FFF never is touched!

wstjohn's

Code:
*= $FFFA
.word Start ; NMI
.word Start ; RESET
.word Start ; IRQ


therefore has no meaning. The top of the memory is $1FFF and the ROM in ???? - $1FFF is of no concern for the game developer, he only deals with the cartridge area in the lower part of the memory, $0000 - ????-1

Execution must then start in the operation system resident in ROM and the game starts with a JSR or a JMP statement to the cartridge entry when the the start-up sequence has terminated. As there is no IRQ the application program resident in the cartridge must then actively pass control to operating system services (user/TV interface) by JSR to system routines in ROM.

Is this correct?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 14, 2007 1:03 pm 
Offline

Joined: Tue Mar 06, 2007 6:37 pm
Posts: 5
As I understand it, the 6507 has a 16-bit internal address space and PC like a real 6502, it just lacks some of the address pins. So the ROM cartridge probably has aliases at 8k intervals all the way up to e000-ffff. In which case it
sort of makes sense to say that by convention you're going to write code whose ORG is in the top alias as that puts the vectors at the addresses
everyone expects.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 14, 2007 2:14 pm 
Offline

Joined: Sun Aug 24, 2003 7:17 pm
Posts: 111
gnb10 writes:

Quote:
As I understand it, the 6507 has a 16-bit internal address space and PC like a real 6502, it just lacks some of the address pins. So the ROM cartridge probably has aliases at 8k intervals all the way up to e000-ffff.


Makes sense! It then just that the 3 most significant address lines goes to "dead ends" and that the power-up vector definitely is is in $1FFC,$1FFD alias $FFFC,$FFFD while $1FFA,$1FFB alias $FFFA,$FFFB and $1FFE,$1FFF alias $FFFE,$FFFF just is "rubbish" used for nothing. But this does not change that there is a range in memory including $1FFC,$1FFD (alias $FFFC,$FFFD) that must not (cannot?) be touched by the programmer of the (game) application! Either it physically is in a "fixed" (unprogrammable)part of the cartridge or in a ROM chip resident in the console itself

raccon writes:

Quote:
ROM is not built in, but in de game cartridges only.


Well, if the ROM containing the system software physically is resident in the removable cartridge or in the console itself does not change much. But it seems strange that at a time when ROM was expensive one puts one copy in each cartridge increasing the hardware cost of these cartridges!?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 14, 2007 5:41 pm 
Offline

Joined: Tue Mar 06, 2007 6:37 pm
Posts: 5
Quote:
Well, if the ROM containing the system software physically is resident in the removable cartridge or in the console itself does not change much.

I don't think there was any system software as such. Each cartridge will contain the game plus all the support code it needs, and the reset vector just points to wherever the author of that particular cartridge has put the startup code.
This makes the base console cheaper, at the expense of possibly making the cartridge more expensive if it forces the code size up past a chip size boundary.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 14, 2007 6:37 pm 
Offline

Joined: Sun Aug 24, 2003 7:17 pm
Posts: 111
gnb10 writes:

Quote:
I don't think there was any system software as such. Each cartridge will contain the game plus all the support code it needs, and the reset vector just points to wherever the author of that particular cartridge has put the startup code.
This makes the base console cheaper, at the expense of possibly making the cartridge more expensive if it forces the code size up past a chip size boundary.


If this is how it is I would be interested to get a hex dump of such a cartridge for disassemble/analysis on simulator! I cannot believe that interface to the TV video and the joysticks can be made much simpler then the interface to a keyboard and a (video) monitor (like for example on a PET).

And how is such a cartridge programmed? Are there normal EPROMs inside? Pin-compatible with now available and manifactured EPROMs. Or at least programmable with now available Prommers?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 14, 2007 8:57 pm 
Offline

Joined: Tue Nov 18, 2003 8:41 pm
Posts: 250
Mats wrote:
gnb10 writes:

[
If this is how it is I would be interested to get a hex dump of such a cartridge for disassemble/analysis on simulator!


umm, there's this thing called Google ..

;)


http://www.io.com/~nickb/atari/


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 15, 2007 9:28 pm 
Offline

Joined: Sun Sep 15, 2002 10:42 pm
Posts: 214
Mats wrote:
If this is how it is I would be interested to get a hex dump of such a cartridge for disassemble/analysis on simulator! I cannot believe that interface to the TV video and the joysticks can be made much simpler then the interface to a keyboard and a (video) monitor (like for example on a PET).

And how is such a cartridge programmed? Are there normal EPROMs inside? Pin-compatible with now available and manifactured EPROMs. Or at least programmable with now available Prommers?


There is no built-in ROM on the Atari VCS. There is no built-in ROM on the Nintendo 8-bit, 16-bit, Super Nintendo, or Sega Genesis either.

Not EPROMS. Mask programmed ROMs.

Toshi


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 16, 2007 11:52 am 
Offline

Joined: Sun Aug 24, 2003 7:17 pm
Posts: 111
bogax found the page

Quote:


The following memory mapping is specified there:

VIDEO $0000-$007F
RAM $0080-$00FF
VIDEO $0100-$017F
STACK $0180-$01FF
IO $0281-$0285

ROM $1000-$1FFF

The game "combat" has a reset vector pointing to the ROM start at $1000 and the initialisation done is:

Code:
START   ; Two bytes of housekeeping that must be done...
        SEI  ; Disable interrupts
        CLD  ; Clear decimal bit
        LDX  #$FF
        TXS  ; Set stack to beginning.
        ; In all truthfulness,
        LDA  #$10
        STA  SWCHB+1    ;Port B data direction register,  SWCHB=$0281
 


Really not much but at least this has to be done. The hardware hardly needs any initialisation! The state of the joysticks can be read from an I/O port of the chip in $0281-$0285, only the data direction must be set.

Tmorita wrote:

Quote:
Not EPROMS. Mask programmed ROMs


But user wstjohn who wants to write new games would need some pin compatible EPROMS or get/make a suitable adapter!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 16, 2007 2:14 pm 
Offline

Joined: Sun Aug 24, 2003 7:17 pm
Posts: 111
For the benifit of "wstjohn" I put at the end of

http://www.geocities.com/matsr2007/

the source code of the Atari game "Combat" slightly modified to be compatible with the Kowalski assembler/simulator. This is certainly a good template for a Atari game. The hardware problem, to interface an Eprom, is then another story!


Top
 Profile  
Reply with quote  
 Post subject: epilogue
PostPosted: Fri Mar 16, 2007 2:16 pm 
Offline

Joined: Sun Mar 04, 2007 1:47 am
Posts: 19
Well, my original problem ended up being my fault all along. I was hard coding a variable to memory location $FFAA (really $1FAA for the 6507), which is a ROM location. I did this to test the ability to access ROM memory from 16 bit pointers.
I eventually got the pointers to work in a real program (on all 3 emulators), but was having problems originally b/c I 'illegally' tried to set a variable to a hard coded ROM location.
So, everything seems to be working now, but I'm sure I will eventually encounter more problems. Thanks again to everyone for their help.


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

All times are UTC


Who is online

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