Gens4All with Z80 Emulation

Place for discussing homebrew games, development, new releases and emulation.

Moderators: pcwzrd13, deluxux, VasiliyRS

User avatar
matador
dark night
Posts: 57

Re: Gens4All with Z80 Emulation

Post#81 » Mon Oct 25, 2021 7:59 pm

Thanks man. This incredible work.

User avatar
KmusDC
fire
Posts: 82

Re: Gens4All with Z80 Emulation

Post#82 » Tue Oct 26, 2021 11:54 pm

Ian Micheal wrote:
KmusDC wrote:Hello bro, excellent contribution, good to see updates for this magnificent emulator. I would like to know how to convert it to an iso for dreamshell. Greetings


as normal that should work use iso make tools once you get the files from abovr un scramble the 1St_read.bin normal stuff



thanks a lot. It works perfect.

TapamN
letterbomb
Posts: 149

Re: Gens4All with Z80 Emulation

Post#83 » Wed Oct 27, 2021 2:33 am

The example code I posted is equivalent to this:

Code: Select all

void pvr_tex_lmemset32(pvr_ptr_t dst, int l, size_t len) {
   //Set PVR DMA registers
   volatile int *pvrdmacfg = (int*)0xA05F6888;
   pvrdmacfg[1] = pvrdmacfg[0] = 0;
   
   //Convert read/write area pointer to DMA write only area pointer
   void *dmaareaptr = ((uintptr_t)dst & 0xffffff) | 0x11000000;
   
   sq_set32(dmaareaptr, l, len);
}

I've tested it, and it definitely works on real hardware. It's possible that some/all emulators don't support it.

Ian Micheal wrote:

Code: Select all

   //Set QACR registers
   volatile int *qacr = (int*)0xFF000038;
   qacr[1] = qacr[0] = 0x11;


How does this related to

Code: Select all

    /* Set store queue memory area as desired */
    QACR0 = ((((unsigned int)sbuf->vramData)>>26)<<2)&0x1c;
    QACR1 = ((((unsigned int)sbuf->vramData)>>26)<<2)&0x1c;


My qacr[0]/qacr[1] value is just the precalculated result of what's written to QACR0/QACR1. Also, all that needs to be done to generate the QACR value for a given pointer is "(unsigned int)ptr >> 24". The extra shifting and masking is unnecessary.

Ian Micheal wrote:In your sh4 lib

Code: Select all

#define NONCACHED(a) (typeof (&(a)[0]))(((unsigned int)(a)) |  (1 << 29))
#define CACHED(a)    (typeof (&(a)[0]))(((unsigned int)(a)) & ~(1 << 29))
#define OCI_BANK0(a) (typeof (&(a)[0]))(((unsigned int)(a)) & ~(1 << 25))
#define OCI_BANK1(a) (typeof (&(a)[0]))(((unsigned int)(a)) |  (1 << 25))


That's not SQ stuff. It's for controlling how the SH4's cache is accessed.

User avatar
Ian Micheal
Developer
Posts: 5995
Contact:

Re: Gens4All with Z80 Emulation

Post#84 » Wed Oct 27, 2021 2:46 am

Thank you TapmN! I understand now thank you have it working on hardware your a Genus you know it :) :D

User avatar
Ian Micheal
Developer
Posts: 5995
Contact:

Re: Gens4All with Z80 Emulation

Post#85 » Wed Oct 27, 2021 3:13 am

I have no idea how you come up with this or even thought of it lol

User avatar
fafadou
Gold Lion
Posts: 1655

Re: Gens4All with Z80 Emulation

Post#86 » Wed Oct 27, 2021 5:37 am

You are very good @tapamN, awesome work.

User avatar
Ian Micheal
Developer
Posts: 5995
Contact:

Re: Gens4All with Z80 Emulation

Post#87 » Wed Oct 27, 2021 11:46 am

I have been using this for years i use it few of my ports I came up with

Code: Select all

void dc_txr_dma_cpy(void *dest, void *src, int n)
{
   long i = n/32;
   char   *ptr=dest;


   do
   {
      asm("ocbp @%0" : : "r" (ptr));
      ptr += 32;
   } while (-- i);

      pvr_txr_load_dma(dest, src, n,0,NULL,0);

}

User avatar
Ian Micheal
Developer
Posts: 5995
Contact:

Re: Gens4All with Z80 Emulation

Post#88 » Thu Oct 28, 2021 5:09 pm

Your SQ way is faster then pvr dma block trasnfer This is my benchmark using SDL dreamhal 1.0

Code: Select all

TapmN SQ ```32x32 blits (blits/sec):   3276.8  4275.57  3091.32   4371.4 ```

Code: Select all

 ``` Pvr DMA 32x32 blits (blits/sec):  3056.72  3934.68  2868.35  3927.13 ```

User avatar
KmusDC
fire
Posts: 82

Re: Gens4All with Z80 Emulation

Post#89 » Fri Oct 29, 2021 7:54 pm


dcsteve
undertow
Posts: 27

Re: Gens4All with Z80 Emulation

Post#90 » Sat Oct 30, 2021 12:43 am

Look 8 minutes into that video. Contra Hard Corp is perfect. Sound and drums are spot on crystal clear.

  • Similar Topics
    Replies
    Views
    Last post

Return to “New Releases/Homebrew/Emulation”

Who is online

Users browsing this forum: No registered users