Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;//------------------------------------------------------------------------
- ;
- ; Shinobi System16 arcade ROM hack for Genesis/Megadrive.
- ;
- ; Bootleg romset used. B3/B1 and epr11263.43/epr11261.25 sets for code.
- ;
- ; History:
- ;
- ; 11/19/10 - Ver: 0.0.1 - Initial setup. (Tomaitheous)
- ;
- ; Assemble with ASL (http://john.ccac.rwth-aachen.de:8000/as/)
- ;
- ; asw shinobi.s
- ; plist shinobi.p
- ; p2bin shinobi.p shinobi.bin -r $-$3ffff
- ;
- ; Text editor: TAB = 2 spaces.
- ;
- ;//........................................................................
- ;
- ; Quick hardware notes:
- ;
- ; $1c000-$1ffff appears to be free/unused space
- ; $39600-$3fbff appears to be free/unused space.
- ;
- ; More indepth notes section in the end part of the source file.
- ;
- CPU 68000
- SUPMODE ON
- ;//........................................................................
- ;
- ; Include the original (assembled) 68k code rom from the arcade set.
- ORG $00000000
- shinobi_rom:
- BINCLUDE "68k.bin"
- ;//........................................................................
- ;
- ; New/replacement code/data.
- ORG $00000000
- dc.l $FFFFFF00, STARTUP
- ; STARTUP is the hook to initialize the Genesis first, before
- ; continuing onto the game init code.
- ORG $00000070
- dc.l HINT ; Not sure this will be needed yet. Original hardware doesn't have
- ; Hblank interrupts.
- ORG $00000078
- dc.l VINT ; This should be correct. The system16 doesn't do HBL interrupts, but
- ; the VBL is in the HBL vector in the arcade setup. Changed to match.
- ORG $00000100
- ; A little bit of header info to get it to run on emulators/etc.
- ; Honestly, note sure where this template originally came from.
- sega:
- dc.b "SEGA GENESIS "
- dc.b "SHINOBI "
- dc.b "VER 0.0.1 "
- dc.b "GM 00000000-00",$a5,$fb
- dc.b "JD ",$00,$00,$00,$00,$00,$02,$00,$00
- dc.b $00,$ff,$00,$00,$ff,$ff,$ff,$ff," "
- dc.b " "
- dc.b " "
- dc.b "JUE "
- org $0001c000
- ; Start of the free space area, for Genesis specific code.
- ;//........................................................................
- STARTUP: ;Genesis Init code should go here
- move.w #$2700, SR ;disable interrupts
- MOVE.B $A10001, D0
- ANDI.B #$0F, D0
- CMP.B #0, D0
- BEQ SkipSegaSecurity
- MOVE.L sega, $A14000
- SkipSegaSecurity:
- move.l #$00003fff,d0 ;clear ram
- move.l #$00ff0000,a0
- .clear_ram
- move.l #$00000000,(a0)+
- dbra d0, .clear_ram
- move.w #$100,$a11100 ; z80 perma halt
- move.w #$100,$a11200
- jsr INIT_VDP
- move.w #$8164,VDP_CTRL ; Reg. 01, enable display, enable Vint
- jmp ROM_MAIN ; Jump to the original power-on vector address.
- ;//........................................................................
- INIT_VDP:
- move.w #$8104,VDP_CTRL ;disble the display
- lea Init_VDP_REGS, a0 ;initialize regs
- .lp01
- move.w (a0)+,d0
- cmp.w #$ffff,d0
- beq .out00
- move.w d0,VDP_CTRL
- bra .lp01
- .out00
- move.l #$40000000, VDP_CTRL ;clear vram
- move.l #$00003fff,d0
- .lp02
- move.l #$00000000,VDP_DATA
- dbra d0, .lp02
- move.l #$C0000000, VDP_CTRL ;clear CRAM
- move.l #$20,d0
- .lp03
- move.w #$0000, VDP_DATA
- dbra d0,.lp03
- move.l #$40000010, VDP_CTRL ;clear VSRAM
- move.l #$40,d0
- .lp04
- move.w #$0000, VDP_DATA
- dbra d0,.lp04
- rts
- ;data
- align 2
- Init_VDP_REGS:
- dc.w $8004 ; Plane A @ $e000
- dc.w $8238 ; Plane A @ $e000
- dc.w $8300 ; Window @ $0000
- dc.w $8406 ; Plane B @ $c000
- dc.w $855f ; Sprite table @ $be00
- dc.w $8700 ; Set BG color
- dc.w $8a00 ; Hint raster
- dc.w $8b00 ; Set scroll mode: full scroll
- dc.w $8c00 ; Set res H32, non interlaced, hilight disabled
- dc.w $8d2f ; Hscroll block @ $bc00
- dc.w $8f02 ; Auto-increment to 2
- dc.w $9011 ; Map set to 64x32
- dc.w $9100 ; window disable
- dc.w $92ff ; window disable
- dc.w $ffff
- ;//........................................................................
- VINT:
- ; Additional vblank layer code here.
- ; Jump to original vblank interrupt routine
- jmp VBL
- ;//........................................................................
- HINT:
- RTE
- ;//........................................................................
- INT:
- RTE
- ;//........................................................................
- align 2
- include "gamepad.asm"
- ;//........................................................................
- ;
- ; EQUATES:
- ;arcade equates
- ROM_MAIN = $00000400
- VBL = $00000404
- ;Genesis equates
- VDP_CTRL = $00C00004
- VDP_DATA = $00C00000
- ;/////////////////////////////////////////////////////////////////////////////////////////////
- ;/////////////////////////////////////////////////////////////////////////////////////////////
- ;/////////////////////////////////////////////////////////////////////////////////////////////
- ;/////////////////////////////////////////////////////////////////////////////////////////////
- ;
- ; BSS
- ;
- org $ff0000 ; <- Arcade doesn't use $FFFF0000-$FFFFBFFF work ram (hopefully it
- ; doesn't use the mirrored ram addresses)
- VDP_STAT: ds.w 1
- vblank_num: ds.w 1
- vblank: ds.w 1
- BG0_VS: ds.l 1
- BG1_VS: ds.l 1
- BG0_HS: ds.l 1
- BG1_HS: ds.l 1
- SATB: ds.w (80*4) ;local sprite table
- ;// some external defined variables
- include "gamepad.inc"
- ;//........................................................................
- ;
- ; General notes:
- ;
- ;
- ;End of File
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement