Gens4All with Z80 Emulation

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

Moderators: pcwzrd13, deluxux, VasiliyRS

matador
dark night
Posts: 57
Location: Aqui

Re: Gens4All with Z80 Emulation

Post by matador »

Thanks man. This incredible work.

User avatar
KmusDC
fire
Posts: 82
Dreamcast Games you play Online: Worms World Party, Phantasy Star Online v2, POD Speed Zone, Alien Front Online.

Re: Gens4All with Z80 Emulation

Post by KmusDC »

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 by TapamN »

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: 6012
Location: USA
Contact:

Re: Gens4All with Z80 Emulation

Post by Ian Micheal »

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: 6012
Location: USA
Contact:

Re: Gens4All with Z80 Emulation

Post by Ian Micheal »

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

User avatar
fafadou
Gold Lion
Posts: 1664

Re: Gens4All with Z80 Emulation

Post by fafadou »

You are very good @tapamN, awesome work.

User avatar
Ian Micheal
Developer
Posts: 6012
Location: USA
Contact:

Re: Gens4All with Z80 Emulation

Post by Ian Micheal »

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: 6012
Location: USA
Contact:

Re: Gens4All with Z80 Emulation

Post by Ian Micheal »

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
Dreamcast Games you play Online: Worms World Party, Phantasy Star Online v2, POD Speed Zone, Alien Front Online.

Re: Gens4All with Z80 Emulation

Post by KmusDC »


dcsteve
undertow
Posts: 27

Re: Gens4All with Z80 Emulation

Post by dcsteve »

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