Author Topic: some small changes/fixes  (Read 10010 times)

kev

  • Guest
some small changes/fixes
« on: July 16, 2008, 04:21:06 PM »
While trying to work out what is going wrong with MAME Z80 and CZ80 in certain games, I ran into a problem with the sn76496 exit routine that was causing the megadrive driver to crash when using either core which I have fixed.

Also, the cz80 interface has been merged into the latest Zet. The make file will need to be changed to compile cz80.c, the other c files are included from there. Compiles ok with visual studio 2008 and PSP gcc but I have not tested with mingw. There are still problems with CPS1 Qsound, TNZ, vulgus, etc but I am still trying to find out whats wrong with them. Currently I suspect that the interface to Cz80 and MAME Z80 is handling interrupts incorrectly.

Finally, I have included my current wip of dec0 as I had made a few changes to the video rendering code which fixes the robocop title screen but its still quite f***ed.


http://www.kja.pwp.blueyonder.co.uk/smallfixes.rar

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: some small changes/fixes
« Reply #1 on: July 17, 2008, 03:52:50 AM »
Cheers Kev. I've merged the changes in.

I had to name the anonymous struct (and amend all the macros to reflect it) to get it to compile under MinGW, and then it didn't work!

Rather than spend time debugging it I've put the code in as you sent it. I don't see the Windows build needing to use CZ80 so I haven't chased it down to make it work with MinGW (just not included it in the makefile).
« Last Edit: July 17, 2008, 03:53:51 AM by Treble Winner »
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

kev

  • Guest
Re: some small changes/fixes
« Reply #2 on: July 17, 2008, 07:58:32 AM »
Cool. I agree that we probably won't need CZ80 under windows anyway, esp when we have fixed the interface to the Mame z80. I'm going to take a look at merging in Oopswares sek later as well, as that seems to be faster than a68k.

Offline OOKAMI

  • Newbies
  • *
  • Posts: 10
  • Karma: +0/-0
Re: some small changes/fixes
« Reply #3 on: July 17, 2008, 09:27:11 PM »
hi Kev

i have update sources and try to compile

i have just these errors

Linking executable... FBA4PSP.elf
obj/PSP/burn/zet.o: In function `ZetSetReadHandler(unsigned char (*)(unsigned sh
ort))':
zet.cpp:(.text+0x20): undefined reference to `Doze'
zet.cpp:(.text+0x28): undefined reference to `Doze'
obj/PSP/burn/zet.o: In function `ZetSetWriteHandler(void (*)(unsigned short, uns
igned char))':
zet.cpp:(.text+0x2c): undefined reference to `Doze'
zet.cpp:(.text+0x34): undefined reference to `Doze'
obj/PSP/burn/zet.o: In function `ZetSetInHandler(unsigned char (*)(unsigned shor
t))':
zet.cpp:(.text+0x38): undefined reference to `Doze'
obj/PSP/burn/zet.o:zet.cpp:(.text+0x40): more undefined references to `Doze' fol
low
obj/PSP/burn/zet.o: In function `ZetNmi()':
zet.cpp:(.text+0x5a0): undefined reference to `DozeNmi'
zet.cpp:(.text+0x5a8): undefined reference to `Doze'
zet.cpp:(.text+0x5ac): undefined reference to `Doze'
obj/PSP/burn/zet.o: In function `ZetReset()':
zet.cpp:(.text+0x6b4): undefined reference to `DozeReset'
obj/PSP/burn/zet.o: In function `ZetRun(int)':
zet.cpp:(.text+0x7b8): undefined reference to `Doze'
zet.cpp:(.text+0x7c4): undefined reference to `Doze'
zet.cpp:(.text+0x7e0): undefined reference to `DozeRun'
collect2: ld returned 1 exit status
make[2]: *** [FBA4PSP.elf] Error 1
make[1]: *** [all] Error 2
make: *** [psp] Error 2

i try to see where i must change line in makefile but i dont find where exactly

can you help me about this ?


Offline OOKAMI

  • Newbies
  • *
  • Posts: 10
  • Karma: +0/-0
Re: some small changes/fixes
« Reply #4 on: July 18, 2008, 08:08:16 AM »
ok, i found the solution

in zet.cpp

nCycles = Doze.nCyclesSegment - Doze.nCyclesLeft;

transformed at

//nCycles = Doze.nCyclesSegment - Doze.nCyclesLeft;

result

emulation for CPS2 gigawing speed increase greatly !
same thing for metal slug first

i let the makefile for all want to compile for test and the cpp file modified

BE CAREFUL !!! => THIS FBA ACCEPT ONLY CPS AND NEOGEO

indeed, i have modified the version to make some test. I will add others systems after

bye :)

« Last Edit: July 18, 2008, 08:09:51 AM by OOKAMI »

kev

  • Guest
Re: some small changes/fixes
« Reply #5 on: July 18, 2008, 02:02:52 PM »
Undo the change you made and change

Code: [Select]
#define EMU_DOZE // Use Dave's 'Doze' Assembler Z80 emulator
//#define EMU_MAME_Z80
//#define EMU_CZ80


to

Code: [Select]
//#define EMU_DOZE // Use Dave's 'Doze' Assembler Z80 emulator
//#define EMU_MAME_Z80
#define EMU_CZ80

as there is no doze for psp. The fix you made will probably completely disable the z80, at a guess

Offline OOKAMI

  • Newbies
  • *
  • Posts: 10
  • Karma: +0/-0
Re: some small changes/fixes
« Reply #6 on: July 18, 2008, 04:12:52 PM »
ok, i will try this and i make feedback :)


thanks :)

just a thing : for CPS1 games, I can reload a new game when I want but it's not the case for CPS2 and NEOGEO, bug or maybe my fault ?

other thing, I want to activate control config but i dont find the concerned file

good evening :)


EDIT

code don't found in zet.cpp

weird !

EDIT 2

ok code found in zet.h

fine :)

EDIT 3

ok, I make the change and obtain this error :

Compiling src/burn/zet.cpp...
src/burn/zet.cpp: In function 'int ZetNmi()':
src/burn/zet.cpp:646: error: 'nCycles' was not declared in this scope
src/burn/zet.cpp: In function 'int ZetTotalCycles()':
src/burn/zet.cpp:682: warning: control reaches end of non-void function
src/burn/zet.cpp: In function 'int ZetSegmentCycles()':
src/burn/zet.cpp:671: warning: control reaches end of non-void function
src/burn/zet.cpp: In function 'int ZetHL(int)':
src/burn/zet.cpp:553: warning: control reaches end of non-void function
src/burn/zet.cpp: In function 'int ZetBc(int)':
src/burn/zet.cpp:532: warning: control reaches end of non-void function
src/burn/zet.cpp: In function 'int ZetRun(int)':
src/burn/zet.cpp:274: warning: control reaches end of non-void function
make[1]: *** [zet.o] Error 1
make: *** [psp] Error 2

i have make this change

Code :

// Z80 (Zed Eight-Ty) Interface
//#define EMU_DOZE// Use Dave's 'Doze' Assembler Z80 emulator
#define EMU_MAME_Z80
#define EMU_CZ80

compilation ok but roms slow

hum....
« Last Edit: July 18, 2008, 04:40:05 PM by OOKAMI »

Offline OopsWare

  • Expert
  • *****
  • Posts: 38
  • Karma: +31/-0
Re: some small changes/fixes
« Reply #7 on: July 18, 2008, 11:39:05 PM »
this cz80 core version is v0.9, with some fix by NJ .
i rewrite the Cz80_exec , to resolve the interrupt quite like the DOZE .
now , CPS1 QS works correctly .

Offline OOKAMI

  • Newbies
  • *
  • Posts: 10
  • Karma: +0/-0
Re: some small changes/fixes
« Reply #8 on: July 19, 2008, 02:04:05 AM »
this cz80 core version is v0.9, with some fix by NJ .
i rewrite the Cz80_exec , to resolve the interrupt quite like the DOZE .
now , CPS1 QS works correctly .



ok, I have compiled and error i have :


make[2]: Warning: File `src/cpu/cz80/cz80.c' has modification time 1.2e+04 s in
the future
Compiling src/cpu/cz80/cz80.c...
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not fo
r C

Linking executable... FBA4PSP.elf
Creating PSP EBOOT.PBP...
  •         332 bytes | eboot.sfo
  • [1]      10642 bytes | src/psp/fbapsp.png
    [2]          0 bytes | NULL
    [3]          0 bytes | NULL
    [4]          0 bytes | NULL
    [5]          0 bytes | NULL
    [6]    2172608 bytes | eboot_strip.elf
    [7]          0 bytes | NULL
    make[2]: warning:  Clock skew detected.  Your build may be incomplete.
    make[1]: warning:  Clock skew detected.  Your build may be incomplete.


    first compilation => black screen but i can quit soft by home button
    second compilation => same thing

    any idea ?
    for my part, i verify where is detected warning

    :)

    EDIT :

    ok, after first verification => a cz80.o is created in
    src/burn/cpu/cz80
    and
    obj/burn/cpu/cz80

    the o file in src size 68k
    the o file in obj size 62k

    if I update the o file in obj, the makefile replace the file

    I continue controls
« Last Edit: July 19, 2008, 02:10:21 AM by OOKAMI »

kev

  • Guest
Re: some small changes/fixes
« Reply #9 on: July 19, 2008, 09:47:40 AM »
this cz80 core version is v0.9, with some fix by NJ .
i rewrite the Cz80_exec , to resolve the interrupt quite like the DOZE .
now , CPS1 QS works correctly .


Nice work OopsWare. :)  I am running some tests with this version and will upload an update to get it building with visual studio afterwards.



kev

  • Guest
Re: some small changes/fixes
« Reply #10 on: July 19, 2008, 09:51:40 AM »
Linking executable... FBA4PSP.elf
Creating PSP EBOOT.PBP...

that sounds like it built ok to me, maybe a rom problem?

If you are having problems with any applying any of the patches I would suggest just using the code from OopsWares site as it is for now, any changes you are going to make can be merged in with the next version easily enough.

kev

  • Guest
Re: some small changes/fixes
« Reply #11 on: July 19, 2008, 10:19:23 AM »
this cz80 core version is v0.9, with some fix by NJ .
i rewrite the Cz80_exec , to resolve the interrupt quite like the DOZE .
now , CPS1 QS works correctly .


Yeah, this is a very good fix! seems like all the problems in vulgus, etc are gone now.

Here is a version merged in with the latest zet. Treble, if you are reading this, can you please apply this patch you your source? :)
http://www.kja.pwp.blueyonder.co.uk/z80fix.rar

Offline OopsWare

  • Expert
  • *****
  • Posts: 38
  • Karma: +31/-0
Re: some small changes/fixes
« Reply #12 on: July 19, 2008, 10:44:06 AM »
hi kev , is MS VC does NOT support array of goto label ? any other changes ?
i'v repleased that inline innerRead / innerWrite functions with macros after i post the sourcecode.
now the Cz80_Get_PC() will work correctly while CZ80 is executting .
and i think it'll a bit faster .



kev

  • Guest
Re: some small changes/fixes
« Reply #13 on: July 19, 2008, 11:40:10 AM »
hi kev , is MS VC does NOT support array of goto label ? any other changes ?
i'v repleased that inline innerRead / innerWrite functions with macros after i post the sourcecode.
now the Cz80_Get_PC() will work correctly while CZ80 is executting .
and i think it'll a bit faster .


Yeah, it seems that it doesnt like the array of gotos. Not really looked into why but it is possible to get it building with that option enabled but it won't run any Z80 code. That is the only change I have had to make to CZ80 tho. I have updated zet again so it works with the latest code from Treblewinner.

http://www.kja.pwp.blueyonder.co.uk/z80fix2.rar


I think the changes you have made have sped it up a tiny bit at least. I did a quick profile build and CZ80 seems to be about 20% faster than DOZE now and about 40% quicker on some games like bombjack.

Offline OOKAMI

  • Newbies
  • *
  • Posts: 10
  • Karma: +0/-0
Re: some small changes/fixes
« Reply #14 on: July 19, 2008, 11:45:24 AM »
Yeah, this is a very good fix! seems like all the problems in vulgus, etc are gone now.

Here is a version merged in with the latest zet. Treble, if you are reading this, can you please apply this patch you your source? :)
http://www.kja.pwp.blueyonder.co.uk/z80fix.rar

ok I have make new compile for PSP and all is ok, I make test now :)
ok, your suggestion about undo the fix and change define is good, i have same speed :)

Yeah, it seems that it doesnt like the array of gotos. Not really looked into why but it is possible to get it building with that option enabled but it won't run any Z80 code. That is the only change I have had to make to CZ80 tho. I have updated zet again so it works with the latest code from Treblewinner.

http://www.kja.pwp.blueyonder.co.uk/z80fix2.rar


I think the changes you have made have sped it up a tiny bit at least. I did a quick profile build and CZ80 seems to be about 20% faster than DOZE now and about 40% quicker on some games like bombjack.

i make update now :)


EDIT

ok, for second update

make[2]: Warning: File `src/cpu/cz80/cz80_op.c' has modification time 1.5e+04 s
in the future
Compiling src/cpu/cz80/cz80.c...
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not fo
r C

Linking executable... FBA4PSP.elf
Creating PSP EBOOT.PBP...
  •         332 bytes | eboot.sfo
  • [1]      10642 bytes | src/psp/fbapsp.png
    [2]          0 bytes | NULL
    [3]          0 bytes | NULL
    [4]          0 bytes | NULL
    [5]          0 bytes | NULL
    [6]    2171936 bytes | eboot_strip.elf
    [7]          0 bytes | NULL
    make[2]: warning:  Clock skew detected.  Your build may be incomplete.


    but

    no black screen
    games ok but slow more ingame instade of first z80 fix

« Last Edit: July 19, 2008, 12:11:23 PM by OOKAMI »