cd-w Posted August 26, 2018 Share Posted August 26, 2018 (edited) It is now 6 years since Chetiry was released in the AA homebrew store, and (until now) I have not made the source or ROM available publicly. The main reason is that the ROM image is not currently playable on either the Harmony cart or Stella emulator: Chetiry uses an EEPROM chip inside the Hamony/Melody to store the music and high score data. On the Harmony, this chip is used for the menu system and would be overwritten. Chetiry uses a custom bankswitching format (FA2) that is not yet emulated by Stella. The audio code in Stella has recently been rewritten, and various people have asked if the ROM for Chetiry is available for testing. As a result, I have now decided to post it publicly in the hope that this will lead to support in Stella.The files are as follows: chetiry_NOEEPROM_NTSC.bin & chetiry_NOEEPROM_PAL.bin - These ROMS will work on Harmony and Stella but with no music or hiscore table. chetiry_NTSC.bin & chetiry_PAL.bin - The full ROMS (they do not work in Stella or Harmony currently). chetiry_tunes_img.zip - The image file for the Chetiry tunes (stored in the EEPROM). chetiry_SRC.zip - The source code for Chetiry. [EDIT: 10/21/2018] Attached chetiry_NTSC_STELLA.bin & chetiry_PAL_STELLA.bin - thse binaries contain both the game and tune data. [/EDIT] Chris chetiry_NOEEPROM_NTSC.bin chetiry_NOEEPROM_PAL.bin chetiry_NTSC.bin chetiry_PAL.bin chetiry_SRC.zip chetiry_tunes_img.zip chetiry_NTSC_STELLA.bin chetiry_PAL_STELLA.bin Edited October 21, 2018 by cd-w 22 Quote Link to comment Share on other sites More sharing options...
cd-w Posted August 26, 2018 Author Share Posted August 26, 2018 (edited) For completeness, here is the (fixed) source code and ROM images for the cutdown "GameBoy" edition of Chetiry. This version was released as an april fool back in 2011. Chris chetirygb_NTSC.bin chetirygb_PAL.bin chetirygb_SRC.zip Edited August 26, 2018 by cd-w 9 Quote Link to comment Share on other sites More sharing options...
+stephena Posted August 26, 2018 Share Posted August 26, 2018 Thanks for the release. Note that "chetiry_NOEEPROM_NTSC" and "chetiry_NTSC" will both partially work in Stella with the 'CTY' bankswitching scheme. The hiscore stuff will work in the latter one; only the sound is missing from both. But both are completely playable otherwise. So the 'full' ROMs do work, just without the music. 1 Quote Link to comment Share on other sites More sharing options...
cd-w Posted August 26, 2018 Author Share Posted August 26, 2018 (edited) So the 'full' ROMs do work, just without the music.Hi Stephen Thanks for clarifying - I knew you had done work on this, but was not aware CTY bankswitching was now available in Stella. Chris Edited August 26, 2018 by cd-w Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 26, 2018 Share Posted August 26, 2018 Yep, full ROM does work in Stella, just no music. Stella also does not auto-detect the CTY bankswitching, so you have to manually set that yourself. Instructions below for those who don't know how, note that you only have to set it once as Stella will remember that you changed it. Chris has sent me the specs, I'll see about adding music support for CTY. Been a while since I worked on Stella so need to get the latest source, then refresh my memory on what goes where How to manually specify CTY bankswitching: Load the ROM as normal, you'll see a spinning square in the middle of the screen that never goes away. Hit TAB Click on Game Properties... Change Type to CTY Click OK Click Exit Menu Hit CONTROL-R on your keyboard to reload the ROM. NOTE: The spinning square will still show up, but will go away after a few seconds. 2 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 26, 2018 Share Posted August 26, 2018 Have preliminary support in Stella for Chetiry's music. chetiry.mov 8 Quote Link to comment Share on other sites More sharing options...
DirtyHairy Posted August 27, 2018 Share Posted August 27, 2018 Thanks a lot for releasing the ROM! I'll look into adding support in 6502.ts, too. 1 Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted August 27, 2018 Share Posted August 27, 2018 Chris, what is missing to get these working with music on Harmony? Quote Link to comment Share on other sites More sharing options...
+stephena Posted August 27, 2018 Share Posted August 27, 2018 Have preliminary support in Stella for Chetiry's music. chetiry.mov Spice, feel free to send me diffs if you don't want to deal with git; I recall you had 'issues' before 1 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 27, 2018 Share Posted August 27, 2018 Spice, feel free to send me diffs if you don't want to deal with git; I recall you had 'issues' before Will do. My initial pass was to copy over the music routines from CartDPC (the Activision one, not DPC+). Notes and such were different (one used ascending consecutive values, the other descending disjoint values), so I used a conversion table to get it working. Since then I've been reviewing the CTY driver itself and can see the actual implementation is a bit different than how DPC was implemented, more like how DPC+ was done (but with only square waves). Also found the actual frequency values, so I'll be re-implementing it with that info. Still to do is figure out how it transitions to a new tune, my guess at how it was done isn't quite right. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted August 28, 2018 Share Posted August 28, 2018 Wow - I didn't know that there was a Tetris version for the 2600 that was this good! Thanks for releasing the ROM. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 29, 2018 Share Posted August 29, 2018 I believe I have it finished, would like some Mac users try this and let me know if it sounds correct. If feedback is affirmative I'll send the changes to stephena. Stella.6.0pre1_chetiry.zip I modified the window's titlebar to include "Chetiry Music Test" Quote Link to comment Share on other sites More sharing options...
Nerf Herder73 Posted August 29, 2018 Share Posted August 29, 2018 (edited) -- Edited August 29, 2018 by Nerf Herder73 Quote Link to comment Share on other sites More sharing options...
+Nathan Strum Posted August 29, 2018 Share Posted August 29, 2018 It should sound better - the existing videos on YouTube were made with an earlier version of Stella. The sound has been improved considerably since then. Quote Link to comment Share on other sites More sharing options...
+Nathan Strum Posted August 29, 2018 Share Posted August 29, 2018 (edited) In the main title screen music, the percussion is out-of sync. In the "chetiry-tunes" binaries Chris posted, it's correct. Edited August 29, 2018 by Nathan Strum 1 Quote Link to comment Share on other sites More sharing options...
Andromeda Stardust Posted August 29, 2018 Share Posted August 29, 2018 Will the Chetiry ROM brick my Harmony Encore? I have the software to reflash it if necessary, but I'd rather not if I don't have to. Thanks again for this release. I have played the GB ROM on my Harmony many times, as well as the full physical homebrew. Cheers... Quote Link to comment Share on other sites More sharing options...
iesposta Posted August 29, 2018 Share Posted August 29, 2018 Will the Chetiry ROM brick my Harmony Encore? I have the software to reflash it if necessary, but I'd rather not if I don't have to. Thanks again for this release. I have played the GB ROM on my Harmony many times, as well as the full physical homebrew. Cheers... The first post says it is not currently playable on Harmony! Why then would you even ask? Mine stop working a lot, and I'm not even doing things I'm told won't work. Reflashing makes Harmony work again. You should be asking if you can flash the game to a Harmony or Harmony Encore and if will that work the same as the store cart. You still need to reflash to turn a single game flashed Harmony back into an SD Harmony with menu. Quote Link to comment Share on other sites More sharing options...
iesposta Posted August 29, 2018 Share Posted August 29, 2018 Will the Chetiry ROM brick my Harmony Encore? I have the software to reflash it if necessary, but I'd rather not if I don't have to. Thanks again for this release. I have played the GB ROM on my Harmony many times, as well as the full physical homebrew. Cheers... The first post says it is not currently playable on Harmony! Why then would you even ask? Mine stop working a lot, and I'm not even doing things I'm told won't work. Reflashing makes Harmony work again. You should be asking if you can flash the game to a Harmony or Harmony Encore and if will that work the same as the store cart. You still need to reflash to turn a single game flashed Harmony back into an SD Harmony with menu. Quote Link to comment Share on other sites More sharing options...
Nerf Herder73 Posted August 29, 2018 Share Posted August 29, 2018 (edited) -- Edited August 29, 2018 by Nerf Herder73 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 29, 2018 Share Posted August 29, 2018 In the main title screen music, the percussion is out-of sync. In the "chetiry-tunes" binaries Chris posted, it's correct. I compared it with my cartridge version and didn't notice it, though it wasn't a side-by-side comparison. Is it off a lot? Percussion leading or trailing? My suspicion would be the return tune position is off by 1. I took a quick look and see I forgot the & 0xFF, like was done for the random number, but that shouldn't matter as it occurs automatically when returning a short int value in an unsigned char function. Arrows point at the lines I'm talking about case 0x01: // Get next Random Number (8-bit LFSR) myRandomNumber = ((myRandomNumber & (1<<10)) ? 0x10adab1e: 0x00) ^ ((myRandomNumber >> 11) | (myRandomNumber << 21)); --> return myRandomNumber & 0xFF; case 0x02: // Get Tune position (low byte) --> return myTunePosition; case 0x03: // Get Tune position (high byte) --> return myTunePosition >> 8; The tunes image doesn't do anything in Stella, looks to be the 28K file that gets put on the EEPROM. Quote Link to comment Share on other sites More sharing options...
+stephena Posted August 29, 2018 Share Posted August 29, 2018 This 'tunes' data is what I was given many years ago. Perhaps it has changed in a subsequent release? Or perhaps I made a mistake in converting it to a C++ header file?? Or am I misunderstanding you, and that the tunes data isn't being used at all? Because if that's the case, we can remove it from the codebase entirely. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 29, 2018 Share Posted August 29, 2018 I was originally going to create a new ROM with the game merged with the tune data, but then I noticed CartCTYTunes.hxx. I did a hex dump of the tunes.bin and compared it with the header file. The header appeared to match so I'm using it, though I didn't compare the entire file. While the music is handled in the ARM code, the percussion's done by 6507 code updating TIA as normal (in bank5.asm). The ARM keeps track of music position, which the drum routine retrieves via TUNELO_R and TUNEHI_R (case 2 and 3 in my code snippet above). So if my routines in CartCTY.cpp don't return the same position values as the ARM code, the drums will be off. ; Drum Position lda TUNEHI_R ; [10] + 4 <--- retrieve music position cmp #$FF ; [14] + 2 Wrap Marker beq SkipDrums ; [16] + 2/3 lsr ; [18] + 2 sta TEMP ; [20] + 3 lda TUNELO_R ; [23] + 3 <--- retrieve music position tax ; [26] + 2 and #%00000011 ; [28] + 2 tay ; [30] + 2 txa ; [32] + 2 ror ; [34] + 2 lsr TEMP ; [36] + 5 ror ; [41] + 2 tax ; [43] + 2 lda DrumTable,X ; [45] + 4 sta DPTR ; [49] + 3 sta WSYNC ; [0] PLAY_MUSIC ; [0] + 5 ; Play Drums lda (DPTR),Y ; [5] + 5 beq SkipDrums ; [10] + 2/3 cmp #SLOW ; [12] + 2 beq SlowTempo ; [14] + 2/3 cmp #FAST ; [16] + 2 beq FastTempo ; [18] + 2/3 sta AUDF1 ; [20] + 3 lda #8 ; [23] + 2 sta AUDC1 ; [25] + 3 lsr ; [28] + 2 sta AUDV1 ; [30] + 3 jmp SkipDrums ; [33] + 3 SlowTempo ldx #SLOWTEMPO ; [17] + 2 stx TEMPO ; [19] + 3 jmp SkipDrums ; [22] + 3 FastTempo ldx #TITLETEMPO ; [21] + 2 stx TEMPO ; [23] + 3 SkipDrums jmp EndTitleMusic ; [36] + 3 Quote Link to comment Share on other sites More sharing options...
+stephena Posted August 29, 2018 Share Posted August 29, 2018 I have no issue with removing the tunes from Stella completely, and including it only with the ROM. This is likely the only ROM that will need the data, so it really belongs there. And as a side effect, it will allow to easily autodetect the bankswitch type. Since the ROM currently isn't compatible with any other emulator or the Harmony, etc, we don't have to worry about breaking compatibility. 1 Quote Link to comment Share on other sites More sharing options...
+Nathan Strum Posted August 29, 2018 Share Posted August 29, 2018 Sorry. I was too vague. I should've said that it was the youtube video on the Chetiry store page. That's what I was referring to. I made that one (and one or two others) using an older version of Stella, recording the gameplay and music separately. Up until now, the only other videos of Chetiry would have been made by recording from real hardware, since the binaries weren't even available. Quote Link to comment Share on other sites More sharing options...
+Nathan Strum Posted August 29, 2018 Share Posted August 29, 2018 I compared it with my cartridge version and didn't notice it, though it wasn't a side-by-side comparison. Is it off a lot? Percussion leading or trailing? Not sure - I'll have to check again tonight. Seems to me it was trailing. The tunes image doesn't do anything in Stella, looks to be the 28K file that gets put on the EEPROM. Ah... I didn't actually check the tunes posted here. I assumed they were the same binaries that Chris sent me to make the video. That's what I was checking against. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.