Sonic and Sega Retro Message Board: Changing Sonic 2's level format - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 4 Pages +
  • ◄ First
  • 2
  • 3
  • 4
    Locked
    Locked Forum

Changing Sonic 2's level format

#46 User is offline StephenUK 

Posted 21 January 2006 - 08:21 PM

  • Liquor in the front, poker in the rear
  • Posts: 1675
  • Joined: 30-December 04
  • Gender:Male
  • Location:Manchester, UK
  • Project:Quackshot Disassembly
You've just been told by me and Ultima about an hour ago how to do it. You need to decompress it to a buffer (and you claim to know what one is) and then from there you send it to VDP by programming the registers as you've been told by both of us, and by sending information to the control and data ports.

#47 User is offline Tweaker 

Posted 21 January 2006 - 08:24 PM

  • Posts: 12389
  • Joined: 27-June 04
  • Gender:Male
Christ, just make a fucking pattern load cue. End.

#48 User is offline StephenUK 

Posted 21 January 2006 - 08:25 PM

  • Liquor in the front, poker in the rear
  • Posts: 1675
  • Joined: 30-December 04
  • Gender:Male
  • Location:Manchester, UK
  • Project:Quackshot Disassembly
Or just use the dynamic load cues. IIRC, LOst told you how they work.

#49 User is offline drx 

Posted 22 January 2006 - 08:51 AM

  • <Shade> fuck MJ
  • Posts: 2157
  • Joined: 02-March 04
  • Gender:Male
  • Project::rolleyes:
  • Wiki edits:8
Stolen from Sonic 3: (yeah, my disassembly)

; -----------------------------------------------------
;  This	subroutine sets	the DMA	(Direct	Memory Access) to 68k to VRAM
; 
;   d1.l - DMA source address (in 68k memory)
;   d2.w - DMA destination address (in VRAM)
;   d3.w - DMA length
; -----------------------------------------------------

SetupDMA_68kToVRam:  ; CODE XREF: KosinskiModDec_Decompress+72p
    ; ROM:00003676p ...
  movea.l	($FFFFFBFC).w,a1
  cmpa.w	#$FBFC,a1
  beq.s	SetupDMA_NoDMA

  move.w	#$9300,d0
  move.b	d3,d0
  move.w	d0,(a1)+; setup	VDP register $13 - DMA length bits 7-0

  move.w	#$9400,d0
  lsr.w	#8,d3
  move.b	d3,d0
  move.w	d0,(a1)+; setup	VDP register $14 - DMA length bits 15-8

  move.w	#$9500,d0
  lsr.l	#1,d1
  move.b	d1,d0
  move.w	d0,(a1)+; setup	VDP register $15 - 68k addr bits 8-1 (remember,	the bit	0 is always %0!)

  move.w	#$9600,d0
  lsr.l	#8,d1
  move.b	d1,d0
  move.w	d0,(a1)+; setup	VDP register $16 - 68k addr bits 16-9

  move.w	#$9700,d0
  lsr.l	#8,d1
  andi.b	#$7F,d1; ''
  move.b	d1,d0
  move.w	d0,(a1)+; setup	VDP register $17 - 68k addr bits 23-17

  andi.l	#$FFFF,d2; VRAM destination address
  lsl.l	#2,d2
  lsr.w	#2,d2
  swap	d2	; VRAM destination address, edited to suit VDP =P
  ori.l	#$40000080,d2; set up the 68k to VRAM DMA, start it
  move.l	d2,(a1)+
  move.l	a1,($FFFFFBFC).w

loc_1806:
  cmpa.w	#$FBFC,a1
  beq.s	SetupDMA_NoDMA
  move.w	#0,(a1)

SetupDMA_NoDMA: 	 ; CODE XREF: SetupDMA_68kToVRam+8j
    ; SetupDMA_68kToVRam+5Aj
  rts	
; End of function SetupDMA_68kToVRam


  • 4 Pages +
  • ◄ First
  • 2
  • 3
  • 4
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users