Jump to content
IGNORED

7800 PAL BIOS


DanBoris

Recommended Posts

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

palbios.txt

Link to comment
Share on other sites

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/files/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.

Link to comment
Share on other sites

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.

 

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.

Link to comment
Share on other sites

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	

Link to comment
Share on other sites

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

 

909156[/snapback]

 

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

 

Mitch

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...