GEMS Jukebox

Announce (tech) demos or games releases

Moderator: Mask of Destiny

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Jun 05, 2013 8:33 pm

This is why working with pure ASM is pretty hard, tons of possible bugs on real hardware you don't notice on emulator.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 05, 2013 8:40 pm

Ok, :twisted:.
Test again. http://elektropage.ru/r57shell/Player.bin
Stef wrote:This is why working with pure ASM is pretty hard, tons of possible bugs on real hardware you don't notice on emulator.
Strange, but making hacks in pure assembly is much easy than make something work from blank.

Offtopic: is there sample with SGDK using DMA from RAM to VRAM? Just wanna see disassembly ^^ to check last sending (access).
partic, cube_flat does not use DMA.
Image

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Jun 05, 2013 9:12 pm

That one goes instantly to the exception screen. It's an Illegal Instruction exception ($04).

Code: Select all

D0=00000008  A0=00A10005
D1=0000FF00  A1=FFFFFF88
D2=0000FFFF  A2=00000E6D
D3=00000000  A3=00000E5A
D4=00000000  A4=FFFFA000
D5=00000000  A5=00000000
D6=00000000  A6=00C00000
D7=00003354  SP=00FFDFF2

PC=0001A006  SR=2004

00FFDFF0=
DFF22004 0001A006 00000776 00000532
(rest of stack is 0)
Seems like a stack issue (pulling too many regs off the stack, or forgetting and leaving regs on the stack).

EDIT: Okay, I checked $1A006 and it's a RTS. So... thinking about something I corrected some time back, I updated the menu on my Myth flash cart to the latest and the program works fine. There was a bug some time back that didn't load the extra bytes past the last full sector of a game... not normally an issue since most everyone pads their MD game to 128K or 64K or at least 1K... except for homebrew like this where you have 6 bytes more than an even sector, which just happens to contain code that is instantly used. :P :lol:

Anywho, the menu on the flash cart was old enough that it had that bug. Updating it to current loads the WHOLE program, which runs fine now that ALL the code is loaded. Sorry about that. :oops:

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 05, 2013 9:24 pm

It seems like flashcart bug :D. Not full dump loaded.
I will add some FFFFF in the end.
http://elektropage.ru/r57shell/Player.bin
May be just last byte not readed. So this invalid instruction 4E FF or 4E 00. But in my ROM in the end 4E 75 = rts.
Image

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 05, 2013 9:31 pm

Nothing to sorry about.
You have found bug in your soft :].
So, full speed ahead!
I will turn all things on.
http://elektropage.ru/r57shell/Player.bin
Image

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Jun 05, 2013 9:44 pm

Works fine, even the level bars. :D

I worked that bug out a LONG time ago. I just didn't realize the menu on the SD card was that old... I thought I had replaced the menu on all my SD cards after I fixed that. Apparently I missed one.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 05, 2013 10:10 pm

I'm glad. If you know what I mean :D
Now, I want ask to test.
1) I will wrap DMA again in gemsdmastart gemsdmaend, as it should be. It needs to prevent suspending of z80.
2) I want to try get deadlock. I thought that there was deadlock, but it can be just bug with flash card.
1) http://elektropage.ru/r57shell/Player.bin
2) http://elektropage.ru/r57shell/Player_first.bin - just first version with last DMA access corrected, and padded size.
Image

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Jun 05, 2013 11:05 pm

r57shell wrote:I'm glad. If you know what I mean :D
Now, I want ask to test.
1) I will wrap DMA again in gemsdmastart gemsdmaend, as it should be. It needs to prevent suspending of z80.
2) I want to try get deadlock. I thought that there was deadlock, but it can be just bug with flash card.
1) http://elektropage.ru/r57shell/Player.bin
2) http://elektropage.ru/r57shell/Player_first.bin - just first version with last DMA access corrected, and padded size.
Those both seem to work. But while music playing, DAC may or may not sound. Probably due to music using DAC itself. If I play #4, DAC plays fine. I don't think there's any perc in Moonlight Sonata.
:D

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 05, 2013 11:17 pm

Chilly Willy wrote:Those both seem to work.
Oh god! It means, that all tests that we done - just for removing DMA bug and flash card bug.
Chilly Willy wrote:But while music playing, DAC may or may not sound.
By default, priority of channel 15 is lowest. I use 15 channel for playing DAC.
So, any another PCM will prevent DAC from playing. Use SFX control for playing SFX, or play drums in VOID.

You can mute any channel by pressing A. :]

Ok, all tests is done. At lasT!)
Great job. Thank you very much. Now I know that my Jukebox will work on real hardware. I will remove almost all files, so links will broken.
Next time: instrument editor right in player :S.
Image

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Jun 06, 2013 5:28 am

r57shell wrote:Oh god! It means, that all tests that we done - just for removing DMA bug and flash card bug.
Well, we learned a lot, you cleaned up your code, and added a nice exception debug screen. :D

Ok, all tests is done. At lasT!)
Great job. Thank you very much. Now I know that my Jukebox will work on real hardware. I will remove almost all files, so links will broken.
Next time: instrument editor right in player :S.
I imagine it will allow loading and saving instruments?

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Thu Jun 06, 2013 7:49 am

Chilly Willy wrote:Well, we learned a lot, you cleaned up your code, and added a nice exception debug screen. :D
This screen already removed. I don't want to include this thing.
Chilly Willy wrote:I imagine it will allow loading and saving instruments?
Loading - yes, but saving - how? It will support only notepad with pen :S.
I can make support of saving into SRAM, but I don't realy know is it useful.
Image

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Jun 06, 2013 6:53 pm

r57shell wrote:
Chilly Willy wrote:Well, we learned a lot, you cleaned up your code, and added a nice exception debug screen. :D
This screen already removed. I don't want to include this thing.
Until you run into the next untraceable crash. :wink:
Chilly Willy wrote:I imagine it will allow loading and saving instruments?
Loading - yes, but saving - how? It will support only notepad with pen :S.
I can make support of saving into SRAM, but I don't realy know is it useful.
Flash carts with SD card support have the ability to save sram to an SD file, so that could be useful. I guess it's not something you NEED, but every feature makes it a bit better.

Ti_
Very interested
Posts: 97
Joined: Tue Aug 30, 2011 7:50 am
Contact:

Post by Ti_ » Fri Mar 20, 2015 2:29 pm

Here's my compilation for r57shell's player:

Tracklist: Vectorman 1, Earthworm Jim 2, Doom Troopers, Comix Zone, Dune2.

gems_compilation_wip.rar

Some bugs of GEMS_Player.bin:
Some wrong in rom header, code starts from (0x1F4 instead of 0x200).
When you play combined song (example: DT: Nero) , and if start a new song with A button, it not stops.
Not sure I have latest builder.

Post Reply