News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: DMA problem  (Read 6977 times)

mopoz

  • Jr. Member
  • **
  • Posts: 65
  • Russia, Vodka and Bears
    • View Profile
DMA problem
« on: December 08, 2010, 05:47:23 am »
I do VWF in the game illusion fo gaia.
Since the font in the game to boot, like a map tile, it had to be corrected.
The problem lies in the fact that sending a new font via DMA into VRAM.
In the emulator snes9x v1.51 displayed incorrectly.
And in 1.52, and Geiger's debugger, Tracer, bsnes and the PSP everything works fine.
What's the problem? Not the correct code or a bug emulator?
Skate-punk rulezzzz

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5733
    • View Profile
    • Nightcrawler's Translation Corporation
Re: DMA problem
« Reply #1 on: December 08, 2010, 08:28:54 am »
It's probably best if you can find someone with a copier or flash cart to confirm it works on the real hardware. That would be a definitive answer. Aside from that, BSNES is the most accurate emulator we have and pretty trustworthy in most cases. So, it's likely your code is OK and there is just a problem with SNES9x 1.51.

9 times out of 10 DMA VWF problems are attributed to not properly waiting for vblank. You cannot transfer to VRAM (or most video registers) outside of vblank. Did you wait for vblank? If you're using the game's own DMA code, this is probably not an issue unless the code executes late in the vblank period. An increase in data transferred then may not make it before vblank expires.
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

andrewclunn

  • Full Member
  • ***
  • Posts: 213
    • View Profile
Re: DMA problem
« Reply #2 on: December 08, 2010, 02:30:02 pm »
Crap, how far along are you?  I've been working on an Illusion of Gaia update.  I've been correcting text typos, making the voice consistent (Will sometimes thinks in the first person, sometimes his thoughts are narrated in the third, and even sometimes in the second person!), healing items and charge timing, and the goal was to add a variable width font as the final stroke.  I haven't started on the VW font part yet, but if you're working on that then I'd like to make sure that my work is compatible with yours.  Are you modifying the script coding at all?  Is anything being moved to a new location in ROM?

Auryn

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: DMA problem
« Reply #3 on: December 08, 2010, 04:33:45 pm »
If u need to test it on the real hardware, i can do that, i have a super wildcard 32MB and a profighter (i don't remember which one because longtime not used).

mopoz

  • Jr. Member
  • **
  • Posts: 65
  • Russia, Vodka and Bears
    • View Profile
Re: DMA problem
« Reply #4 on: December 16, 2010, 06:05:50 am »
Code: [Select]
jmp $e00000

org $e00000
 REP #$20
 AND #$00FF
 INY
 STA $00
 rep #$30
 stx regx ; old X
 sty regy ; old Y
 pha
 tax
 lda $e05000,x ; wight
 and #$0007
 sta vwf
 pla
 ;and #$007F
 asl
 asl
 asl
 asl
 
 adc #$4000
 sta $f0
 lda #$00e0
 sta $f2  ; e04000 = font
 ldy #$0000
 ldx $0938; x reg for save font in ram
copy:
 lda #$0000
 sep #$20
 clc
 lda [$f0],y ; copy 1 byte font 1bpp
 sta char ;
 lda #$ff
 ;lsr char
 sbc char ; 00010010 => 11101101
 
 rep #$30
 ;xba
 adc #$ff00
 sta $7eF000,x
 iny
 inx
 inx
 cpy #$0010
 bne copy
 ...
 jsl $e00800

;----------------
; DMA font      |
;----------------
org $e00800
 rep #$30
 lda $0938 ;  address in VRAM
 sbc #$0020
 clc
 lsr
 clc
 adc #$6800 ; $D000 address in Vram
 sta $2116
 lda #$0020  ;The number of bytes to send in video RAM.
 sta $4305
 lda $0938
 sbc #$0020
 adc #$f000 ;offsetes address in RAM
 sta $4302
 sep #$20
 lda #$7e
 sta $4304
 lda #$80
 sta $2115
 lda #$01
 sta $4300
 lda #$18
 sta $4301
 lda #$01
 sta $420b

vb: 
 lda $4212 ; check Vblank
 bpl vb
 
 rtl

Text output, but with a delay of ~ 1 second.
Skate-punk rulezzzz

mopoz

  • Jr. Member
  • **
  • Posts: 65
  • Russia, Vodka and Bears
    • View Profile
Re: DMA problem
« Reply #5 on: January 20, 2011, 10:03:04 am »





I did it!
My first VFW!!!
I will finish for Illusion fo Gaia. ;D
« Last Edit: January 20, 2011, 12:18:21 pm by mopoz »
Skate-punk rulezzzz

RedComet

  • Hero Member
  • *****
  • Posts: 3162
    • View Profile
    • Twilight Translations
Re: DMA problem
« Reply #6 on: January 20, 2011, 10:53:57 am »
Congratulations! Everyone remembers their first forever. ;)
Twilight Translations - More than just Dragonball Z. :P

justin3009

  • Hero Member
  • *****
  • Posts: 1602
  • Welp
    • View Profile
Re: DMA problem
« Reply #7 on: January 20, 2011, 11:58:32 am »
Woah.  Adding a VWF to a game is something I want to learn very soon.  Seeing you guys pulling this off with success is truly inspiring :D
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5733
    • View Profile
    • Nightcrawler's Translation Corporation
Re: DMA problem
« Reply #8 on: January 20, 2011, 01:51:22 pm »
Looks nice! Congrats!  :)

I know you want Illusion of Gaia, but you may want to make a small project out of this game too. If you reformat the text to use the extra window space you now have, you can release a nice Bof improvement patch that I'm sure a number of people would appreciate.

Two questions:

Where did you get the font you used?

How come you got rid of the text window background color?
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

mopoz

  • Jr. Member
  • **
  • Posts: 65
  • Russia, Vodka and Bears
    • View Profile
Re: DMA problem
« Reply #9 on: January 20, 2011, 02:08:34 pm »
Font I took from DQ3. Thank you, DaMarsMan, I think he is not offended. =)
I replaced the background, changing the register # $ 2003 (blue), while filling the window.
I have yet to be fully not finish, still need to post the menu and battles. There used 4bpp, for a place 2bpp.
What about the window. I want to add more h-dma, to look beautiful.
What about the patch. I rewrote for hacking the ROM hirom, so it was convenient. Changed the system S-ram. Because in Hirom address $ 30:6000.
But as completed yet, will put a patch, it will be a good occasion to re-translation.
Skate-punk rulezzzz

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5733
    • View Profile
    • Nightcrawler's Translation Corporation
Re: DMA problem
« Reply #10 on: January 20, 2011, 03:16:02 pm »
Sounds great! You're well on you way to becoming a superstar:woot!:
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

mopoz

  • Jr. Member
  • **
  • Posts: 65
  • Russia, Vodka and Bears
    • View Profile
Re: DMA problem
« Reply #11 on: January 21, 2011, 08:23:33 am »
Damn!
Only appears in one frame and disappears.
In geiger's debug log do H-DMA, sends data only once per dialog.
Although the cycle is repeated not once. But does not send data ..
Put rti, but after the run, the results from the vector to any address. Who knows, tell me.
Skate-punk rulezzzz

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5733
    • View Profile
    • Nightcrawler's Translation Corporation
Re: DMA problem
« Reply #12 on: January 21, 2011, 11:05:31 am »
I'm not sure I totally understand due to the language barrier. But:

I assume you put your HDMA code inside the NMI routine and that's where the RTI statement is? It needs to execute (or at least initiate the HDMA) there to work every frame.

Try using VSNES. Take a savestate during the frame where things are working properly and then take another when they are not. You can then load them up in VSNES and compare your HDMA/DMA channels and setups there. That would point you in the right direction of what changed. When you know what changed, you can use that information to look for code or breakpoints in the debugger to find the offending code.

Being that you say it worked for a frame, I imagine either your HDMA is only actually being executed one time, or some other code overwrote the registers for some other DMA/HDMA use.

I'm a little rusty with my HDMA. Anybody else have any other insight to add?
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

mopoz

  • Jr. Member
  • **
  • Posts: 65
  • Russia, Vodka and Bears
    • View Profile
Re: DMA problem
« Reply #13 on: January 21, 2011, 01:08:08 pm »
Uh ...
When put to the procedure in the NMI, it makes my terms in the h-dma, but not the data themselves do not go into the process of implementation. Does not even show that my channels are used.
When I put the procedure in the code output window, it shows one frame. =)
What about the free channels. I'm using 6 and 7 in the game all goes only 0 channel. Well, the first channel my VWF. I analyzed the game with other H-dma, but did not understand the essence of the situation.

P.S. I have a session, I did not prepare for the exams, I sit here and hack. ;D

January 22, 2011, 01:18:53 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Oh, damn!
I do it's!!! :crazy: :crazy: :crazy:
So far, only transparency.
Another line Colors Experiment.
« Last Edit: January 22, 2011, 01:18:53 pm by mopoz »
Skate-punk rulezzzz

justin3009

  • Hero Member
  • *****
  • Posts: 1602
  • Welp
    • View Profile
Re: DMA problem
« Reply #14 on: January 22, 2011, 02:36:31 pm »
Very nice job :D
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5733
    • View Profile
    • Nightcrawler's Translation Corporation
Re: DMA problem
« Reply #15 on: January 23, 2011, 11:17:10 am »
What ended up being the problem?
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

mopoz

  • Jr. Member
  • **
  • Posts: 65
  • Russia, Vodka and Bears
    • View Profile
Re: DMA problem
« Reply #16 on: January 24, 2011, 06:12:06 am »
I have a DMA transmit to the VRAM too much data # $ 0a00, all the space vacated by the new font. And the H-DMA did not have time. Made to DMA sent one letter in front of each output to the screen. And after that was okay.


« Last Edit: January 25, 2011, 12:35:23 am by mopoz »
Skate-punk rulezzzz

Griever

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: DMA problem
« Reply #17 on: January 24, 2011, 12:24:46 pm »
Они говорят 'wise men learn by other's faults, fools by their own'.
Здорово получилось, поздравляю.

mopoz

  • Jr. Member
  • **
  • Posts: 65
  • Russia, Vodka and Bears
    • View Profile
Re: DMA problem
« Reply #18 on: January 24, 2011, 12:32:44 pm »
In Russia, learn from their fails ;D ;D ;D

January 26, 2011, 07:10:43 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Menu / Shop




« Last Edit: January 26, 2011, 07:10:43 am by mopoz »
Skate-punk rulezzzz

DavidMG

  • Jr. Member
  • **
  • Posts: 12
  • Soviet translator
    • View Profile
Re: DMA problem
« Reply #19 on: January 26, 2011, 01:50:27 pm »
Sweet! :thumbsup:
Maybe in the future you'll be able to issue the BOF is not worse than the retranslation of the BOF2  :woot!:


Молодец! Прогресс на лицо Мороз!  :laugh: