Previous Thread
Next Thread
Print Thread
Page 2 of 7 1 2 3 4 5 6 7
#88977 - 06/09/13 06:52 PM Re: N64 driver improvement [Re: Octocontrabass]  
Joined: May 2009
Posts: 1,664
Just Desserts Offline
Very Senior Member
Just Desserts  Offline
Very Senior Member

Joined: May 2009
Posts: 1,664
Originally Posted By Octocontrabass
I haven't actually written any code for MESS before, so I have no idea how I should determine the difference between a cold boot and a warm boot. Do I add a new variable? Is similar functionality already present? Is there another driver that I should use as reference?


If you hop into #messdev or something I can give you a quick overview. The structure is pretty straightforward, overall:

src/emu/cpu/rsp/*: RSP-related files

src/mess/drivers/n64.c: The core N64 driver file. Defines the memory maps, input, and the main machine definition.

src/mame/video/rdp*.c and n64.c: RDP emulation. Here be dragons.

src/mame/machine/n64.c: Non-RDP-related emulation code. This is where most of the stuff you want is located, as it handles stuff like PIF, cold/warm boot, and things like the RDRAM regs. mi_reg_r/mi_reg_w handle MI, vi_reg_r/vi_reg_w handle VI, and so on for AI, PI, RI and SI. There's also rdram_reg_r and rdram_reg_w, which is what you want. As you can see, the RDRAM register handling is completely a stub at the moment, so it should be pretty straightforward if you want to try adding support for those registers.

As for cold boot versus warm boot, I don't believe the PIF RAM is ever initialized to anything in the first place in the current MESS code. For all I know this may well be why some games don't want to boot in MESS for inexplicable reasons. This could be easily taken care of by initializing the PIF RAM in n64_state::machine_start. To flag a warm boot, you would want to poke the relevant value into PIF RAM in either reset_tick (if the value appears when the reset button is released) or in poll_reset_button (if the value appears as soon as the reset button is depressed).

#88978 - 06/09/13 07:13 PM Re: N64 driver improvement [Re: Octocontrabass]  
Joined: Apr 2010
Posts: 47
Happy Offline
Member
Happy  Offline
Member

Joined: Apr 2010
Posts: 47
The PIF should detect Boot/Reset and load PIF RAM word 0x24 (0x1FC0 07E4) with

1. bits 7-0, IPL2 (PIF ROM) Checksum Seed
2. bits 15-8, IPL3 (First 1MB of CART) Checksum Seed
3. bit 16, (NTSC vs. PAL ?) bit never checked, PIF forces NTSC
4. bit 17, Reset Type (Cold vs. Warm) -> 0x8000 030C
5. bit 18, Version (HW 1 vs. HW 2 ?) -> 0x8000 0314
6. bit 19, ROM Type (DD Bulk vs. CART) -> 0x8000 0304

I doubt this is the reason why some games don't want to boot, unless they always detect a warm boot and expect valid data to be in the NMI Buffer at 0x8000 031C.

#88979 - 06/09/13 08:02 PM Re: N64 driver improvement [Re: Happy]  
Joined: May 2009
Posts: 1,664
Just Desserts Offline
Very Senior Member
Just Desserts  Offline
Very Senior Member

Joined: May 2009
Posts: 1,664
I feel like I should know this, but... NMI Buffer?

#88980 - 06/09/13 08:22 PM Re: N64 driver improvement [Re: Octocontrabass]  
Joined: Apr 2010
Posts: 47
Happy Offline
Member
Happy  Offline
Member

Joined: Apr 2010
Posts: 47
The boot procedure promises not to overwrite any value between 0x8000 031C and 0x8000 035C (although 6105 Bootcode is different). This allows a program to write some values here when an Pre-NMI is detected. These values should still be valid when the NMI (Reset) has finished and the program restarted. It isn't very much memory and most games I've seen just reinitialize everything instead of using it.

#88991 - 06/11/13 05:55 AM Re: N64 driver improvement [Re: Octocontrabass]  
Joined: Mar 2008
Posts: 1,029
Shideravan Offline
Very Senior Member
Shideravan  Offline
Very Senior Member

Joined: Mar 2008
Posts: 1,029
Octocontrabass = Joe?


"A user interface is like a joke. If you have to explain it, it's not that good."
#88992 - 06/11/13 06:59 AM Re: N64 driver improvement [Re: Octocontrabass]  
Joined: Jun 2013
Posts: 34
Octocontrabass Offline
Member
Octocontrabass  Offline
Member

Joined: Jun 2013
Posts: 34
That's right. grin

Once I have a few hours of free time, I can get to work on the n64 driver a bit more. I'm not sure what I'll do next.

Maybe I'll look into what causes this amusing bug.

#88996 - 06/11/13 02:15 PM Re: N64 driver improvement [Re: Octocontrabass]  
Joined: May 2009
Posts: 1,664
Just Desserts Offline
Very Senior Member
Just Desserts  Offline
Very Senior Member

Joined: May 2009
Posts: 1,664
Originally Posted By Octocontrabass
Maybe I'll look into what causes this amusing bug.


That's hilarious, and probably some sort of core MIPS bug. Good luck! smile

#89004 - 06/11/13 10:02 PM Re: N64 driver improvement [Re: Octocontrabass]  
Joined: Apr 2006
Posts: 618
Dullaron Offline
Senior Member
Dullaron  Offline
Senior Member

Joined: Apr 2006
Posts: 618
Fort Worth, TX.
Funny. The game is looping. LOL

Three Nintendo favorite characters. :P


Windows 10 Pro 64-bit / Intel Core i5-4460 3.20 GHz / 8.00 GB RAM / AMD Radeon R9 200 Series
#89029 - 06/13/13 04:13 AM Re: N64 driver improvement [Re: Octocontrabass]  
Joined: Mar 2008
Posts: 1,029
Shideravan Offline
Very Senior Member
Shideravan  Offline
Very Senior Member

Joined: Mar 2008
Posts: 1,029
LoL
Good luck smile


"A user interface is like a joke. If you have to explain it, it's not that good."
#90599 - 09/21/13 10:05 PM Re: N64 driver improvement [Re: Just Desserts]  
Joined: Aug 2008
Posts: 87
Christina Offline
Member
Christina  Offline
Member

Joined: Aug 2008
Posts: 87
Originally Posted By Just Desserts
Originally Posted By Octocontrabass
Maybe I'll look into what causes this amusing bug.


That's hilarious, and probably some sort of core MIPS bug. Good luck! smile

Any news about that?

Page 2 of 7 1 2 3 4 5 6 7

Who's Online Now
8 registered members (AJR, judge, Roberto Fresca, EoceneMiacid, MarkBielman, remax, Edstrom, 1 invisible), 30 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,496
Posts110,806
Members4,781
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.0
Page Time: 0.096s Queries: 15 (0.045s) Memory: 5.0248 MB (Peak: 5.2739 MB) Zlib enabled. Server Time: 2018-02-22 16:36:22 UTC