News for hackers. Stuff that matters.
Re:Gameboy hello world by feeb on Saturday October 14, 2017 @04:35PM (#15474128)
(author) thanks so much for the comments. i vaguely knew about this but i serendipitously didn't run into it. how does lack of vram access manifest? do vram writes silently fail?

this is precisely the sort of quirk i wanted to cover in this template so i appreciate hearing about it.

Re:Gameboy hello world by wk_end on Saturday October 14, 2017 @07:46PM (#15474970)
Yeah, writes are ignored, and reads return garbage (no idea what).

I recommend using the BGB emulator - you can configure it to crash into a debugger whenever it detects an invalid VRAM access. Plus the debugger is insanely useful.

Re:Gameboy hello world by posterboy on Monday October 16, 2017 @12:50PM (#15484658)
and the screen is blanked i suppose. that would allow pritive pwm. has that been used? i would imagine that allows some nice fade effects or enhanced bit-depth in the brightness, as is done eg. on c64.
Re:Gameboy hello world by moozilla on Sunday October 15, 2017 @07:13AM (#15476679)
Adding to what wk_end has said - many emulators (VBA included) will just write to the VRAM without complaining, so you won't even catch the bug unless you try it on a flash cart or in BGB (I'll second that recommendation).

For your demo checking $FF41 should be sufficient, unless you're writing a lot of data you'll usually have enough time in one vblank period. You could wait for $FF41 == 01 and then copy all the data, or check it each iteration of the loop (less efficient but will never fail). I've seen actual games do it both ways (decent amount of disassembly/ROM hacking experience).