DanBoris Posted August 11, 2005 Share Posted August 11, 2005 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 Quote Link to comment Share on other sites More sharing options...
Bruce Tomlin Posted August 11, 2005 Share Posted August 11, 2005 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. Quote Link to comment Share on other sites More sharing options...
Bruce Tomlin Posted August 11, 2005 Share Posted August 11, 2005 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. Quote Link to comment Share on other sites More sharing options...
Bruce Tomlin Posted August 11, 2005 Share Posted August 11, 2005 Try starting from this... 7800pal.txt Quote Link to comment Share on other sites More sharing options...
DanBoris Posted August 11, 2005 Author Share Posted August 11, 2005 Try starting from this... 908813[/snapback] Where is this from? Dan Quote Link to comment Share on other sites More sharing options...
Bruce Tomlin Posted August 11, 2005 Share Posted August 11, 2005 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, itassumes 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. Quote Link to comment Share on other sites More sharing options...
DanBoris Posted August 11, 2005 Author Share Posted August 11, 2005 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 Quote Link to comment Share on other sites More sharing options...
+Mitch Posted August 11, 2005 Share Posted August 11, 2005 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 Quote Link to comment Share on other sites More sharing options...
Bruce Tomlin Posted August 11, 2005 Share Posted August 11, 2005 (edited) Cool! I'm most definitely snarfing that bit of code. :-) Edited August 11, 2005 by Bruce Tomlin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.