It is currently Wed Nov 22, 2017 8:07 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 84 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
 Post subject: Re: upernes
PostPosted: Tue Aug 15, 2017 8:14 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 69
Location: Lyon
I fixed the PAD problem, Thwaite works 100%.
Pacman works, except I have no sound while the sound routine executes.

Thanks for the solution AWJ, I could find a way to emulate it by using the bit 8 of the object data.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Tue Aug 15, 2017 8:20 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19240
Location: NE Indiana, USA (NTSC)
Patrick FR wrote:
I fixed the PAD problem, Thwaite works 100%.

Congratulations. Do you have the mouse that came with Mario Paint?


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Tue Aug 15, 2017 1:31 pm 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 69
Location: Lyon
I do not have the mouse for the snes.
Edit: Plus it is a rare object, it could be tried on an emulator?

Using the FCEUX debugger, I found out why PACMAN does not play music:

STA ($F6,X) @ $4000 = #$FF

It writes in the sound port using this direct indexed thing. X is 0 by the way. $4000 is in the direct page at $F6. It must be patched by hand, like adding an asm file containing a custom routine, and calling it from a patch at this address. This cannot be automatic, the address checks would slow everything down.

Edit: doing like Memblers in the NSF player should also work: executing from the WRAM and reading the register values from WRAM @ $4000 to $4015.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sun Oct 22, 2017 4:40 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 69
Location: Lyon
Hello.
I managed to execute the converted rom from work ram. It is how Memeblers emulation works because there is no need to patch the accesses to $4000 - $4015, it writes directly in WRAM to this address range.
I did this because pacman accesses sound registers in a way that cannot be detected when disassembling.

However, it does not work 100% yet, the sound is weird I must have missed something because pacman hangs.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sun Oct 22, 2017 9:17 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
There is one thing to watch out for when you execute from work RAM, you might have seen this already, but it is surprisingly common to find code that writes to zeropage with absolute mode. So they'll do something like STA $0000 / LDA ($00,y). But with direct register page allowed in bank zero only, and the data bank register being in WRAM, $00 and $0000 are different places. In my NSF player, I had to patch that code manually. In the NSF it was usually just 1 or 2 spots where that would happen, but there was at least one game where every single ZP access was in absolute mode (I didn't even bother with that one).


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sun Oct 22, 2017 10:46 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 69
Location: Lyon
Thanks Memblers, I was not expecting this behaviour. I must look at this.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sun Oct 22, 2017 7:44 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19240
Location: NE Indiana, USA (NTSC)
As I understand it, that can be worked around by running the NES program from bank $7E, as $000000-$001FFF is a mirror of $7E0000-$7E1FFF.

One plausible scenario is to assign to X and Y the indices of two elements in the same array and access one element with dd,X and the other with aaaa,Y, as the 6502 lacks dd,Y mode for most instructions that aren't LDX/STX.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Mon Oct 23, 2017 11:52 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 69
Location: Lyon
Maybe it could work if using bank $7E. The lower 8KB of bank $7E is the same ram as the $00 bank. And I use $7E as data and program bank. I converted the following code (using the nes palette test rom) and it works:

Code:
   lda $918
   ldy #$00
   lda #$CC
   sta $0000
   lda #$34
   sta $00CC
   lda #$00
   lda [$00], y

It loads $34 from $00CC in A ($918 is my breakpoint address).

I am close to fix the audio, I may have forgotten some IO request in the $7E bank.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sat Nov 04, 2017 4:57 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 69
Location: Lyon
Pacman passes on WRAM, it plays sound.

I tested upernes from a fresh clone and it works (on needs to write the indirect jumps and then disable the tests on them, but once this is done, it works).

Sound is a little weird however, like when I first integrated it. But it plays more sounds than by using the IO patching method. I assume it is because it missed sound IO accesses when disassembling and now it is read from the WRAM at $4000. Maybe I should do a video to show the problem, not today however.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 84 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

All times are UTC - 7 hours


Who is online

Users browsing this forum: Ti_ and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group