Kernel Updates

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
uze6666
Site Admin
Posts: 4778
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Kernel Updates

Post by uze6666 »

This thread holds the development status of the kernel "upgrade", a modification of the sound engine to recover ~500 bytes of RAM. The trick is to mix the sound channel during HBLANK instead of VBLANK. This way there's is no need for an audio ring buffer. This freed RAM will allow for more ramtiles in mode3.

Final
------
Here's the summary of the main changes in the kernel update:

-Implemented inline mixer: mixes during HSYNC (recovers 512 bytes of RAM)
-Added a 5th channel of type PCM when using the inline mixer
-optimized the VSYNC code to recover ~3 scanlines of CPU
-Reduced kernel size by about 350 bytes
-Added new pitch slide patch command to the music engine

Code was commited to the trunk.

Beta6
------
-Fixed the sound issue
-Reduced kernel size by another 350+ bytes
-Emulator was updated (1.15). A windows binary is included in the zip.

Beta5
-------
-Reworked the mixer stuff to allow user to select which mixer (online or vsync) with a compile switch. Defaults to the vsync mixer for backward compatibility.
-Refactored a lot of code, specially the MIDI player, reducing kernel size a bit
-Recovered yet more RAM: ~30 bytes
-Implemented an interrupt callback to update the vsync pulses instead of waiting in a loop wasting tons of cycles. It effectively recovers about 3 scan lines worth of CPU cycles. Downside is that for the moment, the emulator locks because a timer interrupt is not emulated.
-That's pretty much the last beta of what was planned, I'm checking with Lee on how to integrate his ramtile stuff in the kernel.

Beta4
------
-Added video modes to inline mixer: 1,2,6,8,9
-Fixed a bug in the inline mixer that would sometime stop the noise channel

Beta3
------
-Added video mode 5 to the inline mixer (to recover ~512 bytes of RAM)
-Ported mode 3 with scrolling to the new sync code. Note: it still only can use the older mixer.

Beta2
------
-fixes the audio glitches found in beta1.

Beta1
------
-Original release

As usual, let me know if you found any bugs.

-Uze
Attachments
kernel-upgrade-beta-6.zip
(564.74 KiB) Downloaded 834 times
kernel-upgrade-beta-5.zip
(120.06 KiB) Downloaded 763 times
kernel-upgrade-beta4.zip
(119.65 KiB) Downloaded 746 times
kernel-upgrade-beta-3.zip
(119.47 KiB) Downloaded 785 times
User avatar
uze6666
Site Admin
Posts: 4778
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Kernel "upgrade" -- beta 3

Post by uze6666 »

Just added the beta 3 release to the main post.

-Uze
User avatar
Flecko
Posts: 158
Joined: Mon Jan 05, 2009 11:50 pm

Re: Kernel "upgrade" -- beta 3

Post by Flecko »

Stupid question, but are any of these changes in subversion yet?

I see the last checkin was made on August 10th, so I'm assuming no?
Not a big deal, just let me know if anyone gets a chance.
Thanks!
User avatar
uze6666
Site Admin
Posts: 4778
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Kernel "upgrade" -- beta 3

Post by uze6666 »

Nope, it's not there yet. I need to update everything at once or all unfixed video modes will be screwed up. Right after Maker Faire, I'll have time to wrap this up.

-Uze
User avatar
Flecko
Posts: 158
Joined: Mon Jan 05, 2009 11:50 pm

Re: Kernel "upgrade" -- beta 3

Post by Flecko »

Thanks Uze.

I was just making sure I wasn't crazy. And no need to rush on the update, I'd rather you keep your sanity then try to get it done quickly.
I just appreciate all the effort you've put into the project, as I'm sure everyone else does here.

I hope your trip to Maker Faire goes smashingly. I was considering the trip up from Maryland, but I've got a wedding to goto that weekend...oh well.
hpglow
Posts: 269
Joined: Wed Apr 14, 2010 6:06 am

Re: Kernel "upgrade" -- beta 3

Post by hpglow »

Beta 3 gives me some compiler errors. Somthing about undefined variables. I can re-install it if you want the exact error. I wouldn't worry about it Uze just letting you know.
User avatar
uze6666
Site Admin
Posts: 4778
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Kernel "upgrade" -- beta 3

Post by uze6666 »

That's quite possible I forgot to add a file or something in the last build. If you get to a chance, I'd like to know the error for sure.

-Uze
hpglow
Posts: 269
Joined: Wed Apr 14, 2010 6:06 am

Re: Kernel "upgrade" -- beta 3

Post by hpglow »

This is the error I get, it goes away when I revert to the old kernel.
Attachments
error.jpg
error.jpg (33.19 KiB) Viewed 17854 times
User avatar
uze6666
Site Admin
Posts: 4778
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Kernel "upgrade" -- beta 3

Post by uze6666 »

Ahhh, yes that's expected. Why the upgrade it's so long is because all the video modes have to be fixed in order to handle the new sound mixer. So far only mode 3 and 5 are done and from what I see, you use mode 2 for your game. I'll wrap this up after Maker Faire.

-Uze
hpglow
Posts: 269
Joined: Wed Apr 14, 2010 6:06 am

Re: Kernel "upgrade" -- beta 3

Post by hpglow »

Sorry, don't make any urgency out of it. I was just making you aware of the issue.
Post Reply