func (c *Cartridge) String() string { startingString := "Gameboy" if c.IsColourGB { startingString += " Color" } var destinationRegion string if c.IsJapanese { destinationRegion = "Japanese" } else { destinationRegion = "Non-Japanese" } var header []string = []string{ fmt.Sprintf(utils.PadRight("Title:", 19, " ")+"%s", c.Title), fmt.Sprintf(utils.PadRight("Type:", 19, " ")+"%s %s", c.Type.Description, utils.ByteToString(c.Type.ID)), fmt.Sprintf(utils.PadRight("Destination code:", 19, " ")+"%s", destinationRegion), fmt.Sprintf(utils.PadRight("File:", 19, " ")+"%s", c.Filename), } return fmt.Sprintln("\n"+startingString, "Cartridge") + fmt.Sprintln(strings.Repeat("-", 100)) + fmt.Sprintln(strings.Join(header, "\n")) + fmt.Sprintln(c.MBC) + fmt.Sprintln(strings.Repeat("-", 100)) }
func (m *MBC1) String() string { var batteryStr string if m.hasBattery { batteryStr += "Yes" } else { batteryStr += "No" } return fmt.Sprintln("\nMemory Bank Controller") + fmt.Sprintln(strings.Repeat("-", 50)) + fmt.Sprintln(utils.PadRight("ROM Banks:", 18, " "), len(m.romBanks), fmt.Sprintf("(%d bytes)", m.ROMSize)) + fmt.Sprintln(utils.PadRight("RAM Banks:", 18, " "), m.RAMSize/0x2000, fmt.Sprintf("(%d bytes)", m.RAMSize)) + fmt.Sprintln(utils.PadRight("Battery:", 18, " "), batteryStr) }
func (c *Config) String() string { return fmt.Sprintln("Configuration settings") + fmt.Sprintln(strings.Repeat("-", 50)) + fmt.Sprintln(utils.PadRight("Title: ", 19, " "), c.Title) + fmt.Sprintln(utils.PadRight("Skip Boot: ", 19, " "), c.SkipBoot) + fmt.Sprintln(utils.PadRight("GB Color Mode: ", 19, " "), c.ColorMode) + fmt.Sprintln(utils.PadRight("Display FPS: ", 19, " "), c.DisplayFPS) + fmt.Sprintln(utils.PadRight("Screen Size: ", 19, " "), c.ScreenSize) + fmt.Sprintln(utils.PadRight("Debug mode?: ", 19, " "), c.Debug) + fmt.Sprintln(utils.PadRight("Breakpoint: ", 19, " "), c.BreakOn) + fmt.Sprintln(utils.PadRight("CPU Dump?: ", 19, " "), c.DumpState) + fmt.Sprintln(utils.PadRight("Settings Dir: ", 19, " "), c.SettingsDir) + fmt.Sprintln(utils.PadRight("Saves Dir: ", 19, " "), c.SavesDir) + fmt.Sprint(strings.Repeat("-", 50)) }
func (g *DebugOptions) AddDebugFunc(command string, description string, f DebugCommandHandler) { g.debugFuncMap[command] = f g.debugHelpStr = append(g.debugHelpStr, utils.PadRight(command, 4, " ")+" = "+description) }
func (m *MBC0) String() string { return fmt.Sprintln("\nMemory Bank Controller") + fmt.Sprintln(strings.Repeat("-", 50)) + fmt.Sprintln(utils.PadRight("ROM Banks:", 18, " "), 1, fmt.Sprintf("(%d bytes)", len(m.romBank))) }