Sonic and Sega Retro Message Board: Weird Person - Viewing Profile - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help

Group:
Member: Members
Active Posts:
367 (0.1 per day)
Most Active In:
General Sonic Discussion (103 posts)
Joined:
12-March 05
Profile Views:
931
Last Active:
User is offline Private
Currently:
Offline

My Information

Member Title:
You lost two seconds reading this
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Not Telling Not Telling

Contact Information

E-mail:
Click here to e-mail me
Website:
Website  http://

Previous Fields

Project:
Who knows?
National Flag:
br

Latest Visitors

Topics I've Started

  1. Where I'm doing it wrong?

    07 December 2006 - 08:13 PM

    (Note for the admins:
    Due to a combination of tab and enter, I posted this before it was complete, so the post didn't made any sense. That's why I asked for a trashing.)

    I'm trying to do a very simple program that loads a color into CRAM... while the Vblank is occuring.
    So I did the following things:

    1. In the Vectors table (ROM header), the 31st longword points to the location where the Mega Drive will jump when the Vblank occurs:
    Vectors:	dc.l $FFFE00,	Entrypoint,	Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l HBlank,	Error,		VBlank,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    		dc.l Error,	Error,		Error,	Error
    


    Checked. Everything fine here.

    2. The 5 bit of VDP register #1 is used to define if the Vblank interrupts will happen or not. So I set it (among other stuff).
    	move.w #$8134,($C00004).l; Set the 5 bit of the #1 VDP register (among other stuff)
    


    Again, everything fine here.

    3. A eternal Loop. The Mega Drive is going to jump to the Vblank label, not me!
    EternalLoop:
    	 bra.s EternalLoop
    


    All right.

    4. Put some code below the Vblank label

    Vblank:
       move.l #$C0000000,($C00004).l  ; Program the CRAM
       move.w #$0E00,($C00000).l		; move the color blue to CRAM
       rte								 ; Return from Interruption
    


    No problems.


    Everything is fine, right? But, No matter how I hard I try, The Gens screen just keep black! I looked, relooked and overlooked over my code and I don't see nothing wrong! Gens doesn't emulate Vblank interrupts? Or It is something wrong in my code?
  2. Sonic 1 Ad

    21 November 2006 - 04:51 PM

    http://www.youtube.c...h?v=pk__11SH0VA

    I was playing around with YouTube videos when I found this ads. Robotnik's ball shinies very odly. I think it was editted to look cooler, but I think this, even if it's just a Video issue, is worth some attention.

    Old? New?
  3. Something very interesting I discovered!

    15 November 2006 - 12:13 PM

    While programming a small rom, and after a lot of pain in the ass to make it work properly, I noticed a very interesting thing:

    Look at the big letters. They're green, right? The color of these letters changes?

    Did you answered yes? But the answer is NO! (Go check CRAM if you don't believe me.)

    The flashing yellow color lures you to believe that the green color is changing! But it isn't changing!

    Amazing, isn't it?

    [EDIT] Fixed typos.
  4. Searching for code...

    12 November 2006 - 01:34 PM

    I'd like to know a code that does very simple thing:

    When the scanline (Number) is beign processed, jump to a label.

    This is because I want learn how to do the water effect, and I had some success with this code (go to label main). But it loads the pallete 1 scanline after I planned.

    I tried use 'Vblank' label (Interrupt request level 6), but MD NEVER jumps to there.
  5. MD is Weird.

    05 November 2006 - 12:17 PM

    I'm developing a easy-to-use subroutine that allows you load any sort of data to CRAM,VRAM or VSRAM, and I got a subroutine that looks perfect! Look at the code below:

    Main:
    	
    	move.b #$03,d0
    	move.w #$0020,d1
    	move.l #Pallete,d2
    	move.w #EndPallete-Pallete,d3
    	jsr Proc_LoadGraphics
    
    	move.b #$01,d0
    	move.w #$0020,d1
    	move.l #Vram,d2
    	move.w #EndVram-Vram,d3
    	jsr Proc_LoadGraphics
    	
    EternalLoop:
    	bra.s EternalLoop
    	rts
    		
    Pallete:
    	dc.w $0EEE,$068E,$0E86,$0E0E,$066E,$0E66
    EndPallete:
    
    Vram:
    	dc.w $0E22,$068E,$0E86,$0E0E,$066E,$0E66
    	dc.w $0E22,$0444,$0444,$0E0E,$066E,$0E66
    	dc.w $0E10,$0444,$0E86,$0444,$066E,$0E66	
    	dc.w $0EEE,$068E,$0E86,$0E0E,$0444,$0E66	
    	dc.w $0EEE,$068E,$0E86,$0E0E,$066E,$0E66	
    	dc.w $0EEE,$068E,$0E86,$0E0E,$066E,$0E66	
    EndVram:
    ;-------------------------------;	
    ; Procedures
    ;-------------------------------;
    
    ;-------------------------------;
    ; Proc_LoadGraphics
    ;-------------------------------;
    
    Proc_LoadGraphics:
    
    ; d0.b = Code
    ; d1.w = Adress (in CRAM, VRAM or VSRAM...)
    ; d2.l = Source Data Adress
    ; d3.w = How many bytes to move.
    ; d4.l = Temporary Register.
    
    	and.l #$0000FFFF,d1	; Clear shitty data.
    	rol.l #2,d1
    	ror.w #2,d1
    	swap.w d1
    
    Proc_LoadGraphics_Switch1:
    
    	cmp.b #1,d0
    	beq Proc_LoadGraphics_Switch1_1
    
    	cmp.b #2,d0
    	beq Proc_LoadGraphics_Switch1_2
    
    	cmp.b #3,d0
    	beq Proc_LoadGraphics_Switch1_3
    
    	bra Proc_LoadGraphics_Switch1_Default
    
    Proc_LoadGraphics_Switch1_1:
    ; You choosed: VRAM
    
    	move.l #$40000000,d0
    	bra.s Proc_LoadGraphics_EndSwitch1
    
    Proc_LoadGraphics_Switch1_2:
    ; You choosed: VSRAM
    
    	move.l #$40000010,d0
    	bra.s Proc_LoadGraphics_EndSwitch1
    
    Proc_LoadGraphics_Switch1_3:
    ; You choosed: CRAM
    
    	move.l #$C0000000,d0
    	bra.s Proc_LoadGraphics_EndSwitch1
    
    Proc_LoadGraphics_Switch1_Default:
    ; Invalid Choice.
    
    	moveq #0,d0
    	bra EndProc_LoadGraphics
    
    Proc_LoadGraphics_EndSwitch1:
    
    	add.l d1,d0		
    	move.l d0,($C00004).l
    	move.l a0,d4
    	move.l d2,a0
    	lsr.w #1,d3	; d3 = d3 / 2
    	sub.w #1,d3	; d3 = d3 - 1
    
    Proc_LoadGraphics_Loop1:
    
    	move.w	(a0)+,($C00000).l
    	dbra	d3,Proc_LoadGraphics_Loop1
    
    Proc_LoadGraphics_EndLoop1:
    
    	move.l d4,a0
    
    EndProc_LoadGraphics:
    	rts
    


    The code above worked pretty well for me. (It's a piece of code. You can get the full code here)

    Now, Think there is a file named "vram.bin" with a 62,5kb size (fits in VRAM.)
    Look at what's between the Labels "Vram" and "EndVram". It's some random data that is loaded at the VRAM. Change it to " incbin "vram.bin" ". And the game will crash!

    The procedure "LoadGraphics" works pretty well in load small pieces of data (1Kb, 2Kb, 3Kb, 4Kb...), but It fails why loading big pieces of data (62Kb...). I looked over and over the code, and I see no reason for that happen. Both datas (1Kb and 62,5Kb) fits in VRAM. Can someone help me?

Friends

Weird Person hasn't added any friends yet.