30

Tonma (./29):
I compiled your code and I have no sprites displayed at all. Only the Background.

Add this at the end of the if(action==6)
aSpriteAnimate(&sp1); aSpriteAnimate(&sp2); aSpriteAnimate(&sp3); aSpriteAnimate(&sp4); aSpriteAnimate(&sp5);

Thank you! But these sprites must be animated if miniGame variable is equal to 1 only. However the piece of code below -

if(miniGame==1) { aSpriteAnimate(&sp1); aSpriteAnimate(&sp2); aSpriteAnimate(&sp3); aSpriteAnimate(&sp4); if(controlON==1) { if((curs_x>104)&&(curs_y>96)) { if((curs_x<208)&&(curs_y>136)) { aSpriteAnimate(&sp5); if(frame==55) score++; } } } if((min==0)&&(sec==0)&&(frame==0)) { miniGame=2; clearSprites(25,46); if(score>=21) choice=0; if(score<=15) choice=1; if((score>15)&&(score<21)) choice=2; action++; } }
- doesn't work. What mistake I did at this time?

Here is updated sources wholly.

tromb Fichier joint : girlxgirl.rar
avatar

31

I move your cursor to foreground to see the hand (pictureInit(&Cursor, &Cur,56,34,curs_x,curs_y,FLIP_NONE)wink and change the function for the position. You use aSpritesetpos but it's a picture.

In your code miniGame always be 1 after init because you push miniGame=1;

You need to change animation inside your if(controlON==1) and you need to change the frame of the breast. You need to add the variable int breast_frame=0; after your define too.

fixPrintf1(1,5,7,3,"%d:",min); fixPrintf1(3,5,7,3,"%d",sec); pictureSetPos(&Cursor,curs_x,curs_y); if(miniGame==1) { if(controlON==1) { if((curs_x>104)&&(curs_y>96)) { if((curs_x<208)&&(curs_y>136)) { // aSpriteAnimate(&sp5); // if(frame%10==3) boobs(); aSpriteSetStep(&sp5, breast_frame); if(breast_frame<5) breast_frame++; else breast_frame=0; if(frame==55) score++; aSpriteSetStep(&sp1, eyes1_frame); aSpriteSetStep(&sp2, eyes2_frame); aSpriteSetStep(&sp3, lips_frame); aSpriteSetStep(&sp4, hand_frame); aSpriteAnimate(&sp1); aSpriteAnimate(&sp2); aSpriteAnimate(&sp3); aSpriteAnimate(&sp4); aSpriteAnimate(&sp5); } } } if((min==0)&&(sec==0)&&(frame==0)) { miniGame=2; clearSprites(25,60); if(score>=21) choice=0; if(score<=15) choice=1; if((score>15)&&(score<21)) choice=2; action++; } }
tromb Fichier joint : main.c

32

[quote]Tonma (./31):
You use aSpritesetpos but it's a picture.

Oooops! Looks like I made a misprint because of hurry.

Thank you, but I need sp1/2/3/4 sprites (unlike sp5) to be animated not only when joysltick is active (ControlON varible means jostick activity exactly). And why these sprites (and sp5 sprite too) cannot be animated automatically, without manual enforcement?
avatar

33

Sorry, I didn't understand that for the breast only animation.

It's already animated automatically. You can see that with the Animator software. "Playback Loop". So the aSpriteSetStep is not useful.

The new code :
pictureSetPos(&Cursor,curs_x,curs_y); if(miniGame==1) { if(controlON==1) { if((curs_x>104)&&(curs_y>96)) { if((curs_x<208)&&(curs_y>136)) { // aSpriteAnimate(&sp5); // if(frame%10==3) boobs(); // aSpriteSetStep(&sp5, breast_frame); // if(breast_frame<5) breast_frame++; // else breast_frame=0; if(frame==55) score++; aSpriteAnimate(&sp5); } } } // aSpriteSetStep(&sp1, eyes1_frame); // aSpriteSetStep(&sp2, eyes2_frame); // aSpriteSetStep(&sp3, lips_frame); // aSpriteSetStep(&sp4, hand_frame); aSpriteAnimate(&sp1); aSpriteAnimate(&sp2); aSpriteAnimate(&sp3); aSpriteAnimate(&sp4); if((min==0)&&(sec==0)&&(frame==0)) { miniGame=2; clearSprites(25,60); if(score>=21) choice=0; if(score<=15) choice=1; if((score>15)&&(score<21)) choice=2; action++; } }

34

It turned out that it was need just to move a code quoted above to separate function - and no more unnecessary torment. All animations working perfectly. But for some reason blue arrows in ArrowHorAnim and ArrowVertAnim functions are refusing to move automatically. And, in instruction and information functions, low arrow doesn't disappear after reaching of last page.

tromb Fichier joint : girlxgirl.rar
avatar

35

Hi,
First, please, correct your code to remove all warnings. It's difficult to find error when you have too much warnings information and you soft will work better.

>> low arrow doesn't disappear after reaching of last page.
You need to change the test of the number of pages. When you have 2 pages, you only have page 0 and page 1.
if(page==numberofpages-1) { arrow1X=320; arrow2X=288; }
>> blue arrows in ArrowHorAnim and ArrowVertAnim functions are refusing to move automatically
you init variable path=0; every frame, you "path" value never change. Test value with writing variable on screen. Move the variable like
void instruction() { ushort *data; ushort flipMode=0; button_available=true; mode=3; page=0; numberofpages=2; path = 0;

36

Tonma (./35):
Hi,
First, please, correct your code to remove all warnings. It's difficult to find error when you have too much warnings information and you soft will work better.

>> low arrow doesn't disappear after reaching of last page.
You need to change the test of the number of pages. When you have 2 pages, you only have page 0 and page 1.
if(page==numberofpages-1) { arrow1X=320; arrow2X=288; }
>> blue arrows in ArrowHorAnim and ArrowVertAnim functions are refusing to move automatically
you init variable path=0; every frame, you "path" value never change. Test value with writing variable on screen. Move the variable like
void instruction() { ushort *data; ushort flipMode=0; button_available=true; mode=3; page=0; numberofpages=2; path = 0;

As I found out, it was need to move to the begin of functions using ArrowHor/VertAnim also direction variable too.

Next piece of question: why after selection of exit options in StartMenu and PauseMenu functions -
if(p1e&JOY_A) { if(roll==0) { clearSprites(22,48); if(choice==0) Scene0(0); if(choice==1) settings(0, choice, 0); if(choice==2) instruction(); if(choice==3) information(); if(choice==4) main(); } } if(p1e&JOY_A) { if(roll==0) { clearSprites(55,22); clearFixLayer(); if(choice==0) { if(whatscenefrom==1) Scene0(ret_choice); if(whatscenefrom==2) Scene1(ret_choice); if(whatscenefrom==3) Scene2(ret_choice); if(whatscenefrom==4) Scene3(ret_choice); if(whatscenefrom==5) Scene4(ret_choice); if(whatscenefrom==6) Scene5(ret_choice); if(whatscenefrom==7) Home1(ret_choice); if(whatscenefrom==8) Home2(ret_choice); if(whatscenefrom==9) Scene6(ret_choice,0); if(whatscenefrom==10) Lose1(ret_choice); if(whatscenefrom==11) Lose2(ret_choice); if(whatscenefrom==12) Lose3(ret_choice); if(whatscenefrom==13) miniGame(); } if(choice==1) settings(ret_choice, choice, 0); if(choice==2) main(); } }- icons and arrow sprites doesn't disappear, as if sprite clearing doesn't work, unlike case of main function call in the end of GameOver function?
void GameOver() { int screenTimer=0; button_available=false; current_track=2; if(soundOFF==0) PlayMusic(current_track); if(success==0) { fixPrint(15,15,4,3,"GAME OVER"); } else { fixPrint(16,15,4,3,"YOU WIN!"); } while(1) { SCClose(); waitVBlank(); if(++screenTimer==780) { screenTimer=0; success=0; action=0; main(); } } }
avatar

37

Now I reached a difficultest part of development - creation of arcade mode. From now I really need your help - with a creation of AI controlling a cursor movement in gameplay demonstration (herewith an actions of this AI must be maximally similar to real player's actions), hi-score table, adding of "eyecatcher" animation after every end of demo, backup RAM and soft DIPs interaction.

That's all I successed to code already:
tromb Fichier joint : girlxgirl.rar
avatar

38

I found some problem, when I tried to prescribe the soft DIPs in crt0_cart.s file. For some reason, in soft DIPs menu the game name is still "HELLO WORLD US/JP/EU" left, although there is no more any "HELLO WORLD" text in crt0_cart.s, and "GIRL X GIRL" label are percieved by system as a name of DIP switch.

3GLQ
Dbjp

I hope, the source will help you.

tromb Fichier joint : girlxgirl.rar
avatar

39

VasiliyFamiliya (./38):
I found some problem, when I tried to prescribe the soft DIPs in crt0_cart.s file. For some reason, in soft DIPs menu the game name is still "HELLO WORLD US/JP/EU" left, although there is no more any "HELLO WORLD" text in crt0_cart.s, and "GIRL X GIRL" label are percieved by system as a name of DIP switch.

You probably need to reset the backup/save/nvram data, as the title and options text gets "installed" to the MVS backup memory on the first boot of the game.
avatar

40

freem (./39):
VasiliyFamiliya (./38):
I found some problem, when I tried to prescribe the soft DIPs in crt0_cart.s file. For some reason, in soft DIPs menu the game name is still "HELLO WORLD US/JP/EU" left, although there is no more any "HELLO WORLD" text in crt0_cart.s, and "GIRL X GIRL" label are percieved by system as a name of DIP switch.

You probably need to reset the backup/save/nvram data, as the title and options text gets "installed" to the MVS backup memory on the first boot of the game.

Thank you! Here is my new soft DIPs code:
JPconfig: .ascii "GIRL X GIRL " .word 0xffff, 0xffff .byte 0xff, 0xff, 0x13, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .ascii "DIFFICULTY " .ascii "EASY " .ascii "NORMAL " .ascii "HARD " .ascii "LANGUAGE " .ascii "ENGLISH " .ascii "RUSSIAN " NAconfig: .ascii "GIRL X GIRL " .word 0xffff, 0xffff .byte 0xff, 0xff, 0x13, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .ascii "DIFFICULTY " .ascii "EASY " .ascii "NORMAL " .ascii "HARD " .ascii "LANGUAGE " .ascii "ENGLISH " .ascii "RUSSIAN " EUconfig: .ascii "GIRL X GIRL " .word 0xffff, 0xffff .byte 0xff, 0xff, 0x13, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .ascii "DIFFICULTY " .ascii "EASY " .ascii "NORMAL " .ascii "HARD " .ascii "LANGUAGE " .ascii "ENGLISH " .ascii "RUSSIAN "
But now some new bug's appeared - first, system perceives "HARD" string as a name of 2nd switch, not as 3rd position of 1st switch, although I deleted old nvram files. Second - at the first launch, the game doesn't play boot animation, and after that it doesn't read BIOS RAM values.

Oh, and some more little question - what is best way to rip Neo-Geo bios logo sprites from other games as a raw binary GFX data? And why eyecatcher melody in my game fading out so sharply at the end?
avatar

41

what is best way to rip Neo-Geo bios logo sprites from other games as a raw binary GFX data?
maybe you will find some helpful information here: eyecatcher-image-using-datlib

And why eyecatcher melody in my game fading out so sharply at the end?
opposite to the logo this sound is not coming from the bios and is played by the game itself. most games do this via FM, the NGFX-driver uses a short ADPCM-sample for this, which may not be perfect or optimal but is very small and saves space in the V-ROM.

42

blastar (./41):
And why eyecatcher melody in my game fading out so sharply at the end?
opposite to the logo this sound is not coming from the bios and is played by the game itself. most games do this via FM, the NGFX-driver uses a short ADPCM-sample for this, which may not be perfect or optimal but is very small and saves space in the V-ROM.

I understood. By the way, already at the times, when I just had to begin to learn the Neo-Geo games, I noticed that some games (for example, Magicial Lord, World Heroes, Metal Slug 1) uses an alternate sound for eyecatcher melody. Since that I use to wonder - is YM2610 FM module able to generate a sounds, similar to sound of synthesizers used in Latvian cartoon "Phantadrome", or in Final Countdown performed by Europe, or in main theme of OST of Delta Force One starring Chuck Norris?
avatar

43

Please, somebody, tell me, is it possible to extract a raw binary GFX data from the C roms of other games using HEX editor?
avatar

44

what kind of gfx-data do you want to rip from which game and why? there is no simple YES, it always depends on what you want to do.

45

blastar (./44):
what kind of gfx-data do you want to rip from which game and why? there is no simple YES, it always depends on what you want to do.

"Neo-Geo" logo tiles used in eyecatcher animation. The game I going to rip these tiles from is Shock Troopers (the logo is stored in the bank №82 in this game). I need to save these tiles as .bin file, and import it in my project through BuildChar utility.
avatar

46

sent you a message... works fine if I inject this (via HEXeditor) into the GXG rom and activate the eyecatcher.

47

blastar (./46):
sent you a message... works fine if I inject this (via HEXeditor) into the GXG rom and activate the eyecatcher.

Thank you very much! The next problem is software DIPs. Just look at this:
jf0g

Did I make any mistake in crt0_cart.s file, when I prescribed a software DIPs?

* Names MUST be 16 characters long * <----------------> JPconfig: .ascii "GIRL X GIRL " .word 0xffff, 0xffff .byte 0xff, 0xff, 0x13, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .ascii "DIFFICULTY " .ascii "EASY " .ascii "NORMAL " .ascii "HARD " .ascii "LANGUAGE " .ascii "ENGLISH " .ascii "RUSSIAN " NAconfig: .ascii "GIRL X GIRL " .word 0xffff, 0xffff .byte 0xff, 0xff, 0x13, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .ascii "DIFFICULTY " .ascii "EASY " .ascii "NORMAL " .ascii "HARD " .ascii "LANGUAGE " .ascii "ENGLISH " .ascii "RUSSIAN " EUconfig: .ascii "GIRL X GIRL " .word 0xffff, 0xffff .byte 0xff, 0xff, 0x13, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .ascii "DIFFICULTY " .ascii "EASY " .ascii "NORMAL " .ascii "HARD " .ascii "LANGUAGE " .ascii "ENGLISH " .ascii "RUSSIAN "
avatar

48

https://wiki.neogeodev.org/index.php?title=Software_DIPs
Options string table. Strings are 12 bytes long and padded with 0x20 (space)

49

blastar (./48):
https://wiki.neogeodev.org/index.php?title=Software_DIPs
Options string table. Strings are 12 bytes long and padded with 0x20 (space)

Thank you once more! Now I'd like to know a reason, why game doesn't play eyecatcher animation during first launch, and after that it doesn't react to service and other buttons press+some other bugs, but at the all following launches these bugs not present.

tromb Fichier joint : girlxgirl.rar
avatar

50

Does anybody know the reason why BIOS_START_FLAG doesn't clear after game start, and REG_STATUS_A second bit is active from the very launch, althought I never inserted a virtual coin into chute №2 (this bug was found when I tested the game with US MVS U4 bios)? Because of these bugs continue function immediately return the player to the normal game, without any coin insertions and start pressing.

tromb Fichier joint : girlxgirl.rar
avatar

51

For this time, during the name entry in high score table, if I press A button to finish it, then left arrow (fix tile №16) appears at the right side from name at 3rd place, and if I choose C button, copyright sign (fix tile №64) appers at the same section of the screen, and only when I use B button, no any tiles appears there. Also, when enter variable is equal to 0, game keeps to react to joypad buttons pressing, althought I clearly prescribed that if enter=0, button_avaiable value must be "false".

Does anybody know, what's the reason of these bugs?

tromb Fichier joint : girlxgirl.rar
avatar

52

I found that numbers of appearing tiles is according to $10FD96 register value at the moment of pressing. Something makes it to print at the same place (at the tile with X coordinate equal to 22 and Y coordinate equal to 17) always, althought I didn't prescribed such command anywhere.
avatar

53

The name entry function in highscore table finally works properly, but I can't understand - why game resets highscore values written to backup ram after every gameover? Did I missed something during highscore saving?

tromb Fichier joint : girlxgirl.rar
avatar

54

VasiliyFamiliya (./53):
The name entry function in highscore table finally works properly, but I can't understand - why game resets highscore values written to backup ram after every gameover? Did I missed something during highscore saving?

Hi, could you try to load the default highscore values before calling BIOSF_SYSTEM_RETURN ?

int main(void) { initGfx(); palJobPut(0,8,fixPalettes); backgroundColor(0x7bbb); if(BIOS_MVS_FLAG==0) TitleScreen(); else { if(BIOS_USER_REQUEST==0) // user_request=0 is called by BIOS { // is called by BIOS if given NGH number has not been found into backup RAM (MVS system) // only executed once if game is installed the first time into the MVS system // is always executed in simulated MVS-Mode on AES systems with Uni-Bios // if MVS system has been detected: // initial load of default SOFT_DIP data from JPConfig, USConfig, EUConfig // initial setup of the backup RAM save pointer (game data like rankings can be saved in this loaction) // initial load of default ranking data bkp_data.scores[0]=150; bkp_data.scores[1]=110; bkp_data.scores[2]=75; bkp_data.scores[3]=45; bkp_data.scores[4]=20; bkp_data.names[0]='V'; bkp_data.names[1]='A'; bkp_data.names[2]='S'; bkp_data.names[3]='H'; bkp_data.names[4]='P'; bkp_data.names[5]='M'; bkp_data.names[6]='B'; bkp_data.names[7]='L'; bkp_data.names[8]='A'; bkp_data.names[9]='M'; bkp_data.names[10]='E'; bkp_data.names[11]='G'; bkp_data.names[12]='Z'; bkp_data.names[13]='E'; bkp_data.names[14]='R'; __asm__ ("jmp 0xc00444 \n"); // BIOSF_SYSTEM_RETURN - return to bios control } Demo(); } }

55

NeoHomeBrew (./54):
VasiliyFamiliya (./53):
The name entry function in highscore table finally works properly, but I can't understand - why game resets highscore values written to backup ram after every gameover? Did I missed something during highscore saving?

Hi, could you try to load the default highscore values before calling BIOSF_SYSTEM_RETURN ?

int main(void) { initGfx(); palJobPut(0,8,fixPalettes); backgroundColor(0x7bbb); if(BIOS_MVS_FLAG==0) TitleScreen(); else { if(BIOS_USER_REQUEST==0) // user_request=0 is called by BIOS { // is called by BIOS if given NGH number has not been found into backup RAM (MVS system) // only executed once if game is installed the first time into the MVS system // is always executed in simulated MVS-Mode on AES systems with Uni-Bios // if MVS system has been detected: // initial load of default SOFT_DIP data from JPConfig, USConfig, EUConfig // initial setup of the backup RAM save pointer (game data like rankings can be saved in this loaction) // initial load of default ranking data bkp_data.scores[0]=150; bkp_data.scores[1]=110; bkp_data.scores[2]=75; bkp_data.scores[3]=45; bkp_data.scores[4]=20; bkp_data.names[0]='V'; bkp_data.names[1]='A'; bkp_data.names[2]='S'; bkp_data.names[3]='H'; bkp_data.names[4]='P'; bkp_data.names[5]='M'; bkp_data.names[6]='B'; bkp_data.names[7]='L'; bkp_data.names[8]='A'; bkp_data.names[9]='M'; bkp_data.names[10]='E'; bkp_data.names[11]='G'; bkp_data.names[12]='Z'; bkp_data.names[13]='E'; bkp_data.names[14]='R'; __asm__ ("jmp 0xc00444 \n"); // BIOSF_SYSTEM_RETURN - return to bios control } Demo(); } }


I tried this option already, and then highscore table after launch turned out to be absolutely empty at all.
avatar

56

Hi, now I have read trough your 4800 lines of code and have seen multible things which are handled completely different than in my user subroutine which is posted here: topics/171604-user-subroutine-with-neobitz-c-dev-kit-datlib
Please check out the instructions HPMAN has posted there, the first thing you need to do is to change the ASM code in your "common_crt0_cart.s" and "crt0_cart.s" file and run the main loop as "void USER(void)".
Also, I would suggest to separate your game code for the user subroutine and handle both independently. The subroutine is a quite complicated thing, maybe it would be easier to create a smaller test project first before starting to integrate it in your game.

57

NeoHomeBrew (./56):
Please check out the instructions HPMAN has posted there, the first thing you need to do is to change the ASM code in your "common_crt0_cart.s" and "crt0_cart.s" file and run the main loop as "void USER(void)".

Would it be a good idea to just replace old .s files with .s flies from your template insted of manual editing?
avatar

58

The "common_crt0_cart.s" can be replaced, inside the "crt0_cart.s" you may need to change the NGH number and game configs if you want it.

http://www.neohomebrew.com/downloads/common_crt0_cart.s

http://www.neohomebrew.com/downloads/crt0_cart.s

59

NeoHomeBrew (./58):
The "common_crt0_cart.s" can be replaced, inside the "crt0_cart.s" you may need to change the NGH number and game configs if you want it.

http://www.neohomebrew.com/downloads/common_crt0_cart.s

http://www.neohomebrew.com/downloads/crt0_cart.s

Thank you! Saving code finally works now!
avatar

60

Great news, I am happy that could help you sun