Author Topic: Need a little help with coding for menu  (Read 25624 times)

0 Members and 1 Guest are viewing this topic.

Offline madmonkey

  • Neo MOD
  • Full Member
  • *
  • Posts: 178
Re: Need a little help with coding for menu
« Reply #45 on: August 06, 2010, 07:44:50 PM »
I doubt something like this even exists, particularly different color bracket highlighting :)
just try qt creator. it has most of the stuff you want.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: Need a little help with coding for menu
« Reply #46 on: August 06, 2010, 07:51:39 PM »
Gedit has a full set of plugins :
http://live.gnome.org/Gedit/Plugins

LIke the bookmarking that you asked for. Gedit + plugins is the best combo  8)

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1751
  • Just a coding machine.
Re: Need a little help with coding for menu
« Reply #47 on: August 07, 2010, 04:39:10 AM »
Geany shows the info on functions  - what they return and the args they take... but only if the file where the function is defined (either the c or h file) is currently in one of the tabs. I find it one of the handiest features of geany.
 ~sm-51.gif~.gif

Geany also has auto-completion on variables, defines, functions, and structure fields... again when the file where they are defined is open in one of the tabs.

Offline sanni

  • Moderator
  • Hero Member
  • *****
  • Posts: 502
Re: Need a little help with coding for menu
« Reply #48 on: August 07, 2010, 05:30:28 AM »
Thank you Chillywilly  :-* I didn't know that.
I will continue to use Geany now.
I should read the manual first before complaining :-\

Tommorrow I have some time again, I then will try to back up the gba sram from within the menu and split it to savefiles. I already done that once with my *.bat files I posted here and there is madmonkeys programmer code that also contains how to do that.
The best thing about not knowig how hard things are is that you are not afraid of trying  I guess ~sm-79.gif~.gif

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1751
  • Just a coding machine.
Re: Need a little help with coding for menu
« Reply #49 on: August 07, 2010, 05:48:07 AM »
Thank you Chillywilly  :-* I didn't know that.
I will continue to use Geany now.
I should read the manual first before complaining :-\

Who ever reads the manuals?  ~sm-64.gif~.gif  ~sm-82.gif~.gif


Quote
Tommorrow I have some time again, I then will try to back up the gba sram from within the menu and split it to savefiles. I already done that once with my *.bat files I posted here and there is madmonkeys programmer code that also contains how to do that.
The best thing about not knowig how hard things are is that you are not afraid of trying  I guess ~sm-79.gif~.gif

Um, you mean the N64 Myth sram. The GBA sram isn't used on the N64 Myth. As the comments on the update indicate, the code to read/write the gba sram on the N64 Myth don't even work (yet).

I am going to get them working if at all possible. It would allow people on flash-only carts another place to backup sram to.
« Last Edit: August 07, 2010, 05:51:28 AM by ChillyWilly »

Offline sanni

  • Moderator
  • Hero Member
  • *****
  • Posts: 502
Re: Need a little help with coding for menu
« Reply #50 on: August 08, 2010, 01:01:50 AM »
I search for a place where I could store the cart id of the last played game.
So that when you turn the Neo Myth on, it will automatily backup the nsram and save it under that cartid. Then when you start another game I could let it auto load it's save without worrying about overwriting an other games save.

I can't use the upper half of the nsram because it would be overwritten when playing a game from bank 4. I don't want to write it to the U2 menu area, because it will unnecessary wear it with time.
The psram will lose the info without power.
So there is either the gba sram or the gba menu area left.
I would prefer the menu area but someone could have flashed an MF version of the menu there. So all comes down to the gbasram again  ~sm-79.gif~.gif
Or could you tell me an offset in the gbamenu area where I can savely write without killing the MF menu, if there is one flashed?

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1751
  • Just a coding machine.
Re: Need a little help with coding for menu
« Reply #51 on: August 08, 2010, 03:07:56 AM »
There are no banks in the N64 save ram. The sram is used in the emulation of the other save forms, so the 128KB of FRAM would use half the sram. The other half is essentially "free" as nothing uses more sram. I was already planning to reserve the last 512 bytes of N64 sram for our own purposes - right now, I use the last 16 bytes for when games run from the SD card need to reset to game, but have a different CIC than the boot CIC. We could use part of that area for save info as well... the first 256 bytes (of the last 512 bytes) would be a 255 char long array holding the name of the last rom run,with a couple extra bytes for a flag that it needs saving on boot, and what save type the last rom was so that you save the correct amount.

Offline sanni

  • Moderator
  • Hero Member
  • *****
  • Posts: 502
Re: Need a little help with coding for menu
« Reply #52 on: August 10, 2010, 07:06:14 AM »
I have a problem .. again  :(

As soon as I put #include <mikmod.h> togehter in one main.c with #include <diskio.h> and #include <ff.h> I get this error:

Quote
/home/sanni/dragon/mips64-elf/bin/mips64-elf-gcc -std=gnu99 -march=vr4300 -mtune=vr4300 -O1 -G0 -Wall -I/home/sanni/dragon/mips64-elf/include -I/home/sanni/dragon/mips64-elf/mips64-elf/include -DRUN_FROM_U2   -c -o main.o main.c
In file included from main.c:11:
/home/sanni/dragon/mips64-elf/include/mikmod.h:83: error: conflicting types for 'CHAR'
/home/sanni/dragon/mips64-elf/include/integer.h:16: note: previous declaration of 'CHAR' was here
/home/sanni/dragon/mips64-elf/include/mikmod.h:108: error: redefinition of typedef 'ULONG'
/home/sanni/dragon/mips64-elf/include/integer.h:28: note: previous declaration of 'ULONG' was here
/home/sanni/dragon/mips64-elf/include/mikmod.h:109: error: conflicting types for 'BOOL'
/home/sanni/dragon/mips64-elf/include/integer.h:32: note: previous declaration of 'BOOL' was here
make[1]: *** [main.o] Error 1
make[1]: Leaving directory `/home/sanni/dragon/src/NeoMenu/NeoN64Menu-v1.4S2/src'
make: *** [NEON64.v64] Error 2

I have absolutely no clue what it is trying to tell me  ~sm-39.gif~

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: Need a little help with coding for menu
« Reply #53 on: August 10, 2010, 11:14:16 AM »
It says that the defined types in mikmod.h have been defined already in the included file integer.h.
So , you either remove the include , or you remove the (already)defined types from mikmod.h ..or put them between #if #endif blocks that check if those types have been defined in another header.
« Last Edit: August 10, 2010, 11:16:08 AM by Conle »

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1751
  • Just a coding machine.
Re: Need a little help with coding for menu
« Reply #54 on: August 10, 2010, 11:31:41 AM »
I really wish everybody would just use stdint.h... it's what it's for!!  >:D

Offline sanni

  • Moderator
  • Hero Member
  • *****
  • Posts: 502
Re: Need a little help with coding for menu
« Reply #55 on: August 10, 2010, 11:39:49 PM »
Is there a way to assign priorities to processes?
I have the backgroundmusic working in the menu but to keep it playing I have to do

Code: [Select]
MikMod_Update();

all the time.
So I put it in the main while(1) but when I move the cursur for game selection the music plays slower but goes back to normal speed as soon as I do nothing again and when it loads/displays a boxart it plays so slow it almost stops and while loading a rom, well guess what   ~sm-62.gif~.gif
So if I could somehow tell the N64 that MikMod_Update(); is super important and it should not wait to execute it, that would be nice.

I guess the mikmod thing is not the best way to play audio, way to cpu depending.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: Need a little help with coding for menu
« Reply #56 on: August 11, 2010, 12:39:08 AM »
Well , your best bet is to let the 2nd cpu do the audio decoding/playing or maybe try to split the render/audio playback to threads.
Give higher priority to audio thread and a bit lower to the render function.

Or .. play with the time and add 2 states.When the timer reaches a fixed time it will swap state but this is not a real solution :D
Also check to see if that lib has some kind of status flags that tell when the audio buffer needs syncing...   ~sm-72.gif~.gif

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1751
  • Just a coding machine.
Re: Need a little help with coding for menu
« Reply #57 on: August 11, 2010, 03:05:38 AM »
Is there a way to assign priorities to processes?
I have the backgroundmusic working in the menu but to keep it playing I have to do

Code: [Select]
MikMod_Update();

all the time.
So I put it in the main while(1) but when I move the cursur for game selection the music plays slower but goes back to normal speed as soon as I do nothing again and when it loads/displays a boxart it plays so slow it almost stops and while loading a rom, well guess what   ~sm-62.gif~.gif
So if I could somehow tell the N64 that MikMod_Update(); is super important and it should not wait to execute it, that would be nice.

I guess the mikmod thing is not the best way to play audio, way to cpu depending.

The issue is that nothing (much) is done at an interrupt level on the N64. If you can guarantee that all your resources are in ram and that it won't be TOO intensive, you could add a callback to the audio interrupt that did the update. That would cure your priority issue.

That's all you have until a threading system is made - then you could make an audio thread with a higher priority than the main thread. Until then, just adding update calls all over is your only other option.