CrazyBoss Posted July 18, 2014 Share Posted July 18, 2014 Hello I have experienced some weird problem. If I skip the Colecovision "boot" screen, sometimes the vdp act strange compared to if I dont skip the "Boot" Screen. Its kind of weird, since the VDP is set up the same way inside the game. In one of the game the screen stays black and in another game some vdp read is not right. If I use the reset button at the Colecovision, it seems to running all right. Ofcause everything work perfect in Bluemsx and MEKA (no madder if the "BOOT" screen is skipped or not). Quote Link to comment Share on other sites More sharing options...
+nanochess Posted July 18, 2014 Share Posted July 18, 2014 When you don't use the Colecovision screen, the VRAM isn't initialized. I recommend you to fill all 16K of VRAM with zeros. Emulators can hide the problem because always initialize VRAM to zeros. 1 Quote Link to comment Share on other sites More sharing options...
CrazyBoss Posted July 19, 2014 Author Share Posted July 19, 2014 When you don't use the Colecovision screen, the VRAM isn't initialized. I recommend you to fill all 16K of VRAM with zeros. Emulators can hide the problem because always initialize VRAM to zeros. Actually the game do full the 16k vram with zeros already. I did try to do it one more time, same result, but it does not madder, since the game will use the Colecovision screen, when finished, just annoying when testing on real hardware... Quote Link to comment Share on other sites More sharing options...
+nanochess Posted July 19, 2014 Share Posted July 19, 2014 Actually the game do full the 16k vram with zeros already. I did try to do it one more time, same result, but it does not madder, since the game will use the Colecovision screen, when finished, just annoying when testing on real hardware... Then there is a chance you've a timing problem with interruptions, so pressing Reset reinits everything to a known state. I suggest you to put a HALT instruction after doing VDP initialization (obviously with interrupts enabled) this way your program "gets-in-sync" with VDP. The Z80 stops in the HALT instruction until a VDP interrupt is received. Quote Link to comment Share on other sites More sharing options...
hardhat Posted July 23, 2014 Share Posted July 23, 2014 My bet is that a call to MODE_1 would do whatever thing you're missing would be: MODE_1 EQU 1f85h You must be missing something in your set up for it to give you problems. I've never needed to do a halt, FWIW. Quote Link to comment Share on other sites More sharing options...
CrazyBoss Posted July 26, 2014 Author Share Posted July 26, 2014 actually I mostly avoid using the bios calls so was have setup the screenmode, by writing directly to the 7 vdp registers. Anyway problem is solved after ***NOT*** bypass the ColecoVision screen. 1 Quote Link to comment Share on other sites More sharing options...
hardhat Posted July 30, 2014 Share Posted July 30, 2014 Well that being the situation, there is probably a problem with bottom filling some of the bottom bits in one of the registers. Can you post what values you are filling into all of the registers? Quote Link to comment Share on other sites More sharing options...
CrazyBoss Posted July 30, 2014 Author Share Posted July 30, 2014 Well that being the situation, there is probably a problem with bottom filling some of the bottom bits in one of the registers. Can you post what values you are filling into all of the registers? It should be those: db 2,$82,6,255,3,54,7,1 (decimal) except the $82 but it could be like Nanochess said, something with the interrupt, use a HALT first? Quote Link to comment Share on other sites More sharing options...
Kiwi Posted July 30, 2014 Share Posted July 30, 2014 The video chip is slow and might getting out of sync with the CPU. I would try using a HALT or NOP command to give the GPU a chance to catch up. I use the delay() command in my game if the GPU is showing graphic corruption. It usually solve that problem. Quote Link to comment Share on other sites More sharing options...
hardhat Posted August 1, 2014 Share Posted August 1, 2014 So the good news is that your VDP register set up is perfect, as I'm sure you probably knew.I know from other threads that you don't normally use the BIOS, which is fine. And from your video mode set up, I see that you don't request the VDP interrupt which causes the NMI (Z80 non-maskable interrupt) on the VDP.Do you use the NMI later? If not, your difference in behaviour would make sense, since you only sync to the VDP if the title screen is on or if the reset button is hit. So then the solution really is to turn on the VDP interrupt, and use HALT, like nanochess suggested. The NMI is vectored to the jump table near the beginning of the cartridge map: ORG 8000h ; Tables DB 055h,0aah ;Magic number DW SPRITE_NAME ;Pointer to sprite name table DW SPRITE_ORDER ;Pointer to sprite order table DW SPRITE_WORKING ;Pointer to WR_SPR_NM_TBL work area DW CONTROLLER_BUFFER ;Pointer to hand controler input area DW MAIN_PROG ;Entry point to game ; Vectors JP RST08 ;Restart 8 JP RST10 ;Restart 10h JP RST18 ;Restart 18h JP RST20 ;Restart 20h JP RST28 ;Restart 28h JP RST30 ;Restart 30h JP MASK_INT ;Maskable interrupt (used by spinner) JP VDPINT ;NMI interrupt (used by VDP 60 times per second) ; Title screen name DB 'ADAMCON 11',1eh,1fh DB '/PRESENTS ADAM NEWS NETWORK'S'/1999' ;1dh is copyright symbol ;1eh,1fh is trade mark symbol If you don't want a handler for the VDP interrupt, you can always do RETN there. But the recommended minimum is to have a handler that saves the registers (probably just AF really), reads the status register (which clears the interrupt on the VDP), restores the registers (probably just AF really) and then RETN. Quote Link to comment Share on other sites More sharing options...
CrazyBoss Posted August 4, 2014 Author Share Posted August 4, 2014 thanks for all the help, actually just using the Colecovision screen, works ok for me, so dont think anymore about it, as it works. Just a bit strange Quote Link to comment Share on other sites More sharing options...
MrDave Posted February 21, 2023 Share Posted February 21, 2023 Funny i came across the problem today... if i don't do the title screen my call rnd function does not work..hl returns zeros.. Quote Link to comment Share on other sites More sharing options...
Tony Cruise Posted February 21, 2023 Share Posted February 21, 2023 39 minutes ago, MrDave said: Funny i came across the problem today... if i don't do the title screen my call rnd function does not work..hl returns zeros.. Random functions need a seed value to start with, so they need to be started with some non-zero value. I usually use a fixed value at start-up and then use the time that has passed from when the console has started until the user starts the game, and re-seed the random numbers. That way you get some human randomness (chaos) added (and thus better random numbers). Quote Link to comment Share on other sites More sharing options...
MrDave Posted February 21, 2023 Share Posted February 21, 2023 (edited) Ok ..what memory location do i put the seed ? Hmm maybe its in your book Ok if i read book correctly... put a rnd num in (&73C8) and call &1FFD... Edited February 21, 2023 by MrDave Quote Link to comment Share on other sites More sharing options...
MrDave Posted February 22, 2023 Share Posted February 22, 2023 Yes works great , but needed the push to start feature to seed new random each time,.thanks 1 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.