Author Topic: beware (author of bgb) complains about DefleMask's GB ROM builder  (Read 2283 times)

Offline DevEd

  • Full Member
  • Posts: 359
  • Not to be confused with Delek
beware (author of bgb) complains about DefleMask's GB ROM builder
« on: September 18, 2016, 06:36:01 PM »
So, this happened earlier today:
Code: [Select]
<beware> this rom writes $00 to bank $2000
<beware> this is NOT BEWARE
<beware> don't do that
<beware> bgb trips mbc write exception
<beware> it's bad, because it relies on the mbc to interpret 00 as 01 instead. and needlessly so
<beware> you needlessly pull in a dependency on a certain hardware behavior
<beware> you could just as well write  $01
<beware> did you code the deflemask player rom?
<beware> or does it come with deflemask and you just use it
<beware> oh, and it's a room heater
<beware> but that might be to "deal with noise"
<beware> (like lsdj)
<beware> if you wrote the rom, fix this (the write of $00)
<beware> if you didn't write it, try to tell the creators to fix it
<beware> it also writes bank numbers outside the valid range (in other words, "rom bank echo")
<beware> but that might be on purpose to autodetect the size or so
<beware> ok it keeps doing it
<beware> it's constantly, all the time, switching between $00 and $86
<beware> while it plays the music
<beware> this is bad
<beware> like, broken rom
<beware> it relies on two mbc behaviors thaty it shouldn't.
<beware> - that 0 will set bank 1
<beware> - that bank $86 is mirrored to something else (like bank $6)

Offline TheDeadFish

  • Moderator
  • Newbie
  • Posts: 8
  • Delek FTW
    • Email
beware (author of bgb) complains about DefleMask's GB ROM builder
« Reply #1 on: September 18, 2016, 10:12:38 PM »
I have investigated and found that there is technically no problem.
The bgb emulators debug system complains when an invalid bank is
selected, even if that bank is never read from.

For simplicity my player sets the bank register to zero when it reads from the first bank in the 0000-3FFF region,
when it reaches the end of the first bank it relocates the play position to 4000 and then increments the bank to
1, at this point a valid bank is selected and reads then come from the banked region. When each subsequent bank
is complete play is relocated back to 4000 and the bank is incremented. This way no explicit handling of the
transition between bank 0 and remaining banks is required.

The $86 invalid bank comes from redundant code which can be removed, but the use of bank 0 is perfectly reasonable
for come simplicity. I will recode it do not do the "invalid" behavior but I will state, it is bgb that is wrong here.
Bgb should not flag an error until the invalid bank is read from.