Jump to content
IGNORED

Emulator Glitch Help on Keystone Koppers


wavemotion

Recommended Posts

33 minutes ago, splendidnut said:

Wouldn't you want to use (data & 0x30) and (data & 0x03) for the IF conditions?  

 

Because, unless I'm mistaken, Color data (in 160B) uses the values of 0,4,8,C for the transparent pixels... so long as the bottom two bits aren't 0, the value in lineRAM should be overwritten.

Yep, good point! Well spotted.

  • Like 1
Link to comment
Share on other sites

My code is quite a bit modified from the original ProSystem... but in case someone comes looking for the answer and doesn't have time to work through the 2 pages of thought process... 

 

The original ProSystem 1.3g or the Wii port has this as the "wide" (not sure why they call it that) or "write mode" version of StoreCell.

 

The highlight is not correct... I think it should just be looking at the low for the 160B mode (which, for this original ProSystem code is the lower 2 bits shifted into position by the caller... also can't stand the use of decimal masking so for the love of all that is good please hexify those for future generations!)

 

// ----------------------------------------------------------------------------
// StoreCell
// ----------------------------------------------------------------------------
static inline void maria_StoreCell(byte high, byte low) {  
  if(maria_horizontal < MARIA_LINERAM_SIZE) {
    if(low || high) {
      maria_lineRAM[maria_horizontal] = maria_palette & 16 | high | low;
    }
    else { 
      byte kmode = memory_ram[CTRL] & 4;
      if(kmode) {
        maria_lineRAM[maria_horizontal] = 0;
      }
    }
  }
  maria_horizontal++;
}

Edited by llabnip
  • Like 5
Link to comment
Share on other sites

Whatever works in a given situation is what's best.  No need for a religious war over number systems.

 

I could argue that y'all should be using named CONSTANTS in these situations.... but I really don't see anyone complaining about these 'magic numbers'... so I must be in the minority.  :)

 

  • Like 1
  • Haha 4
Link to comment
Share on other sites

39 minutes ago, RevEng said:

Sure, but C and most of it's descendant languages don't support binary literal values, so that's not possible here.

I would also avoid binary constants for portability purposes, but FWIW GNU compilers support 0b notation for binary constants. 

  • Like 2
Link to comment
Share on other sites

17 minutes ago, Muddyfunster said:

 

@llabnip Thanks for updating your emulator for Koppers, I do use it when I'm travelling to tinker with 7800 stuff (and of course play Pokemon!)

Cool! This is actually the highlight of this thread for me! I also fixed the Pokey sound in E.X.O. and added a bunch of user configuration so future homebrews can be tweaked to run right. The new build is up at https://github.com/wavemotion-dave/A7800DS

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

11 hours ago, Muddyfunster said:

Just installed 3.7. Plays great :)

Glad to hear!

 

Last night I optimized the memory usage on the DS/DSi and the next release will support 1MB (1024K + 128b header) games. So... um... feel free :)

 

I've only been able to find one tech demo for a 1MB 7800 rom... Frankie never sounded so sweet!

image.thumb.png.5d5fdf3e720a4adef51e2b6940aec980.png

 

I assume the practical limit of 512k is due to things like the Concerto and similar carts ... obviously that's a HUGE amount of space relatively speaking.

 

  • Like 1
Link to comment
Share on other sites

On 10/22/2022 at 10:40 PM, RevEng said:

For the write-mode graphic modes, you should only be using the top bit of the palette. I'm not that familiar with your source, but I think I have this right...

 

static inline void _maria_StoreCells4(byte data) 
{
  if((maria_horizontal) < MARIA_LINERAM_SIZE) 
  {
    byte *ptr = &(maria_lineRAM[maria_horizontal]);
#ifdef KANGAROO_MODE_SUPPORTED
    if (memory_ram[CTRL] & 4)
    {
        if (data & 0x03) *ptr-- = (maria_palette & 0x10) | (data & 0x03); else *ptr-- = 0;
        data = data >> 2;
        if (data & 0x03) *ptr-- = (maria_palette & 0x10) | (data & 0x03); else *ptr-- = 0;
        data = data >> 2;
        if (data & 0x03) *ptr-- = (maria_palette & 0x10) | (data & 0x03); else *ptr-- = 0;
        data = data >> 2;
        if (data) *ptr = (maria_palette & 0x10) | (data); else *ptr = 0;
    }
    else
#endif        
    {
        if (data & 0xC0) *ptr++ = (maria_palette & 0x10) | ((data & 0xC0) >> 6); else ptr++;
        if (data & 0x30) *ptr++ = (maria_palette & 0x10) | ((data & 0x30) >> 4); else ptr++;
        if (data & 0x0C) *ptr++ = (maria_palette & 0x10) | ((data & 0x0C) >> 2); else ptr++;
        if (data & 0x03) *ptr++ = (maria_palette & 0x10) | (data & 0x03); 
    }
  }
  maria_horizontal += 4;
}

 

i.e. all references to "maria_palette" in the original h_maria_StoreCells4() should be "(maria_palette & 0x10)"

 

...my guess now is the 160B robber object has a palette index that's neither 0 nor 4, but some other number.

You check for 8 and 12 right? Those are also transparent.

Link to comment
Share on other sites

On 10/24/2022 at 7:37 AM, llabnip said:

Glad to hear!

 

Last night I optimized the memory usage on the DS/DSi and the next release will support 1MB (1024K + 128b header) games. So... um... feel free :)

 

I've only been able to find one tech demo for a 1MB 7800 rom... Frankie never sounded so sweet!

image.thumb.png.5d5fdf3e720a4adef51e2b6940aec980.png

 

I assume the practical limit of 512k is due to things like the Concerto and similar carts ... obviously that's a HUGE amount of space relatively speaking.

 

Oh, I see you'vde fixed it.

Link to comment
Share on other sites

21 hours ago, splendidnut said:

We posted at the same time.  Oh well.

It's ok. 😃

7 hours ago, Muddyfunster said:

@raz0red I think the same "black box" glitch is present in js7800,  maybe the fix is similar given the respective roots of the emulator?

 

 

Well, @raz0red, we have a patch for you to implement!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...