Tony Cruise Posted August 24, 2022 Share Posted August 24, 2022 4 hours ago, Pixelboy said: I'm not sure 100% about the ADAM, I'm just assuming that it works the same as the ColecoVision, since it's always possible that a ColecoVision cartridge will interact with the Coleco BIOS which is expected to be in the first 8K range, regardless if this cart is used on the CV or the ADAM. Yep it just depends what you want selected, but by using Port 7Fh you can select what is in the lower memory from the follow options: and what is in the upper memory from the following options: of course always ensuring bits 4-7 are left as zero. Quote Link to comment https://forums.atariage.com/topic/339837-how-to-port-a-game-to-cv/page/2/#findComment-5111498 Share on other sites More sharing options...
Pixelboy Posted August 25, 2022 Share Posted August 25, 2022 Wow, now that's a nice piece of trivia I really didn't know about. I'm going to go to bed a little less stupid tonight. Thanks, Tony! Quote Link to comment https://forums.atariage.com/topic/339837-how-to-port-a-game-to-cv/page/2/#findComment-5111597 Share on other sites More sharing options...
SiRioKD Posted August 25, 2022 Author Share Posted August 25, 2022 20 hours ago, Pixelboy said: Yes on the memory being the same between the ADAM and SGM (24K of RAM at the same addressing range) except that the ADAM does not let you replace the first 8K of the Coleco BIOS with regular RAM, and the SGM allows you to do that, if you really need 32K of RAM for your game. Also, the ADAM doesn't have a "sound enhancer" at all, that's strictly a feature of the SGM. That's why an SGM detection routine usually doesn't just check if 24K of RAM is available, it also has to check the I/O port for the MSX sound chip, to distinguish between the cartridge running on an ADAM or a ColecoVision with an SGM plugged in. Finally, plugging an SGM into the ADAM's expansion port works fine in terms of compatibility and detection (the SGM yields to the ADAM for the RAM, if I remember correctly). However, there's a problem with the sound output where the passthrough of the MSX sound chip through the ADAM and to the TV doesn't work properly (the volume is brought down to almost silence) because the designers of the ADAM never imagined that the expansion port would be used in this way to double the number of sound channels (because yes, it's possible to use the CV's native sound chip and the SGM sound chip in tandem for enhanced sound output). Hi, do you have a standard detection routines for SGM? Memory is easy to detect but the 8910, how? Quote Link to comment https://forums.atariage.com/topic/339837-how-to-port-a-game-to-cv/page/2/#findComment-5111696 Share on other sites More sharing options...
SiRioKD Posted August 25, 2022 Author Share Posted August 25, 2022 8 hours ago, Tony Cruise said: Yep it just depends what you want selected, but by using Port 7Fh you can select what is in the lower memory from the follow options: and what is in the upper memory from the following options: of course always ensuring bits 4-7 are left as zero. Nice! Quote Link to comment https://forums.atariage.com/topic/339837-how-to-port-a-game-to-cv/page/2/#findComment-5111697 Share on other sites More sharing options...
Pixelboy Posted August 25, 2022 Share Posted August 25, 2022 (edited) 2 hours ago, SiRioKD said: Hi, do you have a standard detection routines for SGM? Memory is easy to detect but the 8910, how? My knowledge of the subject is not detailed enough to remember, so I would suggest sending a PM to nanochess on these forums, he's the author of the CoolCV emulator which supports the SGM. Edited August 25, 2022 by Pixelboy Quote Link to comment https://forums.atariage.com/topic/339837-how-to-port-a-game-to-cv/page/2/#findComment-5111721 Share on other sites More sharing options...
thegeps Posted August 25, 2022 Share Posted August 25, 2022 (edited) So, to run a game that need more RAM (even without AY chip) is enough to test if there is RAM at some expected address simply writing at that address and reading back to check if the value is the one written a moment ago. In that case we could let the game run (no matter if you write to AY ports if AY isn't present, right?) Just to do some tests... Edited August 26, 2022 by thegeps Quote Link to comment https://forums.atariage.com/topic/339837-how-to-port-a-game-to-cv/page/2/#findComment-5111785 Share on other sites More sharing options...
Tony Cruise Posted August 26, 2022 Share Posted August 26, 2022 21 hours ago, thegeps said: So, to run a game that need more RAM (even without AY chip) is enough to test if there is RAM at some expected address simply writing at that address and reading back to check if the value is the one written a moment ago. In that case we could let the game run (no matter if you write to AY ports if AY isn't present, right?) Just to do some tests... ;========================= ; Enable SGM Memory ;========================= ENABLE_SGM_MEMORY: XOR A LD (MACHINE),A ; By default a machine is a ColecoVision ; don't enable SGM memory if we have an Adam CALL IS_ADAM CP 1 RET Z ; look for the SGM PSG CALL PSG_TST ; maybe save this somewhere so we know we know what machine we have CP 1 RET NZ LD A,2 LD (MACHINE),A ; enable SGM memory LD A,00000001bh OUT(53h),A RET ;========================= ; The presence of RAM between 2000h-5FFFh on boot means we have an Adam ; A = 1 if an Adam, 0 otherwise ;========================= IS_ADAM: ; check for Ram at 2000h-5FFFh ; write values to 2000h-20FFh LD HL,02000h LD B,0FFh ISA1: LD (HL),B INC HL DJNZ ISA1 ; now read values back LD HL,02000h LD B,0FFh ISA2: LD A,(HL) CP B JP Z, ISA3 ; not a match so probably ROM XOR A RET ISA3: INC HL DJNZ ISA2 LD A,1 LD (MACHINE),A ; for the moment make this machine an Adam RET ;========================= ; SGM PSG Ports ;========================= PSGCTR: EQU 050h PSGWRT: EQU 051h PSGRD: EQU 052h ;========================= ;Check for the existence of a SGM PSG ; A = 1 if found, false otherwise ;========================= PSG_TST: LD HL,5502H LD DE,0AA00H CALL PSG_SET EX DE,HL ;5502H CALL PSG_SET EX DE,HL ;AA00H CALL PSG_TST1 ;TEST BYTE EX DE,HL ;5502H CALL PSG_TST1 ;TEST BYTE PSG_TST3: ; PSG Found LD A,1 RET ;1st PSG Test PSG_TST1: LD A,E OUT (PSGCTR),A LD D,D IN A,(PSGRD) ;READ BACK CP D RET Z ;RETURN IF OK ;IF PSG NOT FOUND POP DE ; Remove return point XOR A RET ;========================= ; SET SGM PSG ;========================= PSG_SET: LD A,E OUT (PSGCTR),A ;SET PSG REG #0 LD A,D OUT (PSGWRT),A RET Call ENABLE_SGM_MEMORY and the memory location MACHINE will contain 0 = No SGM or Adam, 1 = Just Adam, 2 = Coleco with SGM and if 0 or 2 then the SGM memory will be enabled. If you get the result 'Just Adam', then you can call PSG_TST separately to see if you have a SGM plugged into an Adam and thus use the extra sound chip. 2 Quote Link to comment https://forums.atariage.com/topic/339837-how-to-port-a-game-to-cv/page/2/#findComment-5112382 Share on other sites More sharing options...
thegeps Posted August 26, 2022 Share Posted August 26, 2022 Cool Tony, thanks! Quote Link to comment https://forums.atariage.com/topic/339837-how-to-port-a-game-to-cv/page/2/#findComment-5112407 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.