It is currently Fri Dec 15, 2017 6:32 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Mario Sprites Problem
PostPosted: Sat Dec 25, 2004 12:36 am 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
i have problems emulating super mario bros.
Mario sprites itself goes to position x = 0 after scrolling 128 pixels, and after that mario's sprites are animated but i cant move it.

Help please :(

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 25, 2004 8:06 am 
Online
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3488
Location: Indianapolis
Sounds like it could be a CPU bug. Do other games work ok?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 25, 2004 10:45 am 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Sounds almost like a V flag problem (bad wrapping at 128 could be because the V flag is being set wrong on ADC/SBC)

Double check your ADC/SBC. For ADC... the V flag should be set when:

Positive + Positive = Negative
or
Negative + Negative = Positive

In all other instances of ADC, the V flag should be cleared.


Likewise for SBC... V flag is set when:

Positive - Negative = Negative
or
Negative - Positive = Positive


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 25, 2004 2:38 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19348
Location: NE Indiana, USA (NTSC)
You can make SBC always work by implementing SBC in terms of ADC: load the operand from memory as normal, invert it (^ 0xff), and then do your ADC code. Reducing complexity of your emulator's 6502 core is a good thing.


Top
 Profile  
 
 Post subject: Nestress
PostPosted: Sat Dec 25, 2004 6:02 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
I have tested my cpu with nestress rom and it throw me all "ok"
do i have to trust in that?

Thanks

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 25, 2004 7:00 pm 
Offline

Joined: Mon Sep 27, 2004 11:51 pm
Posts: 101
Do not trust it; I'm pretty sure there is something wrong with your ADC and SBC code (V flag).

_________________
http://hydesprojects.cjb.net/


Top
 Profile  
 
 Post subject: adc implementation
PostPosted: Sat Dec 25, 2004 7:23 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
sure, thanks i will try

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 26, 2004 12:29 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
tepples wrote:
You can make SBC always work by implementing SBC in terms of ADC: load the operand from memory as normal, invert it (^ 0xff), and then do your ADC code. Reducing complexity of your emulator's 6502 core is a good thing.


Really? That's pretty good...
Is there any other similar case?

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 26, 2004 3:27 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
Fx3 wrote:
Really? That's pretty good...
Is there any other similar case?


Fx3 if you read carefully Mos 6502 manual, it says that the processor is always really adding. It inverts the bytes of the source, add carry and then add. :D

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 5:56 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
Anes wrote:
Fx3 wrote:
Really? That's pretty good...
Is there any other similar case?


Fx3 if you read carefully Mos 6502 manual, it says that the processor is always really adding. It inverts the bytes of the source, add carry and then add. :D


Actually, it inverts the BITS of the data (byte)... :roll:

_________________
Zepper
RockNES developer


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 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