Jump to content



0

7800 PAL BIOS


8 replies to this topic

#1 DanBoris OFFLINE  

DanBoris

    Dragonstomper

  • 930 posts
  • Location:New Jersey, USA

Posted Wed Aug 10, 2005 6:47 PM

Has anyone ever looked at the disassembly of 7800's PAL BIOS? A question came up on the 7800 programming mailing list about how the BIOS knowns when to run the internal Asteroids ROM, so I decided to disassemble the BIOS and take a look. There are some odd things going on in there that I don't quite understand. I have attached the partially commented disassembly (don't take any of the comments as gospel). I would like to here anyone elses comments on this.

Dan

Attached Files



#2 Bruce Tomlin OFFLINE  

Bruce Tomlin

    River Patroller

  • 3,531 posts
  • CD C9 01
  • Location:Austin, TX

Posted Wed Aug 10, 2005 7:24 PM

DanBoris, on Wed Aug 10, 2005 7:47 PM, said:

Has anyone ever looked at the disassembly of 7800's PAL BIOS? A question came up on the 7800 programming mailing list about how the BIOS knowns when to run the internal Asteroids ROM, so I decided to disassemble the BIOS and take a look. There are some odd things going on in there that I don't quite understand. I have attached the partially commented disassembly (don't take any of the comments as gospel). I would like to here anyone elses comments on this.
You might want to start with the original 7800 BIOS source code first.

http://atari7800.net.../7800source.asm

This is the genuine original Atari source code, which I typed in from a printout. It has very few differences from the released NTSC BIOS.

#3 Bruce Tomlin OFFLINE  

Bruce Tomlin

    River Patroller

  • 3,531 posts
  • CD C9 01
  • Location:Austin, TX

Posted Wed Aug 10, 2005 8:03 PM

Wow, there's not much to it in the PAL version, is there?

Not that there needs to be. Once you take out the stupid CPU test, and the signature validiation, there really isn't much left.

#4 Bruce Tomlin OFFLINE  

Bruce Tomlin

    River Patroller

  • 3,531 posts
  • CD C9 01
  • Location:Austin, TX

Posted Wed Aug 10, 2005 9:33 PM

Try starting from this...

Attached Files



#5 DanBoris OFFLINE  

DanBoris

    Dragonstomper

  • 930 posts
  • Location:New Jersey, USA

Posted Thu Aug 11, 2005 7:52 AM

Bruce Tomlin, on Wed Aug 10, 2005 10:33 PM, said:

Try starting from this...

View Post


Where is this from?

Dan

#6 Bruce Tomlin OFFLINE  

Bruce Tomlin

    River Patroller

  • 3,531 posts
  • CD C9 01
  • Location:Austin, TX

Posted Thu Aug 11, 2005 9:07 AM

I disassembled the ROM, then took the original Atari source code and copied over any lines that matched. You can tell because they're indented more.

What's interesting is that they messed with the 2600 startup so much. Considering that most of that stuff is fluff anyhow, I don't know what they were doing.

Quote

The BIOS compares FE00-FE7F with FE80-FF00 and if they are the same, it
assumes there no cartridge and jumps to internal game.

          LDY     #$FF
          LDX     #$7F                  ;SEE IF A CART PLUGGED IN
CTSTLOOP LDA     $FE00,X
          CMP     $FD80,Y
          BNE     NOCART
          DEY
          DEX
          BPL     CTSTLOOP              ;X LEFT = FF, Y LEFT = 7F

Look closer. It's actually using different index offsets when comparing $FE00-$FE7F to itself to make sure that it's not reading bus float. Very clever.

#7 DanBoris OFFLINE  

DanBoris

    Dragonstomper

  • 930 posts
  • Location:New Jersey, USA

Posted Thu Aug 11, 2005 10:42 AM

I thought this was interesting. It appears to be counting the number of scanlines in a video frame.


FFCB: 24 28      bit  $28
FFCD: 30 FC      bmi  $FFCB
FFCF: A9 9E      lda  #$9E
FFD1: A0 00      ldy  #$00

FFD3: A2 00      ldx  #$00
FFD5: 24 28      bit  $28;Wait for VBLANK
FFD7: 30 07      bmi  $FFE0;
FFD9: 85 24      sta  $24;WSYNC
FFDB: 85 24      sta  $24;WSYNC
FFDD: CA         dex    
FFDE: D0 F5      bne  $FFD5

FFE0: E0 78      cpx  #$78;Branch if > 120
FFE2: B0 04      bcs  $FFE8;
FFE4: A9 98      lda  #$98
FFE6: A0 2B      ldy  #$2B
FFE8: 85 30      sta  $30
FFEA: 8C 01 20   sty  $2001	


#8 Mitch ONLINE  

Mitch

    Quadrunner

  • 5,769 posts
  • 7800 Guy
  • Location:Southern California, USA

Posted Thu Aug 11, 2005 2:10 PM

DanBoris, on Thu Aug 11, 2005 9:42 AM, said:

I thought this was interesting. It appears to be counting the number of scanlines in a video frame.

View Post


That's probably part of the NTSC/PAL autodetect routine, since that BIOS works fine in either a PAL or NTSC 7800.

Mitch

#9 Bruce Tomlin OFFLINE  

Bruce Tomlin

    River Patroller

  • 3,531 posts
  • CD C9 01
  • Location:Austin, TX

Posted Thu Aug 11, 2005 5:19 PM

Cool! I'm most definitely snarfing that bit of code. :-)

Edited by Bruce Tomlin, Thu Aug 11, 2005 5:21 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users