View unanswered posts | View active topics It is currently Thu Dec 12, 2019 6:31 am



This topic is locked, you cannot edit posts or make further replies.  [ 125 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
bsnes v0.042 released 
Author Message
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3902
Location: Solar powered park bench
Post 
byuu wrote:
I believe it was _Demo_ who speculated that it'd take at least a 10GHz processor to achieve this. Then again, it's been so long I could be attributing the quote to the wrong person. Don't even remember the exact words anymore. Anyone recall?


It was 4 GHz IIRC.
You should however try some of the really heavy games.
Code:
-------------------------Container--------------------------
       File: Jikkyou Oshaberi Parodius (J).gz
   Sub File: Jikkyou Oshaberi Parodius (J)
---------------------Internal ROM Info----------------------
       Name: OSHABERI PARODIUS        Company: Konami
     Header: None                        Bank: LoROM
Interleaved: None                         ROM: 24 Mb
       Type: SA-1                        SRAM: 64 Kb
  Expansion: None                     Battery: Present
    Country: Japan                      Video: NTSC
  ROM Speed: 200ns (SlowROM)         Revision: 1.0
   Checksum: Good 0x58D2            Game Code: Marked, AJOJ
---------------------------Hashes---------------------------
      CRC32: 177937AB
--------------------------Database--------------------------
       Name: Jikkyou Oshaberi Parodius
    Country: Japan                   Revision: 1.0
     Port 1: Gamepad                   Port 2: Gamepad
    Genre 1: Shooter                  Genre 2: Horizontal Scrolling

Also try the Kirby Super Star intro.

BTW, congrads.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Wed Apr 08, 2009 7:13 am
Profile WWW
Post 
Nach wrote:
It was 4 GHz IIRC.


Wow, he really called that, didn't he? In P4 speeds, that was pretty much dead-on. I'd get about 40fps there, so you figure with some good optimizations that'd be about right for consistent 60fps.

Nach wrote:
You should however try some of the really heavy games.


Ah, I always heard Kirby 3 was the all-time worst. Parodius doesn't run in-game yet. I still don't understand how the interrupt mechanism works.

Nach wrote:
BTW, congrads.


Thank you. Apologies if I seemed braggy or anything. It's more I'm in shock that it's as fast as it is for the rate it's actually syncing. According to my stand-alone libco tests, it should be running at ~60fps before actually emulating anything (just from the context switches), and yet it's at ~90-120 with emulation.

But that's good news for everyone, as single-level state machines are quite a bit faster still. If ZSNES v2 makes the SA-1 cycle-level as well, it should be many times faster than this.

And two more things (SFX+PPU) and I'll have nothing left to brag about adding :P

"This revolutionary new RISC core allows Quick-move Shogi Match with Nidan Rank-holder Morita II to run with cycle-level computer move computations!"


Wed Apr 08, 2009 7:50 am
Buzzkill Gil

Joined: Wed Jan 12, 2005 7:14 pm
Posts: 4249
Post 
I want pictures of SRW Gaiden!


Wed Apr 08, 2009 8:49 am
Profile
Post 
New WIP. Copy-paste:
Quote:
Working on SA-1, still a long way to go. Fixed a bug where I was clearing MA after multiplication / cumulative sum when I wasn't supposed to. Fixes Kirby 3 Pop Star scene.

Added normal DMA, along with full support for DPRIO (allowing DMA to run alongside the SA-1 CPU) and blocking of invalid transfer types / modes. This fixes sprites in Marvelous.

Also added BW-RAM bitmap mirroring to $[60-6f]:[0000-ffff], proper mapping for the bitmap mode to the $[00-3f|80-bf]:[6000-7fff] regions, variable-length bit read data port, and I now at least cache the register settings for IRQs (though I still do nothing with them.)

I added support for BW-RAM and I-RAM write protection, but when it's enabled, most games will no longer load. So I'm forced to leave that off for now. Maybe the protection didn't actually work on the real hardware? Hmm ...

No idea what the bitmap registers $2240-$224f are for, and I don't see how it's supposed to be possible to trigger IRQs as needed by Super Mario RPG and Parodius. But at least three of five games should now be fully playable with no issues. Speed remains the same as yesterday. No hit for the SA-1 CPU+DMA simultaneous transfer mode support.


Image Image

Quote:
I want pictures of SRW Gaiden!


Can always try it and see what happens ... after I get some sleep :D


Wed Apr 08, 2009 12:22 pm
Post 
Code:
(DCNT) DMA control register:
Set DPRIO to assign priority between SA-1 CPU and DMA.
DPRIO=0: SA-1 CPU priority (instructions can be executed during transmission.)
DPRIO=1: DMA priority (SA-1 CPU waits during DMA.)
NOTE: DPRIO is only valid during normal DMA between BW-RAM and SA-1 I-RAM.

Character conversion DMA:
STEP 1:
Set DCNT char conversion DMA enable = 1.
...
STEP 7:
The SA-1 CPU can return to program processing after STEP 1 has been performed,
However, it must wait during any simultaneous access to BW-RAM or SA-1 I-RAM as DMA has priority.


...

So the control register says the SA-1 is paused until the DMA completes with DMA priority, and that char conversion can only use DMA priority.

Then it says the SA-1 CPU can run during char conversion in the next section.

Yet Marvelous churns out successive 64-byte DMA transfers back-to-back. If I force allow both to run, even with DMA priority + CPU stalls (cycle interleaving), the transfers would overlap each other and break. 110 CPU cycles (changing other DMA regs during that) to 256 DMA cycles. So the CPU definitely has to be stopped completely with DPRIO=1.

If DMA priority meant it kept priority during the entire transfer, then step 7 above would not be possible.

Maybe it's best to just avoid asynchronous DMA transfers for now. Not sure if it's a good idea to emulate a behavior that I don't understand and no game uses. Would likely just screw it up anyway.

CPU priority mode between BW-RAM and I-RAM would be limited to 2048 bytes * 4 = 8,192 cycles anyway @ 21,477,272Hz anyway.

Marvelous:
Code:
//start 64-byte DMA
00d29c sta $37       [$002237] A:0040 X:0000 Y:2080 S:37f5 D:2200 DB:00 nvMxdizc V:141 H: 960
//counter jumps by +~256 due to DMA being synchronous
00d29e plx                     A:0040 X:0000 Y:2080 S:37f5 D:2200 DB:00 nvMxdizc V:141 H:1100
00d29f lda #$c4                A:0040 X:0000 Y:2080 S:37f7 D:2200 DB:00 nvMxdiZc V:141 H:1112
//already modifying DMA regs ~18 cycles later
00d2a1 sta $30       [$002230] A:00c4 X:0000 Y:2080 S:37f7 D:2200 DB:00 NvMxdizc V:141 H:1118
00d2a3 ldy $ca0d,x   [$00ca0d] A:00c4 X:0000 Y:2080 S:37f7 D:2200 DB:00 NvMxdizc V:141 H:1126
00d2a6 sty $32       [$002232] A:00c4 X:0000 Y:8200 S:37f7 D:2200 DB:00 NvMxdizc V:141 H:1140
00d2a8 lda #$90                A:00c4 X:0000 Y:8200 S:37f7 D:2200 DB:00 NvMxdizc V:141 H:1154
00d2aa sta $34       [$002234] A:0090 X:0000 Y:8200 S:37f7 D:2200 DB:00 NvMxdizc V:141 H:1162
00d2ac ldy #$0040              A:0090 X:0000 Y:8200 S:37f7 D:2200 DB:00 NvMxdizc V:141 H:1170
00d2af sty $38       [$002238] A:0090 X:0000 Y:0040 S:37f7 D:2200 DB:00 nvMxdizc V:141 H:1176
00d2b1 ldy #$2280              A:0090 X:0000 Y:0040 S:37f7 D:2200 DB:00 nvMxdizc V:141 H:1192
00d2b4 sty $35       [$002235] A:0090 X:0000 Y:2280 S:37f7 D:2200 DB:00 nvMxdizc V:141 H:1198
00d2b6 lda #$40                A:0090 X:0000 Y:2280 S:37f7 D:2200 DB:00 nvMxdizc V:141 H:1212
//next DMA, ~110 CPU (non-sync-DMA) clocks after last
//if asynchronous, even interleaved 1:1, old DMA would still be active
//if completely synchronous, STEP 7 above is meaningless
00d2b8 sta $37       [$002237] A:0040 X:0000 Y:2280 S:37f7 D:2200 DB:00 nvMxdizc V:141 H:1220


Wed Apr 08, 2009 7:04 pm
Inmate

Joined: Thu Jan 11, 2007 4:28 am
Posts: 1485
Location: Salem, Oregon
Post 
well hot damn, look what happens when I go away on spring break for awhile, Jesus Byuu....

EDIT:

the newest wip plus the newest no-intro set playing kirby 3 feels oh so sexy

_________________
byuu wrote:
Seriously, what kind of asshole makes an old-school 2D emulator that requires a Core 2 to get full speed? >:(


Wed Apr 08, 2009 8:35 pm
Profile WWW
Seen it all
User avatar

Joined: Mon Jan 03, 2005 5:04 pm
Posts: 2302
Location: Germany
Post 
byuu wrote:
Not sure if it's a good idea to emulate a behavior that I don't understand and no game uses.

Would it be possible to run tests on the hardware?

_________________
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list


Wed Apr 08, 2009 9:42 pm
Profile WWW
Post 
Finally figured out how SA-1 IRQs work. They don't trigger based on the SNES' /IRQ line, they simply trigger when the SNES writes to an SA-1 reg to trigger them.

Awesome, so IRQ support won't cause any speed hit over the current WIP, and Parodius is now playable. Still something wrong with Mario RPG (I know! Patience ...) but we're up to four out of fine running fine now :D

Image

Quote:
Would it be possible to run tests on the hardware?


Yes, thanks to blargg's serial cable + stop'n'swop. But unfortunately all of my legally owned and personally dumped SA-1 cartridges that I'm using for the above screenshots have SA-1 chips that aren't working. Water damage. I'd need another SA-1 cart.


Wed Apr 08, 2009 10:35 pm
Regular
User avatar

Joined: Mon Nov 21, 2005 3:43 am
Posts: 236
Post 
byuu wrote:
I'd need another SA-1 cart.


I'll loan you my mario rpg cart as long as you back up my saved game before experimenting. Just PM me any shipping details.

Matsuri loev mario rpg..
Image


Wed Apr 08, 2009 11:14 pm
Profile
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
He can just get his own on ebay for cheap. PGA European Tour is like $5 shipped.


Wed Apr 08, 2009 11:41 pm
Profile
Regular
User avatar

Joined: Mon Nov 21, 2005 3:43 am
Posts: 236
Post 
Or since I live in the US he could pay nothing at all for it. I never said he had to pay for the shipping, I'd even pay to have it shipped back. :P The cart is verified working and in pristine condition too.


Wed Apr 08, 2009 11:47 pm
Profile
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
Right, but then he's dicking with someone else's $40 property to save $5. There's also the possibility that a problem is found well after he's sent it back to you, and he won't have it to run tests on anymore.


Wed Apr 08, 2009 11:54 pm
Profile
Regular
User avatar

Joined: Mon Nov 21, 2005 3:43 am
Posts: 236
Post 
Well just offering, if he doesn't need it that's fine. Also I doubt anything bad would happen to it. Worst case his testing on the game would erase my save I figure which is why I'd want it backed up. It's from 1997 or something.. I haven't played the game since then.


Wed Apr 08, 2009 11:58 pm
Profile
Post 
Yeah I appreciate the offer definitely. But I hate taking things for free, and I can't say if I'd need it two years from now for instance. I should be okay without a cart.

Anyway, IRQ code in case I forget:

Code:
//TODO: test this during last_cycle() instead
    if(mmio.sa1_irq == 1 && mmio.irqcl == 0) {
      if(!regs.p.i) interrupt(mmio.civ);
    }

    if(mmio.sa1_nmi == 1 && mmio.nmicl == 0) {
      if(!regs.p.i) interrupt(mmio.cnv);
    }

    (this->*opcode_table[op_readpc()])();


Code:
void SA1::mmio_w2200(uint8_t data) {
  mmio.sa1_irq  = (data & 0x80);
  mmio.sa1_nmi  = (data & 0x10);
  ...
  if(mmio.sa1_irq) {
    mmio.irq_flag = true;
    if(mmio.cpu_irqen == true) mmio.irqcl = 0;
  }

  if(mmio.sa1_nmi) {
    mmio.nmi_flag = true;
    if(mmio.cpu_nmien == true) mmio.nmicl = 0;
  }
}


Code:
void SA1::mmio_w220a(uint8_t data) {
  if(mmio.cpu_irqen == 0 && (data & 0x80)) {
    if(mmio.irq_flag) mmio.irqcl = 0;
  }

  mmio.cpu_irqen   = (data & 0x80);
...


Code:
void SA1::mmio_w220b(uint8_t data) {
  mmio.irqcl = (data & 0x80);
  mmio.nmicl = (data & 0x10);

  if(mmio.irqcl) mmio.irq_flag = false;
  if(mmio.nmicl) mmio.nmi_flag = false;
}


Code:
uint8_t SA1::mmio_r2301() {
  return (mmio.irq_flag << 7) | (mmio.nmi_flag << 6) | mmio.smeg;
}


Thu Apr 09, 2009 12:05 am
Regular
User avatar

Joined: Mon Nov 21, 2005 3:43 am
Posts: 236
Post 
byuu wrote:
Yeah I appreciate the offer definitely. But I hate taking things for free,


Oh okay, I just felt bad for screwing up with that copier before. Plus I figured it'd give people a chance to enjoy playing mario rpg in an emulator with out all those bugs. If you can get it working with out the cart though that's cool.


Thu Apr 09, 2009 12:13 am
Profile
Post 
Gil_Hamilton wrote:
I want pictures of SRW Gaiden!


Lucky you. It didn't get past the Banpresto logo until I got the IRQs working :)

That makes five out of six. Mario RPG fans are quite unlucky :/

Image

Get Gideon to release a UPS patch and I'll post English screenshots :D


Thu Apr 09, 2009 12:17 am
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
powerspike wrote:
Also I doubt anything bad would happen to it.


As do I, but it's possible. It could get stolen, lost in the mail, or byuu's neighbor could be a paranoid schizophrenic who thinks he's stealing his energy and cuts him down in the parking lot with a decorative sword before he can send it back to you.

http://www.madison.com/wsj/topstories/445676


Thu Apr 09, 2009 12:38 am
Profile
Seen it all
User avatar

Joined: Mon Jan 03, 2005 5:04 pm
Posts: 2302
Location: Germany
Post 
byuu wrote:
Code:
if(mmio.sa1_irq) {
    mmio.irq_flag = true;
    if(mmio.cpu_irqen == true) mmio.irqcl = 0;
  }

Mmmh, explicitly testing for true? Seems inconsistent... :?:

_________________
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list


Thu Apr 09, 2009 12:58 am
Profile WWW
Locksmith of Hyrule
User avatar

Joined: Sun Aug 08, 2004 7:49 am
Posts: 3634
Location: 255.255.255.255
Post 
FitzRoy wrote:
Right, but then he's dicking with someone else's $40 property to save $5. There's also the possibility that a problem is found well after he's sent it back to you, and he won't have it to run tests on anymore.

I'm not sure if this'd help or hurt the SA-1 case, but maybe byuu could run tests on the SMRPG cart specifically to see if there's something particular that this game uses? :?

_________________
Image
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.


Thu Apr 09, 2009 1:03 am
Profile YIM WWW
Buzzkill Gil

Joined: Wed Jan 12, 2005 7:14 pm
Posts: 4249
Post 
powerspike wrote:
byuu wrote:
I'd need another SA-1 cart.


I'll loan you my mario rpg cart as long as you back up my saved game before experimenting. Just PM me any shipping details.

Matsuri loev mario rpg..
Image

She loves it enough to give it an upskirt shot, even.


byuu wrote:
Gil_Hamilton wrote:
I want pictures of SRW Gaiden!


Lucky you. It didn't get past the Banpresto logo until I got the IRQs working :)

That makes five out of six. Mario RPG fans are quite unlucky :/

Image

Get Gideon to release a UPS patch and I'll post English screenshots :D

Hooray! GOGOGO!


If I could get Gid to release ANY patch, I would.
...
Which I guess means I need to start whipping his translator/proofreader.
YAH! MUSH!


Thu Apr 09, 2009 1:05 am
Profile
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
adventure_of_link wrote:
I'm not sure if this'd help or hurt the SA-1 case, but maybe byuu could run tests on the SMRPG cart specifically to see if there's something particular that this game uses? :?


Maybe, but he expressed desire for a generic cart, so I didn't think it mattered.


Thu Apr 09, 2009 1:40 am
Profile
Regular
User avatar

Joined: Mon Nov 21, 2005 3:43 am
Posts: 236
Post 
Gil_Hamilton wrote:
She loves it enough to give it an upskirt shot, even.


Just some fan service for a boring photo. :P :D


FritzRoy wrote:
As do I, but it's possible. It could get stolen, lost in the mail, or byuu's neighbor could be a paranoid schizophrenic who thinks he's stealing his energy and cuts him down in the parking lot with a decorative sword before he can send it back to you.

http://www.madison.com/wsj/topstories/445676


*Makes a note to insure his snes carts* Haha god damn that guy is loon. I'll be more careful with my own property from now on. :wink:


Thu Apr 09, 2009 2:16 am
Profile
♥ Love Freak FlonneZilla ♥
User avatar

Joined: Sun Apr 01, 2007 12:59 am
Posts: 111
Location: USA
Post 
FitzRoy wrote:
http://www.madison.com/wsj/topstories/445676
Wow, how does one even go about obtaining so much ninja contraband? :o


Thu Apr 09, 2009 4:43 am
Profile WWW
Gecko snack

Joined: Sun Aug 21, 2005 11:06 am
Posts: 2372
Location: Australia, QLD
Post 
Killa B wrote:
FitzRoy wrote:
http://www.madison.com/wsj/topstories/445676
Wow, how does one even go about obtaining so much ninja contraband? :o
Yo suspectin' someone stealin' yo energy too?

_________________
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64


Thu Apr 09, 2009 4:48 am
Profile WWW
♥ Love Freak FlonneZilla ♥
User avatar

Joined: Sun Apr 01, 2007 12:59 am
Posts: 111
Location: USA
Post 
Yes, that is precisely why I asked that question. :roll:


Thu Apr 09, 2009 4:51 am
Profile WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 125 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

Who is online

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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.