CodeSlinger
New member
yeah thats all that register does. Dunno why it is called a divider though. One of its purposes is to supply a seed for a random number generator. As I found out the hardway with tetris, if you dont implement this then you always get given the block. Which makes the game a bit easy.
Edit:
One of the parts of the gameboy system I dont understand fully is the LCD Status register. I honestly dont think it is this that is causing the low compat problems im having but I still want to get it right.
This is how I understand it, I'll take each bit of the register at a time:
BIT 6: LYC=LY Coincidence Interrupt: This bit gets set when LYC == LY. When this bit is set it also sets the BIT 1 in the Interupt Request address (0xFF0F) which signals that an LCD interupt is required. When does this Bit 6 get reset?
BIT 5: OAM Interupt. This is set whenever the mode is set to 2. This also requests an interupt. When does it get reset?
BIT 4: V-Blank interupt. This is set during the entire V-Blank period. The thing I dont understand about this is that there is a seperate interupt for V-Blank so why would the CPU service the V-Blank interupt and then service the LCD interupt for V-Blank? They're the same thing.
BIT 3: H-Blank Interupt. This is set for the duration of H-Blank. Thing is is that there isnt a H-Blank interupt. Or does it mean request an LCD interupt and make sure BIT 3 is set?
BIT 2: This is set when LY==LYC same is Bit 6. This doesnt request an interupt. Whats the point in having bit 6 when bit 2 is the same?
BIT 1-0: Set for the current mode of the LCD. I dont know how to determine this.
One other thing. As Bit3-6 is all interupts can more than 1 be set at the same time?
Thanks for any help.
Edit:
One of the parts of the gameboy system I dont understand fully is the LCD Status register. I honestly dont think it is this that is causing the low compat problems im having but I still want to get it right.
This is how I understand it, I'll take each bit of the register at a time:
BIT 6: LYC=LY Coincidence Interrupt: This bit gets set when LYC == LY. When this bit is set it also sets the BIT 1 in the Interupt Request address (0xFF0F) which signals that an LCD interupt is required. When does this Bit 6 get reset?
BIT 5: OAM Interupt. This is set whenever the mode is set to 2. This also requests an interupt. When does it get reset?
BIT 4: V-Blank interupt. This is set during the entire V-Blank period. The thing I dont understand about this is that there is a seperate interupt for V-Blank so why would the CPU service the V-Blank interupt and then service the LCD interupt for V-Blank? They're the same thing.
BIT 3: H-Blank Interupt. This is set for the duration of H-Blank. Thing is is that there isnt a H-Blank interupt. Or does it mean request an LCD interupt and make sure BIT 3 is set?
BIT 2: This is set when LY==LYC same is Bit 6. This doesnt request an interupt. Whats the point in having bit 6 when bit 2 is the same?
BIT 1-0: Set for the current mode of the LCD. I dont know how to determine this.
One other thing. As Bit3-6 is all interupts can more than 1 be set at the same time?
Thanks for any help.
Last edited: