Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ORG $0
- DC.L $00fd000a ; $fd0000 mirrors from $fc0000 (internal 64KB ram)
- DC.L START
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- DC.L error_trap
- START:
- nop
- jsr first_pass.w
- jsr (sp)
- first_pass_return:
- rts
- first_pass:
- movea.l #$00eb0d03, a0
- movea.l #$00eb0d01, a1
- movea.l #$00fc0000, a2
- move.w $00e90b3c, d0
- andi.w #1, d0
- beq.w um6650_check
- move.w d0, $00e90b3c
- um6650_check:
- move.w #$005f, d0
- move.w d0, d1
- um6650_backup_content:
- move.b d0, (a0)
- move.b (a1), (a2)+
- move.w #$c170, $00e90b3c
- cmpi.w #$40, d0
- dble d0, um6650_backup_content
- move.w d1, d0
- um6650_fill_test_pattern:
- move.b d0, (a0)
- move.b d0, (a1)
- move.w #$b5d8, $00e90b3c
- cmpi.w #$40, d0
- dble d0, um6650_fill_test_pattern
- move.w d1, d0
- um6650_check_test_pattern:
- move.b d0, (a0)
- move.w #$b971, $00e90b3c
- cmp.b (a1), d0
- bne.s first_pass_return
- cmpi.w #$40, d0
- dble d0, um6650_check_test_pattern
- move.w d1, d0
- um6650_restore_content:
- move.b d0, (a0)
- move.b -(a2), (a1)
- move.w #$a46c, $00e90b3c
- cmpi.w #$40, d0
- dble d0, um6650_restore_content
- move.w #$002f, d0
- move.w #$000b, d2
- move.w #$0005, d3
- jsr um6650_checksum.w
- eor.w d3, d3
- rts
- um6650_checksum:
- move.w d0, d1
- move.w #$aad1, $00e90b3c
- um6650_read_special_string:
- move.b d0, (a0)
- move.b (a1), (a2)+
- move.w #$a5f7, $00e90b3c
- cmpi.w #$20, d0
- dble d0, um6650_read_special_string
- move.w d2, d0
- clr.w d4
- um6650_calculate_checksum_d4:
- add.b -(a2), d4
- move.w #$a6b3, $00e90b3c
- dbf d0, um6650_calculate_checksum_d4
- move.w d2, d0
- clr.w d5
- um6650_calculate_checksum_d5:
- sub.b (a2)+, d5
- move.w #$adad, $00e90b3c
- dbf d0, um6650_calculate_checksum_d5
- move.w d3, d0
- clr.w d6
- um6650_calculate_checksum_d6:
- add.w -(a2), d6
- move.w #$a4bd, $00e90b3c
- dbf d0, um6650_calculate_checksum_d6
- move.w d3, d0
- clr.w d7
- um6650_calculate_checksum_d7:
- sub.w (a2)+, d7
- clr.w $00e90b3c
- dbf d0, um6650_calculate_checksum_d7
- cmpi.w #$4d55, -(a2) ; $4d55
- bne.w check_failed
- subq.l #6, a2
- cmpi.w #$2820, -(a2) ; $2820
- bne.w check_failed
- cmpi.w #$2943, -(a2) ; $2943
- bne.w check_failed
- cmp.b -(a2), d4
- bne.w check_failed
- cmp.b -(a2), d5
- bne.w check_failed
- cmp.b -(a2), d6
- bne.w check_failed
- move.b #$09, $00eb0d03
- move.b #$ff, $00eb0d01
- cmp.b -(a2), d7
- beq.w second_pass
- check_failed:
- dble d4, um6650_calculate_checksum_d7
- second_pass:
- move.b #$0c, $00eb0d03
- clr.b $00eb0d01
- movea.l #$00002000, a3
- movea.l #$00000954, a4
- move.w #$003f, d0
- rom_check_special_string:
- ; check from $2000 to $207f
- move.w d0, $00e90b3c
- cmpm.w (a3)+, (a4)+
- bne.s check_failed
- dbf d0, rom_check_special_string
- movea.l a4, a5 ; a4 = $9d4
- adda.w #$012c, a5 ; a5 = $b00
- moveq #19, d0 ; loop for 20 times
- rom_check_a:
- swap d0
- clr.l d3
- clr.w d6
- movea.l a3, a2 ; a2 is start address
- move.w #$000e, d5 ; 15 different checksum
- rom_check_b:
- clr.b d3
- clr.l d4
- swap d5
- move.w #$000f, d5 ; loop for 16 words
- rom_check_c:
- move.w d0, d2
- addq.b #1, d2
- addq.b #1, $00e90b3c
- swap d3
- btst d3, d6
- beq.w rom_check_cond_1
- neg.w d2
- rom_check_cond_1:
- swap d3
- clr.b d1
- muls.w (a3)+, d2
- bpl.w rom_check_cond_2
- subq.b #1, d1
- rom_check_cond_2:
- add.l d2, d4
- addx.b d1, d3
- addq.b #1, d6
- addq.b #1, d0
- andi.b #$0f, d0
- dbf d5, rom_check_c
- cmp.b (a4)+, d3
- bne.w check_failed
- cmp.l (a5)+, d4
- bne.w check_failed
- addq.b #1, d0
- andi.b #$0f, d0
- swap d3
- addq.b #1, d3
- andi.b #$03, d3
- swap d3
- movea.l a3, a1
- movea.l a2, a3
- swap d5
- dbf d5, rom_check_b
- movea.l a1, a3 ; set next start address
- swap d0
- dbf d0, rom_check_a
- ; all check passed
- move.w #$0100, -(sp)
- clr.w $00e90b3c
- jmp $00f80604 ; ??
- movea.l #$00e9001c, a1
- move.w (a1), d0 ; read $00e9001c
- ori.w #$0002, d0 ;
- move.w d0, (a1) ; set bit #1 disable bootrom?
- ori.w #$0008, d0
- movea.l $00000000, sp ; set sp from cartridge ROM $0
- movea.l $00000004, a0 ; set entry point from cartridge ROM $4
- move.w d0, (a1) ; set bit #3 disable bootrom?
- jmp (a0) ; game start here
- error_trap:
- rte
- rte
- rte
- rte
- rte
- rte
- rte
- rte
- ; Inside UM6619
- ORG $0954
- DC.L $A5BBB36E, $C5E9A4A7, $B3CCB2D7, $A8CFA5CE
- DC.L $AACCA4A3, $B16FB9EF, $A5BBB36E, $C5E9B669
- DC.L $A6E6A5F4, $A6F3A4CF, $A656A475, $B57B2872
- DC.L $65766572, $73652065, $6E67696E, $65657229
- DC.L $A142A4CF, $B2D5C4B6, $A142A4CF, $BD73C4B6
- DC.L $A9CEA7F3, $A7EFA5BB, $B36EC5E9, $ADECA96C
- DC.L $B57BA6A1, $B35DAD70, $A457B9EF, $B36EC5E9
- DC.L $AABAC2EA, $A977BB50, $B8D1B0A3, $C2EAA977
- ; 15 * 20 different checksum answer
- ORG $09D4
- DC.B $ff, $00, $ff, $ff, $ff, $00, $00, $00, $ff, $00, $ff, $00, $ff, $00, $ff
- DC.B $00, $ff, $ff, $ff, $00, $00, $00, $00, $00, $ff, $ff, $00, $00, $00, $00
- DC.B $00, $00, $ff, $ff, $00, $00, $00, $ff, $00, $00, $ff, $00, $00, $00, $00
- DC.B $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
- DC.B $ff, $ff, $ff, $ff, $ff, $00, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
- DC.B $00, $ff, $ff, $ff, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $ff
- DC.B $00, $ff, $00, $00, $00, $00, $ff, $00, $ff, $ff, $00, $00, $00, $ff, $00
- DC.B $ff, $00, $00, $00, $ff, $00, $00, $00, $ff, $00, $00, $00, $ff, $00, $00
- DC.B $00, $ff, $ff, $ff, $00, $ff, $ff, $ff, $00, $ff, $ff, $ff, $00, $ff, $ff
- DC.B $ff, $00, $ff, $00, $00, $00, $ff, $00, $00, $00, $ff, $00, $00, $00, $ff
- DC.B $ff, $00, $ff, $00, $ff, $ff, $ff, $00, $00, $00, $ff, $00, $ff, $00, $ff
- DC.B $00, $ff, $00, $00, $00, $ff, $00, $00, $00, $ff, $00, $00, $00, $ff, $00
- DC.B $ff, $00, $00, $ff, $ff, $00, $00, $ff, $ff, $00, $00, $ff, $ff, $00, $00
- DC.B $ff, $00, $00, $ff, $ff, $00, $00, $ff, $ff, $00, $00, $ff, $ff, $00, $00
- DC.B $ff, $ff, $ff, $00, $ff, $ff, $ff, $00, $ff, $00, $00, $00, $ff, $ff, $ff
- DC.B $00, $ff, $00, $00, $00, $ff, $00, $00, $00, $ff, $00, $00, $00, $00, $00
- DC.B $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
- DC.B $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
- DC.B $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
- DC.B $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
- ORG $0B00
- DC.L $fff9b3ed, $00049336, $ffffcccf, $fff6f9cc, $fff8f311, $0004b282, $00025c03, $000db7c8, $fff7cec5, $000454de, $fffd9fd7, $000462a4, $fffaa509, $0001054a, $fffdebbb
- DC.L $000a920c, $fffea6ab, $fff8d3a0, $ffefe7df, $000c1ab8, $0001c65f, $000b4c4c, $0002e763, $000b0ee4, $fffde523, $fff87588, $00062047, $0003a380, $000047f7, $00016624
- DC.L $00025882, $00053156, $fff9a2c0, $ffe58636, $00010b5a, $0002a56e, $001369b8, $fffec0e6, $000306e2, $000579b6, $fffa24c0, $000e69e6, $00004e3a, $0007e69e, $000e2a98
- DC.L $00062630, $000b6679, $00088fd8, $0002ee55, $0002708c, $00016605, $00088334, $000a4f71, $00043258, $00054271, $000406e0, $00222e0d, $0008f9b4, $0005cf0d, $0010ae3c
- DC.L $fffefd0a, $ffff9240, $fffede52, $fffec146, $fffea10a, $00006718, $ffff7622, $ffffc9f6, $ffffa22a, $ffffdd10, $ffff8eb2, $ffff7f06, $ffff4faa, $ffffb6b8, $ffff2b52
- DC.L $00018570, $fffe73fb, $fffcfebe, $fffecf37, $fffecf3c, $00013147, $fffd9582, $00019d7b, $fffe40f8, $000198a3, $fffc0256, $0002329f, $fffdabd4, $000206af, $fffa87fa
- DC.L $000003c2, $ffffff82, $00000656, $0000083c, $000002aa, $0000038a, $ffffff4e, $00000304, $ffffff82, $ffffff52, $000000a6, $0000062c, $000000ca, $ffffff6a, $0000017e
- DC.L $fffe7be4, $00017e77, $0001a71a, $0001b727, $fffe2da0, $00020743, $0000286e, $00003473, $ffff824c, $0000b4df, $0000ac92, $0000b67f, $fffee138, $00012cbb, $00010ed6
- DC.L $0003111c, $fffc5b5d, $fffb5e40, $fffb8f0b, $0004c908, $fffabc99, $fff9200c, $fff9cf2f, $00068124, $fff919e5, $fffead98, $ffffdb93, $000075c0, $ffff0c11, $fffd8e64
- DC.L $fffdefda, $0003a7ed, $fff9adc4, $00023813, $000266d6, $000496f1, $fff78490, $0003ca9f, $000578d2, $0004f0e5, $fff604cc, $0007569b, $0004b05e, $00095069, $fffc5e08
- DC.L $fffe81b8, $0005a2b9, $fff7fd44, $000791b9, $fff9c254, $fffe7305, $fffcb618, $000252b5, $00010180, $000043a1, $fffa6c6c, $00061091, $ffff505c, $0000f1dd, $fff734c0
- DC.L $0005242c, $fffa2157, $0003782e, $00079a49, $000800c8, $fff9567b, $00073d52, $000852ed, $0008ad24, $fffe473f, $00017316, $000370f1, $0003b7f0, $fffb7c93, $0001d55a
- DC.L $fff6c765, $0008ae53, $00094cb5, $ffff8477, $fff941dd, $0005615b, $0003591d, $fffdd087, $fff349c5, $000c1f73, $00026f35, $fff58107, $fff4012d, $000c3cdb, $000007bd
- DC.L $fffff2ce, $00000e38, $00000ea4, $fffff064, $fffffea6, $00000260, $00000294, $fffffc74, $fffffafe, $00000608, $000006e4, $fffff824, $fffff6e6, $00000a20, $00000ac4
- DC.L $fffd19b2, $fffde0ee, $fffdcfbe, $0004007e, $fffba2c2, $fffd59f6, $fffd52be, $0001837e, $fffe1fc2, $0000d6ee, $0000b5be, $0003067e, $fffc9cc2, $fffe63e6, $fffe48be
- DC.L $000005f2, $fffffdf6, $000009e6, $00000be0, $00000dda, $fffffde6, $000011ce, $000013c8, $000015c2, $fffffdd6, $000019b6, $00001bb0, $00001daa, $00000db6, $000011ae
- DC.L $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
- DC.L $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
- DC.L $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
- DC.L $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
- END START ; last line of source
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement