Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; +-------------------------------------------------------------------------+
- ; | This file has been generated by The Interactive Disassembler (IDA) |
- ; | Copyright (c) 2011 Hex-Rays, <support@hex-rays.com> |
- ; +-------------------------------------------------------------------------+
- ;
- ; Input MD5 : D3293EBAAA7F4EB2A6766B68A0FB4609
- ; Input CRC32 : 3F888CF4
- ; File Name : ~/No/Really/FuckOff/ShitGophers/tmss.bin
- ; Format : Binary file
- ; Base Address: 0000h Range: 0000h - 0800h Loaded length: 0800h
- ; Processor: 68000
- ; Target Assembler: 680x0 Assembler in MRI compatible mode
- ; This file should be compiled with "as -M"
- ; ===========================================================================
- ; Segment type: Pure code
- ; segment "ROM"
- Vectors: dc.l $FFFF00
- dc.l CodeStart
- dc.l Int
- dc.l Int
- dc.l Int,Int,Int,Int ; 0
- dc.l Int,Int,Int,Int ; 4
- dc.l Int,Int,Int,Int ; 8
- dc.l Int,Int,Int,Int ; $C
- dc.l Int,Int,Int,Int ; $10
- dc.l Int,Int,Int,Int ; $14
- dc.l Int,Int,Int,Int ; $18
- dc.l Int,Int,Int,Int ; $1C
- dc.l Int,Int,Int,Int ; $20
- dc.l Int,Int,Int,Int ; $24
- dc.l Int,Int,Int,Int ; $28
- dc.l Int,Int,Int,Int ; $2C
- dc.l Int,Int,Int,Int ; $30
- dc.l Int,Int,Int,Int ; $34
- dc.l Int,Int,Int,Int ; $38
- SysName: dc.b 'SEGA GENESIS ' ; DATA XREF: ROM:000002EEr
- ; ROM:000002F4r ...
- Copyright: dc.b '(C)SEGA 1990.MAY'
- LocalName: dc.b 'GENESIS OS '
- IntName: dc.b 'GENESIS OS '
- Serial: dc.b 'OS 00000000-00'
- Checksum: dc.w $5B74
- IO: dc.b ' '
- StartROM: dc.l 0 ; 0
- EndROM: dc.l $7FF ; 0
- StartRAM: dc.l $FF0000
- EndRAM: dc.l $FFFFFF
- dc.l $20202020
- dc.l $20202020
- dc.l $20202020
- Notes: dc.b ' '
- Region: dc.b 'U '
- ; ---------------------------------------------------------------------------
- Int: ; CODE XREF: ROM:Intj
- ; DATA XREF: ROM:00000008o ...
- bra.s Int ; Loop indefinitely.
- ; ---------------------------------------------------------------------------
- CodeStart: ; DATA XREF: ROM:00000004o
- lea SetupValues,a5 ; Load the initialisation values address.
- movem.l (a5)+,d5-a4 ; Store to registers.
- move.b -$10FF(a1),d0 ; Get the version register value in d0.
- andi.b #$F,d0 ; Get hardware version.
- beq.s BypassSecurity ; If it's a non-TMSS model, branch.
- move.l #'SEGA',$2F00(a1) ; Write the security code to the TMSS.
- BypassSecurity: ; CODE XREF: ROM:00000212j
- move.w (a4),d0 ; Clear the VDP's command-pending flag.
- moveq #0,d0 ; Clear d0.
- movea.l d0,a6 ; Clear a6.
- move a6,usp ; Set usp to 0.
- moveq #$17,d1 ; Set to loop for $18 VDP registers.
- InitLoop_VDP: ; CODE XREF: ROM:0000022Cj
- move.b (a5)+,d5 ; Load the command byte over the VDP register base.
- move.w d5,(a4) ; Write to the VDP.
- add.w d7,d5 ; Increment to the next VDP register.
- dbf d1,InitLoop_VDP ; Repeat until fully written.
- move.l #$40000080,(a4) ; Set the VDP to VRAM DMA (fill).
- move.w d0,(a3) ; Fill in VRAM.
- ClearVRAM: ; CODE XREF: ROM:0000023Ej
- move.w (a4),d4 ; Get the VDP's status.
- btst #1,d4 ; Is DMA running?
- bne.s ClearVRAM ; If it is, branch.
- move.l #$81048F02,(a4) ; Disable DMA, VBlank and the display. Set the VDP's auto-increment to $02.
- move.l #$C0000000,(a4) ; Set the VDP to CRAM write.
- moveq #$1F,d3 ; Set to repeat for 64 palettes.
- ClearCRAM: ; CODE XREF: ROM:00000250j
- move.l d0,(a3) ; Clear two palettes.
- dbf d3,ClearCRAM ; Repeat until fully cleared.
- move.l #$40000010,(a4) ; Set the VDP to VSRAM write.
- moveq #$13,d4 ; Set to repeat for $50 bytes.
- ClearVSRAM: ; CODE XREF: ROM:0000025Ej
- move.l d0,(a3) ; Clear 4 bytes of VSRAM.
- dbf d4,ClearVSRAM ; Repeat until fully cleared.
- moveq #3,d5 ; Set to repeat for 4 values.
- InitPSG: ; CODE XREF: ROM:00000268j
- move.b (a5)+,$11(a3) ; Load the first PSG channel mute value.
- dbf d5,InitPSG ; Repeat until fully written.
- bra.s Reg_Set ; Load the TMSS program.
- ; ---------------------------------------------------------------------------
- SetupValues: dc.l $8000 ; 0 ; DATA XREF: ROM:CodeStarto
- dc.l $3FFF
- dc.l $100
- dc.l $A00000
- dc.l $A11100
- dc.l $A11200
- dc.l $C00000
- dc.l $C00004
- VDP_Regs: dc.b 4,$14,$30,$3C, 7,$6C, 0, 0; 0
- dc.b 0, 0,$FF, 0,$81,$37, 0, 1; 8
- dc.b 1, 0, 0,$FF,$FF, 0, 0,$80; $10
- PSG_Setup: dc.b $9F,$BF,$DF,$FF ; 0
- ; ---------------------------------------------------------------------------
- Reg_Set: ; CODE XREF: ROM:0000026Cj
- lea ($FFFFC000).w,a0 ; Set RAM location to stash code.
- lea SetupValues_2,a1 ; Set up registers.
- movem.l (a1)+,d4-d7/a2-a6 ; Copy to registers.
- move.w #$3F,d0 ; Write loop count.
- RAM_Fill: ; CODE XREF: ROM:000002BCj
- move.w (a1)+,(a0)+ ; Stash remaining code in RAM.
- dbf d0,RAM_Fill ; Repeat until fully written.
- jsr $FFFFC000 ; Run code.
- InfiniteLoop: ; CODE XREF: ROM:InfiniteLoopj
- bra.s InfiniteLoop ; Loop indefinitely.
- ; ---------------------------------------------------------------------------
- SetupValues_2: dc.l ' SEG' ; DATA XREF: ROM:000002AEo
- ; Alternate text check (d4)
- dc.l $45940003 ; VRAM Address for text (d5)
- dc.l $F7 ; VDP write loop count (d6)
- dc.l 'SEGA' ; Normal text check (d7)
- dc.l $A14000 ; SEGA security check (a2)
- dc.l $A14101 ; TMSS read register (a3)
- dc.l $C00004 ; VDP Control port (a4)
- dc.l $C00000 ; VDP Data port (a5)
- dc.l $A10001 ; Version register (a6).
- ; ---------------------------------------------------------------------------
- ; $FFFFC000 - Code is loaded into RAM.
- SecCheck:
- bset #0,(a3) ; Read from cart.
- cmp.l (SysName).w,d7 ; Is the ASCII code 'SEGA' there?
- beq.s Match ; If there is, branch.
- cmp.l (SysName).w,d4 ; Is the ASCII code ' SEG' there>
- bne.s NoMatch ; If there isn't, branch.
- cmpi.b #'A',(SysName+4).w ; Check for the remaining 'A'.
- beq.s Match ; If it's there, branch.
- NoMatch: ; CODE XREF: ROM:000002F8j
- bclr #0,(a3) ; Read from TMSS ROM.
- move.b (a6),d0 ; Get version register value.
- andi.b #$F,d0 ; Get hardware version bits.
- beq.s NoMatch_rts ; If it's a non-TMSS model, don't write to the dedicated security address.
- move.l #0,(a2) ; Clear the security register.
- NoMatch_rts: ; CODE XREF: ROM:0000030Cj
- rts ; Return; loop indefinitely.
- ; ---------------------------------------------------------------------------
- Match: ; CODE XREF: ROM:000002F2j
- ; ROM:00000300j
- bclr #0,(a3) ; Swap back to TMSS ROM.
- jsr (PalLoad).l ; Load the text palette.
- move.l #$4C200000,(a4) ; Set the VRAM address to write to ($C20).
- DataPortFill: ; CODE XREF: ROM:00000328j
- move.l (a1)+,(a5) ; Write the first 8 pixels into VRAM.
- dbf d6,DataPortFill ; Repeat until fully written.
- jsr (WriteChar).l ; Draw the copyright text.
- move.w #$8144,(a4) ; Turn on the display.
- move.w #$3C,d0 ; '<' ; Set amount of times to repeat the subroutine.
- bsr.s DelayBoot ; Delay the screen.
- move.w #$8104,(a4) ; Turn off the display.
- move.b (a6),d0 ; Get the version register value.
- andi.b #$F,d0 ; Get hardware version bits.
- beq.s BlankVerBit ; If it's a non-TMSS model, ignore the security space write.
- move.l #0,(a2) ; Clear the security register.
- BlankVerBit: ; CODE XREF: ROM:00000346j
- bset #0,(a3) ; Read from the cart.
- moveq #0,d0 ; Clear d0.
- movea.l d0,a0 ; Set to read from the start of the cart ROM.
- movea.l (a0)+,sp ; Set the cart stack pointer as the stack pointer.
- movea.l (a0)+,a0 ; Load the entry point address into a0.
- jmp (a0) ; Run the cartridge ROM.
- ; =============== S U B R O U T I N E =======================================
- DelayBoot: ; CODE XREF: ROM:0000033Ap
- ; DelayBoot+8j
- move.w #$95CE,d1 ; Set a delay of $95CE arbitrary units.
- DelayBootLoop: ; CODE XREF: DelayBoot:DelayBootLoopj
- dbf d1,DelayBootLoop ; Repeat until delay has passed.
- dbf d0,DelayBoot ; Loop the subroutine the amount of times stated.
- rts ; Return.
- ; End of function DelayBoot
- ; ---------------------------------------------------------------------------
- dc.w 1
- dc.w $EEE
- dc.w $EE8
- Chars: dc.l $1111100,$11000110,$11000110,$11000110; 0
- dc.l $11111110,$11000110,$11000110, 0; 4
- dc.l $11111100,$11000110,$11000110,$11111100; 0
- dc.l $11000110,$11000110,$11111100, 0; 4
- dc.l $11111110,$11000110,$11000110,$11000000; 0
- dc.l $11000110,$11000110,$11111110, 0; 4
- dc.l $11111100,$11000110,$11000110,$11000110; 0
- dc.l $11000110,$11000110,$11111100, 0; 4
- dc.l $11111110,$11000000,$11000000,$11111100; 0
- dc.l $11000000,$11000000,$11111110, 0; 4
- dc.l $11111110,$11000000,$11000000,$11111100; 0
- dc.l $11000000,$11000000,$11000000, 0; 4
- dc.l $11111110,$11000110,$11000000,$11001110; 0
- dc.l $11000110,$11000110,$11111110, 0; 4
- dc.l $11000110,$11000110,$11000110,$11111110; 0
- dc.l $11000110,$11000110,$11000110, 0; 4
- dc.l $111000, $111000, $111000, $111000; 0
- dc.l $111000, $111000, $111000, 0; 4
- dc.l $110, $110, $110, $110; 0
- dc.l $110, $1100110, $1111110, 0; 4
- dc.l $11000110,$11001100,$11111000,$11111000; 0
- dc.l $11001100,$11000110,$11000110, 0; 4
- dc.l $1100000, $1100000, $1100000, $1100000; 0
- dc.l $1100000, $1100000, $1111110, 0; 4
- dc.l $11000110,$11101110,$11111110,$11010110; 0
- dc.l $11000110,$11000110,$11000110, 0; 4
- dc.l $11000110,$11100110,$11110110,$11011110; 0
- dc.l $11001110,$11000110,$11000110, 0; 4
- dc.l $11111110,$11000110,$11000110,$11000110; 0
- dc.l $11000110,$11000110,$11111110, 0; 4
- dc.l $11111110,$11000110,$11000110,$11111110; 0
- dc.l $11000000,$11000000,$11000000, 0; 4
- dc.l $11111110,$11000110,$11000110,$11000110; 0
- dc.l $11001110,$11001110,$11111110, 0; 4
- dc.l $11111110,$11000110,$11000110,$11111100; 0
- dc.l $11000110,$11000110,$11000110, 0; 4
- dc.l $11111110,$11000110,$11000000,$11111110; 0
- dc.l $110,$11000110,$11111110, 0; 4
- dc.l $11111110, $111000, $111000, $111000; 0
- dc.l $111000, $111000, $111000, 0; 4
- dc.l $11000110,$11000110,$11000110,$11000110; 0
- dc.l $11000110,$11000110,$11111110, 0; 4
- dc.l $11000110,$11000110,$11000110,$11000110; 0
- dc.l $1101100, $111000, $10000, 0; 4
- dc.l $11000110,$11000110,$11000110,$11010110; 0
- dc.l $11111110,$11101110,$11000110, 0; 4
- dc.l $11000110,$11000110,$11101110, $1111100; 0
- dc.l $11101110,$11000110,$11000110, 0; 4
- dc.l $11000110,$11000110,$11000110, $1101100; 0
- dc.l $111000, $111000, $111000, 0; 4
- dc.l $11111110, $1110, $11100, $111000; 0
- dc.l $1110000,$11100000,$11111110, 0; 4
- dc.l 0, 0, 0, 0; 0
- dc.l 0, $1100000, $1100000, 0; 4
- UnusedSEGA: dc.l $2222200,$22000220,$22000000, $2222200; 0
- dc.l $220,$22000220, $2222200, 0; 4
- dc.l $2222220,$22000000,$22000000,$22222200; 0
- dc.l $22000000,$22000000, $2222220, 0; 4
- dc.l $2222200,$22000220,$22000000,$22002220; 0
- dc.l $22000220,$22000220, $2222220, 0; 4
- dc.l $22000, $222200, $222200, $2200220; 0
- dc.l $2200220,$22000022,$22022222, 0; 4
- TMSS_Message: dc.b ' produced by or� under license from�sega,enterprises ltd{',0
- ; =============== S U B R O U T I N E =======================================
- PalLoad: ; CODE XREF: ROM:0000031Ap
- move.w (a1)+,d0
- move.l #$C0020000,(a4)
- WritePal: ; CODE XREF: PalLoad+Aj
- move.w (a1)+,(a5)
- dbf d0,WritePal
- rts
- ; End of function PalLoad
- ; =============== S U B R O U T I N E =======================================
- WriteChar: ; CODE XREF: ROM:0000032Cp
- ; WriteChar+16j
- move.l d5,(a4) ; Set the text's plane map address.
- FindChar: ; CODE XREF: WriteChar+Ej
- moveq #0,d1 ; Clear d1.
- move.b (a1)+,d1 ; Load the first character.
- bmi.s NewLine ; If it's a control code for a new line ($80+), branch.
- bne.s CharToDataPort ; If it isn't a terminator ($00), write onto the screen.
- rts ; Return.
- ; ---------------------------------------------------------------------------
- CharToDataPort: ; CODE XREF: WriteChar+8j
- move.w d1,(a5) ; Draw onto the screen.
- bra.s FindChar ; Repeat until the text is fully dumped.
- ; ---------------------------------------------------------------------------
- NewLine: ; CODE XREF: WriteChar+6j
- addi.l #$1000000,d5 ; Set to increment two lines down at this plane size.
- bra.s WriteChar ; Set new VRAM address and continue writing text.
- ; End of function WriteChar
- ; ---------------------------------------------------------------------------
- dc.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF; 0
- dc.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF; 8
- dc.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF; $10
- dc.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF; $18
- dc.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF; $20
- dc.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF; $28
- dc.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF; $30
- dc.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF; $38
- dc.b $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF; $40
- dc.b $FF,$FF,$FF,$FF ; $48
- ; end of 'ROM'
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement