MMLL Development Diary

flash · 349900

Offline sverx

  • RBP Member
  • IBM PC
  • *****
    • Posts: 516
  • "Ow!!! What's that ?!?!"
    • My NDS folder
Reply #480 on: September 30, 2009, 03:24:14 pm
The problem here is that the mixing is done by the hardware, so we do not have a mixing buffer to use to calculate values for a VU meter...  :-X




Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #481 on: September 30, 2009, 04:02:25 pm
Well, I was thinking of just having a bit returned when a sound is triggered..

Ie. halfword 0000 0000 0000 0000 representing channels 0-15, when a sound is triggered in arm7, set the relevent bit, when a sound is not triggered, clear the bit.

That would be enought for me to read the bits and at least have come action in relation to a trigger?

Perhaps!!??

Coding for the love of it!


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #482 on: September 30, 2009, 08:10:07 pm
I think arm9 could clear the bit when first got? that would been ok for some vumeter (like you see in most module players) display? Sometimes I use release effect (to stop the sound) as well, but not needed to been detected if you ask me.
« Last Edit: September 30, 2009, 08:22:27 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #483 on: October 01, 2009, 12:45:06 am
Shouldn't it be "Willywood" instead of "Hollywood Willy"?



Offline Lobo

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 3119
    • Spitoufs
Reply #484 on: October 01, 2009, 02:13:30 am
Shouldn't it be "Willywood" instead of "Hollywood Willy"?

Makes sense :D. Also, Flash, what is 'Blagger' all about?
'Real central' is really cool, definitely leave it.



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #485 on: October 01, 2009, 07:24:30 am
I was gonna see if I could grab the first level of 'Blagger' (a c64 manic miner rip off by tony crowther) and add that as a bonus level.

Coding for the love of it!


Offline sverx

  • RBP Member
  • IBM PC
  • *****
    • Posts: 516
  • "Ow!!! What's that ?!?!"
    • My NDS folder
Reply #486 on: October 01, 2009, 10:48:12 am
[...] at least have come action in relation to a trigger?

I think if you simply want to see if something happens it's easier to read the pattern accessing directly your XM7_ModuleManager_Type struct. You can read CurrentLine and when it changes you can access Pattern[CurrentPatternNumber] and check if the line currently playing contains a note. That would be easy and probably would fit. Just remember that these values change because of the ARM7 program so you should flush and invalidate the cache (just flushing it always worked for me) before accessing this struct.

See this video, here I'm drawing the patterns on screen (so I'm accessing the data with the ARM9) while playing the tune with libXM7. It worked ;)

« Last Edit: October 01, 2009, 10:49:56 am by sverx »



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #487 on: October 01, 2009, 01:18:22 pm
Sound like a soiid idea, but remember - I am just a humble ASM coder, all this C talk makes my ears bleed!! LOL

Coding for the love of it!


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #488 on: October 01, 2009, 02:54:15 pm
The struct he's referring to is the data stored in the "Module:" label in my music.s file. To get the value of "CurrentLine" you just have to find the offset in the struct (XM7_ModuleManager_Type) and then read the value from "Module:" using the offset. The header file you need to look at is "libxm7.h" (included in the libxm7 example from sverx's website) which contains the definition of the structs so from that you should be able to calculate the offsets. Most values are pretty obvious u8 is 8 bits, u16 is 16 bits, u32 is 32 bits. I think it's a good learning excercise for you but if you have any trouble PM me and I can help go through it in more detail.
« Last Edit: October 01, 2009, 03:00:11 pm by headkaze »



Offline sverx

  • RBP Member
  • IBM PC
  • *****
    • Posts: 516
  • "Ow!!! What's that ?!?!"
    • My NDS folder
Reply #489 on: October 01, 2009, 03:24:38 pm
To get the value of "CurrentLine" you just have to find the offset in the struct (XM7_ModuleManager_Type) and then read the value from "Module:" using the offset.

Even if I never did that, I guess it's exactly like that. So you need the offsets of this variable and you need the offset of the CurrentPatternNumber and the offset of the Pattern array. Then read the CurrentPatternNumber-th item in the Pattern array, this is a pointer to the place in memory where the currently playing pattern is.

At this location you'll find 5 bytes for each channel for each row of the pattern, so you've got to skip CurrentLine * <number or channels in this XM> * 5 bytes and start reading from here. The 1st byte of every 5 is the note that should be triggered (1 to 96 means C-0 to B-9 plus 0=no note, 97= key off)

The number of channels is in the NumberofChannels variable, always in that same struct.

Hope it helps...




Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #490 on: October 01, 2009, 04:10:10 pm
Sod it, now my brain is bleeding

Coding for the love of it!


Offline sverx

  • RBP Member
  • IBM PC
  • *****
    • Posts: 516
  • "Ow!!! What's that ?!?!"
    • My NDS folder
Reply #491 on: October 01, 2009, 04:24:14 pm
Ok, let's try to do that together...

Code: [Select]
       u16 State;                      // at offset: 0
        char ModuleName  [20];    // offset: 2
        char TrackerName [20];    // offset:22
        u16 ModuleLength;           // offset:42
        u16 RestartPoint;             // offset:44
        u8 NumberofChannels;      //  offset:46
        u8 NumberofInstruments;   //        :47
        u16 NumberofPatterns;     //        :48
        u8 FreqTable;                  //      :50
        u8 DefaultTempo;             //     :51
        u8 DefaultBPM;                //     :52
        u8 PatternOrder[256];      //    :53
        u16 PatternLength[256];    // :54
        XM7_SingleNoteArray_Type* Pattern [256];     // :56
        XM7_Instrument_Type* Instrument[128];        // : 312
        u8 CurrentTempo;              // :824
        u8 CurrentBPM;                 // :825
        u8 CurrentGlobalVolume;     // :826
        u8 CurrentSongPosition;     //  :827
        u8 CurrentPatternNumber;   //  :828
        u8 CurrentLine;                 //  :829
        u8 CurrentTick;                //  :830

Should be correct. Now I think I'll change this order in next release... I've never realized it's so bad.  :-X

« Last Edit: October 02, 2009, 02:46:24 pm by sverx »



Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #492 on: October 01, 2009, 05:16:06 pm
In other words to get the CurrentSongPosition value we first look at what it's defined as in the struct

Code: [Select]
u8 CurrentSongPosition
Okay so it's a u8 (unsigned 8 bits or a byte in size) and the offset calculated by sverx is 827 bytes.

So to get the value of the song position we do this after we have loaded the module via XM7_LoadXM which fills "Module" with this data.

Code: [Select]
ldr r0, =Module @ This is the pointer to XM7_ModuleManager_Type where the data is loaded via XM7_LoadXM
add r0, #827 @ Add the byte offset to CurrentSongPosition
ldrb r1, [r0] @ Read the byte value of CurrentSongPosition

So the value of CurrentSongPosition is now stored in r1. Simple eh? And no blood loss from the brain to be had!  ;)
« Last Edit: October 01, 2009, 05:25:15 pm by headkaze »



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #493 on: October 01, 2009, 06:12:40 pm
Thanks mate ;)

I am now just thowing together the audio option screen.

This will have sfx vol adjust and music on/off

Also, the jukebox.. So, once I have all this going (menu's are a pain in ASM) I will have the top screen free (with piccy) to use for lots of sprites to do stuff based on the init of sounds in the tune.

Hmmm... LOL

Coding for the love of it!


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #494 on: October 01, 2009, 06:23:51 pm
menu's are a pain in ASM

I totally agree with you there Flash lol Your right though they are a PITA but the hiscore stuff in Warhawk was more annoying IMHO



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #495 on: October 01, 2009, 06:48:04 pm
I will do the highscore stuff soon..

I am going to keep the scores as binary digits (6 per entry) 0,0,0,0,0,0 and then compare them in that format for the entry.. LOL.. I like doing things the easy way too....

Coding for the love of it!


Offline Lobo

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 3119
    • Spitoufs
Reply #496 on: October 01, 2009, 08:25:55 pm
I was gonna see if I could grab the first level of 'Blagger' (a c64 manic miner rip off by tony crowther) and add that as a bonus level.
Odd, never heard of it before, just how many MM clones are out there?? Anyhoo, from what I've seen it seems like it's almost as our movie levels, inspired with crazy stuff (there's mad hatter level as well).



Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #497 on: October 01, 2009, 08:42:06 pm
Personly I would like to do something with the many extra levels from the SAM version using original graphics and aggresive version of MM theme.

First Miner game I ever played was China Miner to C64, which also a clone. Hence its not radom why I choiced a piano rag in one of the levels.
« Last Edit: October 01, 2009, 08:43:10 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #498 on: October 01, 2009, 09:23:57 pm
Personly I would like to do something with the many extra levels from the SAM version using original graphics and aggresive version of MM theme.

First Miner game I ever played was China Miner to C64, which also a clone. Hence its not radom why I choiced a piano rag in one of the levels.
Ok mate,

Find me a cheat so I can get to the Coupe levels and let me know what ones you would like to add as bonus levels and I will happily add them mate..

Also, China Miner, I will check that out to see if the mechanics of the game are the same?

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #499 on: October 01, 2009, 09:26:51 pm
Odd, never heard of it before, just how many MM clones are out there?? Anyhoo, from what I've seen it seems like it's almost as our movie levels, inspired with crazy stuff (there's mad hatter level as well).

Blagger was a pretty smart game, and i have a bit of a soft spot for Ratt also, so it would be nice to add a level or 2? (Though perhaps with original graphics? ? ? ? ? ?)

Coding for the love of it!


Offline Lobo

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 3119
    • Spitoufs
Reply #500 on: October 01, 2009, 09:34:11 pm
Maybe one or two levels, I see one called 'the chinese takeaway', almost seeing Jack Nicholson in there for some reason.  8)

Hah, there's a level called 'the evil dentist', this one familiar, flash?  :o
Though, 'Mad Hatter' sounds better just cause it has, well...MAD HATTER!



Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #501 on: October 01, 2009, 09:46:36 pm
http://www.worldofsam.org/node/57

There should been a cheat mode for the sam, but it diddent work here (due it seen the emulator I used did not send F functions at all, and the required 4 keys holding ghosted my keyboard).

The Musician for the RetroBytes Portal Projects.


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #502 on: October 01, 2009, 10:57:22 pm
http://www.worldofsam.org/node/57

There should been a cheat mode for the sam, but it diddent work here (due it seen the emulator I used did not send F functions at all, and the required 4 keys holding ghosted my keyboard).
I will have a search for a working cheat, and failing that, perhaps crack it - z80 based asm i can handle - mostly LOL

Coding for the love of it!


Offline sverx

  • RBP Member
  • IBM PC
  • *****
    • Posts: 516
  • "Ow!!! What's that ?!?!"
    • My NDS folder
Reply #503 on: October 02, 2009, 06:58:32 am
HK is right about how to access struct members, but I'm not sure I calculated the offset correctly, be careful with those ;) [I also realized now that there are some values you might be interested with that are after those I copied... well, HK can easily calculate the other offsets you may need :) ]

Btw, what are you planning to do? Moving something on the screen at the same speed of the tune? Turn on/off lights when instruments and/or channels are used? Draw fingers on a piano keyboard according to notes played? ;)




Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #504 on: October 02, 2009, 07:52:20 am
Just animation when instruments are used really... Not entirely sure.. LOL

Coding for the love of it!


Offline sverx

  • RBP Member
  • IBM PC
  • *****
    • Posts: 516
  • "Ow!!! What's that ?!?!"
    • My NDS folder
Reply #505 on: October 02, 2009, 02:44:42 pm
Just animation when instruments are used really... Not entirely sure.. LOL

If you just need to sync to the music, you could simply use CurrentLine member (the byte at offset 829). Each time it changes it means that the music tempo is going on...

« Last Edit: October 02, 2009, 02:47:29 pm by sverx »



Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #506 on: October 02, 2009, 03:46:53 pm
for vumeter (like the channel "vumenter" like xmplay, deliplayer or such), its also needed to known if a note is played. Tempo in some songs can been changed as well (I do think only title do that).

Names for song is also nice and found out some songs was still missings a title. I send when new songs is done, no need to doing that now.

The Musician for the RetroBytes Portal Projects.


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #507 on: October 02, 2009, 04:48:14 pm
SF, I have done the jukebox (without animation for now) and have added names for all the current songs (I made some names up so they were not just one word).

Also, had added SFX volume control and game music on/off.

Coding for the love of it!


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #508 on: October 02, 2009, 05:49:09 pm
can you send me names, so I can add these to the title tag in the XM (which have around 16 chars)? That why I do titles short.

Issue:
If you swap screen, the screens is also swapped in gameover as well title which you can't swap. Either they should been swappeble to or stay in the original screen without have been swapped (which I guess should only been possible ingame).
« Last Edit: October 02, 2009, 06:38:54 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #509 on: October 02, 2009, 07:14:05 pm
Well done for spotting another little bug mate.. You are getting pretty good at this... :)

I will send you a demo later that has the audio screen and the names I have used, if there are any you REALLY don't like, please let me know mate..

I will see about sorting the flipping out..

Coding for the love of it!