It is currently Mon Jan 22, 2018 4:57 am

All times are UTC - 5 hours




 Page 1 of 1 [ 3 posts ] 
Author Message
 Post subject: Emulation correct for 8Mbit .bin and .car?
PostPosted: Sat Jan 08, 2005 11:47 am 

Joined: Thu Jan 06, 2005 7:28 pm
Posts: 2
Thanks to Steve for the info on the bank switching of the atarimax cart.
I haven't got all the software installed yet or the real cart working, so I'm just trying things out using the modified emulator to start with. (Can someone post a .bin or .car example rather that an .atr image for me to have a look at until I get things set up please?)

Having a bit of trouble with the emulator though:

8Mbit carts start to run with bank 128, and 1Mbit cart from bank 0?
(emulator always starts in bank 0 for either cart size when I try it though)

Will I have to try on real hardware to test the reset key behaviour?
(The instructions say the emulator should have basic disabled, and I can't make much sense of the coldboot/warmboot behaviour exhibited by the emulator - how can I make things reset safe?)

Could anyone explain a bit more about problems with the maxcart and PORTB mentioned in the manual?
(I want to be able to switch the OS/basic off as soon as possible)

The High score saving versions of games is an excellent idea! Is there any example code of how to do this?

Is the bank switching instantaneous on the real atarimax hardware, or are there delays that could occur?
(I plan to be switching banks 100's if not 1000's of times a second in some of my code)


A lot of questions, I know, and I'm sorry if any have already been answered before - just point me in the right direction!

Thanks in advance
Chris


Offline
 Profile  
 
 Post subject: Re: Emulation correct for 8Mbit .bin and .car?
PostPosted: Tue Jan 11, 2005 12:06 am 
ERROR AT LINE 0
User avatar

Joined: Tue Aug 05, 2003 9:55 am
Posts: 1035
Location: Cleveland, Ohio
Sheddy wrote:
Thanks to Steve for the info on the bank switching of the atarimax cart.
I haven't got all the software installed yet or the real cart working, so I'm just trying things out using the modified emulator to start with. (Can someone post a .bin or .car example rather that an .atr image for me to have a look at until I get things set up please?)


I have attached a 8mbit multicart image in .bin format. :)

Sheddy wrote:
8Mbit carts start to run with bank 128, and 1Mbit cart from bank 0?
(emulator always starts in bank 0 for either cart size when I try it though)


Are you sure its actually starting in bank 0 for 8mbit carts? The 8mbit images all immediately switch to bank 0 when they start, maybe you are just seeing it after it switches? If not please let me know. Here is the Cart_Start() function from Atari800Win that I use for the 8mbit cart:

case CART_ATARIMAX_8192:
Cart_Atarimax_Disable();
Cart_Atarimax_Enable();
CopyROM(0xa000, 0xbfff, cart_image + 0xfe000);
bank = 127;
break;

Sheddy wrote:
Will I have to try on real hardware to test the reset key behaviour?
(The instructions say the emulator should have basic disabled, and I can't make much sense of the coldboot/warmboot behaviour exhibited by the emulator - how can I make things reset safe?)


There isnt any 'reset' behavior for the cartridges, the carts never see a 'reset'. The OS may do different things when you reset the computer, but if you have the OS turned off, you will be providing your own reset vector code, so you will not get any unwanted behaviors.

The emulator also does not behave like a real Atari when you press reset. Instead of just stopping execution and going to the reset vector, it does a lot of other things a real Atari would never do, like clearing memory, changing hardware bits, etc.

The real cartridge itself will stay in whatever state you left it in, until something, your code or OS code, touches the CCTRL area @ D500.

If you can be more specific about what your going to be doing, as far as turning off the OS, etc, maybe I can provide more information?

Sheddy wrote:
Could anyone explain a bit more about problems with the maxcart and PORTB mentioned in the manual?
(I want to be able to switch the OS/basic off as soon as possible)


I wrote the manual quote awhile ago, could you point me to exactly what PORTB problem I was talking about? :)

Sheddy wrote:
The High score saving versions of games is an excellent idea! Is there any example code of how to do this?


Not yet, but there should be soon. People have been testing it for awhile, in the Ultima and Summer Games cart and it seems stable. For now just plan on leaving one 64k area above bank 0x40 blank for saving items and it will be compatible later on with the saving code.

Sheddy wrote:
Is the bank switching instantaneous on the real atarimax hardware, or are there delays that could occur?
(I plan to be switching banks 100's if not 1000's of times a second in some of my code)


Any bank switching operation will complete within a single instruction. So this will work fine:

lda $d500 ; turn cart on
lda $a000 ; get a byte
sta $d501 ; bank 1
ldx $a000 ;
stx $d580 ; cart off
sta $a000 ; save in ram under cart
stx $a001 ; save in ram under cart
sta $d500 ; cart back on

If you have the XL/XE OS enabled, remember there is a software cartridge interlock in the OS VBI routine that checks to see if a cart has been pulled out suddenly or suddenly inserted.

So if the OS VBI routine is installed and running every 1/60th second, you will have to disable interrupts before turning the cartridge on or off, and update the interlock register to reflect its new state before turning the VBI back on. This is not required to switch banks, only to turn from off to on, or on to off.

There is code in every flash cart module source file that shows how to do this safely and quickly. If you are going to rid yourself of the OS anyway for your game, you wont have to worry about the interlock anyway.

Sheddy wrote:
A lot of questions, I know, and I'm sorry if any have already been answered before - just point me in the right direction!


Hope I was able to answer some of them, feel free to followup and send me a PM if I dont respond soon, sometimes I dont check the message boards for a week or so, but a PM will send me an e-mail to remind me. :)

Steve


There are images and/or files attached to this posting. You must be logged-in to view or download this content.


Offline
 Profile  
 
 Post subject: Re: Emulation correct for 8Mbit .bin and .car?
PostPosted: Tue Jan 11, 2005 4:04 pm 

Joined: Thu Jan 06, 2005 7:28 pm
Posts: 2
thanks for the answers Steve,
that clears most things up.

...just found I was using an earlier (or maybe corrupt) version of the emulator(Aug 2003 - 201,216 bytes)
Downloaded the latest version (Sep 2003 - 196,608 bytes) and the banks work just fine, like you say. :oops:

Thanks for the binary too - I'll have a look at that to make sure I've done nothing further dumb, and try playing more with the good version of the emulator and the real thing before bothering you any more!

regards
Chris


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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: