+SpiceWare Posted October 8, 2017 Share Posted October 8, 2017 This bit of code: ORG $7000 RORG $F000 ... SoundFreq: ; 0-31 0 = highest freq. ; upper 3 bits control duration, 0 = 1 frame, 1 = 2 frames... 7=8 frames .byte 0, D4+29, D4+29, D6+0, D2+26 ; _12_AA_Jingle .byte D2+26, D6+0, D2+23, D2+23 ; _12_AA_Jingle .byte D6+0, D2+21, D2+21, D6+0 ; _12_AA_Jingle .byte D2+29, D2+29, D6+0, D2+29 ; _12_AA_Jingle .byte D2+29, D6+0, D2+29, D2+29 ; _12_AA_Jingle .byte D6+0, D2+29, D2+29 ; _12_AA_Jingle when compiled produces this output in the listing: 40 730a SoundFreq ; 0-31 0 = highest freq. 41 730a ; upper 3 bits control duration, 0 = 1 frame, 1 = 2 frames... 7=8 frames 42 730a 43 730a 00 7d 7d a0* .byte.b 0, D4+29, D4+29, D6+0, D2+26 ; _12_AA_Jingle 44 730f 3a a0 37 37 .byte.b D2+26, D6+0, D2+23, D2+23 ; _12_AA_Jingle 45 7313 a0 35 35 a0 .byte.b D6+0, D2+21, D2+21, D6+0 ; _12_AA_Jingle 46 7317 3d 3d a0 3d .byte.b D2+29, D2+29, D6+0, D2+29 ; _12_AA_Jingle 47 731b 3d a0 3d 3d .byte.b D2+29, D6+0, D2+29, D2+29 ; _12_AA_Jingle 48 731f a0 3d 3d .byte.b D6+0, D2+29, D2+29 ; _12_AA_Jingle 49 7322 Due to the ORG/RORG the value given label SoundFreq is F30A. I need the 730A value for the ARM routines, so I've been doing this to convert it: echo "#define SOUND_FREQ ((unsigned char *)(",[[SoundFreq & $fff] + $7000]d,"))" While that works, it's a hassle to maintain when I'm rearranging data usage - forget to change one and things no longer work correctly. Is there a way to do something like this so that SoundFreq would get the 730A value? SoundFreq = SPECIAL_SYMBOL .byte 0, D4+29, D4+29, D6+0, D2+26 ; _12_AA_Jingle .byte D2+26, D6+0, D2+23, D2+23 ; _12_AA_Jingle .byte D6+0, D2+21, D2+21, D6+0 ; _12_AA_Jingle .byte D2+29, D2+29, D6+0, D2+29 ; _12_AA_Jingle .byte D2+29, D6+0, D2+29, D2+29 ; _12_AA_Jingle .byte D6+0, D2+29, D2+29 ; _12_AA_Jingle Dasm must know it, else it couldn't be in the listing. Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted October 8, 2017 Share Posted October 8, 2017 Unless I missing something, you could just: ORG $7000 RORG $7000 You don't need to use $Fxxx specifically for rom addresses. Lots of games use rom addresses other then $Fxxx: $1xxx $3xxx $5xxx $7xxx $9xxx $Bxxx $Dxxx $Fxxx These are all valid. If you really need to go back to $Fxxx addresses later on in the code, then just do another ORG/RORG. Quote Link to comment Share on other sites More sharing options...
RevEng Posted October 8, 2017 Share Posted October 8, 2017 I'm thinking he's talking about moving his tables around in what is a multi-bank rom anyway, and he needs the ORG instead of RORG address for the ARM code to find it. Looking at the dasm docs (and briefly at the source) I don't see a way to spit out the ORG if you're using RORG. So long as you stick to the "usual" F6 style ORG/RORG values, I guess you could do something like "SoundFreq = ( . & $fff ) | ((. >> 1) & $ff000))" Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted October 9, 2017 Author Share Posted October 9, 2017 Using $7000 would actually work in this instance, as I ended up only using a single 4K bank of 6502 code in Draconian (less than 3K actually). The >> might work, will have to remember than for next time. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted October 11, 2017 Author Share Posted October 11, 2017 For my recent round of rearranging I changed it to ORG $7000 and commented out the RORG statements. Worked great, thanks! 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.